From 69200db3473588f6df334836c6f249f489575888 Mon Sep 17 00:00:00 2001 From: mariusbaumann Date: Sat, 3 Jan 2015 07:12:50 +0100 Subject: Completely new Design v1 Some bugs heve to be fexed next days --- module/web/media/js/package_ui.js | 52 +++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'module/web/media/js/package_ui.js') diff --git a/module/web/media/js/package_ui.js b/module/web/media/js/package_ui.js index 3ea965649..87694e909 100644 --- a/module/web/media/js/package_ui.js +++ b/module/web/media/js/package_ui.js @@ -49,7 +49,7 @@ var PackageUI = new Class({ clone: true, revert: true, opacity: 0.4, - handle: ".package_drag", + handle: "#package_drag", onComplete: this.saveSort.bind(this) }); @@ -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 = "\n".substitute({"icon": link.icon}); - html += "{name}
".substitute({"name": link.name}); - html += "{statusmsg}{error} ".substitute({"statusmsg": link.statusmsg, "error":link.error}); - html += "{format_size}".substitute({"format_size": link.format_size}); - html += "{plugin}  ".substitute({"plugin": link.plugin}); - html += "  "; - html += "
"; + var html = "\n".substitute({"icon": link.icon}); + html += "{name}
".substitute({"name": link.name}); + html += "{statusmsg}{error} ".substitute({"statusmsg": link.statusmsg, "error":link.error}); + html += "{format_size}".substitute({"format_size": link.format_size}); + html += " {plugin}  ".substitute({"plugin": link.plugin}); + html += "  "; + html += "
"; 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,7 +267,7 @@ 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, -- cgit v1.2.3