mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
* Add copy options to webui context menu Add Copy Hash to gui (closes #6964) * Use switch statement * Use camel case, switch from signal to qaction. * Rename variable * Change variable name
This commit is contained in:
parent
08aa827366
commit
145641ac41
8 changed files with 90 additions and 0 deletions
|
@ -451,6 +451,36 @@ initializeWindows = function() {
|
|||
}
|
||||
};
|
||||
|
||||
copyNameFN = function() {
|
||||
var selectedRows = torrentsTable.selectedRowsIds();
|
||||
var names = [];
|
||||
if (selectedRows.length) {
|
||||
var rows = torrentsTable.getFilteredAndSortedRows();
|
||||
for (var i = 0; i < selectedRows.length; i++) {
|
||||
var hash = selectedRows[i];
|
||||
names.push(rows[hash].full_data.name);
|
||||
}
|
||||
}
|
||||
return names.join("\n");
|
||||
};
|
||||
|
||||
copyMagnetLinkFN = function() {
|
||||
var selectedRows = torrentsTable.selectedRowsIds();
|
||||
var magnets = [];
|
||||
if (selectedRows.length) {
|
||||
var rows = torrentsTable.getFilteredAndSortedRows();
|
||||
for (var i = 0; i < selectedRows.length; i++) {
|
||||
var hash = selectedRows[i];
|
||||
magnets.push(rows[hash].full_data.magnet_uri);
|
||||
}
|
||||
}
|
||||
return magnets.join("\n");
|
||||
};
|
||||
|
||||
copyHashFN = function() {
|
||||
return torrentsTable.selectedRowsIds().join("\n");
|
||||
};
|
||||
|
||||
['pauseAll', 'resumeAll'].each(function(item) {
|
||||
addClickEvent(item, function(e) {
|
||||
new Event(e).stop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue