summaryrefslogtreecommitdiffstats
path: root/static/functions
diff options
context:
space:
mode:
authorGit <git@what.cd>2013-07-03 08:01:01 +0000
committerGit <git@what.cd>2013-07-03 08:01:01 +0000
commitf86bb1f066725f2d523516f0c2053dbba32d381b (patch)
tree202f442529208a760ee5a0bed4a51707305943a4 /static/functions
parent8b04ca921c50f91b295ed712e89df8e9a880ca1a (diff)
downloadGazelle-f86bb1f066725f2d523516f0c2053dbba32d381b.zip
Gazelle-f86bb1f066725f2d523516f0c2053dbba32d381b.tar.gz
Gazelle-f86bb1f066725f2d523516f0c2053dbba32d381b.tar.bz2
Empty commit
Diffstat (limited to 'static/functions')
-rw-r--r--static/functions/autocomplete.js12
-rw-r--r--static/functions/browse.js10
-rw-r--r--static/functions/upload.js12
3 files changed, 19 insertions, 15 deletions
diff --git a/static/functions/autocomplete.js b/static/functions/autocomplete.js
index 2e810ab..d19affc 100644
--- a/static/functions/autocomplete.js
+++ b/static/functions/autocomplete.js
@@ -1,10 +1,10 @@
var ARTIST_AUTOCOMPLETE_URL = 'artist.php?action=autocomplete';
var TAGS_AUTOCOMPLETE_URL = 'torrents.php?action=autocomplete_tags';
-
+var SELECTOR = '[data-gazelle-autocomplete="true"]';
$(document).ready(function() {
var url = new URL();
- $('#artistsearch').autocomplete({
+ $('#artistsearch' + SELECTOR).autocomplete({
serviceUrl : ARTIST_AUTOCOMPLETE_URL,
onSelect : function(suggestion) {
window.location = 'artist.php?id=' + suggestion['data'];
@@ -12,19 +12,19 @@ $(document).ready(function() {
});
if (url.path == 'torrents' || url.path == 'upload' || url.path == 'artist') {
- $("#artist").autocomplete({
+ $("#artist" + SELECTOR).autocomplete({
serviceUrl : ARTIST_AUTOCOMPLETE_URL
});
- $("#artistsimilar").autocomplete({
+ $("#artistsimilar" + SELECTOR).autocomplete({
serviceUrl : ARTIST_AUTOCOMPLETE_URL
});
}
if (url.path == 'torrents' || url.path == 'upload' || url.path == 'collages' || url.path == 'requests' || url.path == 'top10' || (url.path == 'requests' && url.query['action'] == 'new')) {
- $("#tags").autocomplete({
+ $("#tags" + SELECTOR).autocomplete({
serviceUrl : TAGS_AUTOCOMPLETE_URL,
delimiter: ','
});
- $("#tagname").autocomplete({
+ $("#tagname" + SELECTOR).autocomplete({
serviceUrl : TAGS_AUTOCOMPLETE_URL,
});
}
diff --git a/static/functions/browse.js b/static/functions/browse.js
index 37baadc..2dfddf3 100644
--- a/static/functions/browse.js
+++ b/static/functions/browse.js
@@ -222,11 +222,13 @@ function AddArtistField() {
Importance.name = "importance[]";
Importance.innerHTML = '<option value="1">Main</option><option value="2">Guest</option><option value="4">Composer</option><option value="5">Conductor</option><option value="6">DJ / Compiler</option><option value="3">Remixer</option><option value="7">Producer</option>';
x.appendChild(Importance);
- $(ArtistField).live('focus', function() {
- $(ArtistField).autocomplete({
- serviceUrl : 'artist.php?action=autocomplete'
+ if ($("#artist").data("gazelle-autocomplete")) {
+ $(ArtistField).live('focus', function() {
+ $(ArtistField).autocomplete({
+ serviceUrl : 'artist.php?action=autocomplete'
+ });
});
- });
+ }
ArtistFieldCount++;
}
diff --git a/static/functions/upload.js b/static/functions/upload.js
index aa017c4..b22cd62 100644
--- a/static/functions/upload.js
+++ b/static/functions/upload.js
@@ -234,12 +234,14 @@ function AddArtistField() {
x.appendChild(ArtistField);
x.appendChild(document.createTextNode('\n'));
x.appendChild(ImportanceField);
-
- $(ArtistField).live('focus', function() {
- $(ArtistField).autocomplete({
- serviceUrl : 'artist.php?action=autocomplete'
+
+ if ($("#artist").data("gazelle-autocomplete")) {
+ $(ArtistField).live('focus', function() {
+ $(ArtistField).autocomplete({
+ serviceUrl : 'artist.php?action=autocomplete'
+ });
});
- });
+ }
ArtistCount++;
}