From 901fca2d1216a7f006b3a3ab82d381d9cace50d7 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 23 Mar 2021 17:09:24 +0800 Subject: [PATCH 1/2] Remove wrong parentheses Fix up 87ad8a149524bb48d73f8084fedc03c5c5e1cc38. --- src/webui/www/private/scripts/dynamicTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index 42c016881..dc7778888 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -1103,7 +1103,7 @@ window.qBittorrent.DynamicTable = (function() { // eta this.columns['eta'].updateTd = function(td, row) { - const eta = window.qBittorrent.Misc.friendlyDuration(this.getRowValue(row), window.qBittorrent.Misc.MAX_ETA)); + const eta = window.qBittorrent.Misc.friendlyDuration(this.getRowValue(row), window.qBittorrent.Misc.MAX_ETA); td.set('text', eta); td.set('title', eta); }; From e43a9de2f3ed6162a7787213472582a933c75835 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Tue, 23 Mar 2021 18:50:58 +0800 Subject: [PATCH 2/2] Make global functions immutable --- src/webui/www/private/scripts/contextmenu.js | 2 ++ src/webui/www/private/scripts/download.js | 2 ++ src/webui/www/private/scripts/dynamicTable.js | 2 ++ src/webui/www/private/scripts/file-tree.js | 2 ++ src/webui/www/private/scripts/filesystem.js | 2 ++ src/webui/www/private/scripts/preferences.js | 2 ++ src/webui/www/private/scripts/progressbar.js | 2 ++ src/webui/www/private/scripts/prop-files.js | 2 ++ src/webui/www/private/scripts/prop-general.js | 2 ++ src/webui/www/private/scripts/prop-peers.js | 2 ++ src/webui/www/private/scripts/prop-trackers.js | 2 ++ src/webui/www/private/scripts/prop-webseeds.js | 2 ++ src/webui/www/private/views/filters.html | 2 ++ src/webui/www/private/views/installsearchplugin.html | 2 ++ src/webui/www/private/views/preferences.html | 2 ++ src/webui/www/private/views/rss.html | 2 ++ src/webui/www/private/views/rssDownloader.html | 2 ++ src/webui/www/private/views/search.html | 2 ++ src/webui/www/private/views/searchplugins.html | 2 ++ src/webui/www/private/views/transferlist.html | 2 ++ 20 files changed, 40 insertions(+) diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js index 19089e67d..812299dbe 100644 --- a/src/webui/www/private/scripts/contextmenu.js +++ b/src/webui/www/private/scripts/contextmenu.js @@ -667,3 +667,5 @@ window.qBittorrent.ContextMenu = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.ContextMenu); diff --git a/src/webui/www/private/scripts/download.js b/src/webui/www/private/scripts/download.js index f4f694735..a908f9768 100644 --- a/src/webui/www/private/scripts/download.js +++ b/src/webui/www/private/scripts/download.js @@ -142,3 +142,5 @@ window.qBittorrent.Download = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.Download); diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index dc7778888..9b3649057 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -2495,4 +2495,6 @@ window.qBittorrent.DynamicTable = (function() { return exports(); })(); +Object.freeze(window.qBittorrent.DynamicTable); + /*************************************************************/ diff --git a/src/webui/www/private/scripts/file-tree.js b/src/webui/www/private/scripts/file-tree.js index c3cc15455..e83817d47 100644 --- a/src/webui/www/private/scripts/file-tree.js +++ b/src/webui/www/private/scripts/file-tree.js @@ -193,3 +193,5 @@ window.qBittorrent.FileTree = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.FileTree); diff --git a/src/webui/www/private/scripts/filesystem.js b/src/webui/www/private/scripts/filesystem.js index dc208d6e5..bb7911eb4 100644 --- a/src/webui/www/private/scripts/filesystem.js +++ b/src/webui/www/private/scripts/filesystem.js @@ -76,3 +76,5 @@ window.qBittorrent.Filesystem = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.Filesystem); diff --git a/src/webui/www/private/scripts/preferences.js b/src/webui/www/private/scripts/preferences.js index 87606bad7..d8efa6111 100644 --- a/src/webui/www/private/scripts/preferences.js +++ b/src/webui/www/private/scripts/preferences.js @@ -59,3 +59,5 @@ window.qBittorrent.LocalPreferences = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.LocalPreferences); diff --git a/src/webui/www/private/scripts/progressbar.js b/src/webui/www/private/scripts/progressbar.js index 18c252840..30ffa5136 100644 --- a/src/webui/www/private/scripts/progressbar.js +++ b/src/webui/www/private/scripts/progressbar.js @@ -151,3 +151,5 @@ window.qBittorrent.ProgressBar = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.ProgressBar); diff --git a/src/webui/www/private/scripts/prop-files.js b/src/webui/www/private/scripts/prop-files.js index 1e1ac0af5..45462e4d5 100644 --- a/src/webui/www/private/scripts/prop-files.js +++ b/src/webui/www/private/scripts/prop-files.js @@ -727,3 +727,5 @@ window.qBittorrent.PropFiles = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.PropFiles); diff --git a/src/webui/www/private/scripts/prop-general.js b/src/webui/www/private/scripts/prop-general.js index 69285d0d9..e6a8ed8df 100644 --- a/src/webui/www/private/scripts/prop-general.js +++ b/src/webui/www/private/scripts/prop-general.js @@ -211,3 +211,5 @@ window.qBittorrent.PropGeneral = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.PropGeneral); diff --git a/src/webui/www/private/scripts/prop-peers.js b/src/webui/www/private/scripts/prop-peers.js index 73755aa1a..e6f2c9555 100644 --- a/src/webui/www/private/scripts/prop-peers.js +++ b/src/webui/www/private/scripts/prop-peers.js @@ -182,3 +182,5 @@ window.qBittorrent.PropPeers = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.PropPeers); diff --git a/src/webui/www/private/scripts/prop-trackers.js b/src/webui/www/private/scripts/prop-trackers.js index b739f9323..94847e11c 100644 --- a/src/webui/www/private/scripts/prop-trackers.js +++ b/src/webui/www/private/scripts/prop-trackers.js @@ -235,3 +235,5 @@ window.qBittorrent.PropTrackers = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.PropTrackers); diff --git a/src/webui/www/private/scripts/prop-webseeds.js b/src/webui/www/private/scripts/prop-webseeds.js index 6f6884d03..0910a705d 100644 --- a/src/webui/www/private/scripts/prop-webseeds.js +++ b/src/webui/www/private/scripts/prop-webseeds.js @@ -151,3 +151,5 @@ window.qBittorrent.PropWebseeds = (function() { return exports(); })(); + +Object.freeze(window.qBittorrent.PropWebseeds); diff --git a/src/webui/www/private/views/filters.html b/src/webui/www/private/views/filters.html index e1d00ee2b..ce62f87c0 100644 --- a/src/webui/www/private/views/filters.html +++ b/src/webui/www/private/views/filters.html @@ -159,4 +159,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.Filters); diff --git a/src/webui/www/private/views/installsearchplugin.html b/src/webui/www/private/views/installsearchplugin.html index 6ad8c27f3..e9526dcd4 100644 --- a/src/webui/www/private/views/installsearchplugin.html +++ b/src/webui/www/private/views/installsearchplugin.html @@ -80,4 +80,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.InstallSearchPlugin); diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index 3527e93b3..9df642664 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -2365,4 +2365,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.Preferences); diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html index b81061266..214678902 100644 --- a/src/webui/www/private/views/rss.html +++ b/src/webui/www/private/views/rss.html @@ -829,4 +829,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.Rss); diff --git a/src/webui/www/private/views/rssDownloader.html b/src/webui/www/private/views/rssDownloader.html index e4989d193..9029c5d51 100644 --- a/src/webui/www/private/views/rssDownloader.html +++ b/src/webui/www/private/views/rssDownloader.html @@ -791,4 +791,6 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also initRssDownloader(); return exports(); })(); + + Object.freeze(window.qBittorrent.RssDownloader); diff --git a/src/webui/www/private/views/search.html b/src/webui/www/private/views/search.html index 99d917b60..792df77d2 100644 --- a/src/webui/www/private/views/search.html +++ b/src/webui/www/private/views/search.html @@ -737,4 +737,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.Search); diff --git a/src/webui/www/private/views/searchplugins.html b/src/webui/www/private/views/searchplugins.html index 29b1c7f85..62e57e53f 100644 --- a/src/webui/www/private/views/searchplugins.html +++ b/src/webui/www/private/views/searchplugins.html @@ -236,4 +236,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.SearchPlugins); diff --git a/src/webui/www/private/views/transferlist.html b/src/webui/www/private/views/transferlist.html index c6b2903d4..2092b896d 100644 --- a/src/webui/www/private/views/transferlist.html +++ b/src/webui/www/private/views/transferlist.html @@ -109,4 +109,6 @@ return exports(); })(); + + Object.freeze(window.qBittorrent.TransferList);