diff options
Diffstat (limited to 'module/web/static/default/status.js')
-rw-r--r-- | module/web/static/default/status.js | 93 |
1 files changed, 63 insertions, 30 deletions
diff --git a/module/web/static/default/status.js b/module/web/static/default/status.js index c211fc669..f3d521e45 100644 --- a/module/web/static/default/status.js +++ b/module/web/static/default/status.js @@ -1,51 +1,84 @@ /* hover! */ Element.implement({ - 'hover': function(fn1,fn2) { - return this.addEvents({ - 'mouseenter': function(e) { - fn1.attempt(e,this); - }, - 'mouseleave': function(e) { - fn2.attempt(e,this); - } - }) - } + 'hover': function(fn1,fn2) { + return this.addEvents({ + 'mouseenter': function(e) { + fn1.attempt(e,this); + }, + 'mouseleave': function(e) { + fn2.attempt(e,this); + } + }) + } }); +function updateStatus(data){ + + document.id("status").textContent = "Status: "+ data.status; + document.id("speed").textContent = "Speed: "+ data.speed +" kb/s"; + document.id("queue").textContent = "Files in queue: "+ data.queue; + +} + + +status_req = new Request.JSON({ + onSuccess: updateStatus, + method: 'get', + url: '/json/status', + initialDelay: 0, + delay: 2000, + limit: 20000 +}); window.addEvent('domready', function(){ -$$('.statusbutton').each(function(item){ + status_req.startTimer(); - item.hover(function(e){ - this.tween('opacity',1) - },function(e){ - this.tween('opacity',0.01) - } -) -}) -fx_reveal = new Fx.Reveal($('addlinks')); -//fx_reveal.dissolve() + document.id("btAdd").addEvent("click", function(e){ + new Request({ + method: 'post', + url: '/json/addlinks', + onSuccess: function(){ + document.id('linkarea').value = "" + } + }).send('links='+document.id('linkarea').value) -$$('#addlinks .closeSticky').each(function(el){ -el.addEvent('click',function(e){ + }) -fx_reveal.dissolve(); + $$('.statusbutton').each(function(item){ -}); + item.hover(function(e){ + this.tween('opacity',1) + },function(e){ + this.tween('opacity',0.01) + } + ) + }) -}); + fx_reveal = new Fx.Reveal($('addlinks')); + //fx_reveal.dissolve() -$$('.statusbutton')[2].addEvent('click',function(e){ -$('addlinks').setStyle('top', e.page.y + 5) -$('addlinks').setStyle('left', e.page.x + 5) + $$('#addlinks .closeSticky').each(function(el){ -fx_reveal.reveal() + el.addEvent('click',function(e){ -}); + fx_reveal.dissolve(); + + }); + + }); + + $$('.statusbutton')[2].addEvent('click',function(e){ + + $('addlinks').setStyle('top', e.page.y + 5) + $('addlinks').setStyle('left', e.page.x + 5) + + fx_reveal.reveal() + + }); });
\ No newline at end of file |