From ead592647aff5954fc719c91962b416ab75f8201 Mon Sep 17 00:00:00 2001 From: buinsky Date: Fri, 22 Jan 2016 15:13:35 +0300 Subject: [PATCH] WebUI: Implement delete torrents by category --- src/webui/www/private/index.html | 1 + src/webui/www/public/filters.html | 3 +++ src/webui/www/public/scripts/mocha-init.js | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index d0176af0d..2da2541ae 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -131,6 +131,7 @@
  • QBT_TR(Remove unused categories)QBT_TR QBT_TR(Remove unused categories)QBT_TR
  • QBT_TR(Resume torrents)QBT_TR QBT_TR(Resume torrents)QBT_TR
  • QBT_TR(Pause torrents)QBT_TR QBT_TR(Pause torrents)QBT_TR
  • +
  • QBT_TR(Delete torrents)QBT_TR QBT_TR(Delete torrents)QBT_TR
  • diff --git a/src/webui/www/public/filters.html b/src/webui/www/public/filters.html index f7c922e8e..b2e7eca2c 100644 --- a/src/webui/www/public/filters.html +++ b/src/webui/www/public/filters.html @@ -34,6 +34,9 @@ }, PauseTorrentsByCategory : function (element, ref) { pauseTorrentsByCategoryFN(element.id); + }, + DeleteTorrentsByCategory : function (element, ref) { + deleteTorrentsByCategoryFN(element.id); } }, offsets : { diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index 3ac1c6d67..c5e98f96b 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -417,6 +417,25 @@ initializeWindows = function() { } }; + deleteTorrentsByCategoryFN = function (categoryHash) { + var h = torrentsTable.getFilteredTorrentsHashes('all', categoryHash); + if (h.length) { + new MochaUI.Window({ + id: 'confirmDeletionPage', + title: "QBT_TR(Deletion confirmation)QBT_TR", + loadMethod: 'iframe', + contentURL: 'confirmdeletion.html?hashes=' + h.join("|"), + scrollbars: false, + resizable: false, + maximizable: false, + padding: 10, + width: 424, + height: 140 + }); + updateMainData(); + } + }; + ['pauseAll', 'resumeAll'].each(function(item) { addClickEvent(item, function(e) { new Event(e).stop();