From dcf9df576d0e30e016bb6ecb9fb67decc04d2761 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 30 Nov 2009 23:31:37 +0100 Subject: Fixed EOL Errors, beautified js --- module/web/static/default/home.js | 95 ++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 51 deletions(-) (limited to 'module/web/static/default') diff --git a/module/web/static/default/home.js b/module/web/static/default/home.js index 0d74aa17a..025dcfcc7 100644 --- a/module/web/static/default/home.js +++ b/module/web/static/default/home.js @@ -6,12 +6,12 @@ var dwProgressBar = new Class({ //options options: { container: $$('body')[0], - boxID:'', - percentageID:'', - displayID:'', + boxID: '', + percentageID: '', + displayID: '', startPercentage: 0, displayText: false, - speed:10 + speed: 10 }, //initialization @@ -25,20 +25,20 @@ var dwProgressBar = new Class({ //creates the box and percentage elements createElements: function() { var box = new Element('div', { - id:this.options.boxID + this.options.id, - 'class' : this.options.boxID + id: this.options.boxID + this.options.id, + 'class': this.options.boxID }); var perc = new Element('div', { - id:this.options.percentageID + this.options.id, - 'style':'width:0px;', - 'class' : this.options.percentageID + id: this.options.percentageID + this.options.id, + 'style': 'width:0px;', + 'class': this.options.percentageID }); perc.inject(box); box.inject(this.options.container); - if(this.options.displayText) { + if (this.options.displayText) { var text = new Element('div', { - id:this.options.displayID + this.options.id, - 'class' : this.options.displayID + id: this.options.displayID + this.options.id, + 'class': this.options.displayID }); text.inject(this.options.container); } @@ -47,19 +47,19 @@ var dwProgressBar = new Class({ //calculates width in pixels from percentage calculate: function(percentage) { - return (document.id(this.options.boxID+ this.options.id).getStyle('width').replace('px','') * (percentage / 100)).toInt(); + return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); }, //animates the change in percentage animate: function(to) { - document.id(this.options.percentageID+ this.options.id).set('morph', { + document.id(this.options.percentageID + this.options.id).set('morph', { duration: this.options.speed, - link:'cancel' + link: 'cancel' }).morph({ - width:this.calculate(to.toInt()) + width: this.calculate(to.toInt()) }); - if(this.options.displayText) { - document.id(this.options.displayID+ this.options.id).set('text', to.toInt() + '%'); + if (this.options.displayText) { + document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); } }, @@ -70,7 +70,6 @@ var dwProgressBar = new Class({ }); - req = new Request.JSON({ onSuccess: renderTable, method: 'get', @@ -80,48 +79,46 @@ req = new Request.JSON({ limit: 20000 }); - var dls = [] var pbs = [] -function renderTable(data){ +function renderTable(data) { - data.downloads.each(function(dl){ + data.downloads.each(function(dl) { - if (dls.contains(dl.id)){ + if (dls.contains(dl.id)) { - var div = $('dl'+dl.id) + var div = $('dl' + dl.id) pbs[dl.id].set(dl.percent) div.getChildren("b")[0].textContent = dl.name - if (dl.status == "downloading"){ + if (dl.status == "downloading") { - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - speed = Math.round(dl.speed) + " kb/s" - eta = dl.eta - + size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; + speed = Math.round(dl.speed) + " kb/s"; + eta = dl.eta; - }else if (dl.status == "waiting"){ + } else if (dl.status == "waiting") { - size = "waiting "+ dl.wait - speed = "" - eta = "" + size = "waiting " + dl.wait; + speed = ""; + eta = ""; } - div.getChildren(".dlsize")[0].textContent = size - div.getChildren(".dlspeed")[0].textContent = speed - div.getChildren(".dltime")[0].textContent = eta + div.getChildren(".dlsize")[0].textContent = size; + div.getChildren(".dlspeed")[0].textContent = speed; + div.getChildren(".dltime")[0].textContent = eta; - }else{ + } else { dls.push(dl.id) container = $("dlcontainer") dldiv = new Element('div', { - 'id' : 'dl'+dl.id, + 'id': 'dl' + dl.id, 'class': 'download', 'styles': { 'display': 'None' @@ -158,28 +155,27 @@ function renderTable(data){ 'class': 'dlspeed', 'html': Math.round(dl.speed) + " kb/s" }).inject(dldiv) - + new Element('div', { 'class': 'dltime', 'html': dl.eta }).inject(dldiv) //dldiv.dissolve({duration : 0}) - dldiv.reveal() } }) - dls.each(function(id, index){ + dls.each(function(id, index) { - if (data.ids.contains(id)){ + if (data.ids.contains(id)) { - }else{ +} else { //$("dl"+id).reveal() - dls.erase(id) - $('dl'+id).nix() + dls.erase(id); + $('dl' + id).nix() } @@ -187,7 +183,8 @@ function renderTable(data){ } -window.addEvent('domready', function(){ +window.addEvent('domready', +function() { /* //create the progress bar for example 1 @@ -205,8 +202,4 @@ pb = new dwProgressBar({ req.startTimer(); - -}); - - - +}); \ No newline at end of file -- cgit v1.2.3 From a649d73a1bd2a9b45eb35d535d40e2454238417c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 3 Dec 2009 18:10:48 +0100 Subject: little webinterface fixes --- module/web/static/default/status.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/web/static/default') diff --git a/module/web/static/default/status.js b/module/web/static/default/status.js index 31a4e0032..3923e80ca 100644 --- a/module/web/static/default/status.js +++ b/module/web/static/default/status.js @@ -39,11 +39,11 @@ window.addEvent('domready', function(){ new Request({ method: 'post', - url: '/json/addlinks', + url: '/json/addpackage', onSuccess: function(){ document.id('linkarea').value = "" } - }).send('links='+document.id('linkarea').value) + }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) }) -- cgit v1.2.3 From 95d09b338ac7aed2b387bf143a5cfd1c4b29f612 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 15 Dec 2009 17:48:30 +0100 Subject: new Django webinterface(in development), small fixes --- module/web/static/default/Button-Add-grey.png | Bin 2112 -> 0 bytes module/web/static/default/Button-Add.png | Bin 2110 -> 0 bytes module/web/static/default/Button-Pause-grey.png | Bin 1932 -> 0 bytes module/web/static/default/Button-Pause.png | Bin 2146 -> 0 bytes module/web/static/default/Button-Play-grey.png | Bin 1938 -> 0 bytes module/web/static/default/Button-Play.png | Bin 2023 -> 0 bytes module/web/static/default/head-login.png | Bin 1288 -> 0 bytes .../web/static/default/head-menu-development.png | Bin 1324 -> 0 bytes module/web/static/default/head-menu-download.png | Bin 721 -> 0 bytes module/web/static/default/head-menu-home.png | Bin 920 -> 0 bytes module/web/static/default/head-menu-index.png | Bin 482 -> 0 bytes module/web/static/default/head-menu-news.png | Bin 628 -> 0 bytes module/web/static/default/head-menu-recent.png | Bin 932 -> 0 bytes module/web/static/default/head-menu-wiki.png | Bin 1204 -> 0 bytes module/web/static/default/head-search-noshadow.png | Bin 1187 -> 0 bytes module/web/static/default/head_bg1.png | Bin 125 -> 0 bytes module/web/static/default/home.js | 205 --------------------- module/web/static/default/page-tools-backlinks.png | Bin 540 -> 0 bytes module/web/static/default/page-tools-edit.png | Bin 574 -> 0 bytes module/web/static/default/page-tools-revisions.png | Bin 603 -> 0 bytes module/web/static/default/progress-bar-back.gif | Bin 10819 -> 0 bytes module/web/static/default/progress-bar.gif | Bin 10819 -> 0 bytes .../pyload-logo-edited3.5-new-font-small.png | Bin 8457 -> 0 bytes module/web/static/default/status.js | 100 ---------- module/web/static/default/tab-background.png | Bin 179 -> 0 bytes module/web/static/default/tabs-border-bottom.png | Bin 163 -> 0 bytes module/web/static/default/user-actions-logout.png | Bin 799 -> 0 bytes module/web/static/default/user-actions-profile.png | Bin 628 -> 0 bytes 28 files changed, 305 deletions(-) delete mode 100644 module/web/static/default/Button-Add-grey.png delete mode 100644 module/web/static/default/Button-Add.png delete mode 100644 module/web/static/default/Button-Pause-grey.png delete mode 100644 module/web/static/default/Button-Pause.png delete mode 100644 module/web/static/default/Button-Play-grey.png delete mode 100644 module/web/static/default/Button-Play.png delete mode 100644 module/web/static/default/head-login.png delete mode 100644 module/web/static/default/head-menu-development.png delete mode 100644 module/web/static/default/head-menu-download.png delete mode 100644 module/web/static/default/head-menu-home.png delete mode 100644 module/web/static/default/head-menu-index.png delete mode 100644 module/web/static/default/head-menu-news.png delete mode 100644 module/web/static/default/head-menu-recent.png delete mode 100644 module/web/static/default/head-menu-wiki.png delete mode 100644 module/web/static/default/head-search-noshadow.png delete mode 100644 module/web/static/default/head_bg1.png delete mode 100644 module/web/static/default/home.js delete mode 100644 module/web/static/default/page-tools-backlinks.png delete mode 100644 module/web/static/default/page-tools-edit.png delete mode 100644 module/web/static/default/page-tools-revisions.png delete mode 100644 module/web/static/default/progress-bar-back.gif delete mode 100644 module/web/static/default/progress-bar.gif delete mode 100644 module/web/static/default/pyload-logo-edited3.5-new-font-small.png delete mode 100644 module/web/static/default/status.js delete mode 100644 module/web/static/default/tab-background.png delete mode 100644 module/web/static/default/tabs-border-bottom.png delete mode 100644 module/web/static/default/user-actions-logout.png delete mode 100644 module/web/static/default/user-actions-profile.png (limited to 'module/web/static/default') diff --git a/module/web/static/default/Button-Add-grey.png b/module/web/static/default/Button-Add-grey.png deleted file mode 100644 index 6659e230e..000000000 Binary files a/module/web/static/default/Button-Add-grey.png and /dev/null differ diff --git a/module/web/static/default/Button-Add.png b/module/web/static/default/Button-Add.png deleted file mode 100644 index 602da4131..000000000 Binary files a/module/web/static/default/Button-Add.png and /dev/null differ diff --git a/module/web/static/default/Button-Pause-grey.png b/module/web/static/default/Button-Pause-grey.png deleted file mode 100644 index d1017e974..000000000 Binary files a/module/web/static/default/Button-Pause-grey.png and /dev/null differ diff --git a/module/web/static/default/Button-Pause.png b/module/web/static/default/Button-Pause.png deleted file mode 100644 index 68f3ffc3a..000000000 Binary files a/module/web/static/default/Button-Pause.png and /dev/null differ diff --git a/module/web/static/default/Button-Play-grey.png b/module/web/static/default/Button-Play-grey.png deleted file mode 100644 index 9f44c2289..000000000 Binary files a/module/web/static/default/Button-Play-grey.png and /dev/null differ diff --git a/module/web/static/default/Button-Play.png b/module/web/static/default/Button-Play.png deleted file mode 100644 index 1ce1ed913..000000000 Binary files a/module/web/static/default/Button-Play.png and /dev/null differ diff --git a/module/web/static/default/head-login.png b/module/web/static/default/head-login.png deleted file mode 100644 index b59b7cbbf..000000000 Binary files a/module/web/static/default/head-login.png and /dev/null differ diff --git a/module/web/static/default/head-menu-development.png b/module/web/static/default/head-menu-development.png deleted file mode 100644 index 8ef08e2e5..000000000 Binary files a/module/web/static/default/head-menu-development.png and /dev/null differ diff --git a/module/web/static/default/head-menu-download.png b/module/web/static/default/head-menu-download.png deleted file mode 100644 index 98c5da9db..000000000 Binary files a/module/web/static/default/head-menu-download.png and /dev/null differ diff --git a/module/web/static/default/head-menu-home.png b/module/web/static/default/head-menu-home.png deleted file mode 100644 index 9d62109aa..000000000 Binary files a/module/web/static/default/head-menu-home.png and /dev/null differ diff --git a/module/web/static/default/head-menu-index.png b/module/web/static/default/head-menu-index.png deleted file mode 100644 index 44d631064..000000000 Binary files a/module/web/static/default/head-menu-index.png and /dev/null differ diff --git a/module/web/static/default/head-menu-news.png b/module/web/static/default/head-menu-news.png deleted file mode 100644 index 43950ebc9..000000000 Binary files a/module/web/static/default/head-menu-news.png and /dev/null differ diff --git a/module/web/static/default/head-menu-recent.png b/module/web/static/default/head-menu-recent.png deleted file mode 100644 index fc9b0497f..000000000 Binary files a/module/web/static/default/head-menu-recent.png and /dev/null differ diff --git a/module/web/static/default/head-menu-wiki.png b/module/web/static/default/head-menu-wiki.png deleted file mode 100644 index 07cf0102d..000000000 Binary files a/module/web/static/default/head-menu-wiki.png and /dev/null differ diff --git a/module/web/static/default/head-search-noshadow.png b/module/web/static/default/head-search-noshadow.png deleted file mode 100644 index aafdae015..000000000 Binary files a/module/web/static/default/head-search-noshadow.png and /dev/null differ diff --git a/module/web/static/default/head_bg1.png b/module/web/static/default/head_bg1.png deleted file mode 100644 index f2848c3cc..000000000 Binary files a/module/web/static/default/head_bg1.png and /dev/null differ diff --git a/module/web/static/default/home.js b/module/web/static/default/home.js deleted file mode 100644 index 025dcfcc7..000000000 --- a/module/web/static/default/home.js +++ /dev/null @@ -1,205 +0,0 @@ -var dwProgressBar = new Class({ - - //implements - Implements: [Options], - - //options - options: { - container: $$('body')[0], - boxID: '', - percentageID: '', - displayID: '', - startPercentage: 0, - displayText: false, - speed: 10 - }, - - //initialization - initialize: function(options) { - //set options - this.setOptions(options); - //create elements - this.createElements(); - }, - - //creates the box and percentage elements - createElements: function() { - var box = new Element('div', { - id: this.options.boxID + this.options.id, - 'class': this.options.boxID - }); - var perc = new Element('div', { - id: this.options.percentageID + this.options.id, - 'style': 'width:0px;', - 'class': this.options.percentageID - }); - perc.inject(box); - box.inject(this.options.container); - if (this.options.displayText) { - var text = new Element('div', { - id: this.options.displayID + this.options.id, - 'class': this.options.displayID - }); - text.inject(this.options.container); - } - this.set(this.options.startPercentage); - }, - - //calculates width in pixels from percentage - calculate: function(percentage) { - return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); - }, - - //animates the change in percentage - animate: function(to) { - document.id(this.options.percentageID + this.options.id).set('morph', { - duration: this.options.speed, - link: 'cancel' - }).morph({ - width: this.calculate(to.toInt()) - }); - if (this.options.displayText) { - document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); - } - }, - - //sets the percentage from its current state to desired percentage - set: function(to) { - this.animate(to); - } - -}); - -req = new Request.JSON({ - onSuccess: renderTable, - method: 'get', - url: '/json/links', - initialDelay: 0, - delay: 1000, - limit: 20000 -}); - -var dls = [] -var pbs = [] - -function renderTable(data) { - - data.downloads.each(function(dl) { - - if (dls.contains(dl.id)) { - - var div = $('dl' + dl.id) - - pbs[dl.id].set(dl.percent) - - div.getChildren("b")[0].textContent = dl.name - - if (dl.status == "downloading") { - - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; - speed = Math.round(dl.speed) + " kb/s"; - eta = dl.eta; - - } else if (dl.status == "waiting") { - - size = "waiting " + dl.wait; - speed = ""; - eta = ""; - - } - div.getChildren(".dlsize")[0].textContent = size; - div.getChildren(".dlspeed")[0].textContent = speed; - div.getChildren(".dltime")[0].textContent = eta; - - } else { - - dls.push(dl.id) - - container = $("dlcontainer") - - dldiv = new Element('div', { - 'id': 'dl' + dl.id, - 'class': 'download', - 'styles': { - 'display': 'None' - } - }) - - new Element('p').inject(dldiv) - - new Element('b', { - 'html': dl.name - }).inject(dldiv) - - new Element('br').inject(dldiv) - - dldiv.inject(container) - - pbs[dl.id] = new dwProgressBar({ - container: $(dldiv), - startPercentage: 0, - speed: 1000, - id: dl.id, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' - }); - - new Element('div', { - 'class': 'dlsize', - 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - }).inject(dldiv) - - new Element('div', { - 'class': 'dlspeed', - 'html': Math.round(dl.speed) + " kb/s" - }).inject(dldiv) - - new Element('div', { - 'class': 'dltime', - 'html': dl.eta - }).inject(dldiv) - - //dldiv.dissolve({duration : 0}) - dldiv.reveal() - - } - }) - - dls.each(function(id, index) { - - if (data.ids.contains(id)) { - -} else { - - //$("dl"+id).reveal() - dls.erase(id); - $('dl' + id).nix() - - } - - }) - -} - -window.addEvent('domready', -function() { - - /* -//create the progress bar for example 1 -pb = new dwProgressBar({ - container: $$('.level1 p')[0], - startPercentage: 25, - speed: 1000, - id: 1, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' -}); -*/ - - req.startTimer(); - -}); \ No newline at end of file diff --git a/module/web/static/default/page-tools-backlinks.png b/module/web/static/default/page-tools-backlinks.png deleted file mode 100644 index 3eb6a9ce3..000000000 Binary files a/module/web/static/default/page-tools-backlinks.png and /dev/null differ diff --git a/module/web/static/default/page-tools-edit.png b/module/web/static/default/page-tools-edit.png deleted file mode 100644 index 188e1c12b..000000000 Binary files a/module/web/static/default/page-tools-edit.png and /dev/null differ diff --git a/module/web/static/default/page-tools-revisions.png b/module/web/static/default/page-tools-revisions.png deleted file mode 100644 index 5c3b8587f..000000000 Binary files a/module/web/static/default/page-tools-revisions.png and /dev/null differ diff --git a/module/web/static/default/progress-bar-back.gif b/module/web/static/default/progress-bar-back.gif deleted file mode 100644 index 0c8f68211..000000000 Binary files a/module/web/static/default/progress-bar-back.gif and /dev/null differ diff --git a/module/web/static/default/progress-bar.gif b/module/web/static/default/progress-bar.gif deleted file mode 100644 index 746f77175..000000000 Binary files a/module/web/static/default/progress-bar.gif and /dev/null differ diff --git a/module/web/static/default/pyload-logo-edited3.5-new-font-small.png b/module/web/static/default/pyload-logo-edited3.5-new-font-small.png deleted file mode 100644 index 2443cd8b1..000000000 Binary files a/module/web/static/default/pyload-logo-edited3.5-new-font-small.png and /dev/null differ diff --git a/module/web/static/default/status.js b/module/web/static/default/status.js deleted file mode 100644 index 3923e80ca..000000000 --- a/module/web/static/default/status.js +++ /dev/null @@ -1,100 +0,0 @@ -/* hover! */ -Element.implement({ - '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(){ - - status_req.startTimer(); - - - document.id("btAdd").addEvent("click", function(e){ - - new Request({ - method: 'post', - url: '/json/addpackage', - onSuccess: function(){ - document.id('linkarea').value = "" - } - }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) - - - }) - - $$('.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() - - - $$('#addlinks .closeSticky').each(function(el){ - - 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() - - }); - - $$('.statusbutton')[0].addEvent('click', function(e){ - - new Request({ - 'url' : '/json/play', - 'method' : 'get' - }).send() - }) - - $$('.statusbutton')[1].addEvent('click', function(e){ - - new Request({ - 'url' : '/json/pause', - 'method' : 'get' - }).send() - }) - -}); \ No newline at end of file diff --git a/module/web/static/default/tab-background.png b/module/web/static/default/tab-background.png deleted file mode 100644 index 29a5d1991..000000000 Binary files a/module/web/static/default/tab-background.png and /dev/null differ diff --git a/module/web/static/default/tabs-border-bottom.png b/module/web/static/default/tabs-border-bottom.png deleted file mode 100644 index 02440f428..000000000 Binary files a/module/web/static/default/tabs-border-bottom.png and /dev/null differ diff --git a/module/web/static/default/user-actions-logout.png b/module/web/static/default/user-actions-logout.png deleted file mode 100644 index 0010931e2..000000000 Binary files a/module/web/static/default/user-actions-logout.png and /dev/null differ diff --git a/module/web/static/default/user-actions-profile.png b/module/web/static/default/user-actions-profile.png deleted file mode 100644 index 46573fff6..000000000 Binary files a/module/web/static/default/user-actions-profile.png and /dev/null differ -- cgit v1.2.3