mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 08:27:24 -06:00
@@ -28,10 +28,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.Cache = (() => {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.Cache ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
buildInfo: new BuildInfoCache(),
|
||||
@@ -170,5 +168,4 @@ window.qBittorrent.Cache = (() => {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.Cache);
|
||||
|
||||
@@ -25,10 +25,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.Client = (() => {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.Client ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
closeWindows: closeWindows,
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.ContextMenu = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.ContextMenu ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
ContextMenu: ContextMenu,
|
||||
TorrentsTableContextMenu: TorrentsTableContextMenu,
|
||||
@@ -680,5 +678,4 @@ window.qBittorrent.ContextMenu = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.ContextMenu);
|
||||
|
||||
@@ -23,11 +23,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.Download = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.Download ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
changeCategorySelect: changeCategorySelect,
|
||||
changeTMM: changeTMM
|
||||
@@ -138,5 +136,4 @@ window.qBittorrent.Download = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.Download);
|
||||
|
||||
@@ -33,11 +33,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.DynamicTable = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.DynamicTable ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
TorrentsTable: TorrentsTable,
|
||||
TorrentPeersTable: TorrentPeersTable,
|
||||
@@ -3279,7 +3277,6 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.DynamicTable);
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.FileTree = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.FileTree ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
FilePriority: FilePriority,
|
||||
TriState: TriState,
|
||||
@@ -196,5 +194,4 @@ window.qBittorrent.FileTree = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.FileTree);
|
||||
|
||||
@@ -30,11 +30,9 @@
|
||||
|
||||
// This file is the JavaScript implementation of base/utils/fs.cpp
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.Filesystem = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.Filesystem ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
PathSeparator: PathSeparator,
|
||||
fileExtension: fileExtension,
|
||||
@@ -71,5 +69,4 @@ window.qBittorrent.Filesystem = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.Filesystem);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.LocalPreferences = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.LocalPreferences ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
LocalPreferencesClass: LocalPreferencesClass
|
||||
};
|
||||
@@ -67,5 +65,4 @@ window.qBittorrent.LocalPreferences = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.LocalPreferences);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.Misc = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.Misc ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
friendlyUnit: friendlyUnit,
|
||||
friendlyDuration: friendlyDuration,
|
||||
@@ -230,5 +228,4 @@ window.qBittorrent.Misc = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.Misc);
|
||||
|
||||
@@ -31,63 +31,59 @@
|
||||
/*
|
||||
File implementing auto-fill for the path input field in the path dialogs.
|
||||
*/
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
if (window.qBittorrent.pathAutofill === undefined) {
|
||||
window.qBittorrent.pathAutofill = (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
attachPathAutofill: attachPathAutofill
|
||||
};
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.pathAutofill ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
attachPathAutofill: attachPathAutofill
|
||||
};
|
||||
};
|
||||
|
||||
function showInputSuggestions(inputElement, names) {
|
||||
const datalist = document.createElement("datalist");
|
||||
datalist.id = inputElement.id + "Suggestions";
|
||||
for (const name of names) {
|
||||
const option = document.createElement("option");
|
||||
option.value = name;
|
||||
datalist.appendChild(option);
|
||||
}
|
||||
|
||||
const oldDatalist = document.getElementById(`${inputElement.id}Suggestions`);
|
||||
if (oldDatalist !== null) {
|
||||
oldDatalist.replaceWith(datalist);
|
||||
}
|
||||
else {
|
||||
inputElement.appendChild(datalist);
|
||||
inputElement.setAttribute("list", datalist.id);
|
||||
}
|
||||
function showInputSuggestions(inputElement, names) {
|
||||
const datalist = document.createElement("datalist");
|
||||
datalist.id = inputElement.id + "Suggestions";
|
||||
for (const name of names) {
|
||||
const option = document.createElement("option");
|
||||
option.value = name;
|
||||
datalist.appendChild(option);
|
||||
}
|
||||
|
||||
function showPathSuggestions(element, mode) {
|
||||
const partialPath = element.value;
|
||||
if (partialPath === "")
|
||||
return;
|
||||
const oldDatalist = document.getElementById(`${inputElement.id}Suggestions`);
|
||||
if (oldDatalist !== null) {
|
||||
oldDatalist.replaceWith(datalist);
|
||||
}
|
||||
else {
|
||||
inputElement.appendChild(datalist);
|
||||
inputElement.setAttribute("list", datalist.id);
|
||||
}
|
||||
}
|
||||
|
||||
fetch(`api/v2/app/getDirectoryContent?dirPath=${partialPath}&mode=${mode}`)
|
||||
.then(response => response.json())
|
||||
.then(filesList => { showInputSuggestions(element, filesList); })
|
||||
.catch(error => {});
|
||||
function showPathSuggestions(element, mode) {
|
||||
const partialPath = element.value;
|
||||
if (partialPath === "")
|
||||
return;
|
||||
|
||||
fetch(`api/v2/app/getDirectoryContent?dirPath=${partialPath}&mode=${mode}`)
|
||||
.then(response => response.json())
|
||||
.then(filesList => { showInputSuggestions(element, filesList); })
|
||||
.catch(error => {});
|
||||
}
|
||||
|
||||
function attachPathAutofill() {
|
||||
const directoryInputs = document.querySelectorAll(".pathDirectory:not(.pathAutoFillInitialized)");
|
||||
for (const input of directoryInputs) {
|
||||
input.addEventListener("input", function() { showPathSuggestions(this, "dirs"); });
|
||||
input.classList.add("pathAutoFillInitialized");
|
||||
}
|
||||
|
||||
function attachPathAutofill() {
|
||||
const directoryInputs = document.querySelectorAll(".pathDirectory:not(.pathAutoFillInitialized)");
|
||||
for (const input of directoryInputs) {
|
||||
input.addEventListener("input", function() { showPathSuggestions(this, "dirs"); });
|
||||
input.classList.add("pathAutoFillInitialized");
|
||||
}
|
||||
const fileInputs = document.querySelectorAll(".pathFile:not(.pathAutoFillInitialized)");
|
||||
for (const input of fileInputs) {
|
||||
input.addEventListener("input", function() { showPathSuggestions(this, "all"); });
|
||||
input.classList.add("pathAutoFillInitialized");
|
||||
}
|
||||
};
|
||||
|
||||
const fileInputs = document.querySelectorAll(".pathFile:not(.pathAutoFillInitialized)");
|
||||
for (const input of fileInputs) {
|
||||
input.addEventListener("input", function() { showPathSuggestions(this, "all"); });
|
||||
input.classList.add("pathAutoFillInitialized");
|
||||
}
|
||||
};
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.pathAutofill);
|
||||
};
|
||||
return exports();
|
||||
})();
|
||||
Object.freeze(window.qBittorrent.pathAutofill);
|
||||
|
||||
@@ -28,10 +28,8 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.PiecesBar = (() => {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.PiecesBar ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
PiecesBar: PiecesBar
|
||||
@@ -267,5 +265,4 @@ window.qBittorrent.PiecesBar = (() => {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.PiecesBar);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.ProgressBar = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.ProgressBar ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
ProgressBar: ProgressBar
|
||||
};
|
||||
@@ -157,5 +155,4 @@ window.qBittorrent.ProgressBar = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.ProgressBar);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.PropFiles = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.PropFiles ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
normalizePriority: normalizePriority,
|
||||
isDownloadCheckboxExists: isDownloadCheckboxExists,
|
||||
@@ -769,5 +767,4 @@ window.qBittorrent.PropFiles = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.PropFiles);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.PropGeneral = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.PropGeneral ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
updateData: updateData
|
||||
};
|
||||
@@ -257,5 +255,4 @@ window.qBittorrent.PropGeneral = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.PropGeneral);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.PropPeers = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.PropPeers ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
updateData: updateData
|
||||
};
|
||||
@@ -182,5 +180,4 @@ window.qBittorrent.PropPeers = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.PropPeers);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.PropTrackers = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.PropTrackers ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
updateData: updateData
|
||||
};
|
||||
@@ -237,5 +235,4 @@ window.qBittorrent.PropTrackers = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.PropTrackers);
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.PropWebseeds = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.PropWebseeds ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
updateData: updateData
|
||||
};
|
||||
@@ -148,5 +146,4 @@ window.qBittorrent.PropWebseeds = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.PropWebseeds);
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.MultiRename = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.MultiRename ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
AppliesTo: AppliesTo,
|
||||
RenameFiles: RenameFiles
|
||||
@@ -282,5 +280,4 @@ window.qBittorrent.MultiRename = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.MultiRename);
|
||||
|
||||
@@ -23,11 +23,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined)
|
||||
window.qBittorrent = {};
|
||||
|
||||
window.qBittorrent.Search = (function() {
|
||||
const exports = function() {
|
||||
window.qBittorrent ??= {};
|
||||
window.qBittorrent.Search ??= (() => {
|
||||
const exports = () => {
|
||||
return {
|
||||
startStopSearch: startStopSearch,
|
||||
manageSearchPlugins: manageSearchPlugins,
|
||||
@@ -866,5 +864,4 @@ window.qBittorrent.Search = (function() {
|
||||
|
||||
return exports();
|
||||
})();
|
||||
|
||||
Object.freeze(window.qBittorrent.Search);
|
||||
|
||||
Reference in New Issue
Block a user