From afbfe1a96d562dc1d6b88ead865343c013b498d4 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 29 Dec 2008 23:04:45 +0000 Subject: [PATCH] - Hide priority column in Web UI when queueing is disabled --- Changelog | 1 + src/webui/index.html | 2 +- src/webui/scripts/client.js | 7 +++++-- src/webui/scripts/dynamicTable.js | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 7bac360a3..81081d8c4 100644 --- a/Changelog +++ b/Changelog @@ -14,6 +14,7 @@ - FEATURE: Added notification in WebUI when qBittorrent is not reachable - FEATURE: Rewrote folder scanning code (Now uses a filesystem watcher) - FEATURE: Added torrent deletion from hard drive function in Web UI + - FEATURE: Added queueing priority actions in Web UI - BUGFIX: Made usage of fastresume data more reliable - BUGFIX: qBittorrent shutdown is now faster - BUGFIX: Fixed several memory leaks diff --git a/src/webui/index.html b/src/webui/index.html index c5b4f65f2..58310a4e2 100644 --- a/src/webui/index.html +++ b/src/webui/index.html @@ -86,7 +86,7 @@ Progress DL Speed UP Speed - Priority + Priority diff --git a/src/webui/scripts/client.js b/src/webui/scripts/client.js index 97ab7fde7..a588f1d88 100644 --- a/src/webui/scripts/client.js +++ b/src/webui/scripts/client.js @@ -153,10 +153,13 @@ window.addEvent('domready', function(){ myTableUP.removeRow(hash); } }); - if(queueing_enabled) + if(queueing_enabled) { $('queueingButtons').removeClass('invisible'); - else + myTable.showPriority(); + } else { $('queueingButtons').addClass('invisible'); + myTable.hidePriority(); + } } waiting=false; ajaxfn.delay(1000); diff --git a/src/webui/scripts/dynamicTable.js b/src/webui/scripts/dynamicTable.js index fe039bbf5..4bef8c8ed 100644 --- a/src/webui/scripts/dynamicTable.js +++ b/src/webui/scripts/dynamicTable.js @@ -40,6 +40,7 @@ var dynamicTable = new Class ({ this.table = $(table); this.rows = new Object(); this.cur = new Array(); + this.priority_hidden = false; }, altRow: function() @@ -54,6 +55,28 @@ var dynamicTable = new Class ({ }.bind(this)); }, + hidePriority: function(){ + if(this.priority_hidden) return; + $('prioHeader').addClass('invisible'); + var trs = this.table.getElements('tr'); + trs.each(function(tr,i){ + var tds = tr.getElements('td'); + tds.getLast().addClass('invisible'); + }.bind(this)); + this.priority_hidden = true; + }, + + showPriority: function(){ + if(!this.priority_hidden) return; + $('prioHeader').removeClass('invisible'); + var trs = this.table.getElements('tr'); + trs.each(function(tr,i){ + var tds = tr.getElements('td'); + tds.getLast().removeClass('invisible'); + }.bind(this)); + this.priority_hidden = false; + }, + insertRow: function(id, row){ var tr = this.rows[id]; if($defined(tr))