From 324d20d42c2b7edb8489fd06eac0788e2a77eb2c Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Sun, 14 Jul 2019 17:40:42 -0700 Subject: [PATCH 1/2] Move registering WebUI magnet handler behind toolbar option Alert the user if the operation fails due to lack of browser support --- src/webui/www/private/index.html | 1 + src/webui/www/private/scripts/client.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 90dda35d0..f3cc77357 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -77,6 +77,7 @@ QBT_TR(Tools)QBT_TR[CONTEXT=MainWindow]
  • diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index c2621af2b..b8bdf323b 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -590,6 +590,10 @@ window.addEvent('load', function() { MochaUI.Desktop.setDesktopSize(); }); + $('registerMagnetHandlerLink').addEvent('click', function(e) { + registerMagnetHandler(); + }); + $('speedInBrowserTitleBarLink').addEvent('click', function(e) { speedInTitle = !speedInTitle; localStorage.setItem('speed_in_browser_title_bar', speedInTitle.toString()); @@ -801,13 +805,13 @@ window.addEvent('load', function() { addMainWindowTabsEventListener(); addSearchPanel(); } - - registerMagnetHandler(); }); function registerMagnetHandler() { - if (typeof navigator.registerProtocolHandler !== 'function') + if (typeof navigator.registerProtocolHandler !== 'function') { + alert("Your browser does not support this feature"); return; + } const hashParams = getHashParamsFromUrl(); hashParams.download = ''; From 1c3c81db99b3f2700c23e26eaf8e8eed3be50d71 Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Sun, 14 Jul 2019 17:41:11 -0700 Subject: [PATCH 2/2] Fix missing parenthesis Introduced in #9995. --- src/webui/www/private/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index f3cc77357..ab145df1b 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -58,7 +58,7 @@
  • QBT_TR(Delete)QBT_TR[CONTEXT=MainWindow]QBT_TR(Delete)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]
  • -
  • QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow]QBT_TRMove Down Queue)QBT_TR[CONTEXT=MainWindow]
  • +
  • QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Move Down Queue)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Bottom of Queue)QBT_TR[CONTEXT=MainWindow]
  • QBT_TR(Force Recheck)QBT_TR[CONTEXT=TransferListWidget]QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]