Browse Source

WebUI: Implement delete torrents by category

adaptive-webui-19844
buinsky 9 years ago
parent
commit
ead592647a
  1. 1
      src/webui/www/private/index.html
  2. 3
      src/webui/www/public/filters.html
  3. 19
      src/webui/www/public/scripts/mocha-init.js

1
src/webui/www/private/index.html

@ -131,6 +131,7 @@
<li><a href="#DeleteUnusedCategories"><img src="theme/list-remove" alt="QBT_TR(Remove unused categories)QBT_TR"/> QBT_TR(Remove unused categories)QBT_TR</a></li> <li><a href="#DeleteUnusedCategories"><img src="theme/list-remove" alt="QBT_TR(Remove unused categories)QBT_TR"/> QBT_TR(Remove unused categories)QBT_TR</a></li>
<li class="separator"><a href="#StartTorrentsByCategory"><img src="theme/media-playback-start" alt="QBT_TR(Resume torrents)QBT_TR"/> QBT_TR(Resume torrents)QBT_TR</a></li> <li class="separator"><a href="#StartTorrentsByCategory"><img src="theme/media-playback-start" alt="QBT_TR(Resume torrents)QBT_TR"/> QBT_TR(Resume torrents)QBT_TR</a></li>
<li><a href="#PauseTorrentsByCategory"><img src="theme/media-playback-pause" alt="QBT_TR(Pause torrents)QBT_TR"/> QBT_TR(Pause torrents)QBT_TR</a></li> <li><a href="#PauseTorrentsByCategory"><img src="theme/media-playback-pause" alt="QBT_TR(Pause torrents)QBT_TR"/> QBT_TR(Pause torrents)QBT_TR</a></li>
<li><a href="#DeleteTorrentsByCategory"><img src="theme/edit-delete" alt="QBT_TR(Delete torrents)QBT_TR"/> QBT_TR(Delete torrents)QBT_TR</a></li>
</ul> </ul>
<div id="desktopFooterWrapper"> <div id="desktopFooterWrapper">
<div id="desktopFooter"> <div id="desktopFooter">

3
src/webui/www/public/filters.html

@ -34,6 +34,9 @@
}, },
PauseTorrentsByCategory : function (element, ref) { PauseTorrentsByCategory : function (element, ref) {
pauseTorrentsByCategoryFN(element.id); pauseTorrentsByCategoryFN(element.id);
},
DeleteTorrentsByCategory : function (element, ref) {
deleteTorrentsByCategoryFN(element.id);
} }
}, },
offsets : { offsets : {

19
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) { ['pauseAll', 'resumeAll'].each(function(item) {
addClickEvent(item, function(e) { addClickEvent(item, function(e) {
new Event(e).stop(); new Event(e).stop();

Loading…
Cancel
Save