diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-17 01:18:06 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-17 01:18:06 +0100 |
commit | ed2373b3c3568db328e8000984f8dfc98028db73 (patch) | |
tree | bd08ffb6259a5a938465e6066cc6a034ae8321b8 /module/web/media/js | |
parent | webui temp (diff) | |
parent | delete tmp folder (diff) | |
download | pyload-ed2373b3c3568db328e8000984f8dfc98028db73.tar.xz |
Merge branch 'pr/n1006_mariusbaumann' into 0.4.10
Diffstat (limited to 'module/web/media/js')
-rw-r--r-- | module/web/media/js/MooDropMenu_static.js | 13 | ||||
-rw-r--r-- | module/web/media/js/package_ui.js | 54 | ||||
-rw-r--r-- | module/web/media/js/purr_static.js | 11 | ||||
-rw-r--r-- | module/web/media/js/settings.js | 2 | ||||
-rw-r--r-- | module/web/media/js/tinytab_static.js | 2 |
5 files changed, 53 insertions, 29 deletions
diff --git a/module/web/media/js/MooDropMenu_static.js b/module/web/media/js/MooDropMenu_static.js index b9cd8cc10..621031599 100644 --- a/module/web/media/js/MooDropMenu_static.js +++ b/module/web/media/js/MooDropMenu_static.js @@ -23,13 +23,13 @@ var MooDropMenu = new Class({ options: { onOpen: function(el){ - el.removeClass('close').addClass('open'); + el.removeClass('open').addClass('open'); }, onClose: function(el){ - el.removeClass('open').addClass('close'); + el.removeClass('open').addClass('open'); }, onInitialize: function(el){ - el.removeClass('open').addClass('close'); + el.removeClass('open').addClass('open'); }, mouseoutDelay: 200, mouseoverDelay: 0, @@ -44,9 +44,10 @@ var MooDropMenu = new Class({ var menu = this.menu = document.id(menu); menu.getElements(options.itemSelector + ' > ' + options.listSelector).each(function(el){ + this.fireEvent('initialize', el); - + var parent = el.getParent(options.itemSelector), timer; @@ -62,11 +63,11 @@ var MooDropMenu = new Class({ }.bind(this), 'mouseleave': function(){ - parent.store('DropDownOpen', false); + parent.store('DropDownOpen', true); clearTimeout(timer); timer = (function(){ - if (!parent.retrieve('DropDownOpen')) this.fireEvent('close', el); + if (!parent.retrieve('DropDownOpen')) this.fireEvent('open', el); }).delay(options.mouseoutDelay, this); }.bind(this) diff --git a/module/web/media/js/package_ui.js b/module/web/media/js/package_ui.js index 3ea965649..384207882 100644 --- a/module/web/media/js/package_ui.js +++ b/module/web/media/js/package_ui.js @@ -162,16 +162,16 @@ var Package = new Class({ }, parseElement: function() { - var imgs = this.ele.getElements('img'); + var imgs = this.ele.getElements('span'); this.name = this.ele.getElements('.name')[0]; this.folder = this.ele.getElements('.folder')[0]; this.password = this.ele.getElements('.password')[0]; - imgs[1].addEvent('click', this.deletePackage.bind(this)); - imgs[2].addEvent('click', this.restartPackage.bind(this)); - imgs[3].addEvent('click', this.editPackage.bind(this)); - imgs[4].addEvent('click', this.movePackage.bind(this)); + imgs[3].addEvent('click', this.deletePackage.bind(this)); + imgs[4].addEvent('click', this.restartPackage.bind(this)); + imgs[5].addEvent('click', this.editPackage.bind(this)); + imgs[6].addEvent('click', this.movePackage.bind(this)); this.ele.getElement('.packagename').addEvent('click', this.toggle.bind(this)); @@ -197,14 +197,34 @@ var Package = new Class({ "margin-left": 0 } }); + + if (link.icon == 'arrow_right.png'){ + link.icon = 'glyphicon glyphicon-arrow-right'; + } + if (link.icon == 'status_downloading.png'){ + link.icon = 'glyphicon glyphicon-cloud-download'; + } + if (link.icon == 'status_failed.png'){ + link.icon = 'glyphicon glyphicon-exclamation-sign'; + } + if (link.icon == 'status_finished.png'){ + link.icon = 'glyphicon glyphicon-ok'; + } + if (link.statusmsg == 'queued'){ + link.icon = 'glyphicon glyphicon-time'; + } + if (link.icon == 'status_offline.png'){ + link.icon = 'glyphicon glyphicon-ban-circle'; + } + - var html = "<span style='cursor: move' class='child_status sorthandle'><img src='/media/default/img/{icon}' style='width: 12px; height:12px;'/></span>\n".substitute({"icon": link.icon}); - html += "<span style='font-size: 15px'>{name}</span><br /><div class='child_secrow'>".substitute({"name": link.name}); - html += "<span class='child_status'>{statusmsg}</span>{error} ".substitute({"statusmsg": link.statusmsg, "error":link.error}); - html += "<span class='child_status'>{format_size}</span>".substitute({"format_size": link.format_size}); - html += "<span class='child_status'>{plugin}</span> ".substitute({"plugin": link.plugin}); - html += "<img title='{{_("Delete Link")}}' style='cursor: pointer;' width='10px' height='10px' src='/media/default/img/delete.png' /> "; - html += "<img title='{{_("Restart Link")}}' style='cursor: pointer;margin-left: -4px' width='10px' height='10px' src='/media/default/img/arrow_refresh.png' /></div>"; + var html = "<span style='' class='child_status'><span style='margin-right: 2px;' class='{icon} sorthandle'></span></span>\n".substitute({"icon": link.icon}); + html += "<span style='font-size: 18px; text-weight:bold'>{name}</span><br /><div class='child_secrow' style='margin-left: 21px; margin-bottom: 7px;'>".substitute({"name": link.name}); + html += "<span class='child_status' style='font-size: 12px; color:#555'>{statusmsg}</span>{error} ".substitute({"statusmsg": link.statusmsg, "error":link.error}); + html += "<span class='child_status' style='font-size: 12px; color:#555'>{format_size}</span>".substitute({"format_size": link.format_size}); + html += "<span class='child_status' style='font-size: 12px; color:#555'> {plugin}</span> ".substitute({"plugin": link.plugin}); + html += "<span class='glyphicon glyphicon-trash' title='{{_("Delete Link")}}' style='cursor: pointer; font-size: 12px; color:#333;' ></span> "; + html += "<span class='glyphicon glyphicon-repeat' title='{{_("Restart Link")}}' style='cursor: pointer; font-size: 12px; color:#333;' ></span></div>"; var div = new Element("div", { "id": "file_" + link.id, @@ -235,8 +255,8 @@ var Package = new Class({ registerLinkEvents: function() { this.ele.getElements('.child').each(function(child) { var lid = child.get('id').match(/[0-9]+/); - var imgs = child.getElements('.child_secrow img'); - imgs[0].addEvent('click', function(e) { + var imgs = child.getElements('.child_secrow span'); + imgs[3].addEvent('click', function(e) { new Request({ method: 'get', url: '/api/deleteFiles/[' + this + "]", @@ -247,14 +267,14 @@ var Package = new Class({ }).send(); }.bind(lid)); - imgs[1].addEvent('click', function(e) { + imgs[4].addEvent('click', function(e) { new Request({ method: 'get', url: '/api/restartFile/' + this, onSuccess: function() { var ele = $('file_' + this); - var imgs = ele.getElements("img"); - imgs[0].set("src", "/media/default/img/status_queue.png"); + var imgs = ele.getElements(".glyphicon"); + imgs[0].set("class", "glyphicon glyphicon-time"); var spans = ele.getElements(".child_status"); spans[1].set("html", "queued"); indicateSuccess(); diff --git a/module/web/media/js/purr_static.js b/module/web/media/js/purr_static.js index 7e0aee949..c011ad505 100644 --- a/module/web/media/js/purr_static.js +++ b/module/web/media/js/purr_static.js @@ -32,14 +32,17 @@ var Purr = new Class({ 'wrapper': { 'styles': { 'position': 'fixed', - 'z-index': '9999' + 'z-index': '9999', + 'width': '40%', + 'margin-top': '60px', }, - 'class': 'purr-wrapper' + 'class': '', }, 'alert': { - 'class': 'purr-alert', + 'class': 'alert alert-info', 'styles': { - 'opacity': '.85' + 'opacity': '.70', + 'width': '', } }, 'buttonWrapper': { diff --git a/module/web/media/js/settings.js b/module/web/media/js/settings.js index 9191fac72..be694d365 100644 --- a/module/web/media/js/settings.js +++ b/module/web/media/js/settings.js @@ -1,3 +1,3 @@ {% autoescape true %} -var SettingsUI,root;var __bind=function(a,b){return function(){return a.apply(b,arguments)}};root=this;window.addEvent("domready",function(){root.accountDialog=new MooDialog({destroyOnHide:false});root.accountDialog.setContent($("account_box"));new TinyTab($$("#toptabs li a"),$$("#tabs-body > span"));$$("ul.nav").each(function(a){return new MooDropMenu(a,{onOpen:function(b){return b.fade("in")},onClose:function(b){return b.fade("out")},onInitialize:function(b){return b.fade("hide").set("tween",{duration:500})}})});return new SettingsUI()});SettingsUI=(function(){function a(){var c,e,b,d;this.menu=$$("#general-menu li");this.menu.append($$("#plugin-menu li"));this.name=$("tabsback");this.general=$("general_form_content");this.plugin=$("plugin_form_content");d=this.menu;for(e=0,b=d.length;e<b;e++){c=d[e];c.addEvent("click",this.menuClick.bind(this))}$("general|submit").addEvent("click",this.configSubmit.bind(this));$("plugin|submit").addEvent("click",this.configSubmit.bind(this));$("account_add").addEvent("click",function(f){root.accountDialog.open();return f.stop()});$("account_reset").addEvent("click",function(f){return root.accountDialog.close()});$("account_add_button").addEvent("click",this.addAccount.bind(this));$("account_submit").addEvent("click",this.submitAccounts.bind(this))}a.prototype.menuClick=function(h){var c,b,g,f,d;d=h.target.get("id").split("|"),c=d[0],g=d[1];b=h.target.get("text");f=c==="general"?this.general:this.plugin;f.dissolve();return new Request({method:"get",url:"/json/load_config/"+c+"/"+g,onSuccess:__bind(function(e){f.set("html",e);f.reveal();return this.name.set("text",b)},this)}).send()};a.prototype.configSubmit=function(d){var c,b;c=d.target.get("id").split("|")[0];b=$(""+c+"_form");b.set("send",{method:"post",url:"/json/save_config/"+c,onSuccess:function(){return root.notify.alert('{{ _("Settings saved.")}}',{className:"success"})},onFailure:function(){return root.notify.alert('{{ _("Error occured.")}}',{className:"error"})}});b.send();return d.stop()};a.prototype.addAccount=function(c){var b;b=$("add_account_form");b.set("send",{method:"post",onSuccess:function(){return window.location.reload()},onFailure:function(){return root.notify.alert('{{_("Error occured.")}}',{className:"error"})}});b.send();return c.stop()};a.prototype.submitAccounts=function(c){var b;b=$("account_form");b.set("send",{method:"post",onSuccess:function(){return window.location.reload()},onFailure:function(){return root.notify.alert('{{ _("Error occured.") }}',{className:"error"})}});b.send();return c.stop()};return a})(); +var SettingsUI,root;var __bind=function(a,b){return function(){return a.apply(b,arguments)}};root=this;window.addEvent("domready",function(){root.accountDialog=new MooDialog({destroyOnHide:false});root.accountDialog.setContent($("account_box"));new TinyTab($$("#toptabs li"),$$("#tabs-body > span"));$$("ul.nav").each(function(a){return new MooDropMenu(a,{onOpen:function(b){return b.fade("in")},onClose:function(b){return b.fade("out")},onInitialize:function(b){return b.fade("show").set("tween",{duration:500})}})});return new SettingsUI()});SettingsUI=(function(){function a(){var c,e,b,d;this.menu=$$("#general-menu li");this.menu.append($$("#plugin-menu li"));this.name=$("tabsback");this.general=$("general_form_content");this.plugin=$("plugin_form_content");d=this.menu;for(e=0,b=d.length;e<b;e++){c=d[e];c.addEvent("click",this.menuClick.bind(this))}$("general|submit").addEvent("click",this.configSubmit.bind(this));$("plugin|submit").addEvent("click",this.configSubmit.bind(this));$("account_add").addEvent("click",function(f){root.accountDialog.open();return f.stop()});$("account_reset").addEvent("click",function(f){return root.accountDialog.close()});$("account_add_button").addEvent("click",this.addAccount.bind(this));$("account_submit").addEvent("click",this.submitAccounts.bind(this))}a.prototype.menuClick=function(h){var c,b,g,f,d;d=h.target.get("id").split("|"),c=d[0],g=d[1];b=h.target.get("text");f=c==="general"?this.general:this.plugin;f.dissolve();return new Request({method:"get",url:"/json/load_config/"+c+"/"+g,onSuccess:__bind(function(e){f.set("html",e);f.reveal();return this.name.set("text",b)},this)}).send()};a.prototype.configSubmit=function(d){var c,b;c=d.target.get("id").split("|")[0];b=$(""+c+"_form");b.set("send",{method:"post",url:"/json/save_config/"+c,onSuccess:function(){return root.notify.alert('{{ _("Settings saved.")}}',{className:"success"})},onFailure:function(){return root.notify.alert('{{ _("Error occured.")}}',{className:"error"})}});b.send();return d.stop()};a.prototype.addAccount=function(c){var b;b=$("add_account_form");b.set("send",{method:"post",onSuccess:function(){return window.location.reload()},onFailure:function(){return root.notify.alert('{{_("Error occured.")}}',{className:"error"})}});b.send();return c.stop()};a.prototype.submitAccounts=function(c){var b;b=$("account_form");b.set("send",{method:"post",onSuccess:function(){return window.location.reload()},onFailure:function(){return root.notify.alert('{{ _("Error occured.") }}',{className:"error"})}});b.send();return c.stop()};return a})(); {% endautoescape %}
\ No newline at end of file diff --git a/module/web/media/js/tinytab_static.js b/module/web/media/js/tinytab_static.js index 6c38292f5..bde2bfa2b 100644 --- a/module/web/media/js/tinytab_static.js +++ b/module/web/media/js/tinytab_static.js @@ -26,7 +26,7 @@ provides: TinyTab this.headers.push(""); } if(!opt) opt = {}; - this.css = opt.selectedClass || 'selected'; + this.css = opt.selectedClass || 'active'; this.select(this.tabs[0]); tabs.each(function(el){ el.addEvent('click',function(e){ |