summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-12-27 13:40:32 +0100
committerYorhel <git@yorhel.nl>2008-12-27 13:40:32 +0100
commit99645030d202d7af2edcfc22645d251cd52cac2a (patch)
tree9dd1d0237dc9d31c831c37cc8c8fe826dbbf19fa /static
parent6a490c8c2c7c60e5530ace67fb5e526575939849 (diff)
Re-added the release list dropdown to VN pages
Diffstat (limited to 'static')
-rw-r--r--static/f/script.js72
1 files changed, 72 insertions, 0 deletions
diff --git a/static/f/script.js b/static/f/script.js
index 093bcb74..83530714 100644
--- a/static/f/script.js
+++ b/static/f/script.js
@@ -15,6 +15,10 @@ clearInterval(t);f()}},10);window.onload=f;}
+
+
+/* A D V A N C E D S E A R C H */
+
function searchInit() {
cl('advselect', function() {
var e = x('advoptions');
@@ -184,6 +188,66 @@ function ivClose() {
+
+/* V N L I S T D R O P D O W N */
+
+var rstat = [ 'Unknown', 'Pending', 'Obtained', 'On loan', 'Deleted' ];
+var vstat = [ 'Unknown', 'Playing', 'Finished', 'Stalled', 'Dropped' ];
+function vlDropDown(e) {
+ e = e || window.event;
+ var tg = e.target || e.srcElement;
+ while(tg && (tg.nodeType == 3 || tg.nodeName.toLowerCase() != 'a'))
+ tg = tg.parentNode;
+
+ var o = x('vldd');
+ if(!o && (!tg || tg.id.substr(0,6) != 'rlsel_'))
+ return;
+
+ if(o) {
+ var mouseX = e.pageX || (e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft);
+ var mouseY = e.pageY || (e.clientY + document.body.scrollTop + document.documentElement.scrollTop);
+ if((mouseX < ddx-5 || mouseX > ddx+o.offsetWidth+100 || mouseY < ddy-5 || mouseY > ddy+o.offsetHeight+5)
+ || (tg && tg.id.substr(0,6) == 'rlsel_' && tg.id != 'rlsel_'+o.relId)) {
+ document.body.removeChild(o);
+ o = null;
+ }
+ }
+ if(!o && tg) {
+ o = tg;
+ ddx = ddy = 0;
+ do {
+ ddx += o.offsetLeft;
+ ddy += o.offsetTop;
+ } while(o = o.offsetParent);
+ ddx -= 185;
+
+ var cu = '/r'+tg.id.substr(6)+'/list?e=';
+ var st = tg.innerHTML.split(' / ');
+ var r = '<ul><li><b>Release status</b></li>';
+ for(var i=0;i<rstat.length;i++)
+ r += st[0] && st[0].indexOf(rstat[i]) >= 0 ? '<li><i>'+rstat[i]+'</i></li>' : '<li><a href="'+cu+'r'+i+'">'+rstat[i]+'</a></li>';
+ r += '</ul><ul><li><b>Play status</b></li>';
+ for(var i=0;i<vstat.length;i++)
+ r += st[1] && st[1].indexOf(vstat[i]) >= 0 ? '<li><i>'+vstat[i]+'</i></li>' : '<li><a href="'+cu+'v'+i+'">'+vstat[i]+'</a></li>';
+ r += '</ul>';
+ if(tg.innerHTML != '--')
+ r += '<ul class="full"><li><a href="'+cu+'del">Remove from VN list</a></li></ul>';
+
+ o = document.createElement('div');
+ o.id = 'vldd';
+ o.relId = tg.id.substr(6);
+ o.style.left = ddx+'px';
+ o.style.top = ddy+'px';
+ o.innerHTML = r;
+ document.body.appendChild(o);
+ }
+}
+
+
+
+
+
+
/* J A V A S C R I P T T A B S */
function jtInit() {
@@ -371,6 +435,14 @@ DOMLoad(function() {
// initialize image viewer
ivInit();
+ // vnlist dropdown
+ var l = document.getElementsByTagName('a');
+ for(var i=0;i<l.length;i++)
+ if(l[i].id.substr(0,6) == 'rlsel_') {
+ document.onmousemove = vlDropDown;
+ break;
+ }
+
// Javascript tabs
if(x('jt_select'))
jtInit();