|
|
@ -88,6 +88,7 @@ let copyInfohashFN = function(policy) {}; |
|
|
|
let copyMagnetLinkFN = function() {}; |
|
|
|
let copyMagnetLinkFN = function() {}; |
|
|
|
let copyIdFN = function() {}; |
|
|
|
let copyIdFN = function() {}; |
|
|
|
let setQueuePositionFN = function() {}; |
|
|
|
let setQueuePositionFN = function() {}; |
|
|
|
|
|
|
|
let exportTorrentFN = function() {}; |
|
|
|
|
|
|
|
|
|
|
|
const initializeWindows = function() { |
|
|
|
const initializeWindows = function() { |
|
|
|
saveWindowSize = function(windowId) { |
|
|
|
saveWindowSize = function(windowId) { |
|
|
@ -957,6 +958,26 @@ const initializeWindows = function() { |
|
|
|
return torrentsTable.selectedRowsIds().join("\n"); |
|
|
|
return torrentsTable.selectedRowsIds().join("\n"); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exportTorrentFN = function() { |
|
|
|
|
|
|
|
const hashes = torrentsTable.selectedRowsIds(); |
|
|
|
|
|
|
|
for (const hash of hashes) { |
|
|
|
|
|
|
|
const row = torrentsTable.rows.get(hash); |
|
|
|
|
|
|
|
if (!row) return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const name = row.full_data.name; |
|
|
|
|
|
|
|
const url = new URI("api/v2/torrents/export"); |
|
|
|
|
|
|
|
url.setData("hash", hash); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// download response to file
|
|
|
|
|
|
|
|
const element = document.createElement("a"); |
|
|
|
|
|
|
|
element.setAttribute("href", url); |
|
|
|
|
|
|
|
element.setAttribute("download", name + ".torrent"); |
|
|
|
|
|
|
|
document.body.appendChild(element); |
|
|
|
|
|
|
|
element.click(); |
|
|
|
|
|
|
|
document.body.removeChild(element); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
['pause', 'resume'].each(function(item) { |
|
|
|
['pause', 'resume'].each(function(item) { |
|
|
|
addClickEvent(item + 'All', function(e) { |
|
|
|
addClickEvent(item + 'All', function(e) { |
|
|
|
new Event(e).stop(); |
|
|
|
new Event(e).stop(); |
|
|
|