WebUI: Avoid decoding strings repeatedly

Fix #14553
This commit is contained in:
brvphoenix
2021-03-19 01:27:36 -07:00
committed by sledgehammer999
parent ae44e59c9a
commit 0499111156
10 changed files with 16 additions and 15 deletions

View File

@@ -697,11 +697,12 @@
};
const removeItem = (paths) => {
const encodedPaths = paths.map((path) => encodeURIComponent(path));
new MochaUI.Window({
id: 'confirmFeedDeletionPage',
title: 'QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=RSSWidget]',
loadMethod: 'iframe',
contentURL: 'confirmfeeddeletion.html?paths=' + encodeURIComponent(paths.join('|')),
contentURL: 'confirmfeeddeletion.html?paths=' + encodeURIComponent(encodedPaths.join('|')),
scrollbars: false,
resizable: false,
maximizable: false,

View File

@@ -535,11 +535,12 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
};
const removeRules = (rules) => {
const encodedRules = rules.map((rule) => encodeURIComponent(rule));
new MochaUI.Window({
id: 'removeRulePage',
title: 'QBT_TR(Rule deletion confirmation)QBT_TR[CONTEXT=AutomatedRssDownloader]',
loadMethod: 'iframe',
contentURL: 'confirmruledeletion.html?rules=' + encodeURIComponent(rules.join('|')),
contentURL: 'confirmruledeletion.html?rules=' + encodeURIComponent(encodedRules.join('|')),
scrollbars: false,
resizable: false,
maximizable: false,
@@ -549,11 +550,12 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
};
const clearDownloadedEpisodes = (rules) => {
const encodedRules = rules.map((rule) => encodeURIComponent(rule));
new MochaUI.Window({
id: 'clearRulesPage',
title: 'QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]',
loadMethod: 'iframe',
contentURL: 'confirmruleclear.html?rules=' + encodeURIComponent(rules.join('|')),
contentURL: 'confirmruleclear.html?rules=' + encodeURIComponent(encodedRules.join('|')),
scrollbars: false,
resizable: false,
maximizable: false,