From 653d637b4ee1aa6fd112c11bf082883c3252c928 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 28 Aug 2014 04:51:53 +0200 Subject: [webui] Improve and fix --- module/webui/themes/flat/tml/home.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'module/webui/themes/flat/tml/home.html') diff --git a/module/webui/themes/flat/tml/home.html b/module/webui/themes/flat/tml/home.html index 377fc1359..052e0daca 100644 --- a/module/webui/themes/flat/tml/home.html +++ b/module/webui/themes/flat/tml/home.html @@ -29,12 +29,12 @@ var EntryManager = new Class({ {{ link.id }}, {% endif %} {% endfor %}]; - + this.entries = []; this.container = $('LinksAktiv'); - + this.parseFromContent(); - + this.json.startTimer(); }, parseFromContent: function(){ @@ -45,12 +45,12 @@ var EntryManager = new Class({ }, this); }, update: function(data){ - + try{ this.ids = this.entries.map(function(item){ return item.fid }); - + this.ids.filter(function(id){ return !this.ids.contains(id) },data).each(function(id){ @@ -59,13 +59,13 @@ var EntryManager = new Class({ this.entries = this.entries.filter(function(item){return item.fid != this},id); this.ids = this.ids.erase(id) }, this); - + data.links.each(function(link, i){ if (this.ids.contains(link.fid)){ - + var index = this.ids.indexOf(link.fid); this.entries[index].update(link) - + }else{ var entry = new LinkEntry(link.fid); entry.insert(link); @@ -74,7 +74,7 @@ var EntryManager = new Class({ this.container.adopt(entry.elements.tr,entry.elements.pgbTr); entry.fade.start('opacity', 1); entry.fadeBar.start('opacity', 1); - + } }, this) }catch(e){ @@ -150,7 +150,7 @@ var LinkEntry = new Class({ } }) }; - + this.elements.tr.adopt(this.elements.name,this.elements.status,this.elements.info,this.elements.bleft,new Element('td').adopt(this.elements.percent,this.elements.remove)); this.elements.pgbTr.adopt(new Element('td',{'colspan':5}).adopt(this.elements.pgb)); this.initEffects(); @@ -163,11 +163,11 @@ var LinkEntry = new Class({ this.bar = new Fx.Morph(this.elements.pgb, {unit: '%', duration: 5000, link: 'link', fps:30}); this.fade = new Fx.Tween(this.elements.tr); this.fadeBar = new Fx.Tween(this.elements.pgbTr); - + this.elements.remove.addEvent('click', function(){ new Request({method: 'get', url: '/json/abort_link/'+this.id}).send(); }.bind(this)); - + }, update: function(item){ this.elements.name.set('text', item.name); @@ -242,7 +242,7 @@ var LinkEntry = new Class({ - + {% for link in content %} {{ link.name }} @@ -260,7 +260,7 @@ var LinkEntry = new Class({ {% endfor %} - + {% endblock %} \ No newline at end of file -- cgit v1.2.3