diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-05-19 07:01:24 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-05-19 07:01:24 +0000 |
commit | 2ce770e7e5817f8838fdaf7bc7eda2a8da972962 (patch) | |
tree | 4aa6306599d38b6af01c8495d6731a838944602e /static | |
parent | 8b72b6535a553f8751842369a3abc0016d18611e (diff) |
Too many changes to keep track of. See ChangeLog. (I should commit more often -.-)
git-svn-id: svn://vndb.org/vndb@13 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'static')
-rw-r--r-- | static/files/16x14.png | bin | 2397 -> 0 bytes | |||
-rw-r--r-- | static/files/def.js | 152 | ||||
-rw-r--r-- | static/files/icons.png | bin | 0 -> 2816 bytes | |||
-rw-r--r-- | static/files/style.css | 177 |
4 files changed, 194 insertions, 135 deletions
diff --git a/static/files/16x14.png b/static/files/16x14.png Binary files differdeleted file mode 100644 index 1cf35c08..00000000 --- a/static/files/16x14.png +++ /dev/null diff --git a/static/files/def.js b/static/files/def.js index 72b5cd80..ed7e1f41 100644 --- a/static/files/def.js +++ b/static/files/def.js @@ -75,7 +75,6 @@ function formtoggle(n) { /* D R O P D O W N M E N U S */ - var ddx;var ddy;var dds=null; function dropDown(e) { e = e || window.event; @@ -119,6 +118,92 @@ function dropDown(e) { +/* A D V A N C E D S E A R C H */ + +var ad_cats = {}; +var ad_lang = {}; +var ad_plat = {}; + +function adsearch() { + x('vsearch').onsubmit = ad_dosearch; + x('vsearch_sub').onclick = ad_dosearch; + x('q').onkeyup = ad_update; + + x('adsearchclick').onclick = function() { + if(x('adsearch').style.display == 'none') { + x('adsearch').style.display = 'block'; + x('adsearchclick').innerHTML = '▾ advanced options'; + } else { + x('adsearch').style.display = 'none'; + x('adsearchclick').innerHTML = '▸ advanced options'; + } + }; + + var l = x('cat').getElementsByTagName('li'); + for(i=0;i<l.length;i++) + if(l[i].id.indexOf('cat_') != -1) { + ad_cats[ l[i].id.substr(l[i].id.indexOf('cat_')+4, 3) ] = l[i].innerHTML.substring(0, l[i].innerHTML.indexOf('(')-1).toLowerCase(); + l[i].onclick = function () { + try { document.selection.empty() } catch(e) { try { window.getSelection().collapse(this, 0) } catch(e) {} }; + ad_update(1, this.innerHTML.substring(0, this.innerHTML.indexOf('(')-1)); + }; + } + + l = x('lfilter').getElementsByTagName('input'); + for(i=0;i<l.length;i++) { + ad_lang[ l[i].name.substring(5) ] = l[i].value.toLowerCase(); + l[i].onclick = function() { ad_update(0, this.value) }; + } + + l = x('pfilter').getElementsByTagName('input'); + for(i=0;i<l.length;i++) { + ad_plat[ l[i].name.substring(5) ] = l[i].value.toLowerCase(); + l[i].onclick = function() { ad_update(0, this.value) }; + } +} + +function ad_update(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(); + for (i in ad_lang) + x('lang_'+i).checked = q.indexOf(ad_lang[i]) >= 0 || q.indexOf('l:'+i) >= 0 ? true : false; + for (i in ad_plat) + x('plat_'+i).checked = q.indexOf(ad_plat[i]) >= 0 || q.indexOf('p:'+i) >= 0 ? true : false; + for (i in ad_cats) + x('cat_'+i).className = q.indexOf('-'+ad_cats[i]) >= 0 || q.indexOf('-c:'+i) >= 0 ? 'exc' : q.indexOf(ad_cats[i]) >= 0 || q.indexOf('c:'+i) >= 0 ? 'inc' : ''; +} + +function ad_dosearch() { + location.href = '?q='+x('q').value; + return false; +} + + + + /* O N L O A D */ DOMLoad(function() { @@ -134,41 +219,10 @@ DOMLoad(function() { if(this.value.length < 1) { this.value = 'search'; this.style.color = '#999';} }; - - // browse categories - if(x('catsearch')) { - x('catsearch').onclick = function () { - var u = { i:'',e:'',l:'' }; - var l = x('cat').getElementsByTagName('li'); - var y;var j; - for(y=0;y<l.length;y++) - if((j = l[y].className.indexOf('cat_')) != -1) { - var k = l[y].className.substr(j+4, 3); - if(l[y].className.indexOf(' inc') != -1) - u.i += (u.i?',':'')+k; - if(l[y].className.indexOf(' exc') != -1) - u.e += (u.e?',':'')+k; - } - l = x('lfilter').getElementsByTagName('input'); - for(y=0;y<l.length;y++) - if(l[y].checked) - u.l+=(u.l!=''?',':'')+l[y].name.substr(5); - var url = '/v/cat'; - for (y in u) - if(u[y]) - url+=(url.indexOf('?')<0?'?':';')+y+'='+u[y]; - location.href=url; - return false; - }; - var l = x('cat').getElementsByTagName('li'); - for(i=0;i<l.length;i++) - if(l[i].className.indexOf('cat_') != -1) - l[i].onclick = function () { - try { document.selection.empty() } catch(e) { try { window.getSelection().collapse(this, 0) } catch(e) {} }; - var sel = this.className.substr(this.className.indexOf('cat_'), 7); - this.className = this.className.indexOf(' inc') != -1 ? (sel+' exc') : this.className.indexOf(' exc') != -1 ? sel : (sel + ' inc'); - }; - } + + // advanced search + if(x('adsearch')) + adsearch(); // vnlist cl('askcomment', function() { @@ -197,22 +251,9 @@ DOMLoad(function() { } } - // autocheck - cl('checkall', function () { - var l = document.getElementsByTagName('input'); - var y; - for(y=0;y<l.length;y++) - if(l[y].type == 'checkbox' && l[y].name == this.name) - l[y].checked = this.checked; - }); - - // a few confirm popups + // confirm popup cl('idel', function () { return confirm('Are you sure you want to delete this item?\n\nAll previous edits will be deleted, this action can not be reverted!') }); -// cl('vhide', function () { -// return confirm('!WARNING!\nHiding a visual novel also DELETES the following information:\n - VN Relations of ALL revisions\n - VN lists\n - Votes\nThis is NOT recoverable!'); }); - cl('massdel', function () { - return confirm('Are you sure you want to mass-delete all the selected changes?\n\nThis action can not be reverted!') }); // NSFW cl('nsfw', function () { @@ -238,7 +279,6 @@ DOMLoad(function() { formhid(); // init dyna -// if(x('vn_select') || x('md_select') || x('pd_select') || x('rl_select')) if(window.dInit) dInit(); @@ -247,3 +287,13 @@ DOMLoad(function() { for(i=1; i<sub.length; i+=2) sub[i].style.backgroundColor = '#f5f5f5'; }); + + + + +// small hack because the mozilla -moz-inline-stack display hack sucks +// (so we're counter-hacking a CSS hack using JS... right) +if(navigator.userAgent.indexOf('Gecko') >= 0 && navigator.userAgent.indexOf('like Gecko') < 0 && navigator.userAgent.indexOf('fox/3') < 0) + document.write('<style type="text/css">.icons.lang { width: 15px; height: 13px; }</style>'); + + diff --git a/static/files/icons.png b/static/files/icons.png Binary files differnew file mode 100644 index 00000000..f9cad068 --- /dev/null +++ b/static/files/icons.png diff --git a/static/files/style.css b/static/files/style.css index 5d1996c6..980e0861 100644 --- a/static/files/style.css +++ b/static/files/style.css @@ -54,12 +54,7 @@ h3 { p, ul, ol { margin: 0; } - -blockquote { - font-style: italic; -} a { -/* color: #7AB9AB;*/ color: #69A89A; } a:hover { @@ -367,6 +362,7 @@ span.warning ul, span.msg ul { padding: 0 0 0 15px; } +/* VN page header, general dl and list markup */ dt { float: left; font-style: italic; @@ -383,25 +379,13 @@ ul.vnani acronym { border: 0 } ul { padding: 0 0 0 17px; } -p.actions, #vnheader p.actions, b.actions { +p.actions { display: inline; margin: 0 0 0 5px; font-weight: normal; font-size: 12px; color: #999; } -a.relch { - color: #900; -} -a.rss { - display: block; - height: 16px; - width: 16px; - background: url(/files/rss.png) no-repeat; - text-indent: -9999px; - overflow: hidden; - float: right; -} #vnheader div { width: 256px; float: left; @@ -413,15 +397,6 @@ a.rss { #vnheader #nsfw { cursor: pointer; } -img.left { - float: left; - margin: 0 15px 0 0; -} - -img.right { - float: left; - margin: 0 0 0 15px; -} #vnheader dl, #vnheader ul { margin: 0 0 0 270px; padding: 0; @@ -431,21 +406,6 @@ img.right { margin: 5px 0 0 260px; font-size: 13px; } -#vnheader p { - margin: 0 0 0 270px; -} -#vnheader select { - width: 60px; - height: 16px; - display: inline; - float: none; - text-align: center; -} -#vnheader #vnlist { - width: 150px; - text-align: left; -} - #vnheader p.mod { margin: 0; } @@ -453,11 +413,12 @@ img.right { /* producer search */ -form#psearch { +form#psearch fieldset { display: block; - margin: 10px 0 20px 210px; + width: 700px; + text-align: center; } -* html form#psearch { margin-left: 105px; } +form#psearch input { margin: 0 auto; float: none; position: relative; display: inline } ul.home { @@ -540,10 +501,28 @@ b.mod, a.mod { } +/* vn search */ + +form#vsearch fieldset { + display: block; + width: 700px; + text-align: center; +} +form#vsearch input { margin: 0 auto; float: none; position: relative; display: inline } +form#vsearch input.text { width: 400px; } +b#adsearchclick { cursor: pointer } + +ul.filter { margin: 0 0 0 15px; padding: 0; list-style-type: none } +ul.filter li { float: left; padding: 4px 10px 0 0; } +ul.filter label { width: auto; color: #666; font-size: 11px; margin: 0; padding: 0 0 0 1px;} +ul.filter input { border: 0; margin: 0; } + + + /* categories */ ul#cat { - margin: 0; + margin: 0 0 0 15px; padding: 0; } ul#cat ul { @@ -589,20 +568,6 @@ i.crgn2 { font-style: normal; } i.crgn3 { font-style: normal; font-weight: bold; } -/* language filter */ - -div#lfilter { - clear: left; - padding: 10px 0 0 0; -} -div#lfilter input { - float: left; margin: 3px 3px 0 10px; -} -div#lfilter label { - float: left; margin-top: 3px; - width: 90px; -} - /* DOCUMENTATION PAGES */ #dpage h3 { margin-top: 25px; } @@ -654,10 +619,19 @@ acronym.date { b.future { font-weight: normal; color: #900; } -/* 16x14 image sprites */ +/* icon image sprites */ -.plat { - background: url(/files/16x14.png) no-repeat; +a.rss { + display: block; + height: 16px; + width: 16px; + background: url(/files/rss.png) no-repeat; + text-indent: -9999px; + overflow: hidden; + float: right; +} +.icons { + background: url(/files/icons.png) no-repeat; width: 16px; height: 14px; margin: 0 2px 0 0; @@ -668,25 +642,49 @@ b.future { font-weight: normal; color: #900; } border: 0; text-decoration: none; } -acronym.plat { cursor: default; } -.plat.oth { background: none; } -.plat.dc { background-position: 0px 0px; } -.plat.lin { background-position: 0px -14px; } -.plat.nds { background-position: 0px -28px; } -.plat.ps2 { background-position: 0px -42px; } -.plat.sfc { background-position: 0px -56px; } -.plat.gba { background-position: 0px -70px; } -.plat.ext { background-position: 0px -84px; } -.plat.par { background-position: 0px -98px; } -.plat.dvd { background-position: -16px 0px; } -.plat.mac { background-position: -16px -14px; } -.plat.ps { background-position: -16px -28px; } -.plat.psp { background-position: -16px -42px; } -.plat.win { background-position: -16px -56px; } -.plat.wii { background-position: -16px -70px; } -.plat.tri { background-position: -16px -84px; } -.plat.com { background-position: -16px -98px; } -.plat.par, .plat.tri, .plat.com { width: 11px; } +.icons.lang { + width: 13px; + height: 11px; + border: 1px solid #999; + /* see def.js for an ugly FF hack */ +} +.icons.par, .icons.tri, .icons.com { width: 11px; } +acronym.icons { cursor: default; } +.icons.oth { background: none; } +.icons.drc { background-position: 0px 0px; } +.icons.lin { background-position: 0px -14px; } +.icons.nds { background-position: 0px -28px; } +.icons.ps2 { background-position: 0px -42px; } +.icons.sfc { background-position: 0px -56px; } +.icons.gba { background-position: 0px -70px; } +.icons.ext { background-position: 0px -84px; } +.icons.par { background-position: 0px -98px; } +.icons.dvd { background-position: -16px 0px; } +.icons.mac { background-position: -16px -14px; } +.icons.ps1 { background-position: -16px -28px; } +.icons.psp { background-position: -16px -42px; } +.icons.win { background-position: -16px -56px; } +.icons.wii { background-position: -16px -70px; } +.icons.tri { background-position: -16px -84px; } +.icons.com { background-position: -16px -98px; } +.icons.cs { background-position: -32px 0px; } +.icons.da { background-position: -32px -11px; } +.icons.de { background-position: -32px -22px; } +.icons.en { background-position: -32px -33px; } +.icons.es { background-position: -32px -44px; } +.icons.fi { background-position: -32px -55px; } +.icons.fr { background-position: -32px -66px; } +.icons.it { background-position: -32px -77px; } +.icons.ja { background-position: -32px -88px; } +.icons.ko { background-position: -32px -99px; } +.icons.nl { background-position: -45px 0px; } +.icons.no { background-position: -45px -11px; } +.icons.pl { background-position: -45px -22px; } +.icons.pt { background-position: -45px -33px; } +.icons.ru { background-position: -45px -44px; } +.icons.sv { background-position: -45px -55px; } +.icons.tr { background-position: -45px -66px; } +.icons.zh { background-position: -45px -77px; } /* tables */ @@ -733,9 +731,20 @@ b.diff_del { font-weight: normal; background-color: #fcc; } #tre tr.lang { background-color: #f5f5f5!important; font-style: italic; } #tre .tc1 { width: 75px; padding-left: 10px; } -#tre .tc2 { width: 60px; text-align: center; } +#tre .tc2 { width: 50px; text-align: center; white-space: nowrap; } #tre .tc3, #tre .tc5 { width: 16px; margin: 0; padding: 0; white-space: nowrap; text-align: right } -#tre .tc3 { width: 60px; } +#tre .tc3 { width: 70px; } + +#tbv .tc2 acronym, #tbv .tc3 acronym { + zoom: 1; + opacity: 0.7; + filter:alpha(opacity=70); + -moz-opacity: 0.7; +} +#tbv .tc2, #tbv .tc3 { margin: 0; padding: 0; white-space: nowrap } +#tbv .tc2 { text-align: right; padding-right: 3px; } + +#tpd .tc1 { margin: 0; padding: 0; } #debug { border-top: 1px solid #ffb4b4; |