This commit is contained in:
Thomas Piccirello 2025-07-04 17:19:54 +08:00 committed by GitHub
commit ef3d7b0629
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 71 additions and 48 deletions

View file

@ -338,7 +338,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
left: 0
},
loadMethod: "xhr",
contentURL: "views/filters.html",
contentURL: "views/filters.html?v=${CACHEID}",
onContentLoaded: () => {
highlightSelectedStatus();
},
@ -1433,9 +1433,9 @@ window.addEventListener("DOMContentLoaded", (event) => {
left: 0
},
loadMethod: "xhr",
contentURL: "views/search.html",
contentURL: "views/search.html?v=${CACHEID}",
require: {
js: ["scripts/search.js"],
js: ["scripts/search.js?v=${CACHEID}"],
onload: () => {
isSearchPanelLoaded = true;
},
@ -1458,7 +1458,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
left: 0
},
loadMethod: "xhr",
contentURL: "views/rss.html",
contentURL: "views/rss.html?v=${CACHEID}",
onContentLoaded: () => {
isRssPanelLoaded = true;
},
@ -1480,15 +1480,15 @@ window.addEventListener("DOMContentLoaded", (event) => {
left: 0
},
loadMethod: "xhr",
contentURL: "views/log.html",
contentURL: "views/log.html?v=${CACHEID}",
require: {
css: ["css/vanillaSelectBox.css"],
js: ["scripts/lib/vanillaSelectBox.js"],
css: ["css/vanillaSelectBox.css?v=${CACHEID}"],
js: ["scripts/lib/vanillaSelectBox.js?v=${CACHEID}"],
onload: () => {
isLogPanelLoaded = true;
},
},
tabsURL: "views/logTabs.html",
tabsURL: "views/logTabs.html?v=${CACHEID}",
tabsOnload: () => {
MochaUI.initializeTabs("panelTabs");
@ -1530,7 +1530,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
left: 0
},
loadMethod: "xhr",
contentURL: "views/transferlist.html",
contentURL: "views/transferlist.html?v=${CACHEID}",
onContentLoaded: () => {
handleDownloadParam();
updateMainData();
@ -1557,9 +1557,15 @@ window.addEventListener("DOMContentLoaded", (event) => {
bottom: 0,
left: 0
},
contentURL: "views/properties.html",
contentURL: "views/properties.html?v=${CACHEID}",
require: {
js: ["scripts/prop-general.js", "scripts/prop-trackers.js", "scripts/prop-peers.js", "scripts/prop-webseeds.js", "scripts/prop-files.js"],
js: [
"scripts/prop-general.js?v=${CACHEID}",
"scripts/prop-trackers.js?v=${CACHEID}",
"scripts/prop-peers.js?v=${CACHEID}",
"scripts/prop-webseeds.js?v=${CACHEID}",
"scripts/prop-files.js?v=${CACHEID}"
],
onload: () => {
updatePropertiesPanel = () => {
switch (LocalPreferences.get("selected_properties_tab")) {
@ -1582,7 +1588,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
};
}
},
tabsURL: "views/propertiesToolbar.html",
tabsURL: "views/propertiesToolbar.html?v=${CACHEID}",
tabsOnload: () => {}, // must be included, otherwise panel won't load properly
onContentLoaded: function() {
this.panelHeaderCollapseBoxEl.classList.add("invisible");
@ -1687,7 +1693,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
loadMethod: "iframe",
contentURL: "upload.html",
contentURL: "upload.html?v=${CACHEID}",
addClass: "windowFrame", // fixes iframe scrolling on iOS Safari
scrollbars: true,
maximizable: false,
@ -1726,6 +1732,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
const id = "downloadPage";
const contentURL = new URL("download.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
urls: urls.map(encodeURIComponent).join("|")
});
new MochaUI.Window({

File diff suppressed because one or more lines are too long

View file

@ -183,6 +183,7 @@ const initializeWindows = () => {
if (urls && (urls.length > 0)) {
contentURL.search = new URLSearchParams({
v: CACHEID,
urls: urls.map(encodeURIComponent).join("|")
});
}
@ -218,7 +219,7 @@ const initializeWindows = () => {
icon: "images/torrent-creator.svg",
title: "QBT_TR(Torrent Creator)QBT_TR[CONTEXT=TorrentCreator]",
loadMethod: "xhr",
contentURL: "views/torrentcreator.html",
contentURL: "views/torrentcreator.html?v=${CACHEID}",
scrollbars: true,
maximizable: true,
paddingVertical: 0,
@ -245,11 +246,11 @@ const initializeWindows = () => {
title: "QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]",
loadMethod: "xhr",
toolbar: true,
contentURL: "views/preferences.html",
contentURL: "views/preferences.html?v=${CACHEID}",
require: {
css: ["css/Tabs.css"]
css: ["css/Tabs.css?v=${CACHEID}"]
},
toolbarURL: "views/preferencesToolbar.html",
toolbarURL: "views/preferencesToolbar.html?v=${CACHEID}",
maximizable: false,
closable: true,
paddingVertical: 0,
@ -271,7 +272,7 @@ const initializeWindows = () => {
id: id,
title: "QBT_TR(Manage Cookies)QBT_TR[CONTEXT=CookiesDialog]",
loadMethod: "xhr",
contentURL: "views/cookies.html",
contentURL: "views/cookies.html?v=${CACHEID}",
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
@ -293,7 +294,7 @@ const initializeWindows = () => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
loadMethod: "iframe",
contentURL: "upload.html",
contentURL: "upload.html?v=${CACHEID}",
addClass: "windowFrame", // fixes iframe scrolling on iOS Safari
scrollbars: true,
maximizable: false,
@ -311,6 +312,7 @@ const initializeWindows = () => {
globalUploadLimitFN = () => {
const contentURL = new URL("speedlimit.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hashes: "global",
type: "upload",
});
@ -337,6 +339,7 @@ const initializeWindows = () => {
const contentURL = new URL("speedlimit.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hashes: hashes.join("|"),
type: "upload",
});
@ -383,6 +386,7 @@ const initializeWindows = () => {
const contentURL = new URL("shareratio.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hashes: hashes.join("|"),
// if all torrents have same share ratio, display that share ratio. else use the default
orig: torrentsHaveSameShareRatio ? shareRatio : ""
@ -459,6 +463,7 @@ const initializeWindows = () => {
globalDownloadLimitFN = () => {
const contentURL = new URL("speedlimit.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hashes: "global",
type: "download",
});
@ -485,7 +490,7 @@ const initializeWindows = () => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Statistics)QBT_TR[CONTEXT=StatsDialog]",
loadMethod: "xhr",
contentURL: "views/statistics.html",
contentURL: "views/statistics.html?v=${CACHEID}",
maximizable: false,
padding: 10,
width: loadWindowWidth(id, 285),
@ -506,6 +511,7 @@ const initializeWindows = () => {
const contentURL = new URL("speedlimit.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hashes: hashes.join("|"),
type: "download",
});
@ -537,7 +543,7 @@ const initializeWindows = () => {
hashes: hashes,
forceDeleteFiles: forceDeleteFiles
},
contentURL: "views/confirmdeletion.html",
contentURL: "views/confirmdeletion.html?v=${CACHEID}",
onContentLoaded: (w) => {
MochaUI.resizeWindow(w, { centered: true });
MochaUI.centerWindow(w);
@ -615,7 +621,7 @@ const initializeWindows = () => {
hashes: hashes,
enable: enableAutoTMM
},
contentURL: "views/confirmAutoTMM.html"
contentURL: "views/confirmAutoTMM.htm?v=${CACHEID}l"
});
}
else {
@ -647,7 +653,7 @@ const initializeWindows = () => {
id: "confirmRecheckDialog",
title: "QBT_TR(Recheck confirmation)QBT_TR[CONTEXT=confirmRecheckDialog]",
data: { hashes: hashes },
contentURL: "views/confirmRecheck.html"
contentURL: "views/confirmRecheck.htm?v=${CACHEID}l"
});
}
else {
@ -689,6 +695,7 @@ const initializeWindows = () => {
const contentURL = new URL("setlocation.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hashes: hashes.join("|"),
path: encodeURIComponent(torrentsTable.getRow(hashes[0]).full_data.save_path)
});
@ -719,6 +726,7 @@ const initializeWindows = () => {
const contentURL = new URL("rename.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
hash: hashes[0],
name: row.full_data.name
});
@ -750,7 +758,7 @@ const initializeWindows = () => {
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TransferListWidget]",
data: { hash: hash, selectedRows: [] },
loadMethod: "xhr",
contentURL: "rename_files.html",
contentURL: "rename_files.html?v=${CACHEID}",
scrollbars: false,
resizable: true,
maximizable: false,
@ -818,7 +826,7 @@ const initializeWindows = () => {
hashes: hashes,
isDeletingVisibleTorrents: true
},
contentURL: "views/confirmdeletion.html",
contentURL: "views/confirmdeletion.html?v=${CACHEID}",
onContentLoaded: (w) => {
MochaUI.resizeWindow(w, { centered: true });
MochaUI.centerWindow(w);
@ -854,6 +862,7 @@ const initializeWindows = () => {
const contentURL = new URL("newcategory.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
action: "set",
hashes: hashes.join("|")
});
@ -896,6 +905,7 @@ const initializeWindows = () => {
createCategoryFN = () => {
const contentURL = new URL("newcategory.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
action: "create"
});
new MochaUI.Window({
@ -917,6 +927,7 @@ const initializeWindows = () => {
createSubcategoryFN = (category) => {
const contentURL = new URL("newcategory.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
action: "createSubcategory",
categoryName: `${category}/`
});
@ -939,6 +950,7 @@ const initializeWindows = () => {
editCategoryFN = (category) => {
const contentURL = new URL("newcategory.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
action: "edit",
categoryName: category,
savePath: categoryMap.get(category).savePath
@ -1003,6 +1015,7 @@ const initializeWindows = () => {
const contentURL = new URL("newtag.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
action: "set",
hashes: hashes.join("|")
});
@ -1051,6 +1064,7 @@ const initializeWindows = () => {
createTagFN = () => {
const contentURL = new URL("newtag.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
action: "create"
});
new MochaUI.Window({
@ -1105,6 +1119,7 @@ const initializeWindows = () => {
const contentURL = new URL("confirmtrackerdeletion.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
host: trackerHost,
urls: [...trackerMap.get(trackerHost).keys()].map(encodeURIComponent).join("|")
});
@ -1298,12 +1313,12 @@ const initializeWindows = () => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(About qBittorrent)QBT_TR[CONTEXT=AboutDialog]",
loadMethod: "xhr",
contentURL: "views/about.html",
contentURL: "views/about.html?v=${CACHEID}",
require: {
css: ["css/Tabs.css"]
css: ["css/Tabs.css?v=${CACHEID}"]
},
toolbar: true,
toolbarURL: "views/aboutToolbar.html",
toolbarURL: "views/aboutToolbar.html?v=${CACHEID}",
padding: 10,
width: loadWindowWidth(id, 570),
height: loadWindowHeight(id, 360),

View file

@ -497,7 +497,7 @@ window.qBittorrent.PropFiles ??= (() => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
loadMethod: "iframe",
contentURL: `rename_file.html?hash=${hash}&isFolder=${node.isFolder}&path=${encodeURIComponent(path)}`,
contentURL: `rename_file.html?v=${CACHEID}&hash=${hash}&isFolder=${node.isFolder}&path=${encodeURIComponent(path)}`,
scrollbars: false,
resizable: true,
maximizable: false,
@ -515,7 +515,7 @@ window.qBittorrent.PropFiles ??= (() => {
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
data: { hash: hash, selectedRows: torrentFilesTable.selectedRows },
loadMethod: "xhr",
contentURL: "rename_files.html",
contentURL: "rename_files.html?v=${CACHEID}",
scrollbars: false,
resizable: true,
maximizable: false,

View file

@ -139,7 +139,7 @@ window.qBittorrent.PropPeers ??= (() => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Add Peers)QBT_TR[CONTEXT=PeersAdditionDialog]",
loadMethod: "iframe",
contentURL: `addpeers.html?hash=${hash}`,
contentURL: `addpeers.html?v=${CACHEID}&hash=${hash}`,
scrollbars: false,
resizable: false,
maximizable: false,

View file

@ -190,7 +190,7 @@ window.qBittorrent.PropTrackers ??= (() => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Add trackers)QBT_TR[CONTEXT=TrackersAdditionDialog]",
loadMethod: "iframe",
contentURL: `addtrackers.html?hash=${current_hash}`,
contentURL: `addtrackers.html?v=${CACHEID}&hash=${current_hash}`,
scrollbars: true,
resizable: false,
maximizable: false,
@ -215,7 +215,7 @@ window.qBittorrent.PropTrackers ??= (() => {
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]",
loadMethod: "iframe",
contentURL: `edittracker.html?hash=${current_hash}&url=${trackerUrl}`,
contentURL: `edittracker.html?v=${CACHEID}&hash=${current_hash}&url=${trackerUrl}`,
scrollbars: true,
resizable: false,
maximizable: false,

View file

@ -152,7 +152,7 @@ window.qBittorrent.PropWebseeds ??= (() => {
id: "webseedsPage",
title: "QBT_TR(Add web seeds)QBT_TR[CONTEXT=HttpServer]",
loadMethod: "iframe",
contentURL: `addwebseeds.html?hash=${current_hash}`,
contentURL: `addwebseeds.html?v=${CACHEID}&hash=${current_hash}`,
scrollbars: true,
resizable: false,
maximizable: false,
@ -181,7 +181,7 @@ window.qBittorrent.PropWebseeds ??= (() => {
id: "webseedsPage",
title: "QBT_TR(Web seed editing)QBT_TR[CONTEXT=PropertiesWidget]",
loadMethod: "iframe",
contentURL: `editwebseed.html?hash=${current_hash}&url=${encodeURIComponent(webseedUrl)}`,
contentURL: `editwebseed.html?v=${CACHEID}&hash=${current_hash}&url=${encodeURIComponent(webseedUrl)}`,
scrollbars: true,
resizable: false,
maximizable: false,

View file

@ -578,7 +578,7 @@ window.qBittorrent.Search ??= (() => {
title: "QBT_TR(Search plugins)QBT_TR[CONTEXT=PluginSelectDlg]",
icon: "images/qbittorrent-tray.svg",
loadMethod: "xhr",
contentURL: "views/searchplugins.html",
contentURL: "views/searchplugins.html?v=${CACHEID}",
scrollbars: false,
maximizable: false,
paddingVertical: 0,

View file

@ -345,7 +345,7 @@
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Please type a RSS feed URL)QBT_TR[CONTEXT=RSSWidget]",
loadMethod: "iframe",
contentURL: `newfeed.html?path=${encodeURIComponent(path)}`,
contentURL: `newfeed.html?v=${CACHEID}&path=${encodeURIComponent(path)}`,
scrollbars: false,
resizable: false,
maximizable: false,
@ -373,7 +373,7 @@
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Please choose a folder name)QBT_TR[CONTEXT=RSSWidget]",
loadMethod: "iframe",
contentURL: `newfolder.html?path=${encodeURIComponent(path)}`,
contentURL: `newfolder.html?v=${CACHEID}&path=${encodeURIComponent(path)}`,
scrollbars: false,
resizable: false,
maximizable: false,
@ -787,7 +787,7 @@
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Please choose a new name for this RSS feed)QBT_TR[CONTEXT=RSSWidget]",
loadMethod: "iframe",
contentURL: `rename_feed.html?oldPath=${encodeURIComponent(oldPath)}`,
contentURL: `rename_feed.html?v=${CACHEID}&oldPath=${encodeURIComponent(oldPath)}`,
scrollbars: false,
resizable: false,
maximizable: false,
@ -799,6 +799,7 @@
const editUrl = (path, url) => {
const contentURL = new URL("editfeedurl.html", window.location);
contentURL.search = new URLSearchParams({
v: CACHEID,
path: path,
url: url
});
@ -823,7 +824,7 @@
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=RSSWidget]",
loadMethod: "iframe",
contentURL: `confirmfeeddeletion.html?paths=${encodeURIComponent(encodedPaths.join("|"))}`,
contentURL: `confirmfeeddeletion.html?v=${CACHEID}&paths=${encodeURIComponent(encodedPaths.join("|"))}`,
scrollbars: false,
resizable: false,
maximizable: false,
@ -945,7 +946,7 @@
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Rss Downloader)QBT_TR[CONTEXT=AutomatedRssDownloader]",
loadMethod: "xhr",
contentURL: "views/rssDownloader.html",
contentURL: "views/rssDownloader.html?v=${CACHEID}",
maximizable: false,
width: loadWindowWidth(id, 800),
height: loadWindowHeight(id, 650),

View file

@ -532,7 +532,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]",
loadMethod: "iframe",
contentURL: "newrule.html",
contentURL: "newrule.html?v=${CACHEID}",
scrollbars: false,
resizable: false,
maximizable: false,
@ -547,7 +547,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Rule renaming)QBT_TR[CONTEXT=AutomatedRssDownloader]",
loadMethod: "iframe",
contentURL: `rename_rule.html?rule=${encodeURIComponent(rule)}`,
contentURL: `rename_rule.html?v=${CACHEID}&rule=${encodeURIComponent(rule)}`,
scrollbars: false,
resizable: false,
maximizable: false,
@ -570,7 +570,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Rule deletion confirmation)QBT_TR[CONTEXT=AutomatedRssDownloader]",
loadMethod: "iframe",
contentURL: `confirmruledeletion.html?rules=${encodeURIComponent(encodedRules.join("|"))}`,
contentURL: `confirmruledeletion.html?v=${CACHEID}&rules=${encodeURIComponent(encodedRules.join("|"))}`,
scrollbars: false,
resizable: false,
maximizable: false,
@ -586,7 +586,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]",
loadMethod: "iframe",
contentURL: `confirmruleclear.html?rules=${encodeURIComponent(encodedRules.join("|"))}`,
contentURL: `confirmruleclear.html?v=${CACHEID}&rules=${encodeURIComponent(encodedRules.join("|"))}`,
scrollbars: false,
resizable: false,
maximizable: false,

View file

@ -118,7 +118,7 @@
icon: "images/qbittorrent-tray.svg",
title: "QBT_TR(Install plugin)QBT_TR[CONTEXT=PluginSourceDlg]",
loadMethod: "xhr",
contentURL: "views/installsearchplugin.html",
contentURL: "views/installsearchplugin.html?v=${CACHEID}",
scrollbars: false,
resizable: false,
maximizable: false,

View file

@ -165,7 +165,7 @@
icon: "images/list-add.svg",
title: "QBT_TR(Create New Torrent)QBT_TR[CONTEXT=TorrentCreator]",
loadMethod: "xhr",
contentURL: "views/createtorrent.html",
contentURL: "views/createtorrent.html?v=${CACHEID}",
scrollbars: true,
maximizable: false,
closable: true,