diff options
author | Yorhel <git@yorhel.nl> | 2008-12-01 21:32:01 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-12-01 21:32:01 +0100 |
commit | 531db3e8ddc8523df730a3412fe6ccee21a71259 (patch) | |
tree | 939d943c9b2a0cc803a49db52b0e733ed1b1927e /static | |
parent | 3f747b5fce24fad0635be727c431e1fb234c3fa6 (diff) |
Interface for the advanced VN search feature
We're getting there...
Diffstat (limited to 'static')
-rw-r--r-- | static/f/script.js | 78 | ||||
-rw-r--r-- | static/f/select.png | bin | 0 -> 1196 bytes | |||
-rw-r--r-- | static/f/style.css | 83 |
3 files changed, 154 insertions, 7 deletions
diff --git a/static/f/script.js b/static/f/script.js index 5b8e4e04..0bdd6364 100644 --- a/static/f/script.js +++ b/static/f/script.js @@ -15,6 +15,77 @@ clearInterval(t);f()}},10);window.onload=f;} +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 ? '▸' : '▾'; + return false; + }); + + var l = x('catselect').getElementsByTagName('li'); + for(i=0;i<l.length;i++) + if(l[i].id.substr(0,4) == 'cat_') + l[i].onclick = function() { + searchParse(1, this.innerHTML); + }; + + 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('catselect').getElementsByTagName('li'); + for(i=0;i<l.length;i++) + if(l[i].id.substr(0,4) == 'cat_') { + var cat = l[i].innerHTML.toLowerCase(); + l[i].className = q.indexOf('-'+cat) >= 0 ? 'exc' : q.indexOf(cat) >= 0 ? 'inc' : ''; + } + + 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() { @@ -163,6 +234,8 @@ function jtSel(which, nolink) { /* O N L O A D E V E N T */ DOMLoad(function() { + + // search box var i = x('sq'); i.onfocus = function () { if(this.value == 'search') { @@ -178,6 +251,11 @@ DOMLoad(function() { }; + // Advanced VN search + if(x('advselect')) + searchInit(); + + // show/hide NSFW VN image cl('nsfw_show', function() { x('nsfw_show').style.display = 'none'; diff --git a/static/f/select.png b/static/f/select.png Binary files differnew file mode 100644 index 00000000..9473c8a9 --- /dev/null +++ b/static/f/select.png diff --git a/static/f/style.css b/static/f/style.css index 2d961d69..04ce815d 100644 --- a/static/f/style.css +++ b/static/f/style.css @@ -63,6 +63,11 @@ p.locked { font-style: italic; margin: 0!important; } +h2 p { + font: 8pt "Tahoma"; + font-weight: normal; + display: inline; +} @@ -574,7 +579,7 @@ div.vndescription p { margin: 0; cursor: pointer; list-style-type: none; - /*background: url(/f/select.png) no-repeat;*/ + padding: 0; } a.help { vertical-align: super; @@ -583,11 +588,13 @@ a.help { font-weight: bold; padding-left: 1px; } -form #jt_box_categories li li { padding: 0; background: none; } -form #jt_box_categories li li b { width: 13px; font-weight: bold; } -#maincontent form #jt_box_categories li li a { color: #ccc; text-decoration: none; display: block; width: 160px; border: none } -#jt_box_categories li li.inc { background-position: 0px -16px; color: #090; } -#jt_box_categories li li.exc { background-position: 0px -33px; color: #900; } +#maincontent #jt_box_categories li li a { + color: #ccc; + text-decoration: none; + display: block; + width: 160px; + border: none +} #jt_box_relations table { margin-bottom: 10px; } #jt_box_relations h2 { margin: 0 0 3px -10px; } @@ -629,10 +636,72 @@ form #jt_box_categories li li b { width: 13px; font-weight: bold; } #scr_table select { width: 400px; } -/* VN browse */ + + + +/****** VN browse ********/ .vnbrowse .tc2 { text-align: right; padding: 0; } .vnbrowse .tc3 { padding: 0; } +#q { width: 300px } +#advselect { + text-align: center; + display: block; + margin: 10px auto 3px auto; + border: none; + outline: none; +} +#advoptions { + width: 90%; + padding: 0 30px 5px 30px; + margin: 0 auto; + border-top: 1px solid #258; +} +#advoptions.hidden { display: none } +#advoptions h2 { + clear: left; + padding-top: 10px; + margin-left: -20px; + margin-top: 0; + margin-bottom: 3px; +} +#advoptions span { + display: block; + float: left; + width: 170px; +} +#advoptions span input { + margin-right: 3px; +} + +ul#catselect, ul#catselect ul { + list-style-type: none; + padding: 0; + margin: 0; +} +ul#catselect li { + display: block; + width: 170px; + float: left; + clear: none; + font-weight: bold; +} +ul#catselect li li { + display: list-item; + width: auto; + float: none; + clear: left; + font-weight: normal; + padding: 0 0 0 18px; + margin: 0; + cursor: pointer; + list-style-type: none; + background: url(/f/select.png) no-repeat; +} +ul#catselect li li.inc { background-position: 0px -16px; color: #0c0; } +ul#catselect li li.exc { background-position: 0px -33px; color: #c00; } + + |