diff options
author | Yorhel <git@yorhel.nl> | 2009-07-05 18:15:01 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-07-05 18:15:01 +0200 |
commit | d59124e057e3a10dac0a3a448f4503679810850c (patch) | |
tree | 970b2cb381656d6d635cbd4046f30ed685413e62 /static/f | |
parent | ba1d4aed3e9b081a55d306c96c134eee5117284b (diff) |
Tag exclude filters on VN search
Diffstat (limited to 'static/f')
-rw-r--r-- | static/f/forms.js | 4 | ||||
-rw-r--r-- | static/f/script.js | 38 |
2 files changed, 22 insertions, 20 deletions
diff --git a/static/f/forms.js b/static/f/forms.js index 96f0d753..4fb02f1e 100644 --- a/static/f/forms.js +++ b/static/f/forms.js @@ -56,7 +56,7 @@ function dsKeyDown(ev) { } if(obj.selectedId != 0) - obj.value = obj.serFunc(x('ds_box_'+obj.selectedId).itemData); + obj.value = obj.serFunc(x('ds_box_'+obj.selectedId).itemData, obj); if(obj.returnFunc) obj.returnFunc(); if(x('ds_box')) @@ -167,7 +167,7 @@ function dsResults(hr, obj) { l[i].className = l[i].id == 'ds_box_'+obj.selectedId ? 'selected' : ''; }; tr.onclick = function() { - obj.value = obj.serFunc(this.itemData); + obj.value = obj.serFunc(this.itemData, obj); if(obj.returnFunc) obj.returnFunc(); if(x('ds_box')) diff --git a/static/f/script.js b/static/f/script.js index 34f654c0..c94d781a 100644 --- a/static/f/script.js +++ b/static/f/script.js @@ -456,24 +456,26 @@ DOMLoad(function() { // auto-complete tag search if(x('advselect') && x('ti')) { - dsInit(x('ti'), '/xml/tags.xml?q=', - function(item, tr) { - var td = document.createElement('td'); - td.innerHTML = shorten(item.firstChild.nodeValue, 40); - if(item.getAttribute('meta') == 'yes') - td.innerHTML += ' <b class="grayedout">meta</b>'; - else if(item.getAttribute('state') == 0) - td.innerHTML += ' <b class="grayedout">awaiting moderation</b>'; - tr.appendChild(td); - }, - function(item) { - var tags = x('ti').value.split(/ *, */); - tags[tags.length-1] = item.firstChild.nodeValue; - return tags.join(', '); - }, - function() { false; }, - function(val) { return (val.split(/, */))[val.split(/, */).length-1]; } - ); + var fields=['ti','te']; + for(var field=0;field<fields.length;field++) + dsInit(x(fields[field]), '/xml/tags.xml?q=', + function(item, tr) { + var td = document.createElement('td'); + td.innerHTML = shorten(item.firstChild.nodeValue, 40); + if(item.getAttribute('meta') == 'yes') + td.innerHTML += ' <b class="grayedout">meta</b>'; + else if(item.getAttribute('state') == 0) + td.innerHTML += ' <b class="grayedout">awaiting moderation</b>'; + tr.appendChild(td); + }, + function(item, obj) { + var tags = obj.value.split(/ *, */); + tags[tags.length-1] = item.firstChild.nodeValue; + return tags.join(', '); + }, + function() { false; }, + function(val) { return (val.split(/, */))[val.split(/, */).length-1]; } + ); } // update spoiler cookie on VN search radio button |