summaryrefslogtreecommitdiff
path: root/static/f
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-07-04 19:53:09 +0200
committerYorhel <git@yorhel.nl>2009-07-04 19:53:09 +0200
commit7f26d42e6bd1710c8f3521919220b1f1db427bee (patch)
tree563f2354db923157466791d59372a2041a78851d /static/f
parent70d87e3330639295fb656495c2afa1ca258d0867 (diff)
Separated VN search filters from search box
It was a rather stupid and buggy idea...
Diffstat (limited to 'static/f')
-rw-r--r--static/f/script.js75
1 files changed, 8 insertions, 67 deletions
diff --git a/static/f/script.js b/static/f/script.js
index b39ba11f..e6eab3bb 100644
--- a/static/f/script.js
+++ b/static/f/script.js
@@ -53,70 +53,6 @@ function readCookie(n) {
-
-
-
-/* A D V A N C E D S E A R C H */
-
-function searchInit() {
- cl('advselect', function() {
- var e = x('advoptions');
- e.className = e.className.indexOf('hidden')>=0 ? '' : 'hidden';
- this.getElementsByTagName('i')[0].innerHTML = e.className.indexOf('hidden')>=0 ? '&#9656;' : '&#9662;';
- return false;
- });
-
- if(x('advoptions').className.indexOf('vnoptions') < 0)
- return;
- var l = x('advoptions').getElementsByTagName('input');
- for(i=0;i<l.length;i++)
- if(l[i].id.substr(0,5) == 'lang_' || l[i].id.substr(0,5) == 'plat_')
- l[i].onclick = function() {
- searchParse(0, this.parentNode.getElementsByTagName('acronym')[0].title);
- };
-
- x('q').onkeyup = searchParse;
- searchParse();
-}
-
-function searchParse(add, term) {
- var q = x('q').value;
- var i;
-
- if(add == 0 || add === 1) {
- var qn = q;
- if(!add)
- eval('qn = qn.replace(/'+term+'/gi, "")');
- else {
- eval('qn = qn.replace(/(^|[^-])'+term+'/gi, "$1-'+term+'")');
- if(qn == q)
- eval('qn = qn.replace(/-'+term+'/gi, "")');
- }
- if(qn == q)
- q += ' '+term;
- else
- q = qn;
-
- q = q.replace(/^ +/, "");
- q = q.replace(/ +$/, "");
- q = q.replace(/ +/g, " ");
-
- x('q').value = q;
- }
-
- q = q.toLowerCase();
- var l = x('advoptions').getElementsByTagName('input');
- for(i=0;i<l.length;i++)
- if(l[i].id.substr(0,5) == 'lang_' || l[i].id.substr(0,5) == 'plat_')
- l[i].checked = q.indexOf(l[i].parentNode.getElementsByTagName('acronym')[0].title.toLowerCase()) >= 0 ? true : false;
-
- return false;
-}
-
-
-
-
-
/* I M A G E V I E W E R */
function ivInit() {
@@ -511,9 +447,14 @@ DOMLoad(function() {
}
- // Advanced VN search
- if(x('advselect'))
- searchInit();
+ // Advanced search
+ cl('advselect', function() {
+ var e = x('advoptions');
+ e.className = e.className.indexOf('hidden')>=0 ? '' : 'hidden';
+ this.getElementsByTagName('i')[0].innerHTML = e.className.indexOf('hidden')>=0 ? '&#9656;' : '&#9662;';
+ return false;
+ });
+
// show/hide NSFW VN image