mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
WebUI: Apply cache id to all loaded resources
This includes html files and js/css assets loaded via MooTools.
This commit is contained in:
parent
2ebe8595c9
commit
db4272b78c
12 changed files with 129 additions and 47 deletions
|
@ -338,7 +338,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
left: 0
|
left: 0
|
||||||
},
|
},
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/filters.html",
|
contentURL: "views/filters.html?v=${CACHEID}",
|
||||||
onContentLoaded: () => {
|
onContentLoaded: () => {
|
||||||
highlightSelectedStatus();
|
highlightSelectedStatus();
|
||||||
},
|
},
|
||||||
|
@ -1433,9 +1433,9 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
left: 0
|
left: 0
|
||||||
},
|
},
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/search.html",
|
contentURL: "views/search.html?v=${CACHEID}",
|
||||||
require: {
|
require: {
|
||||||
js: ["scripts/search.js"],
|
js: ["scripts/search.js?v=${CACHEID}"],
|
||||||
onload: () => {
|
onload: () => {
|
||||||
isSearchPanelLoaded = true;
|
isSearchPanelLoaded = true;
|
||||||
},
|
},
|
||||||
|
@ -1458,7 +1458,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
left: 0
|
left: 0
|
||||||
},
|
},
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/rss.html",
|
contentURL: "views/rss.html?v=${CACHEID}",
|
||||||
onContentLoaded: () => {
|
onContentLoaded: () => {
|
||||||
isRssPanelLoaded = true;
|
isRssPanelLoaded = true;
|
||||||
},
|
},
|
||||||
|
@ -1480,15 +1480,15 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
left: 0
|
left: 0
|
||||||
},
|
},
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/log.html",
|
contentURL: "views/log.html?v=${CACHEID}",
|
||||||
require: {
|
require: {
|
||||||
css: ["css/vanillaSelectBox.css"],
|
css: ["css/vanillaSelectBox.css?v=${CACHEID}"],
|
||||||
js: ["scripts/lib/vanillaSelectBox.js"],
|
js: ["scripts/lib/vanillaSelectBox.js?v=${CACHEID}"],
|
||||||
onload: () => {
|
onload: () => {
|
||||||
isLogPanelLoaded = true;
|
isLogPanelLoaded = true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tabsURL: "views/logTabs.html",
|
tabsURL: "views/logTabs.html?v=${CACHEID}",
|
||||||
tabsOnload: () => {
|
tabsOnload: () => {
|
||||||
MochaUI.initializeTabs("panelTabs");
|
MochaUI.initializeTabs("panelTabs");
|
||||||
|
|
||||||
|
@ -1530,7 +1530,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
left: 0
|
left: 0
|
||||||
},
|
},
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/transferlist.html",
|
contentURL: "views/transferlist.html?v=${CACHEID}",
|
||||||
onContentLoaded: () => {
|
onContentLoaded: () => {
|
||||||
handleDownloadParam();
|
handleDownloadParam();
|
||||||
updateMainData();
|
updateMainData();
|
||||||
|
@ -1557,9 +1557,15 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
left: 0
|
left: 0
|
||||||
},
|
},
|
||||||
contentURL: "views/properties.html",
|
contentURL: "views/properties.html?v=${CACHEID}",
|
||||||
require: {
|
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: () => {
|
onload: () => {
|
||||||
updatePropertiesPanel = () => {
|
updatePropertiesPanel = () => {
|
||||||
switch (LocalPreferences.get("selected_properties_tab")) {
|
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
|
tabsOnload: () => {}, // must be included, otherwise panel won't load properly
|
||||||
onContentLoaded: function() {
|
onContentLoaded: function() {
|
||||||
this.panelHeaderCollapseBoxEl.classList.add("invisible");
|
this.panelHeaderCollapseBoxEl.classList.add("invisible");
|
||||||
|
@ -1687,7 +1693,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
|
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: "upload.html",
|
contentURL: "upload.html?v=${CACHEID}",
|
||||||
addClass: "windowFrame", // fixes iframe scrolling on iOS Safari
|
addClass: "windowFrame", // fixes iframe scrolling on iOS Safari
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -1726,6 +1732,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
const id = "downloadPage";
|
const id = "downloadPage";
|
||||||
const contentURL = new URL("download.html", window.location);
|
const contentURL = new URL("download.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
urls: urls.map(encodeURIComponent).join("|")
|
urls: urls.map(encodeURIComponent).join("|")
|
||||||
});
|
});
|
||||||
new MochaUI.Window({
|
new MochaUI.Window({
|
||||||
|
|
|
@ -196,6 +196,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
if (urls && (urls.length > 0)) {
|
if (urls && (urls.length > 0)) {
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
urls: urls.map(encodeURIComponent).join("|")
|
urls: urls.map(encodeURIComponent).join("|")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -231,7 +232,7 @@ const initializeWindows = () => {
|
||||||
icon: "images/torrent-creator.svg",
|
icon: "images/torrent-creator.svg",
|
||||||
title: "QBT_TR(Torrent Creator)QBT_TR[CONTEXT=TorrentCreator]",
|
title: "QBT_TR(Torrent Creator)QBT_TR[CONTEXT=TorrentCreator]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/torrentcreator.html",
|
contentURL: "views/torrentcreator.html?v=${CACHEID}",
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
maximizable: true,
|
maximizable: true,
|
||||||
paddingVertical: 0,
|
paddingVertical: 0,
|
||||||
|
@ -258,11 +259,11 @@ const initializeWindows = () => {
|
||||||
title: "QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]",
|
title: "QBT_TR(Options)QBT_TR[CONTEXT=OptionsDialog]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
toolbar: true,
|
toolbar: true,
|
||||||
contentURL: "views/preferences.html",
|
contentURL: "views/preferences.html?v=${CACHEID}",
|
||||||
require: {
|
require: {
|
||||||
css: ["css/Tabs.css"]
|
css: ["css/Tabs.css?v=${CACHEID}"]
|
||||||
},
|
},
|
||||||
toolbarURL: "views/preferencesToolbar.html",
|
toolbarURL: "views/preferencesToolbar.html?v=${CACHEID}",
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
closable: true,
|
closable: true,
|
||||||
paddingVertical: 0,
|
paddingVertical: 0,
|
||||||
|
@ -284,7 +285,7 @@ const initializeWindows = () => {
|
||||||
id: id,
|
id: id,
|
||||||
title: "QBT_TR(Manage Cookies)QBT_TR[CONTEXT=CookiesDialog]",
|
title: "QBT_TR(Manage Cookies)QBT_TR[CONTEXT=CookiesDialog]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/cookies.html",
|
contentURL: "views/cookies.html?v=${CACHEID}",
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
paddingVertical: 0,
|
paddingVertical: 0,
|
||||||
paddingHorizontal: 0,
|
paddingHorizontal: 0,
|
||||||
|
@ -306,7 +307,7 @@ const initializeWindows = () => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
|
title: "QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: "upload.html",
|
contentURL: "upload.html?v=${CACHEID}",
|
||||||
addClass: "windowFrame", // fixes iframe scrolling on iOS Safari
|
addClass: "windowFrame", // fixes iframe scrolling on iOS Safari
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -324,6 +325,7 @@ const initializeWindows = () => {
|
||||||
globalUploadLimitFN = () => {
|
globalUploadLimitFN = () => {
|
||||||
const contentURL = new URL("speedlimit.html", window.location);
|
const contentURL = new URL("speedlimit.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hashes: "global",
|
hashes: "global",
|
||||||
type: "upload",
|
type: "upload",
|
||||||
});
|
});
|
||||||
|
@ -350,6 +352,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("speedlimit.html", window.location);
|
const contentURL = new URL("speedlimit.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hashes: hashes.join("|"),
|
hashes: hashes.join("|"),
|
||||||
type: "upload",
|
type: "upload",
|
||||||
});
|
});
|
||||||
|
@ -396,6 +399,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("shareratio.html", window.location);
|
const contentURL = new URL("shareratio.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hashes: hashes.join("|"),
|
hashes: hashes.join("|"),
|
||||||
// if all torrents have same share ratio, display that share ratio. else use the default
|
// if all torrents have same share ratio, display that share ratio. else use the default
|
||||||
orig: torrentsHaveSameShareRatio ? shareRatio : ""
|
orig: torrentsHaveSameShareRatio ? shareRatio : ""
|
||||||
|
@ -472,6 +476,7 @@ const initializeWindows = () => {
|
||||||
globalDownloadLimitFN = () => {
|
globalDownloadLimitFN = () => {
|
||||||
const contentURL = new URL("speedlimit.html", window.location);
|
const contentURL = new URL("speedlimit.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hashes: "global",
|
hashes: "global",
|
||||||
type: "download",
|
type: "download",
|
||||||
});
|
});
|
||||||
|
@ -498,7 +503,7 @@ const initializeWindows = () => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Statistics)QBT_TR[CONTEXT=StatsDialog]",
|
title: "QBT_TR(Statistics)QBT_TR[CONTEXT=StatsDialog]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/statistics.html",
|
contentURL: "views/statistics.html?v=${CACHEID}",
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
padding: 10,
|
padding: 10,
|
||||||
width: loadWindowWidth(id, 285),
|
width: loadWindowWidth(id, 285),
|
||||||
|
@ -519,6 +524,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("speedlimit.html", window.location);
|
const contentURL = new URL("speedlimit.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hashes: hashes.join("|"),
|
hashes: hashes.join("|"),
|
||||||
type: "download",
|
type: "download",
|
||||||
});
|
});
|
||||||
|
@ -550,7 +556,7 @@ const initializeWindows = () => {
|
||||||
hashes: hashes,
|
hashes: hashes,
|
||||||
forceDeleteFiles: forceDeleteFiles
|
forceDeleteFiles: forceDeleteFiles
|
||||||
},
|
},
|
||||||
contentURL: "views/confirmdeletion.html",
|
contentURL: "views/confirmdeletion.html?v=${CACHEID}",
|
||||||
onContentLoaded: (w) => {
|
onContentLoaded: (w) => {
|
||||||
MochaUI.resizeWindow(w, { centered: true });
|
MochaUI.resizeWindow(w, { centered: true });
|
||||||
MochaUI.centerWindow(w);
|
MochaUI.centerWindow(w);
|
||||||
|
@ -628,7 +634,7 @@ const initializeWindows = () => {
|
||||||
hashes: hashes,
|
hashes: hashes,
|
||||||
enable: enableAutoTMM
|
enable: enableAutoTMM
|
||||||
},
|
},
|
||||||
contentURL: "views/confirmAutoTMM.html"
|
contentURL: "views/confirmAutoTMM.htm?v=${CACHEID}l"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -660,7 +666,7 @@ const initializeWindows = () => {
|
||||||
id: "confirmRecheckDialog",
|
id: "confirmRecheckDialog",
|
||||||
title: "QBT_TR(Recheck confirmation)QBT_TR[CONTEXT=confirmRecheckDialog]",
|
title: "QBT_TR(Recheck confirmation)QBT_TR[CONTEXT=confirmRecheckDialog]",
|
||||||
data: { hashes: hashes },
|
data: { hashes: hashes },
|
||||||
contentURL: "views/confirmRecheck.html"
|
contentURL: "views/confirmRecheck.htm?v=${CACHEID}l"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -702,6 +708,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("setlocation.html", window.location);
|
const contentURL = new URL("setlocation.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hashes: hashes.join("|"),
|
hashes: hashes.join("|"),
|
||||||
path: encodeURIComponent(torrentsTable.getRow(hashes[0]).full_data.save_path)
|
path: encodeURIComponent(torrentsTable.getRow(hashes[0]).full_data.save_path)
|
||||||
});
|
});
|
||||||
|
@ -732,6 +739,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("rename.html", window.location);
|
const contentURL = new URL("rename.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
hash: hashes[0],
|
hash: hashes[0],
|
||||||
name: row.full_data.name
|
name: row.full_data.name
|
||||||
});
|
});
|
||||||
|
@ -763,7 +771,7 @@ const initializeWindows = () => {
|
||||||
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TransferListWidget]",
|
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TransferListWidget]",
|
||||||
data: { hash: hash, selectedRows: [] },
|
data: { hash: hash, selectedRows: [] },
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "rename_files.html",
|
contentURL: "rename_files.html?v=${CACHEID}",
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -831,7 +839,7 @@ const initializeWindows = () => {
|
||||||
hashes: hashes,
|
hashes: hashes,
|
||||||
isDeletingVisibleTorrents: true
|
isDeletingVisibleTorrents: true
|
||||||
},
|
},
|
||||||
contentURL: "views/confirmdeletion.html",
|
contentURL: "views/confirmdeletion.html?v=${CACHEID}",
|
||||||
onContentLoaded: (w) => {
|
onContentLoaded: (w) => {
|
||||||
MochaUI.resizeWindow(w, { centered: true });
|
MochaUI.resizeWindow(w, { centered: true });
|
||||||
MochaUI.centerWindow(w);
|
MochaUI.centerWindow(w);
|
||||||
|
@ -867,6 +875,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("newcategory.html", window.location);
|
const contentURL = new URL("newcategory.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
action: "set",
|
action: "set",
|
||||||
hashes: hashes.join("|")
|
hashes: hashes.join("|")
|
||||||
});
|
});
|
||||||
|
@ -909,6 +918,7 @@ const initializeWindows = () => {
|
||||||
createCategoryFN = () => {
|
createCategoryFN = () => {
|
||||||
const contentURL = new URL("newcategory.html", window.location);
|
const contentURL = new URL("newcategory.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
action: "create"
|
action: "create"
|
||||||
});
|
});
|
||||||
new MochaUI.Window({
|
new MochaUI.Window({
|
||||||
|
@ -930,6 +940,7 @@ const initializeWindows = () => {
|
||||||
createSubcategoryFN = (category) => {
|
createSubcategoryFN = (category) => {
|
||||||
const contentURL = new URL("newcategory.html", window.location);
|
const contentURL = new URL("newcategory.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
action: "createSubcategory",
|
action: "createSubcategory",
|
||||||
categoryName: `${category}/`
|
categoryName: `${category}/`
|
||||||
});
|
});
|
||||||
|
@ -952,6 +963,7 @@ const initializeWindows = () => {
|
||||||
editCategoryFN = (category) => {
|
editCategoryFN = (category) => {
|
||||||
const contentURL = new URL("newcategory.html", window.location);
|
const contentURL = new URL("newcategory.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
action: "edit",
|
action: "edit",
|
||||||
categoryName: category,
|
categoryName: category,
|
||||||
savePath: categoryMap.get(category).savePath
|
savePath: categoryMap.get(category).savePath
|
||||||
|
@ -1016,6 +1028,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("newtag.html", window.location);
|
const contentURL = new URL("newtag.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
action: "set",
|
action: "set",
|
||||||
hashes: hashes.join("|")
|
hashes: hashes.join("|")
|
||||||
});
|
});
|
||||||
|
@ -1064,6 +1077,7 @@ const initializeWindows = () => {
|
||||||
createTagFN = () => {
|
createTagFN = () => {
|
||||||
const contentURL = new URL("newtag.html", window.location);
|
const contentURL = new URL("newtag.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
action: "create"
|
action: "create"
|
||||||
});
|
});
|
||||||
new MochaUI.Window({
|
new MochaUI.Window({
|
||||||
|
@ -1118,6 +1132,7 @@ const initializeWindows = () => {
|
||||||
|
|
||||||
const contentURL = new URL("confirmtrackerdeletion.html", window.location);
|
const contentURL = new URL("confirmtrackerdeletion.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
host: trackerHost,
|
host: trackerHost,
|
||||||
urls: [...trackerMap.get(trackerHost).keys()].map(encodeURIComponent).join("|")
|
urls: [...trackerMap.get(trackerHost).keys()].map(encodeURIComponent).join("|")
|
||||||
});
|
});
|
||||||
|
@ -1311,12 +1326,12 @@ const initializeWindows = () => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(About qBittorrent)QBT_TR[CONTEXT=AboutDialog]",
|
title: "QBT_TR(About qBittorrent)QBT_TR[CONTEXT=AboutDialog]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/about.html",
|
contentURL: "views/about.html?v=${CACHEID}",
|
||||||
require: {
|
require: {
|
||||||
css: ["css/Tabs.css"]
|
css: ["css/Tabs.css?v=${CACHEID}"]
|
||||||
},
|
},
|
||||||
toolbar: true,
|
toolbar: true,
|
||||||
toolbarURL: "views/aboutToolbar.html",
|
toolbarURL: "views/aboutToolbar.html?v=${CACHEID}",
|
||||||
padding: 10,
|
padding: 10,
|
||||||
width: loadWindowWidth(id, 570),
|
width: loadWindowWidth(id, 570),
|
||||||
height: loadWindowHeight(id, 360),
|
height: loadWindowHeight(id, 360),
|
||||||
|
|
|
@ -39,6 +39,7 @@ window.qBittorrent.MonkeyPatch ??= (() => {
|
||||||
|
|
||||||
const patch = () => {
|
const patch = () => {
|
||||||
patchMootoolsDocumentId();
|
patchMootoolsDocumentId();
|
||||||
|
patchMochaGetAsset();
|
||||||
};
|
};
|
||||||
|
|
||||||
const patchMootoolsDocumentId = () => {
|
const patchMootoolsDocumentId = () => {
|
||||||
|
@ -64,6 +65,64 @@ window.qBittorrent.MonkeyPatch ??= (() => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modified to support specifying an asset with a version query param (`?v=`) for cache busting
|
||||||
|
*/
|
||||||
|
const patchMochaGetAsset = () => {
|
||||||
|
MUI.Require.prototype.getAsset = (source, onload) => {
|
||||||
|
// If the asset is loaded, fire the onload function.
|
||||||
|
if (MUI.files[source] === "loaded") {
|
||||||
|
if (typeof onload === "function")
|
||||||
|
onload();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the asset is loading, wait until it is loaded and then fire the onload function.
|
||||||
|
// If asset doesn't load by a number of tries, fire onload anyway.
|
||||||
|
else if (MUI.files[source] === "loading") {
|
||||||
|
let tries = 0;
|
||||||
|
const checker = (function() {
|
||||||
|
tries++;
|
||||||
|
if ((MUI.files[source] === "loading") && (tries < "100"))
|
||||||
|
return;
|
||||||
|
$clear(checker);
|
||||||
|
if (typeof onload === "function")
|
||||||
|
onload();
|
||||||
|
}).periodical(50);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the asset is not yet loaded or loading, start loading the asset.
|
||||||
|
else {
|
||||||
|
MUI.files[source] = "loading";
|
||||||
|
|
||||||
|
const properties = {
|
||||||
|
onload: (onload !== "undefined") ? onload : $empty
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add to the onload function
|
||||||
|
const oldonload = properties.onload;
|
||||||
|
properties.onload = () => {
|
||||||
|
MUI.files[source] = "loaded";
|
||||||
|
if (oldonload)
|
||||||
|
oldonload();
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (source.match(/(\.\w+)(?:\?v=\w+)?$/)[1]) {
|
||||||
|
case ".js":
|
||||||
|
return Asset.javascript(source, properties);
|
||||||
|
case ".css":
|
||||||
|
return Asset.css(source, properties);
|
||||||
|
case ".jpg":
|
||||||
|
case ".png":
|
||||||
|
case ".gif":
|
||||||
|
return Asset.image(source, properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
alert(`The required file "${source}" could not be loaded`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
return exports();
|
return exports();
|
||||||
})();
|
})();
|
||||||
Object.freeze(window.qBittorrent.MonkeyPatch);
|
Object.freeze(window.qBittorrent.MonkeyPatch);
|
||||||
|
|
|
@ -497,7 +497,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
|
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
|
||||||
loadMethod: "iframe",
|
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,
|
scrollbars: false,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -515,7 +515,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
||||||
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
|
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TorrentContentTreeView]",
|
||||||
data: { hash: hash, selectedRows: torrentFilesTable.selectedRows },
|
data: { hash: hash, selectedRows: torrentFilesTable.selectedRows },
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "rename_files.html",
|
contentURL: "rename_files.html?v=${CACHEID}",
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
|
@ -139,7 +139,7 @@ window.qBittorrent.PropPeers ??= (() => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Add Peers)QBT_TR[CONTEXT=PeersAdditionDialog]",
|
title: "QBT_TR(Add Peers)QBT_TR[CONTEXT=PeersAdditionDialog]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `addpeers.html?hash=${hash}`,
|
contentURL: `addpeers.html?v=${CACHEID}&hash=${hash}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
|
@ -190,7 +190,7 @@ window.qBittorrent.PropTrackers ??= (() => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Add trackers)QBT_TR[CONTEXT=TrackersAdditionDialog]",
|
title: "QBT_TR(Add trackers)QBT_TR[CONTEXT=TrackersAdditionDialog]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `addtrackers.html?hash=${current_hash}`,
|
contentURL: `addtrackers.html?v=${CACHEID}&hash=${current_hash}`,
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -215,7 +215,7 @@ window.qBittorrent.PropTrackers ??= (() => {
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]",
|
title: "QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `edittracker.html?hash=${current_hash}&url=${trackerUrl}`,
|
contentURL: `edittracker.html?v=${CACHEID}&hash=${current_hash}&url=${trackerUrl}`,
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
|
@ -152,7 +152,7 @@ window.qBittorrent.PropWebseeds ??= (() => {
|
||||||
id: "webseedsPage",
|
id: "webseedsPage",
|
||||||
title: "QBT_TR(Add web seeds)QBT_TR[CONTEXT=HttpServer]",
|
title: "QBT_TR(Add web seeds)QBT_TR[CONTEXT=HttpServer]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `addwebseeds.html?hash=${current_hash}`,
|
contentURL: `addwebseeds.html?v=${CACHEID}&hash=${current_hash}`,
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -181,7 +181,7 @@ window.qBittorrent.PropWebseeds ??= (() => {
|
||||||
id: "webseedsPage",
|
id: "webseedsPage",
|
||||||
title: "QBT_TR(Web seed editing)QBT_TR[CONTEXT=PropertiesWidget]",
|
title: "QBT_TR(Web seed editing)QBT_TR[CONTEXT=PropertiesWidget]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `editwebseed.html?hash=${current_hash}&url=${encodeURIComponent(webseedUrl)}`,
|
contentURL: `editwebseed.html?v=${CACHEID}&hash=${current_hash}&url=${encodeURIComponent(webseedUrl)}`,
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
|
@ -578,7 +578,7 @@ window.qBittorrent.Search ??= (() => {
|
||||||
title: "QBT_TR(Search plugins)QBT_TR[CONTEXT=PluginSelectDlg]",
|
title: "QBT_TR(Search plugins)QBT_TR[CONTEXT=PluginSelectDlg]",
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/searchplugins.html",
|
contentURL: "views/searchplugins.html?v=${CACHEID}",
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
paddingVertical: 0,
|
paddingVertical: 0,
|
||||||
|
|
|
@ -345,7 +345,7 @@
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Please type a RSS feed URL)QBT_TR[CONTEXT=RSSWidget]",
|
title: "QBT_TR(Please type a RSS feed URL)QBT_TR[CONTEXT=RSSWidget]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `newfeed.html?path=${encodeURIComponent(path)}`,
|
contentURL: `newfeed.html?v=${CACHEID}&path=${encodeURIComponent(path)}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -373,7 +373,7 @@
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Please choose a folder name)QBT_TR[CONTEXT=RSSWidget]",
|
title: "QBT_TR(Please choose a folder name)QBT_TR[CONTEXT=RSSWidget]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `newfolder.html?path=${encodeURIComponent(path)}`,
|
contentURL: `newfolder.html?v=${CACHEID}&path=${encodeURIComponent(path)}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -787,7 +787,7 @@
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Please choose a new name for this RSS feed)QBT_TR[CONTEXT=RSSWidget]",
|
title: "QBT_TR(Please choose a new name for this RSS feed)QBT_TR[CONTEXT=RSSWidget]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `rename_feed.html?oldPath=${encodeURIComponent(oldPath)}`,
|
contentURL: `rename_feed.html?v=${CACHEID}&oldPath=${encodeURIComponent(oldPath)}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -799,6 +799,7 @@
|
||||||
const editUrl = (path, url) => {
|
const editUrl = (path, url) => {
|
||||||
const contentURL = new URL("editfeedurl.html", window.location);
|
const contentURL = new URL("editfeedurl.html", window.location);
|
||||||
contentURL.search = new URLSearchParams({
|
contentURL.search = new URLSearchParams({
|
||||||
|
v: CACHEID,
|
||||||
path: path,
|
path: path,
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
|
@ -823,7 +824,7 @@
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=RSSWidget]",
|
title: "QBT_TR(Deletion confirmation)QBT_TR[CONTEXT=RSSWidget]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `confirmfeeddeletion.html?paths=${encodeURIComponent(encodedPaths.join("|"))}`,
|
contentURL: `confirmfeeddeletion.html?v=${CACHEID}&paths=${encodeURIComponent(encodedPaths.join("|"))}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -945,7 +946,7 @@
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Rss Downloader)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
title: "QBT_TR(Rss Downloader)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/rssDownloader.html",
|
contentURL: "views/rssDownloader.html?v=${CACHEID}",
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
width: loadWindowWidth(id, 800, false),
|
width: loadWindowWidth(id, 800, false),
|
||||||
height: loadWindowHeight(id, 650, false),
|
height: loadWindowHeight(id, 650, false),
|
||||||
|
|
|
@ -532,7 +532,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
title: "QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: "newrule.html",
|
contentURL: "newrule.html?v=${CACHEID}",
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: 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",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Rule renaming)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
title: "QBT_TR(Rule renaming)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `rename_rule.html?rule=${encodeURIComponent(rule)}`,
|
contentURL: `rename_rule.html?v=${CACHEID}&rule=${encodeURIComponent(rule)}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: 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",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Rule deletion confirmation)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
title: "QBT_TR(Rule deletion confirmation)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `confirmruledeletion.html?rules=${encodeURIComponent(encodedRules.join("|"))}`,
|
contentURL: `confirmruledeletion.html?v=${CACHEID}&rules=${encodeURIComponent(encodedRules.join("|"))}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: 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",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
title: "QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]",
|
||||||
loadMethod: "iframe",
|
loadMethod: "iframe",
|
||||||
contentURL: `confirmruleclear.html?rules=${encodeURIComponent(encodedRules.join("|"))}`,
|
contentURL: `confirmruleclear.html?v=${CACHEID}&rules=${encodeURIComponent(encodedRules.join("|"))}`,
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
|
@ -118,7 +118,7 @@
|
||||||
icon: "images/qbittorrent-tray.svg",
|
icon: "images/qbittorrent-tray.svg",
|
||||||
title: "QBT_TR(Install plugin)QBT_TR[CONTEXT=PluginSourceDlg]",
|
title: "QBT_TR(Install plugin)QBT_TR[CONTEXT=PluginSourceDlg]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/installsearchplugin.html",
|
contentURL: "views/installsearchplugin.html?v=${CACHEID}",
|
||||||
scrollbars: false,
|
scrollbars: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
icon: "images/list-add.svg",
|
icon: "images/list-add.svg",
|
||||||
title: "QBT_TR(Create New Torrent)QBT_TR[CONTEXT=TorrentCreator]",
|
title: "QBT_TR(Create New Torrent)QBT_TR[CONTEXT=TorrentCreator]",
|
||||||
loadMethod: "xhr",
|
loadMethod: "xhr",
|
||||||
contentURL: "views/createtorrent.html",
|
contentURL: "views/createtorrent.html?v=${CACHEID}",
|
||||||
scrollbars: true,
|
scrollbars: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
closable: true,
|
closable: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue