Browse Source

Merge pull request #13836 from Chocobo1/webui

Add ability to use 'shift+delete' to delete torrents in WebUI
adaptive-webui-19844
Mike Tzou 4 years ago committed by GitHub
parent
commit
4259b4571c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/webui/www/private/confirmdeletion.html
  2. 4
      src/webui/www/private/scripts/client.js
  3. 4
      src/webui/www/private/scripts/mocha-init.js

3
src/webui/www/private/confirmdeletion.html

@ -11,6 +11,9 @@ @@ -11,6 +11,9 @@
'use strict';
window.addEvent('domready', function() {
const isDeletingFiles = (new URI().getData('deleteFiles') === "true");
$('deleteFromDiskCB').checked = isDeletingFiles;
const hashes = new URI().getData('hashes').split('|');
$('cancelBtn').focus();
$('cancelBtn').addEvent('click', function(e) {

4
src/webui/www/private/scripts/client.js

@ -1225,6 +1225,10 @@ new Keyboard({ @@ -1225,6 +1225,10 @@ new Keyboard({
'delete': function(event) {
deleteFN();
event.preventDefault();
},
'shift+delete': (event) => {
deleteFN(true);
event.preventDefault();
}
}
}).activate();

4
src/webui/www/private/scripts/mocha-init.js

@ -376,14 +376,14 @@ const initializeWindows = function() { @@ -376,14 +376,14 @@ const initializeWindows = function() {
}
};
deleteFN = function() {
deleteFN = function(deleteFiles = false) {
const hashes = torrentsTable.selectedRowsIds();
if (hashes.length) {
new MochaUI.Window({
id: 'confirmDeletionPage',
title: "QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=confirmDeletionDlg]",
loadMethod: 'iframe',
contentURL: 'confirmdeletion.html?hashes=' + hashes.join("|"),
contentURL: ('confirmdeletion.html?hashes=' + hashes.join("|") + '&deleteFiles=' + deleteFiles),
scrollbars: false,
resizable: false,
maximizable: false,

Loading…
Cancel
Save