From e922275c72ec562053d1ada0b97d90ec2fcefbe4 Mon Sep 17 00:00:00 2001 From: ngosang Date: Thu, 17 Sep 2015 17:48:38 +0200 Subject: [PATCH] [Web UI] Clean up JavaScript code --- src/webui/www/public/addtrackers.html | 31 ++++---- src/webui/www/public/confirmdeletion.html | 88 ++++++++-------------- src/webui/www/public/scripts/mocha-init.js | 9 +-- src/webui/www/public/transferlist.html | 3 - 4 files changed, 49 insertions(+), 82 deletions(-) diff --git a/src/webui/www/public/addtrackers.html b/src/webui/www/public/addtrackers.html index 5469109bb..37c8c5341 100644 --- a/src/webui/www/public/addtrackers.html +++ b/src/webui/www/public/addtrackers.html @@ -6,20 +6,23 @@ - +
diff --git a/src/webui/www/public/confirmdeletion.html b/src/webui/www/public/confirmdeletion.html index a92526f3e..b31869ea6 100644 --- a/src/webui/www/public/confirmdeletion.html +++ b/src/webui/www/public/confirmdeletion.html @@ -1,65 +1,37 @@ - - QBT_TR(Deletion confirmation - qBittorrent)QBT_TR - - - - - + + - + cmd = 'command/deletePerm'; + new Request({ + url: cmd, + method: 'post', + data: { + 'hashes': hashes.join('|') + }, + onComplete: function() { + window.parent.closeWindows(); + } + }).send(); + }); + }); +
diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index 1fdd5e924..c4ae5b420 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -234,17 +234,12 @@ initializeWindows = function() { deleteFN = function() { var h = myTable.selectedIds(); - /*if(h.length && confirm('QBT_TR(Are you sure you want to delete the selected torrents from the transfer list?)QBT_TR')) { - h.each(function(item, index){ - new Request({url: 'command/delete', method: 'post', data: {hash: item}}).send(); - }); - }*/ if (h.length) { new MochaUI.Window({ id: 'confirmDeletionPage', - title: "QBT_TR(Deletion confirmation - qBittorrent)QBT_TR", + title: "QBT_TR(Deletion confirmation)QBT_TR", loadMethod: 'iframe', - contentURL: 'confirmdeletion.html?hashes=' + h.join(','), + contentURL: 'confirmdeletion.html?hashes=' + h.join("|"), scrollbars: false, resizable: false, maximizable: false, diff --git a/src/webui/www/public/transferlist.html b/src/webui/www/public/transferlist.html index 54c8105e3..dbfb707b6 100644 --- a/src/webui/www/public/transferlist.html +++ b/src/webui/www/public/transferlist.html @@ -16,9 +16,6 @@ Delete : function (element, ref) { deleteFN(); }, - DeleteHD : function (element, ref) { - deleteHDFN(); - }, Start : function (element, ref) { startFN(); },