mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-13 16:28:06 +00:00
WebUI: Implement start torrents by category
This commit is contained in:
parent
24584503d9
commit
f7833c9f0c
@ -129,6 +129,7 @@
|
|||||||
<li><a href="#CreateCategory"><img src="theme/list-add" alt="QBT_TR(Add category...)QBT_TR"/> QBT_TR(Add category...)QBT_TR</a></li>
|
<li><a href="#CreateCategory"><img src="theme/list-add" alt="QBT_TR(Add category...)QBT_TR"/> QBT_TR(Add category...)QBT_TR</a></li>
|
||||||
<li><a href="#DeleteCategory"><img src="theme/list-remove" alt="QBT_TR(Remove category)QBT_TR"/> QBT_TR(Remove category)QBT_TR</a></li>
|
<li><a href="#DeleteCategory"><img src="theme/list-remove" alt="QBT_TR(Remove category)QBT_TR"/> QBT_TR(Remove category)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><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>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="desktopFooterWrapper">
|
<div id="desktopFooterWrapper">
|
||||||
<div id="desktopFooter">
|
<div id="desktopFooter">
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
},
|
},
|
||||||
DeleteUnusedCategories : function (element, ref) {
|
DeleteUnusedCategories : function (element, ref) {
|
||||||
deleteUnusedCategoriesFN();
|
deleteUnusedCategoriesFN();
|
||||||
|
},
|
||||||
|
StartTorrentsByCategory : function (element, ref) {
|
||||||
|
startTorrentsByCategoryFN(element.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
offsets : {
|
offsets : {
|
||||||
|
@ -683,6 +683,17 @@ var TorrentsTable = new Class({
|
|||||||
return cnt;
|
return cnt;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getFilteredTorrentsHashes : function (filterName, categoryHash) {
|
||||||
|
var rowsHashes = [];
|
||||||
|
var rows = this.rows.getValues();
|
||||||
|
|
||||||
|
for (i = 0; i < rows.length; i++)
|
||||||
|
if (this.applyFilter(rows[i], filterName, categoryHash))
|
||||||
|
rowsHashes.push(rows[i]['rowId']);
|
||||||
|
|
||||||
|
return rowsHashes;
|
||||||
|
},
|
||||||
|
|
||||||
getFilteredAndSortedRows : function () {
|
getFilteredAndSortedRows : function () {
|
||||||
var filteredRows = new Array();
|
var filteredRows = new Array();
|
||||||
|
|
||||||
|
@ -385,6 +385,22 @@ initializeWindows = function() {
|
|||||||
setCategoryFilter(CATEGORIES_ALL);
|
setCategoryFilter(CATEGORIES_ALL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
startTorrentsByCategoryFN = function (categoryHash) {
|
||||||
|
var h = torrentsTable.getFilteredTorrentsHashes('all', categoryHash);
|
||||||
|
if (h.length) {
|
||||||
|
h.each(function (hash, index) {
|
||||||
|
new Request({
|
||||||
|
url: 'command/resume',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
hash: hash
|
||||||
|
}
|
||||||
|
}).send();
|
||||||
|
});
|
||||||
|
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…
Reference in New Issue
Block a user