diff --git a/src/webui/www/private/addpeers.html b/src/webui/www/private/addpeers.html
index b9be98ff1..811276dc0 100644
--- a/src/webui/www/private/addpeers.html
+++ b/src/webui/www/private/addpeers.html
@@ -34,7 +34,7 @@
$("addPeersOk").addEvent("click", (e) => {
new Event(e).stop();
- const peers = $("peers").get("value").trim().split(/[\r\n]+/);
+ const peers = $("peers").value.trim().split(/[\r\n]+/);
if (peers.length === 0)
return;
diff --git a/src/webui/www/private/confirmdeletion.html b/src/webui/www/private/confirmdeletion.html
index 99cc47860..d2e1a1184 100644
--- a/src/webui/www/private/confirmdeletion.html
+++ b/src/webui/www/private/confirmdeletion.html
@@ -68,7 +68,7 @@
parent.torrentsTable.deselectAll();
new Event(e).stop();
const cmd = "api/v2/torrents/delete";
- const deleteFiles = $("deleteFromDiskCB").get("checked");
+ const deleteFiles = $("deleteFromDiskCB").checked;
new Request({
url: cmd,
method: "post",
diff --git a/src/webui/www/private/download.html b/src/webui/www/private/download.html
index c7bc12f37..3d343dce3 100644
--- a/src/webui/www/private/download.html
+++ b/src/webui/www/private/download.html
@@ -173,7 +173,7 @@
});
if (urls.length)
- $("urls").set("value", urls.join("\n"));
+ $("urls").value = urls.join("\n");
}
let submitted = false;
diff --git a/src/webui/www/private/newcategory.html b/src/webui/www/private/newcategory.html
index b17ad6f0f..b652d911d 100644
--- a/src/webui/www/private/newcategory.html
+++ b/src/webui/www/private/newcategory.html
@@ -40,13 +40,13 @@
if (!uriCategoryName)
return false;
- $("categoryName").set("disabled", true);
- $("categoryName").set("value", window.qBittorrent.Misc.escapeHtml(uriCategoryName));
- $("savePath").set("value", window.qBittorrent.Misc.escapeHtml(uriSavePath));
+ $("categoryName").disabled = true;
+ $("categoryName").value = window.qBittorrent.Misc.escapeHtml(uriCategoryName);
+ $("savePath").value = window.qBittorrent.Misc.escapeHtml(uriSavePath);
$("savePath").focus();
}
else if (uriAction === "createSubcategory") {
- $("categoryName").set("value", window.qBittorrent.Misc.escapeHtml(uriCategoryName));
+ $("categoryName").value = window.qBittorrent.Misc.escapeHtml(uriCategoryName);
$("categoryName").focus();
}
else {
diff --git a/src/webui/www/private/rename_files.html b/src/webui/www/private/rename_files.html
index 86ecc6712..9b5a95f7a 100644
--- a/src/webui/www/private/rename_files.html
+++ b/src/webui/www/private/rename_files.html
@@ -27,7 +27,7 @@
menu: "multiRenameFilesMenu",
actions: {
ToggleSelection: function(element, ref) {
- const rowId = parseInt(element.get("data-row-id"), 10);
+ const rowId = parseInt(element.getAttribute("data-row-id"), 10);
const row = bulkRenameFilesTable.getNode(rowId);
const checkState = (row.checked === 1) ? 0 : 1;
bulkRenameFilesTable.toggleNodeTreeCheckbox(rowId, checkState);
@@ -53,8 +53,8 @@
if (checkboxHeader)
checkboxHeader.remove();
checkboxHeader = new Element("input");
- checkboxHeader.set("type", "checkbox");
- checkboxHeader.set("id", "rootMultiRename_cb");
+ checkboxHeader.type = "checkbox";
+ checkboxHeader.id = "rootMultiRename_cb";
checkboxHeader.addEvent("click", (e) => {
bulkRenameFilesTable.toggleGlobalCheckbox();
fileRenamer.selectedFiles = bulkRenameFilesTable.getSelectedRows();
@@ -90,12 +90,12 @@
// Load Multi Rename Preferences
const multiRenamePrefChecked = LocalPreferences.get("multirename_rememberPreferences", "true") === "true";
- $("multirename_rememberprefs_checkbox").setProperty("checked", multiRenamePrefChecked);
+ $("multirename_rememberprefs_checkbox").checked = multiRenamePrefChecked;
if (multiRenamePrefChecked) {
const multirename_search = LocalPreferences.get("multirename_search", "");
fileRenamer.setSearch(multirename_search);
- $("multiRenameSearch").set("value", multirename_search);
+ $("multiRenameSearch").value = multirename_search;
const multirename_useRegex = LocalPreferences.get("multirename_useRegex", false);
fileRenamer.useRegex = multirename_useRegex === "true";
@@ -111,11 +111,11 @@
const multirename_replace = LocalPreferences.get("multirename_replace", "");
fileRenamer.setReplacement(multirename_replace);
- $("multiRenameReplace").set("value", multirename_replace);
+ $("multiRenameReplace").value = multirename_replace;
const multirename_appliesTo = LocalPreferences.get("multirename_appliesTo", window.qBittorrent.MultiRename.AppliesTo.FilenameExtension);
fileRenamer.appliesTo = window.qBittorrent.MultiRename.AppliesTo[multirename_appliesTo];
- $("applies_to_option").set("value", fileRenamer.appliesTo);
+ $("applies_to_option").value = fileRenamer.appliesTo;
const multirename_includeFiles = LocalPreferences.get("multirename_includeFiles", true);
fileRenamer.includeFiles = multirename_includeFiles === "true";
@@ -127,13 +127,13 @@
const multirename_fileEnumerationStart = LocalPreferences.get("multirename_fileEnumerationStart", 0);
fileRenamer.fileEnumerationStart = parseInt(multirename_fileEnumerationStart, 10);
- $("file_counter").set("value", fileRenamer.fileEnumerationStart);
+ $("file_counter").value = fileRenamer.fileEnumerationStart;
const multirename_replaceAll = LocalPreferences.get("multirename_replaceAll", false);
fileRenamer.replaceAll = multirename_replaceAll === "true";
const renameButtonValue = fileRenamer.replaceAll ? "Replace All" : "Replace";
- $("renameOptions").set("value", renameButtonValue);
- $("renameButton").set("value", renameButtonValue);
+ $("renameOptions").value = renameButtonValue;
+ $("renameButton").value = renameButtonValue;
}
// Fires every time a row's selection changes
@@ -145,7 +145,7 @@
// Setup Search Events that control renaming
$("multiRenameSearch").addEvent("input", (e) => {
const sanitized = e.target.value.replace(/\n/g, "");
- $("multiRenameSearch").set("value", sanitized);
+ $("multiRenameSearch").value = sanitized;
// Search input has changed
$("multiRenameSearch").style["border-color"] = "";
@@ -176,13 +176,13 @@
document
.querySelectorAll("span[id^='filesTablefileRenamed']")
.forEach((span) => {
- span.set("text", "");
+ span.textContent = "";
});
// Update renamed column for matched rows
for (let i = 0; i < matchedRows.length; ++i) {
const row = matchedRows[i];
- $("filesTablefileRenamed" + row.rowId).set("text", row.renamed);
+ $("filesTablefileRenamed" + row.rowId).textContent = row.renamed;
}
};
fileRenamer.onInvalidRegex = function(err) {
@@ -192,7 +192,7 @@
// Setup Replace Events that control renaming
$("multiRenameReplace").addEvent("input", (e) => {
const sanitized = e.target.value.replace(/\n/g, "");
- $("multiRenameReplace").set("value", sanitized);
+ $("multiRenameReplace").value = sanitized;
// Replace input has changed
$("multiRenameReplace").style["border-color"] = "";
@@ -223,7 +223,7 @@
if (value > 99999999)
value = 99999999;
fileRenamer.fileEnumerationStart = value;
- $("file_counter").set("value", value);
+ $("file_counter").value = value;
LocalPreferences.set("multirename_fileEnumerationStart", value);
fileRenamer.update();
});
@@ -245,7 +245,7 @@
$("renameButton").disabled = true;
$("renameOptions").disabled = true;
// Clear error text
- $("rename_error").set("text", "");
+ $("rename_error").textContent = "";
fileRenamer.rename();
});
fileRenamer.onRenamed = function(rows) {
@@ -273,13 +273,13 @@
// Adjust file enumeration count by 1 when replacing single files to prevent naming conflicts
if (!fileRenamer.replaceAll) {
fileRenamer.fileEnumerationStart++;
- $("file_counter").set("value", fileRenamer.fileEnumerationStart);
+ $("file_counter").value = fileRenamer.fileEnumerationStart;
}
setupTable(selectedRows);
};
fileRenamer.onRenameError = function(err, row) {
if (err.xhr.status === 409)
- $("rename_error").set("text", `QBT_TR(Rename failed: file or folder already exists)QBT_TR[CONTEXT=PropertiesWidget] \`${row.renamed}\``);
+ $("rename_error").textContent = `QBT_TR(Rename failed: file or folder already exists)QBT_TR[CONTEXT=PropertiesWidget] \`${row.renamed}\``;
};
$("renameOptions").addEvent("change", (e) => {
const combobox = e.target;
@@ -291,7 +291,7 @@
else
fileRenamer.replaceAll = false;
LocalPreferences.set("multirename_replaceAll", fileRenamer.replaceAll);
- $("renameButton").set("value", replaceOperation);
+ $("renameButton").value = replaceOperation;
});
$("closeButton").addEvent("click", () => {
window.parent.qBittorrent.Client.closeWindows();
diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js
index d92880bdb..ce4566e9a 100644
--- a/src/webui/www/private/scripts/client.js
+++ b/src/webui/www/private/scripts/client.js
@@ -719,12 +719,12 @@ window.addEventListener("DOMContentLoaded", () => {
onFailure: function() {
const errorDiv = $("error_div");
if (errorDiv)
- errorDiv.set("html", "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]");
+ errorDiv.textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
syncRequestInProgress = false;
syncData(2000);
},
onSuccess: function(response) {
- $("error_div").set("html", "");
+ $("error_div").textContent = "";
if (response) {
clearTimeout(torrentsFilterInputTimer);
torrentsFilterInputTimer = -1;
@@ -903,12 +903,12 @@ window.addEventListener("DOMContentLoaded", () => {
if (serverState.dl_rate_limit > 0)
transfer_info += " [" + window.qBittorrent.Misc.friendlyUnit(serverState.dl_rate_limit, true) + "]";
transfer_info += " (" + window.qBittorrent.Misc.friendlyUnit(serverState.dl_info_data, false) + ")";
- $("DlInfos").set("html", transfer_info);
+ $("DlInfos").textContent = transfer_info;
transfer_info = window.qBittorrent.Misc.friendlyUnit(serverState.up_info_speed, true);
if (serverState.up_rate_limit > 0)
transfer_info += " [" + window.qBittorrent.Misc.friendlyUnit(serverState.up_rate_limit, true) + "]";
transfer_info += " (" + window.qBittorrent.Misc.friendlyUnit(serverState.up_info_data, false) + ")";
- $("UpInfos").set("html", transfer_info);
+ $("UpInfos").textContent = transfer_info;
document.title = (speedInTitle
? (`QBT_TR([D: %1, U: %2])QBT_TR[CONTEXT=MainWindow] `
@@ -917,23 +917,23 @@ window.addEventListener("DOMContentLoaded", () => {
: "")
+ window.qBittorrent.Client.mainTitle();
- $("freeSpaceOnDisk").set("html", "QBT_TR(Free space: %1)QBT_TR[CONTEXT=HttpServer]".replace("%1", window.qBittorrent.Misc.friendlyUnit(serverState.free_space_on_disk)));
- $("DHTNodes").set("html", "QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]".replace("%1", serverState.dht_nodes));
+ $("freeSpaceOnDisk").textContent = "QBT_TR(Free space: %1)QBT_TR[CONTEXT=HttpServer]".replace("%1", window.qBittorrent.Misc.friendlyUnit(serverState.free_space_on_disk));
+ $("DHTNodes").textContent = "QBT_TR(DHT: %1 nodes)QBT_TR[CONTEXT=StatusBar]".replace("%1", serverState.dht_nodes);
// Statistics dialog
if (document.getElementById("statisticsContent")) {
- $("AlltimeDL").set("html", window.qBittorrent.Misc.friendlyUnit(serverState.alltime_dl, false));
- $("AlltimeUL").set("html", window.qBittorrent.Misc.friendlyUnit(serverState.alltime_ul, false));
- $("TotalWastedSession").set("html", window.qBittorrent.Misc.friendlyUnit(serverState.total_wasted_session, false));
- $("GlobalRatio").set("html", serverState.global_ratio);
- $("TotalPeerConnections").set("html", serverState.total_peer_connections);
- $("ReadCacheHits").set("html", serverState.read_cache_hits + "%");
- $("TotalBuffersSize").set("html", window.qBittorrent.Misc.friendlyUnit(serverState.total_buffers_size, false));
- $("WriteCacheOverload").set("html", serverState.write_cache_overload + "%");
- $("ReadCacheOverload").set("html", serverState.read_cache_overload + "%");
- $("QueuedIOJobs").set("html", serverState.queued_io_jobs);
- $("AverageTimeInQueue").set("html", serverState.average_time_queue + " ms");
- $("TotalQueuedSize").set("html", window.qBittorrent.Misc.friendlyUnit(serverState.total_queued_size, false));
+ $("AlltimeDL").textContent = window.qBittorrent.Misc.friendlyUnit(serverState.alltime_dl, false);
+ $("AlltimeUL").textContent = window.qBittorrent.Misc.friendlyUnit(serverState.alltime_ul, false);
+ $("TotalWastedSession").textContent = window.qBittorrent.Misc.friendlyUnit(serverState.total_wasted_session, false);
+ $("GlobalRatio").textContent = serverState.global_ratio;
+ $("TotalPeerConnections").textContent = serverState.total_peer_connections;
+ $("ReadCacheHits").textContent = serverState.read_cache_hits + "%";
+ $("TotalBuffersSize").textContent = window.qBittorrent.Misc.friendlyUnit(serverState.total_buffers_size, false);
+ $("WriteCacheOverload").textContent = serverState.write_cache_overload + "%";
+ $("ReadCacheOverload").textContent = serverState.read_cache_overload + "%";
+ $("QueuedIOJobs").textContent = serverState.queued_io_jobs;
+ $("AverageTimeInQueue").textContent = serverState.average_time_queue + " ms";
+ $("TotalQueuedSize").textContent = window.qBittorrent.Misc.friendlyUnit(serverState.total_queued_size, false);
}
switch (serverState.connection_status) {
diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js
index 388555ffd..389d443e1 100644
--- a/src/webui/www/private/scripts/contextmenu.js
+++ b/src/webui/www/private/scripts/contextmenu.js
@@ -186,8 +186,8 @@ window.qBittorrent.ContextMenu = (function() {
addTarget: function(t) {
// prevent long press from selecting this text
- t.style.setProperty("user-select", "none");
- t.style.setProperty("-webkit-user-select", "none");
+ t.style.userSelect = "none";
+ t.style["-webkit-user-select"] = "none";
this.targets[this.targets.length] = t;
this.setupEventListeners(t);
@@ -219,7 +219,7 @@ window.qBittorrent.ContextMenu = (function() {
item.addEvent("click", (e) => {
e.preventDefault();
if (!item.hasClass("disabled")) {
- this.execute(item.get("href").split("#")[1], $(this.options.element));
+ this.execute(item.href.split("#")[1], $(this.options.element));
this.fireEvent("click", [item, e]);
}
});
@@ -540,13 +540,13 @@ window.qBittorrent.ContextMenu = (function() {
const enabledColumnIndex = function(text) {
const columns = $("searchPluginsTableFixedHeaderRow").getChildren("th");
for (let i = 0; i < columns.length; ++i) {
- if (columns[i].get("html") === "Enabled")
+ if (columns[i].textContent === "Enabled")
return i;
}
};
this.showItem("Enabled");
- this.setItemChecked("Enabled", this.options.element.getChildren("td")[enabledColumnIndex()].get("html") === "Yes");
+ this.setItemChecked("Enabled", (this.options.element.getChildren("td")[enabledColumnIndex()].textContent === "Yes"));
this.showItem("Uninstall");
}
diff --git a/src/webui/www/private/scripts/download.js b/src/webui/www/private/scripts/download.js
index 7279fd19e..a64f4f9a0 100644
--- a/src/webui/www/private/scripts/download.js
+++ b/src/webui/www/private/scripts/download.js
@@ -51,8 +51,8 @@ window.qBittorrent.Download = (function() {
const category = data[i];
const option = new Element("option");
- option.set("value", category.name);
- option.set("html", category.name);
+ option.value = category.name;
+ option.textContent = category.name;
$("categorySelect").appendChild(option);
}
}
@@ -64,7 +64,7 @@ window.qBittorrent.Download = (function() {
const pref = window.parent.qBittorrent.Cache.preferences.get();
defaultSavePath = pref.save_path;
- $("savepath").setProperty("value", defaultSavePath);
+ $("savepath").value = defaultSavePath;
$("startTorrent").checked = !pref.add_stopped_enabled;
$("addToTopOfQueue").checked = pref.add_to_top_of_queue;
diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js
index 55a7e0900..505113a8d 100644
--- a/src/webui/www/private/scripts/dynamicTable.js
+++ b/src/webui/www/private/scripts/dynamicTable.js
@@ -412,8 +412,8 @@ window.qBittorrent.DynamicTable = (function() {
};
column["updateTd"] = function(td, row) {
const value = this.getRowValue(row);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
column["onResize"] = null;
this.columns.push(column);
@@ -463,8 +463,8 @@ window.qBittorrent.DynamicTable = (function() {
for (let i = 0; i < ths.length; ++i) {
const th = ths[i];
th._this = this;
- th.setAttribute("title", this.columns[i].caption);
- th.set("text", this.columns[i].caption);
+ th.title = this.columns[i].caption;
+ th.textContent = this.columns[i].caption;
th.setAttribute("style", "width: " + this.columns[i].width + "px;" + this.columns[i].style);
th.columnName = this.columns[i].name;
th.addClass("column_" + th.columnName);
@@ -740,10 +740,10 @@ window.qBittorrent.DynamicTable = (function() {
const tr = new Element("tr");
// set tabindex so element receives keydown events
// more info: https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event
- tr.setProperty("tabindex", "-1");
+ tr.tabindex = "-1";
const rowId = rows[rowPos]["rowId"];
- tr.setProperty("data-row-id", rowId);
+ tr.setAttribute("data-row-id", rowId);
tr["rowId"] = rowId;
tr._this = this;
@@ -872,7 +872,7 @@ window.qBittorrent.DynamicTable = (function() {
let selectedIndex = -1;
for (let i = 0; i < visibleRows.length; ++i) {
const row = visibleRows[i];
- if (row.getProperty("data-row-id") === selectedRowId) {
+ if (row.getAttribute("data-row-id") === selectedRowId) {
selectedIndex = i;
break;
}
@@ -883,7 +883,7 @@ window.qBittorrent.DynamicTable = (function() {
this.deselectAll();
const newRow = visibleRows[selectedIndex + 1];
- this.selectRow(newRow.getProperty("data-row-id"));
+ this.selectRow(newRow.getAttribute("data-row-id"));
}
},
@@ -894,7 +894,7 @@ window.qBittorrent.DynamicTable = (function() {
let selectedIndex = -1;
for (let i = 0; i < visibleRows.length; ++i) {
const row = visibleRows[i];
- if (row.getProperty("data-row-id") === selectedRowId) {
+ if (row.getAttribute("data-row-id") === selectedRowId) {
selectedIndex = i;
break;
}
@@ -905,7 +905,7 @@ window.qBittorrent.DynamicTable = (function() {
this.deselectAll();
const newRow = visibleRows[selectedIndex - 1];
- this.selectRow(newRow.getProperty("data-row-id"));
+ this.selectRow(newRow.getAttribute("data-row-id"));
}
},
});
@@ -1025,8 +1025,8 @@ window.qBittorrent.DynamicTable = (function() {
if (td.getChildren("img").length > 0) {
const img = td.getChildren("img")[0];
if (!img.src.includes(img_path)) {
- img.set("src", img_path);
- img.set("title", state);
+ img.src = img_path;
+ img.title = state;
}
}
else {
@@ -1101,16 +1101,16 @@ window.qBittorrent.DynamicTable = (function() {
status = "QBT_TR(Unknown)QBT_TR[CONTEXT=HttpServer]";
}
- td.set("text", status);
- td.set("title", status);
+ td.textContent = status;
+ td.title = status;
};
// priority
this.columns["priority"].updateTd = function(td, row) {
const queuePos = this.getRowValue(row);
const formattedQueuePos = (queuePos < 1) ? "*" : queuePos;
- td.set("text", formattedQueuePos);
- td.set("title", formattedQueuePos);
+ td.textContent = formattedQueuePos;
+ td.title = formattedQueuePos;
};
this.columns["priority"].compareRows = function(row1, row2) {
@@ -1135,8 +1135,8 @@ window.qBittorrent.DynamicTable = (function() {
// size, total_size
this.columns["size"].updateTd = function(td, row) {
const size = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), false);
- td.set("text", size);
- td.set("title", size);
+ td.textContent = size;
+ td.title = size;
};
this.columns["total_size"].updateTd = this.columns["size"].updateTd;
@@ -1186,8 +1186,8 @@ window.qBittorrent.DynamicTable = (function() {
let value = num_seeds;
if (num_complete !== -1)
value += " (" + num_complete + ")";
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
this.columns["num_seeds"].compareRows = function(row1, row2) {
const num_seeds1 = this.getRowValue(row1, 0);
@@ -1209,8 +1209,8 @@ window.qBittorrent.DynamicTable = (function() {
// dlspeed
this.columns["dlspeed"].updateTd = function(td, row) {
const speed = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), true);
- td.set("text", speed);
- td.set("title", speed);
+ td.textContent = speed;
+ td.title = speed;
};
// upspeed
@@ -1219,44 +1219,44 @@ 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);
- td.set("text", eta);
- td.set("title", eta);
+ td.textContent = eta;
+ td.title = eta;
};
// ratio
this.columns["ratio"].updateTd = function(td, row) {
const ratio = this.getRowValue(row);
const string = (ratio === -1) ? "∞" : window.qBittorrent.Misc.toFixedPointString(ratio, 2);
- td.set("text", string);
- td.set("title", string);
+ td.textContent = string;
+ td.title = string;
};
// popularity
this.columns["popularity"].updateTd = function(td, row) {
const value = this.getRowValue(row);
const popularity = (value === -1) ? "∞" : window.qBittorrent.Misc.toFixedPointString(value, 2);
- td.set("text", popularity);
- td.set("title", popularity);
+ td.textContent = popularity;
+ td.title = popularity;
};
// added on
this.columns["added_on"].updateTd = function(td, row) {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
- td.set("text", date);
- td.set("title", date);
+ td.textContent = date;
+ td.title = date;
};
// completion_on
this.columns["completion_on"].updateTd = function(td, row) {
const val = this.getRowValue(row);
if ((val === 0xffffffff) || (val < 0)) {
- td.set("text", "");
- td.set("title", "");
+ td.textContent = "";
+ td.title = "";
}
else {
const date = new Date(this.getRowValue(row) * 1000).toLocaleString();
- td.set("text", date);
- td.set("title", date);
+ td.textContent = date;
+ td.title = date;
}
};
@@ -1264,13 +1264,13 @@ window.qBittorrent.DynamicTable = (function() {
this.columns["dl_limit"].updateTd = function(td, row) {
const speed = this.getRowValue(row);
if (speed === 0) {
- td.set("text", "∞");
- td.set("title", "∞");
+ td.textContent = "∞";
+ td.title = "∞";
}
else {
const formattedSpeed = window.qBittorrent.Misc.friendlyUnit(speed, true);
- td.set("text", formattedSpeed);
- td.set("title", formattedSpeed);
+ td.textContent = formattedSpeed;
+ td.title = formattedSpeed;
}
};
@@ -1292,8 +1292,8 @@ window.qBittorrent.DynamicTable = (function() {
.replace("%1", window.qBittorrent.Misc.friendlyDuration(activeTime))
.replace("%2", window.qBittorrent.Misc.friendlyDuration(seedingTime)))
: window.qBittorrent.Misc.friendlyDuration(activeTime);
- td.set("text", time);
- td.set("title", time);
+ td.textContent = time;
+ td.title = time;
};
// completed
@@ -1309,28 +1309,28 @@ window.qBittorrent.DynamicTable = (function() {
this.columns["last_activity"].updateTd = function(td, row) {
const val = this.getRowValue(row);
if (val < 1) {
- td.set("text", "∞");
- td.set("title", "∞");
+ td.textContent = "∞";
+ td.title = "∞";
}
else {
const formattedVal = "QBT_TR(%1 ago)QBT_TR[CONTEXT=TransferListDelegate]".replace("%1", window.qBittorrent.Misc.friendlyDuration((new Date() / 1000) - val));
- td.set("text", formattedVal);
- td.set("title", formattedVal);
+ td.textContent = formattedVal;
+ td.title = formattedVal;
}
};
// availability
this.columns["availability"].updateTd = function(td, row) {
const value = window.qBittorrent.Misc.toFixedPointString(this.getRowValue(row), 3);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
// reannounce
this.columns["reannounce"].updateTd = function(td, row) {
const time = window.qBittorrent.Misc.friendlyDuration(this.getRowValue(row));
- td.set("text", time);
- td.set("title", time);
+ td.textContent = time;
+ td.title = time;
};
// private
@@ -1342,8 +1342,8 @@ window.qBittorrent.DynamicTable = (function() {
? "QBT_TR(Yes)QBT_TR[CONTEXT=PropertiesWidget]"
: "QBT_TR(No)QBT_TR[CONTEXT=PropertiesWidget]")
: "QBT_TR(N/A)QBT_TR[CONTEXT=PropertiesWidget]";
- td.set("text", string);
- td.set("title", string);
+ td.textContent = string;
+ td.title = string;
};
},
@@ -1623,10 +1623,10 @@ window.qBittorrent.DynamicTable = (function() {
if (td.getChildren("img").length > 0) {
const img = td.getChildren("img")[0];
- img.set("src", img_path);
- img.set("class", "flags");
- img.set("alt", country);
- img.set("title", country);
+ img.src = img_path;
+ img.className = "flags";
+ img.alt = country;
+ img.title = country;
}
else {
td.adopt(new Element("img", {
@@ -1656,8 +1656,8 @@ window.qBittorrent.DynamicTable = (function() {
// flags
this.columns["flags"].updateTd = function(td, row) {
- td.set("text", this.getRowValue(row, 0));
- td.set("title", this.getRowValue(row, 1));
+ td.textContent = this.getRowValue(row, 0);
+ td.title = this.getRowValue(row, 1);
};
// progress
@@ -1667,21 +1667,21 @@ window.qBittorrent.DynamicTable = (function() {
if ((progressFormatted === 100.0) && (progress !== 1.0))
progressFormatted = 99.9;
progressFormatted += "%";
- td.set("text", progressFormatted);
- td.set("title", progressFormatted);
+ td.textContent = progressFormatted;
+ td.title = progressFormatted;
};
// dl_speed, up_speed
this.columns["dl_speed"].updateTd = function(td, row) {
const speed = this.getRowValue(row);
if (speed === 0) {
- td.set("text", "");
- td.set("title", "");
+ td.textContent = "";
+ td.title = "";
}
else {
const formattedSpeed = window.qBittorrent.Misc.friendlyUnit(speed, true);
- td.set("text", formattedSpeed);
- td.set("title", formattedSpeed);
+ td.textContent = formattedSpeed;
+ td.title = formattedSpeed;
}
};
this.columns["up_speed"].updateTd = this.columns["dl_speed"].updateTd;
@@ -1689,8 +1689,8 @@ window.qBittorrent.DynamicTable = (function() {
// downloaded, uploaded
this.columns["downloaded"].updateTd = function(td, row) {
const downloaded = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), false);
- td.set("text", downloaded);
- td.set("title", downloaded);
+ td.textContent = downloaded;
+ td.title = downloaded;
};
this.columns["uploaded"].updateTd = this.columns["downloaded"].updateTd;
@@ -1700,8 +1700,8 @@ window.qBittorrent.DynamicTable = (function() {
// files
this.columns["files"].updateTd = function(td, row) {
const value = this.getRowValue(row, 0);
- td.set("text", value.replace(/\n/g, ";"));
- td.set("title", value);
+ td.textContent = value.replace(/\n/g, ";");
+ td.title = value;
};
}
@@ -1724,20 +1724,20 @@ window.qBittorrent.DynamicTable = (function() {
initColumnsFunctions: function() {
const displaySize = function(td, row) {
const size = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), false);
- td.set("text", size);
- td.set("title", size);
+ td.textContent = size;
+ td.title = size;
};
const displayNum = function(td, row) {
const value = this.getRowValue(row);
const formattedValue = (value === "-1") ? "Unknown" : value;
- td.set("text", formattedValue);
- td.set("title", formattedValue);
+ td.textContent = formattedValue;
+ td.title = formattedValue;
};
const displayDate = function(td, row) {
const value = this.getRowValue(row) * 1000;
const formattedValue = (isNaN(value) || (value <= 0)) ? "" : (new Date(value).toLocaleString());
- td.set("text", formattedValue);
- td.set("title", formattedValue);
+ td.textContent = formattedValue;
+ td.title = formattedValue;
};
this.columns["fileSize"].updateTd = displaySize;
@@ -1785,7 +1785,7 @@ window.qBittorrent.DynamicTable = (function() {
const filterTerms = window.qBittorrent.Search.searchText.filterPattern.toLowerCase().split(" ");
const sizeFilters = getSizeFilters();
const seedsFilters = getSeedsFilters();
- const searchInTorrentName = $("searchInTorrentName").get("value") === "names";
+ const searchInTorrentName = $("searchInTorrentName").value === "names";
if (searchInTorrentName || (filterTerms.length > 0) || (window.qBittorrent.Search.searchSizeFilter.min > 0.00) || (window.qBittorrent.Search.searchSizeFilter.max > 0.00)) {
for (let i = 0; i < rows.length; ++i) {
@@ -1844,14 +1844,14 @@ window.qBittorrent.DynamicTable = (function() {
this.columns["enabled"].updateTd = function(td, row) {
const value = this.getRowValue(row);
if (value) {
- td.set("text", "QBT_TR(Yes)QBT_TR[CONTEXT=SearchPluginsTable]");
- td.set("title", "QBT_TR(Yes)QBT_TR[CONTEXT=SearchPluginsTable]");
+ td.textContent = "QBT_TR(Yes)QBT_TR[CONTEXT=SearchPluginsTable]";
+ td.title = "QBT_TR(Yes)QBT_TR[CONTEXT=SearchPluginsTable]";
td.getParent("tr").addClass("green");
td.getParent("tr").removeClass("red");
}
else {
- td.set("text", "QBT_TR(No)QBT_TR[CONTEXT=SearchPluginsTable]");
- td.set("title", "QBT_TR(No)QBT_TR[CONTEXT=SearchPluginsTable]");
+ td.textContent = "QBT_TR(No)QBT_TR[CONTEXT=SearchPluginsTable]";
+ td.title = "QBT_TR(No)QBT_TR[CONTEXT=SearchPluginsTable]";
td.getParent("tr").addClass("red");
td.getParent("tr").removeClass("green");
}
@@ -2047,10 +2047,10 @@ window.qBittorrent.DynamicTable = (function() {
}
});
const checkbox = new Element("input");
- checkbox.set("type", "checkbox");
- checkbox.set("id", "cbRename" + id);
- checkbox.set("data-id", id);
- checkbox.set("class", "RenamingCB");
+ checkbox.type = "checkbox";
+ checkbox.id = "cbRename" + id;
+ checkbox.setAttribute("data-id", id);
+ checkbox.className = "RenamingCB";
checkbox.addEvent("click", (e) => {
const node = that.getNode(id);
node.checked = e.target.checked ? 0 : 1;
@@ -2076,7 +2076,7 @@ window.qBittorrent.DynamicTable = (function() {
const dirImgId = "renameTableDirImg" + id;
if ($(dirImgId)) {
// just update file name
- $(fileNameId).set("text", value);
+ $(fileNameId).textContent = value;
}
else {
const span = new Element("span", {
@@ -2094,7 +2094,7 @@ window.qBittorrent.DynamicTable = (function() {
id: dirImgId
});
const html = dirImg.outerHTML + span.outerHTML;
- td.set("html", html);
+ td.innerHTML = html;
}
}
else { // is file
@@ -2106,7 +2106,7 @@ window.qBittorrent.DynamicTable = (function() {
"margin-left": ((node.depth + 1) * 20)
}
});
- td.set("html", span.outerHTML);
+ td.innerHTML = span.outerHTML;
}
};
@@ -2120,7 +2120,7 @@ window.qBittorrent.DynamicTable = (function() {
text: value,
id: fileNameRenamedId,
});
- td.set("html", span.outerHTML);
+ td.innerHTML = span.outerHTML;
};
},
@@ -2379,13 +2379,13 @@ window.qBittorrent.DynamicTable = (function() {
const that = this;
const displaySize = function(td, row) {
const size = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), false);
- td.set("text", size);
- td.set("title", size);
+ td.textContent = size;
+ td.title = size;
};
const displayPercentage = function(td, row) {
const value = window.qBittorrent.Misc.friendlyPercentage(this.getRowValue(row));
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
// checked
@@ -2419,7 +2419,7 @@ window.qBittorrent.DynamicTable = (function() {
const dirImgId = "filesTableDirImg" + id;
if ($(dirImgId)) {
// just update file name
- $(fileNameId).set("text", value);
+ $(fileNameId).textContent = value;
}
else {
const collapseIcon = new Element("img", {
@@ -2446,7 +2446,7 @@ window.qBittorrent.DynamicTable = (function() {
id: dirImgId
});
const html = collapseIcon.outerHTML + dirImg.outerHTML + span.outerHTML;
- td.set("html", html);
+ td.innerHTML = html;
}
}
else {
@@ -2458,7 +2458,7 @@ window.qBittorrent.DynamicTable = (function() {
"margin-left": ((node.depth + 1) * 20)
}
});
- td.set("html", span.outerHTML);
+ td.innerHTML = span.outerHTML;
}
};
@@ -2664,8 +2664,8 @@ window.qBittorrent.DynamicTable = (function() {
const name = this.getRowValue(row, 0);
const unreadCount = this.getRowValue(row, 1);
const value = name + " (" + unreadCount + ")";
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
},
setupHeaderMenu: function() {},
@@ -2742,8 +2742,8 @@ window.qBittorrent.DynamicTable = (function() {
if (td.getChildren("img").length > 0) {
const img = td.getChildren("img")[0];
if (!img.src.includes(img_path)) {
- img.set("src", img_path);
- img.set("title", status);
+ img.src = img_path;
+ img.title = status;
}
}
else {
@@ -2782,8 +2782,8 @@ window.qBittorrent.DynamicTable = (function() {
};
column["updateTd"] = function(td, row) {
const value = this.getRowValue(row);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
column["onResize"] = null;
this.columns.push(column);
@@ -2877,8 +2877,8 @@ window.qBittorrent.DynamicTable = (function() {
};
column["updateTd"] = function(td, row) {
const value = this.getRowValue(row);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
column["onResize"] = null;
this.columns.push(column);
@@ -2905,8 +2905,8 @@ window.qBittorrent.DynamicTable = (function() {
this.columns["checked"].updateTd = function(td, row) {
if ($("cbRssDlRule" + row.rowId) === null) {
const checkbox = new Element("input");
- checkbox.set("type", "checkbox");
- checkbox.set("id", "cbRssDlRule" + row.rowId);
+ checkbox.type = "checkbox";
+ checkbox.id = "cbRssDlRule" + row.rowId;
checkbox.checked = row.full_data.checked;
checkbox.addEvent("click", function(e) {
@@ -2962,8 +2962,8 @@ window.qBittorrent.DynamicTable = (function() {
};
column["updateTd"] = function(td, row) {
const value = this.getRowValue(row);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
column["onResize"] = null;
this.columns.push(column);
@@ -2998,8 +2998,8 @@ window.qBittorrent.DynamicTable = (function() {
this.columns["checked"].updateTd = function(td, row) {
if ($("cbRssDlFeed" + row.rowId) === null) {
const checkbox = new Element("input");
- checkbox.set("type", "checkbox");
- checkbox.set("id", "cbRssDlFeed" + row.rowId);
+ checkbox.type = "checkbox";
+ checkbox.id = "cbRssDlFeed" + row.rowId;
checkbox.checked = row.full_data.checked;
checkbox.addEvent("click", function(e) {
@@ -3048,8 +3048,8 @@ window.qBittorrent.DynamicTable = (function() {
};
column["updateTd"] = function(td, row) {
const value = this.getRowValue(row);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
column["onResize"] = null;
this.columns.push(column);
@@ -3097,8 +3097,8 @@ window.qBittorrent.DynamicTable = (function() {
};
column["updateTd"] = function(td, row) {
const value = this.getRowValue(row);
- td.set("text", value);
- td.set("title", value);
+ td.textContent = value;
+ td.title = value;
};
column["onResize"] = null;
this.columns.push(column);
@@ -3179,7 +3179,7 @@ window.qBittorrent.DynamicTable = (function() {
break;
}
td.set({ "text": logLevel, "title": logLevel });
- td.getParent("tr").set("class", "logTableRow " + addClass);
+ td.getParent("tr").className = `logTableRow${addClass}`;
};
},
@@ -3246,7 +3246,7 @@ window.qBittorrent.DynamicTable = (function() {
addClass = "peerBanned";
}
td.set({ "text": status, "title": status });
- td.getParent("tr").set("class", "logTableRow " + addClass);
+ td.getParent("tr").className = `logTableRow${addClass}`;
};
},
diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js
index 36fa4f931..648aceb86 100644
--- a/src/webui/www/private/scripts/mocha-init.js
+++ b/src/webui/www/private/scripts/mocha-init.js
@@ -1052,8 +1052,8 @@ const initializeWindows = function() {
// download response to file
const element = document.createElement("a");
- element.setAttribute("href", url);
- element.setAttribute("download", (name + ".torrent"));
+ element.href = url;
+ element.download = (name + ".torrent");
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
diff --git a/src/webui/www/private/scripts/prop-files.js b/src/webui/www/private/scripts/prop-files.js
index 214792139..7694ac867 100644
--- a/src/webui/www/private/scripts/prop-files.js
+++ b/src/webui/www/private/scripts/prop-files.js
@@ -106,8 +106,8 @@ window.qBittorrent.PropFiles = (function() {
const checkbox = e.target;
const priority = checkbox.checked ? FilePriority.Normal : FilePriority.Ignored;
- const id = checkbox.get("data-id");
- const fileId = checkbox.get("data-file-id");
+ const id = checkbox.getAttribute("data-id");
+ const fileId = checkbox.getAttribute("data-file-id");
const rows = getAllChildren(id, fileId);
@@ -118,8 +118,8 @@ window.qBittorrent.PropFiles = (function() {
const fileComboboxChanged = function(e) {
const combobox = e.target;
const priority = combobox.value;
- const id = combobox.get("data-id");
- const fileId = combobox.get("data-file-id");
+ const id = combobox.getAttribute("data-id");
+ const fileId = combobox.getAttribute("data-file-id");
const rows = getAllChildren(id, fileId);
@@ -133,11 +133,11 @@ window.qBittorrent.PropFiles = (function() {
const createDownloadCheckbox = function(id, fileId, checked) {
const checkbox = new Element("input");
- checkbox.set("type", "checkbox");
- checkbox.set("id", "cbPrio" + id);
- checkbox.set("data-id", id);
- checkbox.set("data-file-id", fileId);
- checkbox.set("class", "DownloadedCB");
+ checkbox.type = "checkbox";
+ checkbox.id = "cbPrio" + id;
+ checkbox.setAttribute("data-id", id);
+ checkbox.setAttribute("data-file-id", fileId);
+ checkbox.className = "DownloadedCB";
checkbox.addEvent("click", fileCheckboxClicked);
updateCheckbox(checkbox, checked);
@@ -169,8 +169,8 @@ window.qBittorrent.PropFiles = (function() {
const createPriorityOptionElement = function(priority, selected, html) {
const elem = new Element("option");
- elem.set("value", priority.toString());
- elem.set("html", html);
+ elem.value = priority.toString();
+ elem.innerHTML = html;
if (selected)
elem.selected = true;
return elem;
@@ -178,9 +178,9 @@ window.qBittorrent.PropFiles = (function() {
const createPriorityCombo = function(id, fileId, selectedPriority) {
const select = new Element("select");
- select.set("id", "comboPrio" + id);
- select.set("data-id", id);
- select.set("data-file-id", fileId);
+ select.id = "comboPrio" + id;
+ select.setAttribute("data-id", id);
+ select.setAttribute("data-file-id", fileId);
select.addClass("combo_priority");
select.addEvent("change", fileComboboxChanged);
@@ -191,7 +191,7 @@ window.qBittorrent.PropFiles = (function() {
// "Mixed" priority is for display only; it shouldn't be selectable
const mixedPriorityOption = createPriorityOptionElement(FilePriority.Mixed, (FilePriority.Mixed === selectedPriority), "QBT_TR(Mixed)QBT_TR[CONTEXT=PropListDelegate]");
- mixedPriorityOption.set("disabled", true);
+ mixedPriorityOption.disabled = true;
mixedPriorityOption.injectInside(select);
return select;
@@ -483,9 +483,9 @@ window.qBittorrent.PropFiles = (function() {
};
const collapseIconClicked = function(event) {
- const id = event.get("data-id");
+ const id = event.getAttribute("data-id");
const node = torrentFilesTable.getNode(id);
- const isCollapsed = (event.parentElement.get("data-collapsed") === "true");
+ const isCollapsed = (event.parentElement.getAttribute("data-collapsed") === "true");
if (isCollapsed)
expandNode(node);
@@ -515,7 +515,7 @@ window.qBittorrent.PropFiles = (function() {
selectedRows.forEach((rowId) => {
const elem = $("comboPrio" + rowId);
rowIds.push(rowId);
- fileIds.push(elem.get("data-file-id"));
+ fileIds.push(elem.getAttribute("data-file-id"));
});
const uniqueRowIds = {};
@@ -623,8 +623,8 @@ window.qBittorrent.PropFiles = (function() {
const tableHeaders = $$("#torrentFilesTableFixedHeaderDiv .dynamicTableHeader th");
if (tableHeaders.length > 0) {
const checkbox = new Element("input");
- checkbox.set("type", "checkbox");
- checkbox.set("id", "tristate_cb");
+ checkbox.type = "checkbox";
+ checkbox.id = "tristate_cb";
checkbox.addEvent("click", switchCheckboxState);
const checkboxTH = tableHeaders[0];
@@ -640,7 +640,7 @@ window.qBittorrent.PropFiles = (function() {
$("torrentFilesFilterInput").addEvent("input", () => {
clearTimeout(torrentFilesFilterInputTimer);
- const value = $("torrentFilesFilterInput").get("value");
+ const value = $("torrentFilesFilterInput").value;
torrentFilesTable.setFilter(value);
torrentFilesFilterInputTimer = setTimeout(() => {
@@ -684,7 +684,7 @@ window.qBittorrent.PropFiles = (function() {
const td = span.parentElement;
// store collapsed state
- td.set("data-collapsed", isCollapsed);
+ td.setAttribute("data-collapsed", isCollapsed);
// rotate the collapse icon
const collapseIcon = td.getElementsByClassName("filesTableCollapseIcon")[0];
@@ -700,7 +700,7 @@ window.qBittorrent.PropFiles = (function() {
return true;
const td = span.parentElement;
- return (td.get("data-collapsed") === "true");
+ return td.getAttribute("data-collapsed") === "true";
};
const expandNode = function(node) {
diff --git a/src/webui/www/private/scripts/prop-general.js b/src/webui/www/private/scripts/prop-general.js
index 402199501..c3fc6588a 100644
--- a/src/webui/www/private/scripts/prop-general.js
+++ b/src/webui/www/private/scripts/prop-general.js
@@ -44,33 +44,33 @@ window.qBittorrent.PropGeneral = (function() {
$("progress").appendChild(piecesBar);
const clearData = function() {
- $("time_elapsed").set("html", "");
- $("eta").set("html", "");
- $("nb_connections").set("html", "");
- $("total_downloaded").set("html", "");
- $("total_uploaded").set("html", "");
- $("dl_speed").set("html", "");
- $("up_speed").set("html", "");
- $("dl_limit").set("html", "");
- $("up_limit").set("html", "");
- $("total_wasted").set("html", "");
- $("seeds").set("html", "");
- $("peers").set("html", "");
- $("share_ratio").set("html", "");
- $("popularity").set("html", "");
- $("reannounce").set("html", "");
- $("last_seen").set("html", "");
- $("total_size").set("html", "");
- $("pieces").set("html", "");
- $("created_by").set("html", "");
- $("addition_date").set("html", "");
- $("completion_date").set("html", "");
- $("creation_date").set("html", "");
- $("torrent_hash_v1").set("html", "");
- $("torrent_hash_v2").set("html", "");
- $("save_path").set("html", "");
- $("comment").set("html", "");
- $("private").set("html", "");
+ $("time_elapsed").textContent = "";
+ $("eta").textContent = "";
+ $("nb_connections").textContent = "";
+ $("total_downloaded").textContent = "";
+ $("total_uploaded").textContent = "";
+ $("dl_speed").textContent = "";
+ $("up_speed").textContent = "";
+ $("dl_limit").textContent = "";
+ $("up_limit").textContent = "";
+ $("total_wasted").textContent = "";
+ $("seeds").textContent = "";
+ $("peers").textContent = "";
+ $("share_ratio").textContent = "";
+ $("popularity").textContent = "";
+ $("reannounce").textContent = "";
+ $("last_seen").textContent = "";
+ $("total_size").textContent = "";
+ $("pieces").textContent = "";
+ $("created_by").textContent = "";
+ $("addition_date").textContent = "";
+ $("completion_date").textContent = "";
+ $("creation_date").textContent = "";
+ $("torrent_hash_v1").textContent = "";
+ $("torrent_hash_v2").textContent = "";
+ $("save_path").textContent = "";
+ $("comment").innerHTML = "";
+ $("private").textContent = "";
piecesBar.clear();
};
@@ -94,12 +94,12 @@ window.qBittorrent.PropGeneral = (function() {
method: "get",
noCache: true,
onFailure: function() {
- $("error_div").set("html", "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]");
+ $("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
clearTimeout(loadTorrentDataTimer);
loadTorrentDataTimer = loadTorrentData.delay(10000);
},
onSuccess: function(data) {
- $("error_div").set("html", "");
+ $("error_div").textContent = "";
if (data) {
// Update Torrent data
@@ -108,70 +108,70 @@ window.qBittorrent.PropGeneral = (function() {
.replace("%1", window.qBittorrent.Misc.friendlyDuration(data.time_elapsed))
.replace("%2", window.qBittorrent.Misc.friendlyDuration(data.seeding_time))
: window.qBittorrent.Misc.friendlyDuration(data.time_elapsed);
- $("time_elapsed").set("html", timeElapsed);
+ $("time_elapsed").textContent = timeElapsed;
- $("eta").set("html", window.qBittorrent.Misc.friendlyDuration(data.eta, window.qBittorrent.Misc.MAX_ETA));
+ $("eta").textContent = window.qBittorrent.Misc.friendlyDuration(data.eta, window.qBittorrent.Misc.MAX_ETA);
const nbConnections = "QBT_TR(%1 (%2 max))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.nb_connections)
.replace("%2", ((data.nb_connections_limit < 0) ? "∞" : data.nb_connections_limit));
- $("nb_connections").set("html", nbConnections);
+ $("nb_connections").textContent = nbConnections;
const totalDownloaded = "QBT_TR(%1 (%2 this session))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", window.qBittorrent.Misc.friendlyUnit(data.total_downloaded))
.replace("%2", window.qBittorrent.Misc.friendlyUnit(data.total_downloaded_session));
- $("total_downloaded").set("html", totalDownloaded);
+ $("total_downloaded").textContent = totalDownloaded;
const totalUploaded = "QBT_TR(%1 (%2 this session))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", window.qBittorrent.Misc.friendlyUnit(data.total_uploaded))
.replace("%2", window.qBittorrent.Misc.friendlyUnit(data.total_uploaded_session));
- $("total_uploaded").set("html", totalUploaded);
+ $("total_uploaded").textContent = totalUploaded;
const dlSpeed = "QBT_TR(%1 (%2 avg.))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", window.qBittorrent.Misc.friendlyUnit(data.dl_speed, true))
.replace("%2", window.qBittorrent.Misc.friendlyUnit(data.dl_speed_avg, true));
- $("dl_speed").set("html", dlSpeed);
+ $("dl_speed").textContent = dlSpeed;
const upSpeed = "QBT_TR(%1 (%2 avg.))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", window.qBittorrent.Misc.friendlyUnit(data.up_speed, true))
.replace("%2", window.qBittorrent.Misc.friendlyUnit(data.up_speed_avg, true));
- $("up_speed").set("html", upSpeed);
+ $("up_speed").textContent = upSpeed;
const dlLimit = (data.dl_limit === -1)
? "∞"
: window.qBittorrent.Misc.friendlyUnit(data.dl_limit, true);
- $("dl_limit").set("html", dlLimit);
+ $("dl_limit").textContent = dlLimit;
const upLimit = (data.up_limit === -1)
? "∞"
: window.qBittorrent.Misc.friendlyUnit(data.up_limit, true);
- $("up_limit").set("html", upLimit);
+ $("up_limit").textContent = upLimit;
- $("total_wasted").set("html", window.qBittorrent.Misc.friendlyUnit(data.total_wasted));
+ $("total_wasted").textContent = window.qBittorrent.Misc.friendlyUnit(data.total_wasted);
const seeds = "QBT_TR(%1 (%2 total))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.seeds)
.replace("%2", data.seeds_total);
- $("seeds").set("html", seeds);
+ $("seeds").textContent = seeds;
const peers = "QBT_TR(%1 (%2 total))QBT_TR[CONTEXT=PropertiesWidget]"
.replace("%1", data.peers)
.replace("%2", data.peers_total);
- $("peers").set("html", peers);
+ $("peers").textContent = peers;
- $("share_ratio").set("html", data.share_ratio.toFixed(2));
+ $("share_ratio").textContent = data.share_ratio.toFixed(2);
- $("popularity").set("html", data.popularity.toFixed(2));
+ $("popularity").textContent = data.popularity.toFixed(2);
- $("reannounce").set("html", window.qBittorrent.Misc.friendlyDuration(data.reannounce));
+ $("reannounce").textContent = window.qBittorrent.Misc.friendlyDuration(data.reannounce);
const lastSeen = (data.last_seen >= 0)
? new Date(data.last_seen * 1000).toLocaleString()
: "QBT_TR(Never)QBT_TR[CONTEXT=PropertiesWidget]";
- $("last_seen").set("html", lastSeen);
+ $("last_seen").textContent = lastSeen;
const totalSize = (data.total_size >= 0) ? window.qBittorrent.Misc.friendlyUnit(data.total_size) : "";
- $("total_size").set("html", totalSize);
+ $("total_size").textContent = totalSize;
const pieces = (data.pieces_num >= 0)
? "QBT_TR(%1 x %2 (have %3))QBT_TR[CONTEXT=PropertiesWidget]"
@@ -179,47 +179,44 @@ window.qBittorrent.PropGeneral = (function() {
.replace("%2", window.qBittorrent.Misc.friendlyUnit(data.piece_size))
.replace("%3", data.pieces_have)
: "";
- $("pieces").set("html", pieces);
+ $("pieces").textContent = pieces;
- $("created_by").set("text", data.created_by);
+ $("created_by").textContent = data.created_by;
const additionDate = (data.addition_date >= 0)
? new Date(data.addition_date * 1000).toLocaleString()
: "QBT_TR(Unknown)QBT_TR[CONTEXT=HttpServer]";
- $("addition_date").set("html", additionDate);
+ $("addition_date").textContent = additionDate;
const completionDate = (data.completion_date >= 0)
? new Date(data.completion_date * 1000).toLocaleString()
: "";
- $("completion_date").set("html", completionDate);
+ $("completion_date").textContent = completionDate;
const creationDate = (data.creation_date >= 0)
? new Date(data.creation_date * 1000).toLocaleString()
: "";
- $("creation_date").set("html", creationDate);
+ $("creation_date").textContent = creationDate;
const torrentHashV1 = (data.infohash_v1 !== "")
? data.infohash_v1
: "QBT_TR(N/A)QBT_TR[CONTEXT=PropertiesWidget]";
- $("torrent_hash_v1").set("html", torrentHashV1);
+ $("torrent_hash_v1").textContent = torrentHashV1;
const torrentHashV2 = (data.infohash_v2 !== "")
? data.infohash_v2
: "QBT_TR(N/A)QBT_TR[CONTEXT=PropertiesWidget]";
- $("torrent_hash_v2").set("html", torrentHashV2);
+ $("torrent_hash_v2").textContent = torrentHashV2;
- $("save_path").set("html", data.save_path);
+ $("save_path").textContent = data.save_path;
- $("comment").set("html", window.qBittorrent.Misc.parseHtmlLinks(window.qBittorrent.Misc.escapeHtml(data.comment)));
+ $("comment").innerHTML = window.qBittorrent.Misc.parseHtmlLinks(window.qBittorrent.Misc.escapeHtml(data.comment));
- if (data.has_metadata) {
- $("private").set("text", (data.private
+ $("private").textContent = (data.has_metadata
+ ? (data.private
? "QBT_TR(Yes)QBT_TR[CONTEXT=PropertiesWidget]"
- : "QBT_TR(No)QBT_TR[CONTEXT=PropertiesWidget]"));
- }
- else {
- $("private").set("text", "QBT_TR(N/A)QBT_TR[CONTEXT=PropertiesWidget]");
- }
+ : "QBT_TR(No)QBT_TR[CONTEXT=PropertiesWidget]")
+ : "QBT_TR(N/A)QBT_TR[CONTEXT=PropertiesWidget]");
}
else {
clearData();
@@ -235,12 +232,12 @@ window.qBittorrent.PropGeneral = (function() {
method: "get",
noCache: true,
onFailure: function() {
- $("error_div").set("html", "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]");
+ $("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
clearTimeout(loadTorrentDataTimer);
loadTorrentDataTimer = loadTorrentData.delay(10000);
},
onSuccess: function(data) {
- $("error_div").set("html", "");
+ $("error_div").textContent = "";
if (data)
piecesBar.setPieces(data);
diff --git a/src/webui/www/private/scripts/prop-peers.js b/src/webui/www/private/scripts/prop-peers.js
index a312affc5..7697dca18 100644
--- a/src/webui/www/private/scripts/prop-peers.js
+++ b/src/webui/www/private/scripts/prop-peers.js
@@ -70,7 +70,7 @@ window.qBittorrent.PropPeers = (function() {
loadTorrentPeersTimer = loadTorrentPeersData.delay(window.qBittorrent.Client.getSyncMainDataInterval());
},
onSuccess: function(response) {
- $("error_div").set("html", "");
+ $("error_div").textContent = "";
if (response) {
const full_update = (response["full_update"] === true);
if (full_update)
diff --git a/src/webui/www/private/scripts/prop-webseeds.js b/src/webui/www/private/scripts/prop-webseeds.js
index dc15ba776..e6a0cea5e 100644
--- a/src/webui/www/private/scripts/prop-webseeds.js
+++ b/src/webui/www/private/scripts/prop-webseeds.js
@@ -65,7 +65,7 @@ window.qBittorrent.PropWebseeds = (function() {
updateRow: function(tr, row) {
const tds = tr.getElements("td");
for (let i = 0; i < row.length; ++i)
- tds[i].set("html", row[i]);
+ tds[i].innerHTML = row[i];
return true;
},
@@ -81,7 +81,7 @@ window.qBittorrent.PropWebseeds = (function() {
this.rows.set(url, tr);
for (let i = 0; i < row.length; ++i) {
const td = new Element("td");
- td.set("html", row[i]);
+ td.innerHTML = row[i];
td.injectInside(tr);
}
tr.injectInside(this.table);
@@ -114,12 +114,12 @@ window.qBittorrent.PropWebseeds = (function() {
method: "get",
noCache: true,
onFailure: function() {
- $("error_div").set("html", "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]");
+ $("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
clearTimeout(loadWebSeedsDataTimer);
loadWebSeedsDataTimer = loadWebSeedsData.delay(20000);
},
onSuccess: function(webseeds) {
- $("error_div").set("html", "");
+ $("error_div").textContent = "";
if (webseeds) {
// Update WebSeeds data
webseeds.each((webseed) => {
diff --git a/src/webui/www/private/scripts/search.js b/src/webui/www/private/scripts/search.js
index c8611e3f6..290dd61a5 100644
--- a/src/webui/www/private/scripts/search.js
+++ b/src/webui/www/private/scripts/search.js
@@ -90,7 +90,7 @@ window.qBittorrent.Search = (function() {
const init = function() {
// load "Search in" preference from local storage
- $("searchInTorrentName").set("value", (LocalPreferences.get("search_in_filter") === "names") ? "names" : "everywhere");
+ $("searchInTorrentName").value = (LocalPreferences.get("search_in_filter") === "names") ? "names" : "everywhere";
const searchResultsTableContextMenu = new window.qBittorrent.ContextMenu.ContextMenu({
targets: ".searchTableRow",
menu: "searchResultsTableMenu",
@@ -114,7 +114,7 @@ window.qBittorrent.Search = (function() {
searchInNameFilterTimer = setTimeout(() => {
searchInNameFilterTimer = -1;
- const value = $("searchInNameFilter").get("value");
+ const value = $("searchInNameFilter").value;
searchText.filterPattern = value;
searchFilterChanged();
}, window.qBittorrent.Misc.FILTER_INPUT_DELAY);
@@ -189,7 +189,7 @@ window.qBittorrent.Search = (function() {
// reinitialize tabs
$("searchTabs").getElements("li").removeEvents("click");
$("searchTabs").getElements("li").addEvent("click", function(e) {
- $("startSearchButton").set("text", "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
setActiveTab(this);
});
@@ -248,8 +248,8 @@ window.qBittorrent.Search = (function() {
resetSearchState();
resetFilters();
- $("numSearchResultsVisible").set("html", 0);
- $("numSearchResultsTotal").set("html", 0);
+ $("numSearchResultsVisible").textContent = 0;
+ $("numSearchResultsTotal").textContent = 0;
$("searchResultsNoSearches").style.display = "block";
$("searchResultsFilters").style.display = "none";
$("searchResultsTableContainer").style.display = "none";
@@ -257,7 +257,7 @@ window.qBittorrent.Search = (function() {
}
else if (isTabSelected && newTabToSelect) {
setActiveTab(newTabToSelect);
- $("startSearchButton").set("text", "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
}
};
@@ -315,32 +315,32 @@ window.qBittorrent.Search = (function() {
// restore filters
searchText.pattern = state.searchPattern;
searchText.filterPattern = state.filterPattern;
- $("searchInNameFilter").set("value", state.filterPattern);
+ $("searchInNameFilter").value = state.filterPattern;
searchSeedsFilter.min = state.seedsFilter.min;
searchSeedsFilter.max = state.seedsFilter.max;
- $("searchMinSeedsFilter").set("value", state.seedsFilter.min);
- $("searchMaxSeedsFilter").set("value", state.seedsFilter.max);
+ $("searchMinSeedsFilter").value = state.seedsFilter.min;
+ $("searchMaxSeedsFilter").value = state.seedsFilter.max;
searchSizeFilter.min = state.sizeFilter.min;
searchSizeFilter.minUnit = state.sizeFilter.minUnit;
searchSizeFilter.max = state.sizeFilter.max;
searchSizeFilter.maxUnit = state.sizeFilter.maxUnit;
- $("searchMinSizeFilter").set("value", state.sizeFilter.min);
- $("searchMinSizePrefix").set("value", state.sizeFilter.minUnit);
- $("searchMaxSizeFilter").set("value", state.sizeFilter.max);
- $("searchMaxSizePrefix").set("value", state.sizeFilter.maxUnit);
+ $("searchMinSizeFilter").value = state.sizeFilter.min;
+ $("searchMinSizePrefix").value = state.sizeFilter.minUnit;
+ $("searchMaxSizeFilter").value = state.sizeFilter.max;
+ $("searchMaxSizePrefix").value = state.sizeFilter.maxUnit;
- const currentSearchPattern = $("searchPattern").getProperty("value").trim();
+ const currentSearchPattern = $("searchPattern").value.trim();
if (state.running && (state.searchPattern === currentSearchPattern)) {
// allow search to be stopped
- $("startSearchButton").set("text", "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
searchPatternChanged = false;
}
searchResultsTable.setSortedColumn(state.sort.column, state.sort.reverse);
- $("searchInTorrentName").set("value", state.searchIn);
+ $("searchInTorrentName").value = state.searchIn;
}
// must restore all filters before calling updateTable
@@ -351,8 +351,8 @@ window.qBittorrent.Search = (function() {
if (rowsToSelect.length > 0)
searchResultsTable.reselectRows(rowsToSelect);
- $("numSearchResultsVisible").set("html", searchResultsTable.getFilteredAndSortedRows().length);
- $("numSearchResultsTotal").set("html", searchResultsTable.getRowIds().length);
+ $("numSearchResultsVisible").textContent = searchResultsTable.getFilteredAndSortedRows().length;
+ $("numSearchResultsTotal").textContent = searchResultsTable.getRowIds().length;
setupSearchTableEvents(true);
};
@@ -373,9 +373,9 @@ window.qBittorrent.Search = (function() {
const searchTab = $(`${searchTabIdPrefix}${searchId}`);
if (searchTab) {
const statusIcon = searchTab.getElement(".statusIcon");
- statusIcon.set("alt", text);
- statusIcon.set("title", text);
- statusIcon.set("src", image);
+ statusIcon.alt = text;
+ statusIcon.title = text;
+ statusIcon.src = image;
}
};
@@ -392,7 +392,7 @@ window.qBittorrent.Search = (function() {
plugins: plugins
},
onSuccess: function(response) {
- $("startSearchButton").set("text", "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
const searchId = response.id;
createSearchTab(searchId, pattern);
@@ -429,9 +429,9 @@ window.qBittorrent.Search = (function() {
const state = searchState.get(currentSearchId);
const isSearchRunning = state && state.running;
if (!isSearchRunning || searchPatternChanged) {
- const pattern = $("searchPattern").getProperty("value").trim();
- const category = $("categorySelect").getProperty("value");
- const plugins = $("pluginsSelect").getProperty("value");
+ const pattern = $("searchPattern").value.trim();
+ const category = $("categorySelect").value;
+ const plugins = $("pluginsSelect").value;
if (!pattern || !category || !plugins)
return;
@@ -522,24 +522,24 @@ window.qBittorrent.Search = (function() {
const onSearchPatternChanged = function() {
const currentSearchId = getSelectedSearchId();
const state = searchState.get(currentSearchId);
- const currentSearchPattern = $("searchPattern").getProperty("value").trim();
+ const currentSearchPattern = $("searchPattern").value.trim();
// start a new search if pattern has changed, otherwise allow the search to be stopped
if (state && (state.searchPattern === currentSearchPattern)) {
searchPatternChanged = false;
- $("startSearchButton").set("text", "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Stop)QBT_TR[CONTEXT=SearchEngineWidget]";
}
else {
searchPatternChanged = true;
- $("startSearchButton").set("text", "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
}
};
const categorySelected = function() {
- selectedCategory = $("categorySelect").get("value");
+ selectedCategory = $("categorySelect").value;
};
const pluginSelected = function() {
- selectedPlugin = $("pluginsSelect").get("value");
+ selectedPlugin = $("pluginsSelect").value;
if (selectedPlugin !== prevSelectedPlugin) {
prevSelectedPlugin = selectedPlugin;
@@ -566,7 +566,7 @@ window.qBittorrent.Search = (function() {
};
const resetSearchState = function(searchId) {
- $("startSearchButton").set("text", "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]");
+ $("startSearchButton").textContent = "QBT_TR(Search)QBT_TR[CONTEXT=SearchEngineWidget]";
const state = searchState.get(searchId);
if (state) {
state.running = false;
@@ -579,8 +579,8 @@ window.qBittorrent.Search = (function() {
const categoryHtml = [];
categories.each((category) => {
const option = new Element("option");
- option.set("value", category.id);
- option.set("html", category.name);
+ option.value = category.id;
+ option.textContent = category.name;
categoryHtml.push(option.outerHTML);
});
@@ -588,15 +588,15 @@ window.qBittorrent.Search = (function() {
if (categoryHtml.length > 1) {
// add separator
const option = new Element("option");
- option.set("disabled", true);
- option.set("html", "──────────");
+ option.disabled = true;
+ option.textContent = "──────────";
categoryHtml.splice(1, 0, option.outerHTML);
}
- $("categorySelect").set("html", categoryHtml.join(""));
+ $("categorySelect").innerHTML = categoryHtml.join("");
};
- const selectedPlugin = $("pluginsSelect").get("value");
+ const selectedPlugin = $("pluginsSelect").value;
if ((selectedPlugin === "all") || (selectedPlugin === "enabled")) {
const uniqueCategories = {};
@@ -660,12 +660,12 @@ window.qBittorrent.Search = (function() {
pluginsHtml.splice(2, 0, "");
}
- $("pluginsSelect").set("html", pluginsHtml.join(""));
+ $("pluginsSelect").innerHTML = pluginsHtml.join("");
- $("searchPattern").setProperty("disabled", searchPluginsEmpty);
- $("categorySelect").setProperty("disabled", searchPluginsEmpty);
- $("pluginsSelect").setProperty("disabled", searchPluginsEmpty);
- $("startSearchButton").setProperty("disabled", searchPluginsEmpty);
+ $("searchPattern").disabled = searchPluginsEmpty;
+ $("categorySelect").disabled = searchPluginsEmpty;
+ $("pluginsSelect").disabled = searchPluginsEmpty;
+ $("startSearchButton").disabled = searchPluginsEmpty;
if (window.qBittorrent.SearchPlugins !== undefined)
window.qBittorrent.SearchPlugins.updateTable();
@@ -687,25 +687,25 @@ window.qBittorrent.Search = (function() {
const resetFilters = function() {
searchText.filterPattern = "";
- $("searchInNameFilter").set("value", "");
+ $("searchInNameFilter").value = "";
searchSeedsFilter.min = 0;
searchSeedsFilter.max = 0;
- $("searchMinSeedsFilter").set("value", searchSeedsFilter.min);
- $("searchMaxSeedsFilter").set("value", searchSeedsFilter.max);
+ $("searchMinSeedsFilter").value = searchSeedsFilter.min;
+ $("searchMaxSeedsFilter").value = searchSeedsFilter.max;
searchSizeFilter.min = 0.00;
searchSizeFilter.minUnit = 2; // B = 0, KiB = 1, MiB = 2, GiB = 3, TiB = 4, PiB = 5, EiB = 6
searchSizeFilter.max = 0.00;
searchSizeFilter.maxUnit = 3;
- $("searchMinSizeFilter").set("value", searchSizeFilter.min);
- $("searchMinSizePrefix").set("value", searchSizeFilter.minUnit);
- $("searchMaxSizeFilter").set("value", searchSizeFilter.max);
- $("searchMaxSizePrefix").set("value", searchSizeFilter.maxUnit);
+ $("searchMinSizeFilter").value = searchSizeFilter.min;
+ $("searchMinSizePrefix").value = searchSizeFilter.minUnit;
+ $("searchMaxSizeFilter").value = searchSizeFilter.max;
+ $("searchMaxSizePrefix").value = searchSizeFilter.maxUnit;
};
const getSearchInTorrentName = function() {
- return $("searchInTorrentName").get("value") === "names" ? "names" : "everywhere";
+ return ($("searchInTorrentName").value === "names") ? "names" : "everywhere";
};
const searchInTorrentName = function() {
@@ -714,29 +714,29 @@ window.qBittorrent.Search = (function() {
};
const searchSeedsFilterChanged = function() {
- searchSeedsFilter.min = $("searchMinSeedsFilter").get("value");
- searchSeedsFilter.max = $("searchMaxSeedsFilter").get("value");
+ searchSeedsFilter.min = $("searchMinSeedsFilter").value;
+ searchSeedsFilter.max = $("searchMaxSeedsFilter").value;
searchFilterChanged();
};
const searchSizeFilterChanged = function() {
- searchSizeFilter.min = $("searchMinSizeFilter").get("value");
- searchSizeFilter.minUnit = $("searchMinSizePrefix").get("value");
- searchSizeFilter.max = $("searchMaxSizeFilter").get("value");
- searchSizeFilter.maxUnit = $("searchMaxSizePrefix").get("value");
+ searchSizeFilter.min = $("searchMinSizeFilter").value;
+ searchSizeFilter.minUnit = $("searchMinSizePrefix").value;
+ searchSizeFilter.max = $("searchMaxSizeFilter").value;
+ searchSizeFilter.maxUnit = $("searchMaxSizePrefix").value;
searchFilterChanged();
};
const searchSizeFilterPrefixChanged = function() {
- if ((Number($("searchMinSizeFilter").get("value")) !== 0) || (Number($("searchMaxSizeFilter").get("value")) !== 0))
+ if ((Number($("searchMinSizeFilter").value) !== 0) || (Number($("searchMaxSizeFilter").value) !== 0))
searchSizeFilterChanged();
};
const searchFilterChanged = function() {
searchResultsTable.updateTable();
- $("numSearchResultsVisible").set("html", searchResultsTable.getFilteredAndSortedRows().length);
+ $("numSearchResultsVisible").textContent = searchResultsTable.getFilteredAndSortedRows().length;
};
const setupSearchTableEvents = function(enable) {
@@ -778,7 +778,7 @@ window.qBittorrent.Search = (function() {
}
},
onSuccess: function(response) {
- $("error_div").set("html", "");
+ $("error_div").textContent = "";
const state = searchState.get(searchId);
// check if user stopped the search prior to receiving the response
@@ -821,8 +821,8 @@ window.qBittorrent.Search = (function() {
for (const row of newRows)
searchResultsTable.updateRowData(row);
- $("numSearchResultsVisible").set("html", searchResultsTable.getFilteredAndSortedRows().length);
- $("numSearchResultsTotal").set("html", searchResultsTable.getRowIds().length);
+ $("numSearchResultsVisible").textContent = searchResultsTable.getFilteredAndSortedRows().length;
+ $("numSearchResultsTotal").textContent = searchResultsTable.getRowIds().length;
searchResultsTable.updateTable();
searchResultsTable.altRow();
diff --git a/src/webui/www/private/setlocation.html b/src/webui/www/private/setlocation.html
index a07f9eaf4..11308054b 100644
--- a/src/webui/www/private/setlocation.html
+++ b/src/webui/www/private/setlocation.html
@@ -42,7 +42,7 @@
// check field
const location = $("setLocation").value.trim();
if ((location === null) || (location === "")) {
- $("error_div").set("text", "QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]");
+ $("error_div").textContent = "QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]";
return false;
}
@@ -58,7 +58,7 @@
window.parent.qBittorrent.Client.closeWindows();
},
onFailure: function(xhr) {
- $("error_div").set("text", xhr.response);
+ $("error_div").textContent = xhr.response;
}
}).send();
});
diff --git a/src/webui/www/private/shareratio.html b/src/webui/www/private/shareratio.html
index 599217a31..4db2e739b 100644
--- a/src/webui/www/private/shareratio.html
+++ b/src/webui/www/private/shareratio.html
@@ -60,16 +60,16 @@
else {
setSelectedRadioValue("shareLimit", "custom");
if (values.ratioLimit >= 0) {
- $("setRatio").set("checked", true);
- $("ratio").set("value", values.ratioLimit);
+ $("setRatio").checked = true;
+ $("ratio").value = values.ratioLimit;
}
if (values.seedingTimeLimit >= 0) {
- $("setTotalMinutes").set("checked", true);
- $("totalMinutes").set("value", values.seedingTimeLimit);
+ $("setTotalMinutes").checked = true;
+ $("totalMinutes").value = values.seedingTimeLimit;
}
if (values.inactiveSeedingTimeLimit >= 0) {
- $("setInactiveMinutes").set("checked", true);
- $("inactiveMinutes").set("value", values.inactiveSeedingTimeLimit);
+ $("setInactiveMinutes").checked = true;
+ $("inactiveMinutes").value = values.inactiveSeedingTimeLimit;
}
}
@@ -94,9 +94,9 @@
ratioLimitValue = seedingTimeLimitValue = inactiveSeedingTimeLimitValue = NoLimit;
}
else if (shareLimit === "custom") {
- ratioLimitValue = $("setRatio").get("checked") ? $("ratio").get("value") : -1;
- seedingTimeLimitValue = $("setTotalMinutes").get("checked") ? $("totalMinutes").get("value") : -1;
- inactiveSeedingTimeLimitValue = $("setInactiveMinutes").get("checked") ? $("inactiveMinutes").get("value") : -1;
+ ratioLimitValue = $("setRatio").checked ? $("ratio").value : -1;
+ seedingTimeLimitValue = $("setTotalMinutes").checked ? $("totalMinutes").value : -1;
+ inactiveSeedingTimeLimitValue = $("setInactiveMinutes").checked ? $("inactiveMinutes").value : -1;
}
else {
return false;
@@ -124,7 +124,7 @@
for (let i = 0; i < radios.length; ++i) {
const radio = radios[i];
if (radio.checked)
- return (radio).get("value");
+ return radio.value;
}
}
@@ -140,26 +140,26 @@
function shareLimitChanged() {
const customShareLimit = getSelectedRadioValue("shareLimit") === "custom";
- $("setRatio").set("disabled", !customShareLimit);
- $("setTotalMinutes").set("disabled", !customShareLimit);
- $("setInactiveMinutes").set("disabled", !customShareLimit);
+ $("setRatio").disabled = !customShareLimit;
+ $("setTotalMinutes").disabled = !customShareLimit;
+ $("setInactiveMinutes").disabled = !customShareLimit;
enableInputBoxes();
- $("save").set("disabled", !isFormValid());
+ $("save").disabled = !isFormValid();
}
function enableInputBoxes() {
- $("ratio").set("disabled", ($("setRatio").get("disabled") || !$("setRatio").get("checked")));
- $("totalMinutes").set("disabled", ($("setTotalMinutes").get("disabled") || !$("setTotalMinutes").get("checked")));
- $("inactiveMinutes").set("disabled", ($("setInactiveMinutes").get("disabled") || !$("setInactiveMinutes").get("checked")));
+ $("ratio").disabled = $("setRatio").disabled || !$("setRatio").checked;
+ $("totalMinutes").disabled = $("setTotalMinutes").disabled || !$("setTotalMinutes").checked;
+ $("inactiveMinutes").disabled = $("setInactiveMinutes").disabled || !$("setInactiveMinutes").checked;
- $("save").set("disabled", !isFormValid());
+ $("save").disabled = !isFormValid();
}
function isFormValid() {
- return !((getSelectedRadioValue("shareLimit") === "custom") && !$("setRatio").get("checked")
- && !$("setTotalMinutes").get("checked") && !$("setInactiveMinutes").get("checked"));
+ return !((getSelectedRadioValue("shareLimit") === "custom") && !$("setRatio").checked
+ && !$("setTotalMinutes").checked && !$("setInactiveMinutes").checked);
}
diff --git a/src/webui/www/private/views/installsearchplugin.html b/src/webui/www/private/views/installsearchplugin.html
index e44a29ef8..aea0f48ec 100644
--- a/src/webui/www/private/views/installsearchplugin.html
+++ b/src/webui/www/private/views/installsearchplugin.html
@@ -60,7 +60,7 @@
};
const newPluginOk = function() {
- const path = $("newPluginPath").get("value").trim();
+ const path = $("newPluginPath").value.trim();
if (path) {
new Request({
url: "api/v2/search/installPlugin",
diff --git a/src/webui/www/private/views/log.html b/src/webui/www/private/views/log.html
index cc2e3b27d..4e3015d43 100644
--- a/src/webui/www/private/views/log.html
+++ b/src/webui/www/private/views/log.html
@@ -288,7 +288,7 @@
};
const filterTextChanged = () => {
- const value = $("filterTextInput").get("value").trim();
+ const value = $("filterTextInput").value.trim();
if (inputtedFilterText !== value) {
inputtedFilterText = value;
logFilterChanged();
@@ -337,8 +337,8 @@
if (curTab === undefined)
curTab = currentSelectedTab;
- $("numFilteredLogs").set("text", tableInfo[curTab].instance.filteredLength());
- $("numTotalLogs").set("text", tableInfo[curTab].instance.getRowIds().length);
+ $("numFilteredLogs").textContent = tableInfo[curTab].instance.filteredLength();
+ $("numTotalLogs").textContent = tableInfo[curTab].instance.getRowIds().length;
};
const syncLogData = (curTab) => {
@@ -369,12 +369,12 @@
onFailure: function(response) {
const errorDiv = $("error_div");
if (errorDiv)
- errorDiv.set("text", "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]");
+ errorDiv.textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]";
tableInfo[curTab].progress = false;
syncLogWithInterval(10000);
},
onSuccess: function(response) {
- $("error_div").set("text", "");
+ $("error_div").textContent = "";
if ($("logTabColumn").hasClass("invisible"))
return;
diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html
index fab7a8e91..4f19172f4 100644
--- a/src/webui/www/private/views/preferences.html
+++ b/src/webui/www/private/views/preferences.html
@@ -1633,10 +1633,10 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
};
const updateFileLogEnabled = function() {
- const isFileLogEnabled = $("filelog_checkbox").getProperty("checked");
- $("filelog_save_path_input").setProperty("disabled", !isFileLogEnabled);
- $("filelog_backup_checkbox").setProperty("disabled", !isFileLogEnabled);
- $("filelog_delete_old_checkbox").setProperty("disabled", !isFileLogEnabled);
+ const isFileLogEnabled = $("filelog_checkbox").checked;
+ $("filelog_save_path_input").disabled = !isFileLogEnabled;
+ $("filelog_backup_checkbox").disabled = !isFileLogEnabled;
+ $("filelog_delete_old_checkbox").disabled = !isFileLogEnabled;
updateFileLogBackupEnabled();
updateFileLogDeleteEnabled();
@@ -1644,21 +1644,21 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
const updateFileLogBackupEnabled = function() {
const pros = $("filelog_backup_checkbox").getProperties("disabled", "checked");
- $("filelog_max_size_input").setProperty("disabled", pros.disabled || !pros.checked);
+ $("filelog_max_size_input").disabled = pros.disabled || !pros.checked;
};
const updateFileLogDeleteEnabled = function() {
const pros = $("filelog_delete_old_checkbox").getProperties("disabled", "checked");
- $("filelog_age_input").setProperty("disabled", pros.disabled || !pros.checked);
- $("filelog_age_type_select").setProperty("disabled", pros.disabled || !pros.checked);
+ $("filelog_age_input").disabled = pros.disabled || !pros.checked;
+ $("filelog_age_type_select").disabled = pros.disabled || !pros.checked;
};
// Downloads tab
const watchedFoldersTable = new HtmlTable($("watched_folders_tab"));
const updateTempDirEnabled = function() {
- const isTempDirEnabled = $("temppath_checkbox").getProperty("checked");
- $("temppath_text").setProperty("disabled", !isTempDirEnabled);
+ const isTempDirEnabled = $("temppath_checkbox").checked;
+ $("temppath_text").disabled = !isTempDirEnabled;
};
const changeWatchFolderSelect = (item) => {
@@ -1689,12 +1689,12 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
+ "";
watchedFoldersTable.push([myinput, mycb]);
- $("cb_watch_" + pos).setProperty("value", sel);
+ $("cb_watch_" + pos).value = sel;
if (disableInput) {
const elt = $("cb_watch_" + pos);
other = elt.options[elt.selectedIndex].textContent;
}
- $("cb_watch_txt_" + pos).setProperty("value", other);
+ $("cb_watch_txt_" + pos).value = other;
// hide previous img
if (pos > 0)
@@ -1705,13 +1705,13 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
const nb_folders = $("watched_folders_tab").getChildren("tbody")[0].getChildren("tr").length;
const folders = new Hash();
for (let i = 0; i < nb_folders; ++i) {
- const fpath = $("text_watch_" + i).getProperty("value").trim();
+ const fpath = $("text_watch_" + i).value.trim();
if (fpath.length > 0) {
- const sel = $("cb_watch_" + i).getProperty("value").trim();
+ const sel = $("cb_watch_" + i).value.trim();
let other;
if (sel === "other")
- other = $("cb_watch_txt_" + i).getProperty("value").trim();
+ other = $("cb_watch_txt_" + i).value.trim();
else
other = (sel === "watch_folder") ? 0 : 1;
@@ -1722,39 +1722,39 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
};
const updateExcludedFileNamesEnabled = function() {
- const isAExcludedFileNamesEnabled = $("excludedFileNamesCheckbox").getProperty("checked");
- $("excludedFileNamesTextarea").setProperty("disabled", !isAExcludedFileNamesEnabled);
+ const isAExcludedFileNamesEnabled = $("excludedFileNamesCheckbox").checked;
+ $("excludedFileNamesTextarea").disabled = !isAExcludedFileNamesEnabled;
};
const updateExportDirEnabled = function() {
- const isExportDirEnabled = $("exportdir_checkbox").getProperty("checked");
- $("exportdir_text").setProperty("disabled", !isExportDirEnabled);
+ const isExportDirEnabled = $("exportdir_checkbox").checked;
+ $("exportdir_text").disabled = !isExportDirEnabled;
};
const updateExportDirFinEnabled = function() {
- const isExportDirFinEnabled = $("exportdirfin_checkbox").getProperty("checked");
- $("exportdirfin_text").setProperty("disabled", !isExportDirFinEnabled);
+ const isExportDirFinEnabled = $("exportdirfin_checkbox").checked;
+ $("exportdirfin_text").disabled = !isExportDirFinEnabled;
};
const updateMailNotification = function() {
- const isMailNotificationEnabled = $("mail_notification_checkbox").getProperty("checked");
- $("src_email_txt").setProperty("disabled", !isMailNotificationEnabled);
- $("dest_email_txt").setProperty("disabled", !isMailNotificationEnabled);
- $("smtp_server_txt").setProperty("disabled", !isMailNotificationEnabled);
- $("mail_ssl_checkbox").setProperty("disabled", !isMailNotificationEnabled);
- $("mail_auth_checkbox").setProperty("disabled", !isMailNotificationEnabled);
- $("mail_test_button").setProperty("disabled", !isMailNotificationEnabled);
+ const isMailNotificationEnabled = $("mail_notification_checkbox").checked;
+ $("src_email_txt").disabled = !isMailNotificationEnabled;
+ $("dest_email_txt").disabled = !isMailNotificationEnabled;
+ $("smtp_server_txt").disabled = !isMailNotificationEnabled;
+ $("mail_ssl_checkbox").disabled = !isMailNotificationEnabled;
+ $("mail_auth_checkbox").disabled = !isMailNotificationEnabled;
+ $("mail_test_button").disabled = !isMailNotificationEnabled;
if (!isMailNotificationEnabled) {
- $("mail_auth_checkbox").setProperty("checked", !isMailNotificationEnabled);
+ $("mail_auth_checkbox").checked = !isMailNotificationEnabled;
updateMailAuthSettings();
}
};
const updateMailAuthSettings = function() {
- const isMailAuthEnabled = $("mail_auth_checkbox").getProperty("checked");
- $("mail_username_text").setProperty("disabled", !isMailAuthEnabled);
- $("mail_password_text").setProperty("disabled", !isMailAuthEnabled);
+ const isMailAuthEnabled = $("mail_auth_checkbox").checked;
+ $("mail_username_text").disabled = !isMailAuthEnabled;
+ $("mail_password_text").disabled = !isMailAuthEnabled;
};
const sendTestEmail = function() {
@@ -1771,163 +1771,163 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
};
const updateAutoRunOnTorrentAdded = function() {
- const isAutoRunOnTorrentAddedEnabled = $("autorunOnTorrentAddedCheckbox").getProperty("checked");
- $("autorunOnTorrentAddedProgram").setProperty("disabled", !isAutoRunOnTorrentAddedEnabled);
+ const isAutoRunOnTorrentAddedEnabled = $("autorunOnTorrentAddedCheckbox").checked;
+ $("autorunOnTorrentAddedProgram").disabled = !isAutoRunOnTorrentAddedEnabled;
};
const updateAutoRun = function() {
- const isAutoRunEnabled = $("autorun_checkbox").getProperty("checked");
- $("autorunProg_txt").setProperty("disabled", !isAutoRunEnabled);
+ const isAutoRunEnabled = $("autorun_checkbox").checked;
+ $("autorunProg_txt").disabled = !isAutoRunEnabled;
};
// Connection tab
const updateMaxConnecEnabled = function() {
- const isMaxConnecEnabled = $("max_connec_checkbox").getProperty("checked");
- $("max_connec_value").setProperty("disabled", !isMaxConnecEnabled);
+ const isMaxConnecEnabled = $("max_connec_checkbox").checked;
+ $("max_connec_value").disabled = !isMaxConnecEnabled;
};
const updateMaxConnecPerTorrentEnabled = function() {
- const isMaxConnecPerTorrentEnabled = $("max_connec_per_torrent_checkbox").getProperty("checked");
- $("max_connec_per_torrent_value").setProperty("disabled", !isMaxConnecPerTorrentEnabled);
+ const isMaxConnecPerTorrentEnabled = $("max_connec_per_torrent_checkbox").checked;
+ $("max_connec_per_torrent_value").disabled = !isMaxConnecPerTorrentEnabled;
};
const updateMaxUploadsEnabled = function() {
- const isMaxUploadsEnabled = $("max_uploads_checkbox").getProperty("checked");
- $("max_uploads_value").setProperty("disabled", !isMaxUploadsEnabled);
+ const isMaxUploadsEnabled = $("max_uploads_checkbox").checked;
+ $("max_uploads_value").disabled = !isMaxUploadsEnabled;
};
const updateMaxUploadsPerTorrentEnabled = function() {
- const isMaxUploadsPerTorrentEnabled = $("max_uploads_per_torrent_checkbox").getProperty("checked");
- $("max_uploads_per_torrent_value").setProperty("disabled", !isMaxUploadsPerTorrentEnabled);
+ const isMaxUploadsPerTorrentEnabled = $("max_uploads_per_torrent_checkbox").checked;
+ $("max_uploads_per_torrent_value").disabled = !isMaxUploadsPerTorrentEnabled;
};
const updateI2PSettingsEnabled = function() {
- const isI2PEnabled = $("i2pEnabledCheckbox").getProperty("checked");
- $("i2pAddress").setProperty("disabled", !isI2PEnabled);
- $("i2pPort").setProperty("disabled", !isI2PEnabled);
- $("i2pMixedMode").setProperty("disabled", !isI2PEnabled);
+ const isI2PEnabled = $("i2pEnabledCheckbox").checked;
+ $("i2pAddress").disabled = !isI2PEnabled;
+ $("i2pPort").disabled = !isI2PEnabled;
+ $("i2pMixedMode").disabled = !isI2PEnabled;
};
const updatePeerProxySettings = function() {
- const proxyType = $("peer_proxy_type_select").getProperty("value");
+ const proxyType = $("peer_proxy_type_select").value;
const isProxyDisabled = (proxyType === "None");
const isProxySocks4 = (proxyType === "SOCKS4");
- $("peer_proxy_host_text").setProperty("disabled", isProxyDisabled);
- $("peer_proxy_port_value").setProperty("disabled", isProxyDisabled);
+ $("peer_proxy_host_text").disabled = isProxyDisabled;
+ $("peer_proxy_port_value").disabled = isProxyDisabled;
- $("peer_proxy_auth_checkbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
- $("proxy_bittorrent_checkbox").setProperty("disabled", isProxyDisabled);
- $("use_peer_proxy_checkbox").setProperty("disabled", (isProxyDisabled || !$("proxy_bittorrent_checkbox").getProperty("checked")));
- $("proxyHostnameLookupCheckbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
- $("proxy_rss_checkbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
- $("proxy_misc_checkbox").setProperty("disabled", (isProxyDisabled || isProxySocks4));
+ $("peer_proxy_auth_checkbox").disabled = (isProxyDisabled || isProxySocks4);
+ $("proxy_bittorrent_checkbox").disabled = isProxyDisabled;
+ $("use_peer_proxy_checkbox").disabled = (isProxyDisabled || !$("proxy_bittorrent_checkbox").checked);
+ $("proxyHostnameLookupCheckbox").disabled = (isProxyDisabled || isProxySocks4);
+ $("proxy_rss_checkbox").disabled = (isProxyDisabled || isProxySocks4);
+ $("proxy_misc_checkbox").disabled = (isProxyDisabled || isProxySocks4);
updatePeerProxyAuthSettings();
};
const updatePeerProxyAuthSettings = function() {
- const proxyType = $("peer_proxy_type_select").getProperty("value");
+ const proxyType = $("peer_proxy_type_select").value;
const isProxyDisabled = (proxyType === "None");
- const isPeerProxyAuthEnabled = (!$("peer_proxy_auth_checkbox").getProperty("disabled") && $("peer_proxy_auth_checkbox").getProperty("checked"));
- $("peer_proxy_username_text").setProperty("disabled", (isProxyDisabled || !isPeerProxyAuthEnabled));
- $("peer_proxy_password_text").setProperty("disabled", (isProxyDisabled || !isPeerProxyAuthEnabled));
+ const isPeerProxyAuthEnabled = (!$("peer_proxy_auth_checkbox").disabled && $("peer_proxy_auth_checkbox").checked);
+ $("peer_proxy_username_text").disabled = (isProxyDisabled || !isPeerProxyAuthEnabled);
+ $("peer_proxy_password_text").disabled = (isProxyDisabled || !isPeerProxyAuthEnabled);
};
const updateFilterSettings = function() {
- const isIPFilterEnabled = $("ipfilter_text_checkbox").getProperty("checked");
- $("ipfilter_text").setProperty("disabled", !isIPFilterEnabled);
+ const isIPFilterEnabled = $("ipfilter_text_checkbox").checked;
+ $("ipfilter_text").disabled = !isIPFilterEnabled;
};
// Speed tab
const updateSchedulingEnabled = function() {
- const isLimitSchedulingEnabled = $("limitSchedulingCheckbox").getProperty("checked");
- $("schedule_from_hour").setProperty("disabled", !isLimitSchedulingEnabled);
- $("schedule_from_min").setProperty("disabled", !isLimitSchedulingEnabled);
- $("schedule_to_hour").setProperty("disabled", !isLimitSchedulingEnabled);
- $("schedule_to_min").setProperty("disabled", !isLimitSchedulingEnabled);
- $("schedule_freq_select").setProperty("disabled", !isLimitSchedulingEnabled);
+ const isLimitSchedulingEnabled = $("limitSchedulingCheckbox").checked;
+ $("schedule_from_hour").disabled = !isLimitSchedulingEnabled;
+ $("schedule_from_min").disabled = !isLimitSchedulingEnabled;
+ $("schedule_to_hour").disabled = !isLimitSchedulingEnabled;
+ $("schedule_to_min").disabled = !isLimitSchedulingEnabled;
+ $("schedule_freq_select").disabled = !isLimitSchedulingEnabled;
};
// Bittorrent tab
const updateQueueingSystem = function() {
- const isQueueingEnabled = $("queueing_checkbox").getProperty("checked");
- $("max_active_dl_value").setProperty("disabled", !isQueueingEnabled);
- $("max_active_up_value").setProperty("disabled", !isQueueingEnabled);
- $("max_active_to_value").setProperty("disabled", !isQueueingEnabled);
- $("dont_count_slow_torrents_checkbox").setProperty("disabled", !isQueueingEnabled);
+ const isQueueingEnabled = $("queueing_checkbox").checked;
+ $("max_active_dl_value").disabled = !isQueueingEnabled;
+ $("max_active_up_value").disabled = !isQueueingEnabled;
+ $("max_active_to_value").disabled = !isQueueingEnabled;
+ $("dont_count_slow_torrents_checkbox").disabled = !isQueueingEnabled;
updateSlowTorrentsSettings();
};
const updateSlowTorrentsSettings = function() {
- const isDontCountSlowTorrentsEnabled = (!$("dont_count_slow_torrents_checkbox").getProperty("disabled")) && $("dont_count_slow_torrents_checkbox").getProperty("checked");
- $("dl_rate_threshold").setProperty("disabled", !isDontCountSlowTorrentsEnabled);
- $("ul_rate_threshold").setProperty("disabled", !isDontCountSlowTorrentsEnabled);
- $("torrent_inactive_timer").setProperty("disabled", !isDontCountSlowTorrentsEnabled);
+ const isDontCountSlowTorrentsEnabled = (!$("dont_count_slow_torrents_checkbox").disabled) && $("dont_count_slow_torrents_checkbox").checked;
+ $("dl_rate_threshold").disabled = !isDontCountSlowTorrentsEnabled;
+ $("ul_rate_threshold").disabled = !isDontCountSlowTorrentsEnabled;
+ $("torrent_inactive_timer").disabled = !isDontCountSlowTorrentsEnabled;
};
const updateMaxRatioTimeEnabled = function() {
- const isMaxRatioEnabled = $("max_ratio_checkbox").getProperty("checked");
- $("max_ratio_value").setProperty("disabled", !isMaxRatioEnabled);
+ const isMaxRatioEnabled = $("max_ratio_checkbox").checked;
+ $("max_ratio_value").disabled = !isMaxRatioEnabled;
- const isMaxSeedingTimeEnabled = $("max_seeding_time_checkbox").getProperty("checked");
- $("max_seeding_time_value").setProperty("disabled", !isMaxSeedingTimeEnabled);
+ const isMaxSeedingTimeEnabled = $("max_seeding_time_checkbox").checked;
+ $("max_seeding_time_value").disabled = !isMaxSeedingTimeEnabled;
- const isMaxInactiveSeedingTimeEnabled = $("max_inactive_seeding_time_checkbox").getProperty("checked");
- $("max_inactive_seeding_time_value").setProperty("disabled", !isMaxInactiveSeedingTimeEnabled);
+ const isMaxInactiveSeedingTimeEnabled = $("max_inactive_seeding_time_checkbox").checked;
+ $("max_inactive_seeding_time_value").disabled = !isMaxInactiveSeedingTimeEnabled;
- $("max_ratio_act").setProperty("disabled", !(isMaxRatioEnabled || isMaxSeedingTimeEnabled || isMaxInactiveSeedingTimeEnabled));
+ $("max_ratio_act").disabled = !(isMaxRatioEnabled || isMaxSeedingTimeEnabled || isMaxInactiveSeedingTimeEnabled);
};
const updateAddTrackersEnabled = function() {
- const isAddTrackersEnabled = $("add_trackers_checkbox").getProperty("checked");
- $("add_trackers_textarea").setProperty("disabled", !isAddTrackersEnabled);
+ const isAddTrackersEnabled = $("add_trackers_checkbox").checked;
+ $("add_trackers_textarea").disabled = !isAddTrackersEnabled;
};
// WebUI tab
const updateHttpsSettings = function() {
- const isUseHttpsEnabled = $("use_https_checkbox").getProperty("checked");
- $("ssl_cert_text").setProperty("disabled", !isUseHttpsEnabled);
- $("ssl_key_text").setProperty("disabled", !isUseHttpsEnabled);
- $("secureCookieCheckbox").setProperty("disabled", !isUseHttpsEnabled);
+ const isUseHttpsEnabled = $("use_https_checkbox").checked;
+ $("ssl_cert_text").disabled = !isUseHttpsEnabled;
+ $("ssl_key_text").disabled = !isUseHttpsEnabled;
+ $("secureCookieCheckbox").disabled = !isUseHttpsEnabled;
};
const updateBypasssAuthSettings = function() {
- const isBypassAuthSubnetWhitelistEnabled = $("bypass_auth_subnet_whitelist_checkbox").getProperty("checked");
- $("bypass_auth_subnet_whitelist_textarea").setProperty("disabled", !isBypassAuthSubnetWhitelistEnabled);
+ const isBypassAuthSubnetWhitelistEnabled = $("bypass_auth_subnet_whitelist_checkbox").checked;
+ $("bypass_auth_subnet_whitelist_textarea").disabled = !isBypassAuthSubnetWhitelistEnabled;
};
const updateAlternativeWebUISettings = function() {
- const isUseAlternativeWebUIEnabled = $("use_alt_webui_checkbox").getProperty("checked");
- $("webui_files_location_textarea").setProperty("disabled", !isUseAlternativeWebUIEnabled);
+ const isUseAlternativeWebUIEnabled = $("use_alt_webui_checkbox").checked;
+ $("webui_files_location_textarea").disabled = !isUseAlternativeWebUIEnabled;
};
const updateHostHeaderValidationSettings = function() {
- const isHostHeaderValidationEnabled = $("host_header_validation_checkbox").getProperty("checked");
- $("webui_domain_textarea").setProperty("disabled", !isHostHeaderValidationEnabled);
+ const isHostHeaderValidationEnabled = $("host_header_validation_checkbox").checked;
+ $("webui_domain_textarea").disabled = !isHostHeaderValidationEnabled;
};
const updateWebUICustomHTTPHeadersSettings = function() {
- const isEnabled = $("webUIUseCustomHTTPHeadersCheckbox").getProperty("checked");
- $("webUICustomHTTPHeadersTextarea").setProperty("disabled", !isEnabled);
+ const isEnabled = $("webUIUseCustomHTTPHeadersCheckbox").checked;
+ $("webUICustomHTTPHeadersTextarea").disabled = !isEnabled;
};
const updateWebUIReverseProxySettings = function() {
- const isEnabled = $("webUIReverseProxySupportCheckbox").getProperty("checked");
- $("webUIReverseProxiesListTextarea").setProperty("disabled", !isEnabled);
+ const isEnabled = $("webUIReverseProxySupportCheckbox").checked;
+ $("webUIReverseProxiesListTextarea").disabled = !isEnabled;
};
const updateDynDnsSettings = function() {
- const isDynDnsEnabled = $("use_dyndns_checkbox").getProperty("checked");
- $("dyndns_select").setProperty("disabled", !isDynDnsEnabled);
- $("dyndns_domain_text").setProperty("disabled", !isDynDnsEnabled);
- $("dyndns_username_text").setProperty("disabled", !isDynDnsEnabled);
- $("dyndns_password_text").setProperty("disabled", !isDynDnsEnabled);
+ const isDynDnsEnabled = $("use_dyndns_checkbox").checked;
+ $("dyndns_select").disabled = !isDynDnsEnabled;
+ $("dyndns_domain_text").disabled = !isDynDnsEnabled;
+ $("dyndns_username_text").disabled = !isDynDnsEnabled;
+ $("dyndns_password_text").disabled = !isDynDnsEnabled;
};
const registerDynDns = function() {
- if ($("dyndns_select").getProperty("value").toInt() === 1)
+ if ($("dyndns_select").value.toInt() === 1)
window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
else
window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
@@ -1937,7 +1937,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
const min = 1024;
const max = 65535;
const port = Math.floor(Math.random() * (max - min + 1) + min);
- $("port_value").setProperty("value", port);
+ $("port_value").value = port;
};
const time_padding = function(val) {
@@ -1970,7 +1970,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
ifaces.forEach((item, index) => {
$("networkInterface").options.add(new Option(item.name, item.value));
});
- $("networkInterface").setProperty("value", default_iface);
+ $("networkInterface").value = default_iface;
}
}).send();
};
@@ -1998,7 +1998,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
addresses.forEach((item, index) => {
$("optionalIPAddressToBind").options.add(new Option(item, item));
});
- $("optionalIPAddressToBind").setProperty("value", default_addr);
+ $("optionalIPAddressToBind").value = default_addr;
}
}).send();
};
@@ -2012,7 +2012,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
const lang = selected.slice(0, selected.indexOf("_"));
selected = languages.includes(lang) ? lang : "en";
}
- $("locale_select").setProperty("value", selected);
+ $("locale_select").value = selected;
};
const loadPreferences = function() {
@@ -2021,13 +2021,13 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
// Behavior tab
$("dblclickDownloadSelect").value = LocalPreferences.get("dblclick_download", "1");
$("dblclickCompleteSelect").value = LocalPreferences.get("dblclick_complete", "1");
- $("filelog_checkbox").setProperty("checked", pref.file_log_enabled);
- $("filelog_save_path_input").setProperty("value", pref.file_log_path);
- $("filelog_backup_checkbox").setProperty("checked", pref.file_log_backup_enabled);
- $("filelog_max_size_input").setProperty("value", pref.file_log_max_size);
- $("filelog_delete_old_checkbox").setProperty("checked", pref.file_log_delete_old);
- $("filelog_age_input").setProperty("value", pref.file_log_age);
- $("filelog_age_type_select").setProperty("value", pref.file_log_age_type);
+ $("filelog_checkbox").checked = pref.file_log_enabled;
+ $("filelog_save_path_input").value = pref.file_log_path;
+ $("filelog_backup_checkbox").checked = pref.file_log_backup_enabled;
+ $("filelog_max_size_input").value = pref.file_log_max_size;
+ $("filelog_delete_old_checkbox").checked = pref.file_log_delete_old;
+ $("filelog_age_input").value = pref.file_log_age;
+ $("filelog_age_type_select").value = pref.file_log_age_type;
updateFileLogEnabled();
// Downloads tab
@@ -2045,8 +2045,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
break;
}
$("contentlayout_select").getChildren("option")[index].selected = true;
- $("addToTopOfQueueCheckbox").setProperty("checked", pref.add_to_top_of_queue);
- $("dontstartdownloads_checkbox").setProperty("checked", pref.add_stopped_enabled);
+ $("addToTopOfQueueCheckbox").checked = pref.add_to_top_of_queue;
+ $("dontstartdownloads_checkbox").checked = pref.add_stopped_enabled;
switch (pref.torrent_stop_condition) {
case "None":
index = 0;
@@ -2059,38 +2059,38 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
break;
}
$("stopConditionSelect").getChildren("option")[index].selected = true;
- $("deletetorrentfileafter_checkbox").setProperty("checked", pref.auto_delete_mode);
+ $("deletetorrentfileafter_checkbox").checked = pref.auto_delete_mode;
- $("preallocateall_checkbox").setProperty("checked", pref.preallocate_all);
- $("appendext_checkbox").setProperty("checked", pref.incomplete_files_ext);
- $("unwantedfolder_checkbox").setProperty("checked", pref.use_unwanted_folder);
+ $("preallocateall_checkbox").checked = pref.preallocate_all;
+ $("appendext_checkbox").checked = pref.incomplete_files_ext;
+ $("unwantedfolder_checkbox").checked = pref.use_unwanted_folder;
// Saving Management
- $("default_tmm_combobox").setProperty("value", pref.auto_tmm_enabled);
- $("torrent_changed_tmm_combobox").setProperty("value", pref.torrent_changed_tmm_enabled);
- $("save_path_changed_tmm_combobox").setProperty("value", pref.save_path_changed_tmm_enabled);
- $("category_changed_tmm_combobox").setProperty("value", pref.category_changed_tmm_enabled);
- $("use_subcategories_checkbox").setProperty("checked", pref.use_subcategories);
- $("savepath_text").setProperty("value", pref.save_path);
- $("temppath_checkbox").setProperty("checked", pref.temp_path_enabled);
- $("temppath_text").setProperty("value", pref.temp_path);
+ $("default_tmm_combobox").value = pref.auto_tmm_enabled;
+ $("torrent_changed_tmm_combobox").value = pref.torrent_changed_tmm_enabled;
+ $("save_path_changed_tmm_combobox").value = pref.save_path_changed_tmm_enabled;
+ $("category_changed_tmm_combobox").value = pref.category_changed_tmm_enabled;
+ $("use_subcategories_checkbox").checked = pref.use_subcategories;
+ $("savepath_text").value = pref.save_path;
+ $("temppath_checkbox").checked = pref.temp_path_enabled;
+ $("temppath_text").value = pref.temp_path;
updateTempDirEnabled();
if (pref.export_dir !== "") {
- $("exportdir_checkbox").setProperty("checked", true);
- $("exportdir_text").setProperty("value", pref.export_dir);
+ $("exportdir_checkbox").checked = true;
+ $("exportdir_text").value = pref.export_dir;
}
else {
- $("exportdir_checkbox").setProperty("checked", false);
- $("exportdir_text").setProperty("value", "");
+ $("exportdir_checkbox").checked = false;
+ $("exportdir_text").value = "";
}
updateExportDirEnabled();
if (pref.export_dir_fin !== "") {
- $("exportdirfin_checkbox").setProperty("checked", true);
- $("exportdirfin_text").setProperty("value", pref.export_dir_fin);
+ $("exportdirfin_checkbox").checked = true;
+ $("exportdirfin_text").value = pref.export_dir_fin;
}
else {
- $("exportdirfin_checkbox").setProperty("checked", false);
- $("exportdirfin_text").setProperty("value", "");
+ $("exportdirfin_checkbox").checked = false;
+ $("exportdirfin_text").value = "";
}
updateExportDirFinEnabled();
@@ -2114,156 +2114,156 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
addWatchFolder();
// Excluded file names
- $("excludedFileNamesCheckbox").setProperty("checked", pref.excluded_file_names_enabled);
- $("excludedFileNamesTextarea").setProperty("value", pref.excluded_file_names);
+ $("excludedFileNamesCheckbox").checked = pref.excluded_file_names_enabled;
+ $("excludedFileNamesTextarea").value = pref.excluded_file_names;
// Email notification upon download completion
- $("mail_notification_checkbox").setProperty("checked", pref.mail_notification_enabled);
- $("src_email_txt").setProperty("value", pref.mail_notification_sender);
- $("dest_email_txt").setProperty("value", pref.mail_notification_email);
- $("smtp_server_txt").setProperty("value", pref.mail_notification_smtp);
- $("mail_ssl_checkbox").setProperty("checked", pref.mail_notification_ssl_enabled);
- $("mail_auth_checkbox").setProperty("checked", pref.mail_notification_auth_enabled);
- $("mail_username_text").setProperty("value", pref.mail_notification_username);
- $("mail_password_text").setProperty("value", pref.mail_notification_password);
+ $("mail_notification_checkbox").checked = pref.mail_notification_enabled;
+ $("src_email_txt").value = pref.mail_notification_sender;
+ $("dest_email_txt").value = pref.mail_notification_email;
+ $("smtp_server_txt").value = pref.mail_notification_smtp;
+ $("mail_ssl_checkbox").checked = pref.mail_notification_ssl_enabled;
+ $("mail_auth_checkbox").checked = pref.mail_notification_auth_enabled;
+ $("mail_username_text").value = pref.mail_notification_username;
+ $("mail_password_text").value = pref.mail_notification_password;
updateMailNotification();
updateMailAuthSettings();
// Run an external program on torrent added
- $("autorunOnTorrentAddedCheckbox").setProperty("checked", pref.autorun_on_torrent_added_enabled);
- $("autorunOnTorrentAddedProgram").setProperty("value", pref.autorun_on_torrent_added_program);
+ $("autorunOnTorrentAddedCheckbox").checked = pref.autorun_on_torrent_added_enabled;
+ $("autorunOnTorrentAddedProgram").value = pref.autorun_on_torrent_added_program;
updateAutoRunOnTorrentAdded();
// Run an external program on torrent finished
- $("autorun_checkbox").setProperty("checked", pref.autorun_enabled);
- $("autorunProg_txt").setProperty("value", pref.autorun_program);
+ $("autorun_checkbox").checked = pref.autorun_enabled;
+ $("autorunProg_txt").value = pref.autorun_program;
updateAutoRun();
// Connection tab
// Listening Port
- $("port_value").setProperty("value", pref.listen_port.toInt());
- $("upnp_checkbox").setProperty("checked", pref.upnp);
+ $("port_value").value = pref.listen_port.toInt();
+ $("upnp_checkbox").checked = pref.upnp;
// Connections Limits
const max_connec = pref.max_connec.toInt();
if (max_connec <= 0) {
- $("max_connec_checkbox").setProperty("checked", false);
- $("max_connec_value").setProperty("value", 500);
+ $("max_connec_checkbox").checked = false;
+ $("max_connec_value").value = 500;
}
else {
- $("max_connec_checkbox").setProperty("checked", true);
- $("max_connec_value").setProperty("value", max_connec);
+ $("max_connec_checkbox").checked = true;
+ $("max_connec_value").value = max_connec;
}
updateMaxConnecEnabled();
const max_connec_per_torrent = pref.max_connec_per_torrent.toInt();
if (max_connec_per_torrent <= 0) {
- $("max_connec_per_torrent_checkbox").setProperty("checked", false);
- $("max_connec_per_torrent_value").setProperty("value", 100);
+ $("max_connec_per_torrent_checkbox").checked = false;
+ $("max_connec_per_torrent_value").value = 100;
}
else {
- $("max_connec_per_torrent_checkbox").setProperty("checked", true);
- $("max_connec_per_torrent_value").setProperty("value", max_connec_per_torrent);
+ $("max_connec_per_torrent_checkbox").checked = true;
+ $("max_connec_per_torrent_value").value = max_connec_per_torrent;
}
updateMaxConnecPerTorrentEnabled();
const max_uploads = pref.max_uploads.toInt();
if (max_uploads <= 0) {
- $("max_uploads_checkbox").setProperty("checked", false);
- $("max_uploads_value").setProperty("value", 8);
+ $("max_uploads_checkbox").checked = false;
+ $("max_uploads_value").value = 8;
}
else {
- $("max_uploads_checkbox").setProperty("checked", true);
- $("max_uploads_value").setProperty("value", max_uploads);
+ $("max_uploads_checkbox").checked = true;
+ $("max_uploads_value").value = max_uploads;
}
updateMaxUploadsEnabled();
const max_uploads_per_torrent = pref.max_uploads_per_torrent.toInt();
if (max_uploads_per_torrent <= 0) {
- $("max_uploads_per_torrent_checkbox").setProperty("checked", false);
- $("max_uploads_per_torrent_value").setProperty("value", 4);
+ $("max_uploads_per_torrent_checkbox").checked = false;
+ $("max_uploads_per_torrent_value").value = 4;
}
else {
- $("max_uploads_per_torrent_checkbox").setProperty("checked", true);
- $("max_uploads_per_torrent_value").setProperty("value", max_uploads_per_torrent);
+ $("max_uploads_per_torrent_checkbox").checked = true;
+ $("max_uploads_per_torrent_value").value = max_uploads_per_torrent;
}
updateMaxUploadsPerTorrentEnabled();
// I2P
- $("i2pEnabledCheckbox").setProperty("checked", pref.i2p_enabled);
- $("i2pAddress").setProperty("value", pref.i2p_address);
- $("i2pPort").setProperty("value", pref.i2p_port);
- $("i2pMixedMode").setProperty("checked", pref.i2p_mixed_mode);
+ $("i2pEnabledCheckbox").checked = pref.i2p_enabled;
+ $("i2pAddress").value = pref.i2p_address;
+ $("i2pPort").value = pref.i2p_port;
+ $("i2pMixedMode").checked = pref.i2p_mixed_mode;
updateI2PSettingsEnabled();
// Proxy Server
- $("peer_proxy_type_select").setProperty("value", pref.proxy_type);
- $("peer_proxy_host_text").setProperty("value", pref.proxy_ip);
- $("peer_proxy_port_value").setProperty("value", pref.proxy_port);
- $("peer_proxy_auth_checkbox").setProperty("checked", pref.proxy_auth_enabled);
- $("peer_proxy_username_text").setProperty("value", pref.proxy_username);
- $("peer_proxy_password_text").setProperty("value", pref.proxy_password);
- $("proxyHostnameLookupCheckbox").setProperty("checked", pref.proxy_hostname_lookup);
- $("proxy_bittorrent_checkbox").setProperty("checked", pref.proxy_bittorrent);
- $("use_peer_proxy_checkbox").setProperty("checked", pref.proxy_peer_connections);
- $("proxy_rss_checkbox").setProperty("checked", pref.proxy_rss);
- $("proxy_misc_checkbox").setProperty("checked", pref.proxy_misc);
+ $("peer_proxy_type_select").value = pref.proxy_type;
+ $("peer_proxy_host_text").value = pref.proxy_ip;
+ $("peer_proxy_port_value").value = pref.proxy_port;
+ $("peer_proxy_auth_checkbox").checked = pref.proxy_auth_enabled;
+ $("peer_proxy_username_text").value = pref.proxy_username;
+ $("peer_proxy_password_text").value = pref.proxy_password;
+ $("proxyHostnameLookupCheckbox").checked = pref.proxy_hostname_lookup;
+ $("proxy_bittorrent_checkbox").checked = pref.proxy_bittorrent;
+ $("use_peer_proxy_checkbox").checked = pref.proxy_peer_connections;
+ $("proxy_rss_checkbox").checked = pref.proxy_rss;
+ $("proxy_misc_checkbox").checked = pref.proxy_misc;
updatePeerProxySettings();
// IP Filtering
- $("ipfilter_text_checkbox").setProperty("checked", pref.ip_filter_enabled);
- $("ipfilter_text").setProperty("value", pref.ip_filter_path);
- $("ipfilter_trackers_checkbox").setProperty("checked", pref.ip_filter_trackers);
- $("banned_IPs_textarea").setProperty("value", pref.banned_IPs);
+ $("ipfilter_text_checkbox").checked = pref.ip_filter_enabled;
+ $("ipfilter_text").value = pref.ip_filter_path;
+ $("ipfilter_trackers_checkbox").checked = pref.ip_filter_trackers;
+ $("banned_IPs_textarea").value = pref.banned_IPs;
updateFilterSettings();
// Speed tab
// Global Rate Limits
- $("up_limit_value").setProperty("value", (pref.up_limit.toInt() / 1024));
- $("dl_limit_value").setProperty("value", (pref.dl_limit.toInt() / 1024));
+ $("up_limit_value").value = (pref.up_limit.toInt() / 1024);
+ $("dl_limit_value").value = (pref.dl_limit.toInt() / 1024);
// Alternative Global Rate Limits
- $("alt_up_limit_value").setProperty("value", (pref.alt_up_limit.toInt() / 1024));
- $("alt_dl_limit_value").setProperty("value", (pref.alt_dl_limit.toInt() / 1024));
+ $("alt_up_limit_value").value = (pref.alt_up_limit.toInt() / 1024);
+ $("alt_dl_limit_value").value = (pref.alt_dl_limit.toInt() / 1024);
- $("enable_protocol_combobox").setProperty("value", pref.bittorrent_protocol);
- $("limit_utp_rate_checkbox").setProperty("checked", pref.limit_utp_rate);
- $("limit_tcp_overhead_checkbox").setProperty("checked", pref.limit_tcp_overhead);
- $("limit_lan_peers_checkbox").setProperty("checked", pref.limit_lan_peers);
+ $("enable_protocol_combobox").value = pref.bittorrent_protocol;
+ $("limit_utp_rate_checkbox").checked = pref.limit_utp_rate;
+ $("limit_tcp_overhead_checkbox").checked = pref.limit_tcp_overhead;
+ $("limit_lan_peers_checkbox").checked = pref.limit_lan_peers;
// Scheduling
- $("limitSchedulingCheckbox").setProperty("checked", pref.scheduler_enabled);
- $("schedule_from_hour").setProperty("value", time_padding(pref.schedule_from_hour));
- $("schedule_from_min").setProperty("value", time_padding(pref.schedule_from_min));
- $("schedule_to_hour").setProperty("value", time_padding(pref.schedule_to_hour));
- $("schedule_to_min").setProperty("value", time_padding(pref.schedule_to_min));
- $("schedule_freq_select").setProperty("value", pref.scheduler_days);
+ $("limitSchedulingCheckbox").checked = pref.scheduler_enabled;
+ $("schedule_from_hour").value = time_padding(pref.schedule_from_hour);
+ $("schedule_from_min").value = time_padding(pref.schedule_from_min);
+ $("schedule_to_hour").value = time_padding(pref.schedule_to_hour);
+ $("schedule_to_min").value = time_padding(pref.schedule_to_min);
+ $("schedule_freq_select").value = pref.scheduler_days;
updateSchedulingEnabled();
// Bittorrent tab
// Privacy
- $("dht_checkbox").setProperty("checked", pref.dht);
- $("pex_checkbox").setProperty("checked", pref.pex);
- $("lsd_checkbox").setProperty("checked", pref.lsd);
+ $("dht_checkbox").checked = pref.dht;
+ $("pex_checkbox").checked = pref.pex;
+ $("lsd_checkbox").checked = pref.lsd;
const encryption = pref.encryption.toInt();
$("encryption_select").getChildren("option")[encryption].selected = true;
- $("anonymous_mode_checkbox").setProperty("checked", pref.anonymous_mode);
+ $("anonymous_mode_checkbox").checked = pref.anonymous_mode;
- $("maxActiveCheckingTorrents").setProperty("value", pref.max_active_checking_torrents);
+ $("maxActiveCheckingTorrents").value = pref.max_active_checking_torrents;
// Torrent Queueing
- $("queueing_checkbox").setProperty("checked", pref.queueing_enabled);
- $("max_active_dl_value").setProperty("value", pref.max_active_downloads.toInt());
- $("max_active_up_value").setProperty("value", pref.max_active_uploads.toInt());
- $("max_active_to_value").setProperty("value", pref.max_active_torrents.toInt());
- $("dont_count_slow_torrents_checkbox").setProperty("checked", pref.dont_count_slow_torrents);
- $("dl_rate_threshold").setProperty("value", pref.slow_torrent_dl_rate_threshold.toInt());
- $("ul_rate_threshold").setProperty("value", pref.slow_torrent_ul_rate_threshold.toInt());
- $("torrent_inactive_timer").setProperty("value", pref.slow_torrent_inactive_timer.toInt());
+ $("queueing_checkbox").checked = pref.queueing_enabled;
+ $("max_active_dl_value").value = pref.max_active_downloads.toInt();
+ $("max_active_up_value").value = pref.max_active_uploads.toInt();
+ $("max_active_to_value").value = pref.max_active_torrents.toInt();
+ $("dont_count_slow_torrents_checkbox").checked = pref.dont_count_slow_torrents;
+ $("dl_rate_threshold").value = pref.slow_torrent_dl_rate_threshold.toInt();
+ $("ul_rate_threshold").value = pref.slow_torrent_ul_rate_threshold.toInt();
+ $("torrent_inactive_timer").value = pref.slow_torrent_inactive_timer.toInt();
updateQueueingSystem();
// Share Limiting
- $("max_ratio_checkbox").setProperty("checked", pref.max_ratio_enabled);
- $("max_ratio_value").setProperty("value", (pref.max_ratio_enabled ? pref.max_ratio : 1));
- $("max_seeding_time_checkbox").setProperty("checked", pref.max_seeding_time_enabled);
- $("max_seeding_time_value").setProperty("value", (pref.max_seeding_time_enabled ? pref.max_seeding_time.toInt() : 1440));
- $("max_inactive_seeding_time_checkbox").setProperty("checked", pref.max_inactive_seeding_time_enabled);
- $("max_inactive_seeding_time_value").setProperty("value", (pref.max_inactive_seeding_time_enabled ? pref.max_inactive_seeding_time.toInt() : 1440));
+ $("max_ratio_checkbox").checked = pref.max_ratio_enabled;
+ $("max_ratio_value").value = (pref.max_ratio_enabled ? pref.max_ratio : 1);
+ $("max_seeding_time_checkbox").checked = pref.max_seeding_time_enabled;
+ $("max_seeding_time_value").value = (pref.max_seeding_time_enabled ? pref.max_seeding_time.toInt() : 1440);
+ $("max_inactive_seeding_time_checkbox").checked = pref.max_inactive_seeding_time_enabled;
+ $("max_inactive_seeding_time_value").value = (pref.max_inactive_seeding_time_enabled ? pref.max_inactive_seeding_time.toInt() : 1440);
let maxRatioAct = 0;
switch (pref.max_ratio_act.toInt()) {
case 0: // Stop
@@ -2284,142 +2284,142 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
updateMaxRatioTimeEnabled();
// Add trackers
- $("add_trackers_checkbox").setProperty("checked", pref.add_trackers_enabled);
- $("add_trackers_textarea").setProperty("value", pref.add_trackers);
+ $("add_trackers_checkbox").checked = pref.add_trackers_enabled;
+ $("add_trackers_textarea").value = pref.add_trackers;
updateAddTrackersEnabled();
// RSS Tab
- $("enable_fetching_rss_feeds_checkbox").setProperty("checked", pref.rss_processing_enabled);
- $("feed_refresh_interval").setProperty("value", pref.rss_refresh_interval);
- $("feedFetchDelay").setProperty("value", pref.rss_fetch_delay);
- $("maximum_article_number").setProperty("value", pref.rss_max_articles_per_feed);
- $("enable_auto_downloading_rss_torrents_checkbox").setProperty("checked", pref.rss_auto_downloading_enabled);
- $("downlock_repack_proper_episodes").setProperty("checked", pref.rss_download_repack_proper_episodes);
- $("rss_filter_textarea").setProperty("value", pref.rss_smart_episode_filters);
+ $("enable_fetching_rss_feeds_checkbox").checked = pref.rss_processing_enabled;
+ $("feed_refresh_interval").value = pref.rss_refresh_interval;
+ $("feedFetchDelay").value = pref.rss_fetch_delay;
+ $("maximum_article_number").value = pref.rss_max_articles_per_feed;
+ $("enable_auto_downloading_rss_torrents_checkbox").checked = pref.rss_auto_downloading_enabled;
+ $("downlock_repack_proper_episodes").checked = pref.rss_download_repack_proper_episodes;
+ $("rss_filter_textarea").value = pref.rss_smart_episode_filters;
// WebUI tab
// Language
updateWebuiLocaleSelect(pref.locale);
- $("performanceWarning").setProperty("checked", pref.performance_warning);
+ $("performanceWarning").checked = pref.performance_warning;
// HTTP Server
- $("webui_domain_textarea").setProperty("value", pref.web_ui_domain_list);
- $("webui_address_value").setProperty("value", pref.web_ui_address);
- $("webui_port_value").setProperty("value", pref.web_ui_port);
- $("webui_upnp_checkbox").setProperty("checked", pref.web_ui_upnp);
- $("use_https_checkbox").setProperty("checked", pref.use_https);
- $("ssl_cert_text").setProperty("value", pref.web_ui_https_cert_path);
- $("ssl_key_text").setProperty("value", pref.web_ui_https_key_path);
+ $("webui_domain_textarea").value = pref.web_ui_domain_list;
+ $("webui_address_value").value = pref.web_ui_address;
+ $("webui_port_value").value = pref.web_ui_port;
+ $("webui_upnp_checkbox").checked = pref.web_ui_upnp;
+ $("use_https_checkbox").checked = pref.use_https;
+ $("ssl_cert_text").value = pref.web_ui_https_cert_path;
+ $("ssl_key_text").value = pref.web_ui_https_key_path;
updateHttpsSettings();
// Authentication
- $("webui_username_text").setProperty("value", pref.web_ui_username);
- $("bypass_local_auth_checkbox").setProperty("checked", pref.bypass_local_auth);
- $("bypass_auth_subnet_whitelist_checkbox").setProperty("checked", pref.bypass_auth_subnet_whitelist_enabled);
- $("bypass_auth_subnet_whitelist_textarea").setProperty("value", pref.bypass_auth_subnet_whitelist);
+ $("webui_username_text").value = pref.web_ui_username;
+ $("bypass_local_auth_checkbox").checked = pref.bypass_local_auth;
+ $("bypass_auth_subnet_whitelist_checkbox").checked = pref.bypass_auth_subnet_whitelist_enabled;
+ $("bypass_auth_subnet_whitelist_textarea").value = pref.bypass_auth_subnet_whitelist;
updateBypasssAuthSettings();
- $("webUIMaxAuthFailCountInput").setProperty("value", pref.web_ui_max_auth_fail_count.toInt());
- $("webUIBanDurationInput").setProperty("value", pref.web_ui_ban_duration.toInt());
- $("webUISessionTimeoutInput").setProperty("value", pref.web_ui_session_timeout.toInt());
+ $("webUIMaxAuthFailCountInput").value = pref.web_ui_max_auth_fail_count.toInt();
+ $("webUIBanDurationInput").value = pref.web_ui_ban_duration.toInt();
+ $("webUISessionTimeoutInput").value = pref.web_ui_session_timeout.toInt();
// Use alternative WebUI
- $("use_alt_webui_checkbox").setProperty("checked", pref.alternative_webui_enabled);
- $("webui_files_location_textarea").setProperty("value", pref.alternative_webui_path);
+ $("use_alt_webui_checkbox").checked = pref.alternative_webui_enabled;
+ $("webui_files_location_textarea").value = pref.alternative_webui_path;
updateAlternativeWebUISettings();
// Security
- $("clickjacking_protection_checkbox").setProperty("checked", pref.web_ui_clickjacking_protection_enabled);
- $("csrf_protection_checkbox").setProperty("checked", pref.web_ui_csrf_protection_enabled);
- $("secureCookieCheckbox").setProperty("checked", pref.web_ui_secure_cookie_enabled);
- $("host_header_validation_checkbox").setProperty("checked", pref.web_ui_host_header_validation_enabled);
+ $("clickjacking_protection_checkbox").checked = pref.web_ui_clickjacking_protection_enabled;
+ $("csrf_protection_checkbox").checked = pref.web_ui_csrf_protection_enabled;
+ $("secureCookieCheckbox").checked = pref.web_ui_secure_cookie_enabled;
+ $("host_header_validation_checkbox").checked = pref.web_ui_host_header_validation_enabled;
updateHostHeaderValidationSettings();
// Custom HTTP headers
- $("webUIUseCustomHTTPHeadersCheckbox").setProperty("checked", pref.web_ui_use_custom_http_headers_enabled);
- $("webUICustomHTTPHeadersTextarea").setProperty("value", pref.web_ui_custom_http_headers);
+ $("webUIUseCustomHTTPHeadersCheckbox").checked = pref.web_ui_use_custom_http_headers_enabled;
+ $("webUICustomHTTPHeadersTextarea").value = pref.web_ui_custom_http_headers;
updateWebUICustomHTTPHeadersSettings();
// Reverse Proxy
- $("webUIReverseProxySupportCheckbox").setProperty("checked", pref.web_ui_reverse_proxy_enabled);
- $("webUIReverseProxiesListTextarea").setProperty("value", pref.web_ui_reverse_proxies_list);
+ $("webUIReverseProxySupportCheckbox").checked = pref.web_ui_reverse_proxy_enabled;
+ $("webUIReverseProxiesListTextarea").value = pref.web_ui_reverse_proxies_list;
updateWebUIReverseProxySettings();
// Update my dynamic domain name
- $("use_dyndns_checkbox").setProperty("checked", pref.dyndns_enabled);
- $("dyndns_select").setProperty("value", pref.dyndns_service);
- $("dyndns_domain_text").setProperty("value", pref.dyndns_domain);
- $("dyndns_username_text").setProperty("value", pref.dyndns_username);
- $("dyndns_password_text").setProperty("value", pref.dyndns_password);
+ $("use_dyndns_checkbox").checked = pref.dyndns_enabled;
+ $("dyndns_select").value = pref.dyndns_service;
+ $("dyndns_domain_text").value = pref.dyndns_domain;
+ $("dyndns_username_text").value = pref.dyndns_username;
+ $("dyndns_password_text").value = pref.dyndns_password;
updateDynDnsSettings();
// Advanced settings
// qBittorrent section
- $("resumeDataStorageType").setProperty("value", pref.resume_data_storage_type);
- $("torrentContentRemoveOption").setProperty("value", pref.torrent_content_remove_option);
- $("memoryWorkingSetLimit").setProperty("value", pref.memory_working_set_limit);
+ $("resumeDataStorageType").value = pref.resume_data_storage_type;
+ $("torrentContentRemoveOption").value = pref.torrent_content_remove_option;
+ $("memoryWorkingSetLimit").value = pref.memory_working_set_limit;
updateNetworkInterfaces(pref.current_network_interface, pref.current_interface_name);
updateInterfaceAddresses(pref.current_network_interface, pref.current_interface_address);
- $("saveResumeDataInterval").setProperty("value", pref.save_resume_data_interval);
- $("torrentFileSizeLimit").setProperty("value", (pref.torrent_file_size_limit / 1024 / 1024));
- $("recheckTorrentsOnCompletion").setProperty("checked", pref.recheck_completed_torrents);
- $("appInstanceName").setProperty("value", pref.app_instance_name);
- $("refreshInterval").setProperty("value", pref.refresh_interval);
- $("resolvePeerCountries").setProperty("checked", pref.resolve_peer_countries);
- $("reannounceWhenAddressChanged").setProperty("checked", pref.reannounce_when_address_changed);
+ $("saveResumeDataInterval").value = pref.save_resume_data_interval;
+ $("torrentFileSizeLimit").value = (pref.torrent_file_size_limit / 1024 / 1024);
+ $("recheckTorrentsOnCompletion").checked = pref.recheck_completed_torrents;
+ $("appInstanceName").value = pref.app_instance_name;
+ $("refreshInterval").value = pref.refresh_interval;
+ $("resolvePeerCountries").checked = pref.resolve_peer_countries;
+ $("reannounceWhenAddressChanged").checked = pref.reannounce_when_address_changed;
// libtorrent section
- $("bdecodeDepthLimit").setProperty("value", pref.bdecode_depth_limit);
- $("bdecodeTokenLimit").setProperty("value", pref.bdecode_token_limit);
- $("asyncIOThreads").setProperty("value", pref.async_io_threads);
- $("hashingThreads").setProperty("value", pref.hashing_threads);
- $("filePoolSize").setProperty("value", pref.file_pool_size);
- $("outstandMemoryWhenCheckingTorrents").setProperty("value", pref.checking_memory_use);
- $("diskCache").setProperty("value", pref.disk_cache);
- $("diskCacheExpiryInterval").setProperty("value", pref.disk_cache_ttl);
- $("diskQueueSize").setProperty("value", (pref.disk_queue_size / 1024));
- $("diskIOType").setProperty("value", pref.disk_io_type);
- $("diskIOReadMode").setProperty("value", pref.disk_io_read_mode);
- $("diskIOWriteMode").setProperty("value", pref.disk_io_write_mode);
- $("coalesceReadsAndWrites").setProperty("checked", pref.enable_coalesce_read_write);
- $("pieceExtentAffinity").setProperty("checked", pref.enable_piece_extent_affinity);
- $("sendUploadPieceSuggestions").setProperty("checked", pref.enable_upload_suggestions);
- $("sendBufferWatermark").setProperty("value", pref.send_buffer_watermark);
- $("sendBufferLowWatermark").setProperty("value", pref.send_buffer_low_watermark);
- $("sendBufferWatermarkFactor").setProperty("value", pref.send_buffer_watermark_factor);
- $("connectionSpeed").setProperty("value", pref.connection_speed);
- $("socketSendBufferSize").setProperty("value", (pref.socket_send_buffer_size / 1024));
- $("socketReceiveBufferSize").setProperty("value", (pref.socket_receive_buffer_size / 1024));
- $("socketBacklogSize").setProperty("value", pref.socket_backlog_size);
- $("outgoingPortsMin").setProperty("value", pref.outgoing_ports_min);
- $("outgoingPortsMax").setProperty("value", pref.outgoing_ports_max);
- $("UPnPLeaseDuration").setProperty("value", pref.upnp_lease_duration);
- $("peerToS").setProperty("value", pref.peer_tos);
- $("utpTCPMixedModeAlgorithm").setProperty("value", pref.utp_tcp_mixed_mode);
- $("IDNSupportCheckbox").setProperty("checked", pref.idn_support_enabled);
- $("allowMultipleConnectionsFromTheSameIPAddress").setProperty("checked", pref.enable_multi_connections_from_same_ip);
- $("validateHTTPSTrackerCertificate").setProperty("checked", pref.validate_https_tracker_certificate);
- $("mitigateSSRF").setProperty("checked", pref.ssrf_mitigation);
- $("blockPeersOnPrivilegedPorts").setProperty("checked", pref.block_peers_on_privileged_ports);
- $("enableEmbeddedTracker").setProperty("checked", pref.enable_embedded_tracker);
- $("embeddedTrackerPort").setProperty("value", pref.embedded_tracker_port);
- $("embeddedTrackerPortForwarding").setProperty("checked", pref.embedded_tracker_port_forwarding);
- $("markOfTheWeb").setProperty("checked", pref.mark_of_the_web);
- $("pythonExecutablePath").setProperty("value", pref.python_executable_path);
- $("uploadSlotsBehavior").setProperty("value", pref.upload_slots_behavior);
- $("uploadChokingAlgorithm").setProperty("value", pref.upload_choking_algorithm);
- $("announceAllTrackers").setProperty("checked", pref.announce_to_all_trackers);
- $("announceAllTiers").setProperty("checked", pref.announce_to_all_tiers);
- $("announceIP").setProperty("value", pref.announce_ip);
- $("maxConcurrentHTTPAnnounces").setProperty("value", pref.max_concurrent_http_announces);
- $("stopTrackerTimeout").setProperty("value", pref.stop_tracker_timeout);
- $("peerTurnover").setProperty("value", pref.peer_turnover);
- $("peerTurnoverCutoff").setProperty("value", pref.peer_turnover_cutoff);
- $("peerTurnoverInterval").setProperty("value", pref.peer_turnover_interval);
- $("requestQueueSize").setProperty("value", pref.request_queue_size);
- $("dhtBootstrapNodes").setProperty("value", pref.dht_bootstrap_nodes);
- $("i2pInboundQuantity").setProperty("value", pref.i2p_inbound_quantity);
- $("i2pOutboundQuantity").setProperty("value", pref.i2p_outbound_quantity);
- $("i2pInboundLength").setProperty("value", pref.i2p_inbound_length);
- $("i2pOutboundLength").setProperty("value", pref.i2p_outbound_length);
+ $("bdecodeDepthLimit").value = pref.bdecode_depth_limit;
+ $("bdecodeTokenLimit").value = pref.bdecode_token_limit;
+ $("asyncIOThreads").value = pref.async_io_threads;
+ $("hashingThreads").value = pref.hashing_threads;
+ $("filePoolSize").value = pref.file_pool_size;
+ $("outstandMemoryWhenCheckingTorrents").value = pref.checking_memory_use;
+ $("diskCache").value = pref.disk_cache;
+ $("diskCacheExpiryInterval").value = pref.disk_cache_ttl;
+ $("diskQueueSize").value = (pref.disk_queue_size / 1024);
+ $("diskIOType").value = pref.disk_io_type;
+ $("diskIOReadMode").value = pref.disk_io_read_mode;
+ $("diskIOWriteMode").value = pref.disk_io_write_mode;
+ $("coalesceReadsAndWrites").checked = pref.enable_coalesce_read_write;
+ $("pieceExtentAffinity").checked = pref.enable_piece_extent_affinity;
+ $("sendUploadPieceSuggestions").checked = pref.enable_upload_suggestions;
+ $("sendBufferWatermark").value = pref.send_buffer_watermark;
+ $("sendBufferLowWatermark").value = pref.send_buffer_low_watermark;
+ $("sendBufferWatermarkFactor").value = pref.send_buffer_watermark_factor;
+ $("connectionSpeed").value = pref.connection_speed;
+ $("socketSendBufferSize").value = (pref.socket_send_buffer_size / 1024);
+ $("socketReceiveBufferSize").value = (pref.socket_receive_buffer_size / 1024);
+ $("socketBacklogSize").value = pref.socket_backlog_size;
+ $("outgoingPortsMin").value = pref.outgoing_ports_min;
+ $("outgoingPortsMax").value = pref.outgoing_ports_max;
+ $("UPnPLeaseDuration").value = pref.upnp_lease_duration;
+ $("peerToS").value = pref.peer_tos;
+ $("utpTCPMixedModeAlgorithm").value = pref.utp_tcp_mixed_mode;
+ $("IDNSupportCheckbox").checked = pref.idn_support_enabled;
+ $("allowMultipleConnectionsFromTheSameIPAddress").checked = pref.enable_multi_connections_from_same_ip;
+ $("validateHTTPSTrackerCertificate").checked = pref.validate_https_tracker_certificate;
+ $("mitigateSSRF").checked = pref.ssrf_mitigation;
+ $("blockPeersOnPrivilegedPorts").checked = pref.block_peers_on_privileged_ports;
+ $("enableEmbeddedTracker").checked = pref.enable_embedded_tracker;
+ $("embeddedTrackerPort").value = pref.embedded_tracker_port;
+ $("embeddedTrackerPortForwarding").checked = pref.embedded_tracker_port_forwarding;
+ $("markOfTheWeb").checked = pref.mark_of_the_web;
+ $("pythonExecutablePath").value = pref.python_executable_path;
+ $("uploadSlotsBehavior").value = pref.upload_slots_behavior;
+ $("uploadChokingAlgorithm").value = pref.upload_choking_algorithm;
+ $("announceAllTrackers").checked = pref.announce_to_all_trackers;
+ $("announceAllTiers").checked = pref.announce_to_all_tiers;
+ $("announceIP").value = pref.announce_ip;
+ $("maxConcurrentHTTPAnnounces").value = pref.max_concurrent_http_announces;
+ $("stopTrackerTimeout").value = pref.stop_tracker_timeout;
+ $("peerTurnover").value = pref.peer_turnover;
+ $("peerTurnoverCutoff").value = pref.peer_turnover_cutoff;
+ $("peerTurnoverInterval").value = pref.peer_turnover_interval;
+ $("requestQueueSize").value = pref.request_queue_size;
+ $("dhtBootstrapNodes").value = pref.dht_bootstrap_nodes;
+ $("i2pInboundQuantity").value = pref.i2p_inbound_quantity;
+ $("i2pOutboundQuantity").value = pref.i2p_outbound_quantity;
+ $("i2pInboundLength").value = pref.i2p_inbound_length;
+ $("i2pOutboundLength").value = pref.i2p_outbound_length;
}
});
};
@@ -2431,41 +2431,41 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
// Behavior tab
LocalPreferences.set("dblclick_download", $("dblclickDownloadSelect").value);
LocalPreferences.set("dblclick_complete", $("dblclickCompleteSelect").value);
- settings["file_log_enabled"] = $("filelog_checkbox").getProperty("checked");
- settings["file_log_path"] = $("filelog_save_path_input").getProperty("value");
- settings["file_log_backup_enabled"] = $("filelog_backup_checkbox").getProperty("checked");
- settings["file_log_max_size"] = Number($("filelog_max_size_input").getProperty("value"));
- settings["file_log_delete_old"] = $("filelog_delete_old_checkbox").getProperty("checked");
- settings["file_log_age"] = Number($("filelog_age_input").getProperty("value"));
- settings["file_log_age_type"] = Number($("filelog_age_type_select").getProperty("value"));
+ settings["file_log_enabled"] = $("filelog_checkbox").checked;
+ settings["file_log_path"] = $("filelog_save_path_input").value;
+ settings["file_log_backup_enabled"] = $("filelog_backup_checkbox").checked;
+ settings["file_log_max_size"] = Number($("filelog_max_size_input").value);
+ settings["file_log_delete_old"] = $("filelog_delete_old_checkbox").checked;
+ settings["file_log_age"] = Number($("filelog_age_input").value);
+ settings["file_log_age_type"] = Number($("filelog_age_type_select").value);
// Downloads tab
// When adding a torrent
- settings["torrent_content_layout"] = $("contentlayout_select").getSelected()[0].getProperty("value");
- settings["add_to_top_of_queue"] = $("addToTopOfQueueCheckbox").getProperty("checked");
- settings["add_stopped_enabled"] = $("dontstartdownloads_checkbox").getProperty("checked");
- settings["torrent_stop_condition"] = $("stopConditionSelect").getSelected()[0].getProperty("value");
- settings["auto_delete_mode"] = Number($("deletetorrentfileafter_checkbox").getProperty("checked"));
+ settings["torrent_content_layout"] = $("contentlayout_select").getSelected()[0].value;
+ settings["add_to_top_of_queue"] = $("addToTopOfQueueCheckbox").checked;
+ settings["add_stopped_enabled"] = $("dontstartdownloads_checkbox").checked;
+ settings["torrent_stop_condition"] = $("stopConditionSelect").getSelected()[0].value;
+ settings["auto_delete_mode"] = Number($("deletetorrentfileafter_checkbox").checked);
- settings["preallocate_all"] = $("preallocateall_checkbox").getProperty("checked");
- settings["incomplete_files_ext"] = $("appendext_checkbox").getProperty("checked");
- settings["use_unwanted_folder"] = $("unwantedfolder_checkbox").getProperty("checked");
+ settings["preallocate_all"] = $("preallocateall_checkbox").checked;
+ settings["incomplete_files_ext"] = $("appendext_checkbox").checked;
+ settings["use_unwanted_folder"] = $("unwantedfolder_checkbox").checked;
// Saving Management
- settings["auto_tmm_enabled"] = ($("default_tmm_combobox").getProperty("value") === "true");
- settings["torrent_changed_tmm_enabled"] = ($("torrent_changed_tmm_combobox").getProperty("value") === "true");
- settings["save_path_changed_tmm_enabled"] = ($("save_path_changed_tmm_combobox").getProperty("value") === "true");
- settings["category_changed_tmm_enabled"] = ($("category_changed_tmm_combobox").getProperty("value") === "true");
- settings["use_subcategories"] = $("use_subcategories_checkbox").getProperty("checked");
- settings["save_path"] = $("savepath_text").getProperty("value");
- settings["temp_path_enabled"] = $("temppath_checkbox").getProperty("checked");
- settings["temp_path"] = $("temppath_text").getProperty("value");
- if ($("exportdir_checkbox").getProperty("checked"))
- settings["export_dir"] = $("exportdir_text").getProperty("value");
+ settings["auto_tmm_enabled"] = ($("default_tmm_combobox").value === "true");
+ settings["torrent_changed_tmm_enabled"] = ($("torrent_changed_tmm_combobox").value === "true");
+ settings["save_path_changed_tmm_enabled"] = ($("save_path_changed_tmm_combobox").value === "true");
+ settings["category_changed_tmm_enabled"] = ($("category_changed_tmm_combobox").value === "true");
+ settings["use_subcategories"] = $("use_subcategories_checkbox").checked;
+ settings["save_path"] = $("savepath_text").value;
+ settings["temp_path_enabled"] = $("temppath_checkbox").checked;
+ settings["temp_path"] = $("temppath_text").value;
+ if ($("exportdir_checkbox").checked)
+ settings["export_dir"] = $("exportdir_text").value;
else
settings["export_dir"] = "";
- if ($("exportdirfin_checkbox").getProperty("checked"))
- settings["export_dir_fin"] = $("exportdirfin_text").getProperty("value");
+ if ($("exportdirfin_checkbox").checked)
+ settings["export_dir_fin"] = $("exportdirfin_text").value;
else
settings["export_dir_fin"] = "";
@@ -2473,40 +2473,40 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings["scan_dirs"] = getWatchedFolders();
// Excluded file names
- settings["excluded_file_names_enabled"] = $("excludedFileNamesCheckbox").getProperty("checked");
- settings["excluded_file_names"] = $("excludedFileNamesTextarea").getProperty("value");
+ settings["excluded_file_names_enabled"] = $("excludedFileNamesCheckbox").checked;
+ settings["excluded_file_names"] = $("excludedFileNamesTextarea").value;
// Email notification upon download completion
- settings["mail_notification_enabled"] = $("mail_notification_checkbox").getProperty("checked");
- settings["mail_notification_sender"] = $("src_email_txt").getProperty("value");
- settings["mail_notification_email"] = $("dest_email_txt").getProperty("value");
- settings["mail_notification_smtp"] = $("smtp_server_txt").getProperty("value");
- settings["mail_notification_ssl_enabled"] = $("mail_ssl_checkbox").getProperty("checked");
- settings["mail_notification_auth_enabled"] = $("mail_auth_checkbox").getProperty("checked");
- settings["mail_notification_username"] = $("mail_username_text").getProperty("value");
- settings["mail_notification_password"] = $("mail_password_text").getProperty("value");
+ settings["mail_notification_enabled"] = $("mail_notification_checkbox").checked;
+ settings["mail_notification_sender"] = $("src_email_txt").value;
+ settings["mail_notification_email"] = $("dest_email_txt").value;
+ settings["mail_notification_smtp"] = $("smtp_server_txt").value;
+ settings["mail_notification_ssl_enabled"] = $("mail_ssl_checkbox").checked;
+ settings["mail_notification_auth_enabled"] = $("mail_auth_checkbox").checked;
+ settings["mail_notification_username"] = $("mail_username_text").value;
+ settings["mail_notification_password"] = $("mail_password_text").value;
// Run an external program on torrent added
- settings["autorun_on_torrent_added_enabled"] = $("autorunOnTorrentAddedCheckbox").getProperty("checked");
- settings["autorun_on_torrent_added_program"] = $("autorunOnTorrentAddedProgram").getProperty("value");
+ settings["autorun_on_torrent_added_enabled"] = $("autorunOnTorrentAddedCheckbox").checked;
+ settings["autorun_on_torrent_added_program"] = $("autorunOnTorrentAddedProgram").value;
// Run an external program on torrent finished
- settings["autorun_enabled"] = $("autorun_checkbox").getProperty("checked");
- settings["autorun_program"] = $("autorunProg_txt").getProperty("value");
+ settings["autorun_enabled"] = $("autorun_checkbox").checked;
+ settings["autorun_program"] = $("autorunProg_txt").value;
// Connection tab
// Listening Port
- const listen_port = $("port_value").getProperty("value").toInt();
+ const listen_port = $("port_value").value.toInt();
if (isNaN(listen_port) || (listen_port < 0) || (listen_port > 65535)) {
alert("QBT_TR(The port used for incoming connections must be between 0 and 65535.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["listen_port"] = listen_port;
- settings["upnp"] = $("upnp_checkbox").getProperty("checked");
+ settings["upnp"] = $("upnp_checkbox").checked;
// Connections Limits
let max_connec = -1;
- if ($("max_connec_checkbox").getProperty("checked")) {
- max_connec = $("max_connec_value").getProperty("value").toInt();
+ if ($("max_connec_checkbox").checked) {
+ max_connec = $("max_connec_value").value.toInt();
if (isNaN(max_connec) || (max_connec <= 0)) {
alert("QBT_TR(Maximum number of connections limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
@@ -2514,8 +2514,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
}
settings["max_connec"] = max_connec;
let max_connec_per_torrent = -1;
- if ($("max_connec_per_torrent_checkbox").getProperty("checked")) {
- max_connec_per_torrent = $("max_connec_per_torrent_value").getProperty("value").toInt();
+ if ($("max_connec_per_torrent_checkbox").checked) {
+ max_connec_per_torrent = $("max_connec_per_torrent_value").value.toInt();
if (isNaN(max_connec_per_torrent) || (max_connec_per_torrent <= 0)) {
alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
@@ -2523,8 +2523,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
}
settings["max_connec_per_torrent"] = max_connec_per_torrent;
let max_uploads = -1;
- if ($("max_uploads_checkbox").getProperty("checked")) {
- max_uploads = $("max_uploads_value").getProperty("value").toInt();
+ if ($("max_uploads_checkbox").checked) {
+ max_uploads = $("max_uploads_value").value.toInt();
if (isNaN(max_uploads) || (max_uploads <= 0)) {
alert("QBT_TR(Global number of upload slots limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
@@ -2532,8 +2532,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
}
settings["max_uploads"] = max_uploads;
let max_uploads_per_torrent = -1;
- if ($("max_uploads_per_torrent_checkbox").getProperty("checked")) {
- max_uploads_per_torrent = $("max_uploads_per_torrent_value").getProperty("value").toInt();
+ if ($("max_uploads_per_torrent_checkbox").checked) {
+ max_uploads_per_torrent = $("max_uploads_per_torrent_value").value.toInt();
if (isNaN(max_uploads_per_torrent) || (max_uploads_per_torrent <= 0)) {
alert("QBT_TR(Maximum number of upload slots per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
@@ -2542,40 +2542,40 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings["max_uploads_per_torrent"] = max_uploads_per_torrent;
// I2P
- settings["i2p_enabled"] = $("i2pEnabledCheckbox").getProperty("checked");
- settings["i2p_address"] = $("i2pAddress").getProperty("value");
- settings["i2p_port"] = $("i2pPort").getProperty("value").toInt();
- settings["i2p_mixed_mode"] = $("i2pMixedMode").getProperty("checked");
+ settings["i2p_enabled"] = $("i2pEnabledCheckbox").checked;
+ settings["i2p_address"] = $("i2pAddress").value;
+ settings["i2p_port"] = $("i2pPort").value.toInt();
+ settings["i2p_mixed_mode"] = $("i2pMixedMode").checked;
// Proxy Server
- settings["proxy_type"] = $("peer_proxy_type_select").getProperty("value");
- settings["proxy_ip"] = $("peer_proxy_host_text").getProperty("value");
- settings["proxy_port"] = $("peer_proxy_port_value").getProperty("value").toInt();
- settings["proxy_auth_enabled"] = $("peer_proxy_auth_checkbox").getProperty("checked");
- settings["proxy_username"] = $("peer_proxy_username_text").getProperty("value");
- settings["proxy_password"] = $("peer_proxy_password_text").getProperty("value");
- settings["proxy_hostname_lookup"] = $("proxyHostnameLookupCheckbox").getProperty("checked");
- settings["proxy_bittorrent"] = $("proxy_bittorrent_checkbox").getProperty("checked");
- settings["proxy_peer_connections"] = $("use_peer_proxy_checkbox").getProperty("checked");
- settings["proxy_rss"] = $("proxy_rss_checkbox").getProperty("checked");
- settings["proxy_misc"] = $("proxy_misc_checkbox").getProperty("checked");
+ settings["proxy_type"] = $("peer_proxy_type_select").value;
+ settings["proxy_ip"] = $("peer_proxy_host_text").value;
+ settings["proxy_port"] = $("peer_proxy_port_value").value.toInt();
+ settings["proxy_auth_enabled"] = $("peer_proxy_auth_checkbox").checked;
+ settings["proxy_username"] = $("peer_proxy_username_text").value;
+ settings["proxy_password"] = $("peer_proxy_password_text").value;
+ settings["proxy_hostname_lookup"] = $("proxyHostnameLookupCheckbox").checked;
+ settings["proxy_bittorrent"] = $("proxy_bittorrent_checkbox").checked;
+ settings["proxy_peer_connections"] = $("use_peer_proxy_checkbox").checked;
+ settings["proxy_rss"] = $("proxy_rss_checkbox").checked;
+ settings["proxy_misc"] = $("proxy_misc_checkbox").checked;
// IP Filtering
- settings["ip_filter_enabled"] = $("ipfilter_text_checkbox").getProperty("checked");
- settings["ip_filter_path"] = $("ipfilter_text").getProperty("value");
- settings["ip_filter_trackers"] = $("ipfilter_trackers_checkbox").getProperty("checked");
- settings["banned_IPs"] = $("banned_IPs_textarea").getProperty("value");
+ settings["ip_filter_enabled"] = $("ipfilter_text_checkbox").checked;
+ settings["ip_filter_path"] = $("ipfilter_text").value;
+ settings["ip_filter_trackers"] = $("ipfilter_trackers_checkbox").checked;
+ settings["banned_IPs"] = $("banned_IPs_textarea").value;
// Speed tab
// Global Rate Limits
- const up_limit = $("up_limit_value").getProperty("value").toInt() * 1024;
+ const up_limit = $("up_limit_value").value.toInt() * 1024;
if (isNaN(up_limit) || (up_limit < 0)) {
alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["up_limit"] = up_limit;
- const dl_limit = $("dl_limit_value").getProperty("value").toInt() * 1024;
+ const dl_limit = $("dl_limit_value").value.toInt() * 1024;
if (isNaN(dl_limit) || (dl_limit < 0)) {
alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
@@ -2583,81 +2583,81 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings["dl_limit"] = dl_limit;
// Alternative Global Rate Limits
- const alt_up_limit = $("alt_up_limit_value").getProperty("value").toInt() * 1024;
+ const alt_up_limit = $("alt_up_limit_value").value.toInt() * 1024;
if (isNaN(alt_up_limit) || (alt_up_limit < 0)) {
alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["alt_up_limit"] = alt_up_limit;
- const alt_dl_limit = $("alt_dl_limit_value").getProperty("value").toInt() * 1024;
+ const alt_dl_limit = $("alt_dl_limit_value").value.toInt() * 1024;
if (isNaN(alt_dl_limit) || (alt_dl_limit < 0)) {
alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["alt_dl_limit"] = alt_dl_limit;
- settings["bittorrent_protocol"] = Number($("enable_protocol_combobox").getProperty("value"));
- settings["limit_utp_rate"] = $("limit_utp_rate_checkbox").getProperty("checked");
- settings["limit_tcp_overhead"] = $("limit_tcp_overhead_checkbox").getProperty("checked");
- settings["limit_lan_peers"] = $("limit_lan_peers_checkbox").getProperty("checked");
+ settings["bittorrent_protocol"] = Number($("enable_protocol_combobox").value);
+ settings["limit_utp_rate"] = $("limit_utp_rate_checkbox").checked;
+ settings["limit_tcp_overhead"] = $("limit_tcp_overhead_checkbox").checked;
+ settings["limit_lan_peers"] = $("limit_lan_peers_checkbox").checked;
// Scheduler
- const scheduling_enabled = $("limitSchedulingCheckbox").getProperty("checked");
+ const scheduling_enabled = $("limitSchedulingCheckbox").checked;
settings["scheduler_enabled"] = scheduling_enabled;
if (scheduling_enabled) {
- settings["schedule_from_hour"] = $("schedule_from_hour").getProperty("value").toInt();
- settings["schedule_from_min"] = $("schedule_from_min").getProperty("value").toInt();
- settings["schedule_to_hour"] = $("schedule_to_hour").getProperty("value").toInt();
- settings["schedule_to_min"] = $("schedule_to_min").getProperty("value").toInt();
- settings["scheduler_days"] = $("schedule_freq_select").getProperty("value").toInt();
+ settings["schedule_from_hour"] = $("schedule_from_hour").value.toInt();
+ settings["schedule_from_min"] = $("schedule_from_min").value.toInt();
+ settings["schedule_to_hour"] = $("schedule_to_hour").value.toInt();
+ settings["schedule_to_min"] = $("schedule_to_min").value.toInt();
+ settings["scheduler_days"] = $("schedule_freq_select").value.toInt();
}
// Bittorrent tab
// Privacy
- settings["dht"] = $("dht_checkbox").getProperty("checked");
- settings["pex"] = $("pex_checkbox").getProperty("checked");
- settings["lsd"] = $("lsd_checkbox").getProperty("checked");
- settings["encryption"] = Number($("encryption_select").getSelected()[0].getProperty("value"));
- settings["anonymous_mode"] = $("anonymous_mode_checkbox").getProperty("checked");
+ settings["dht"] = $("dht_checkbox").checked;
+ settings["pex"] = $("pex_checkbox").checked;
+ settings["lsd"] = $("lsd_checkbox").checked;
+ settings["encryption"] = Number($("encryption_select").getSelected()[0].value);
+ settings["anonymous_mode"] = $("anonymous_mode_checkbox").checked;
- settings["max_active_checking_torrents"] = Number($("maxActiveCheckingTorrents").getProperty("value"));
+ settings["max_active_checking_torrents"] = Number($("maxActiveCheckingTorrents").value);
// Torrent Queueing
- settings["queueing_enabled"] = $("queueing_checkbox").getProperty("checked");
- if ($("queueing_checkbox").getProperty("checked")) {
- const max_active_downloads = $("max_active_dl_value").getProperty("value").toInt();
+ settings["queueing_enabled"] = $("queueing_checkbox").checked;
+ if ($("queueing_checkbox").checked) {
+ const max_active_downloads = $("max_active_dl_value").value.toInt();
if (isNaN(max_active_downloads) || (max_active_downloads < -1)) {
alert("QBT_TR(Maximum active downloads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["max_active_downloads"] = max_active_downloads;
- const max_active_uploads = $("max_active_up_value").getProperty("value").toInt();
+ const max_active_uploads = $("max_active_up_value").value.toInt();
if (isNaN(max_active_uploads) || (max_active_uploads < -1)) {
alert("QBT_TR(Maximum active uploads must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["max_active_uploads"] = max_active_uploads;
- const max_active_torrents = $("max_active_to_value").getProperty("value").toInt();
+ const max_active_torrents = $("max_active_to_value").value.toInt();
if (isNaN(max_active_torrents) || (max_active_torrents < -1)) {
alert("QBT_TR(Maximum active torrents must be greater than -1.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["max_active_torrents"] = max_active_torrents;
- settings["dont_count_slow_torrents"] = $("dont_count_slow_torrents_checkbox").getProperty("checked");
- const dl_rate_threshold = $("dl_rate_threshold").getProperty("value").toInt();
+ settings["dont_count_slow_torrents"] = $("dont_count_slow_torrents_checkbox").checked;
+ const dl_rate_threshold = $("dl_rate_threshold").value.toInt();
if (isNaN(dl_rate_threshold) || (dl_rate_threshold < 1)) {
alert("QBT_TR(Download rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["slow_torrent_dl_rate_threshold"] = dl_rate_threshold;
- const ul_rate_threshold = $("ul_rate_threshold").getProperty("value").toInt();
+ const ul_rate_threshold = $("ul_rate_threshold").value.toInt();
if (isNaN(ul_rate_threshold) || (ul_rate_threshold < 1)) {
alert("QBT_TR(Upload rate threshold must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["slow_torrent_ul_rate_threshold"] = ul_rate_threshold;
- const torrent_inactive_timer = $("torrent_inactive_timer").getProperty("value").toInt();
+ const torrent_inactive_timer = $("torrent_inactive_timer").value.toInt();
if (isNaN(torrent_inactive_timer) || (torrent_inactive_timer < 1)) {
alert("QBT_TR(Torrent inactivity timer must be greater than 0.)QBT_TR[CONTEXT=HttpServer]");
return;
@@ -2667,81 +2667,81 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
// Share Ratio Limiting
let max_ratio = -1;
- if ($("max_ratio_checkbox").getProperty("checked")) {
- max_ratio = $("max_ratio_value").getProperty("value").toFloat();
+ if ($("max_ratio_checkbox").checked) {
+ max_ratio = $("max_ratio_value").value.toFloat();
if (isNaN(max_ratio) || (max_ratio < 0) || (max_ratio > 9998)) {
alert("QBT_TR(Share ratio limit must be between 0 and 9998.)QBT_TR[CONTEXT=HttpServer]");
return;
}
}
- settings["max_ratio_enabled"] = $("max_ratio_checkbox").getProperty("checked");
+ settings["max_ratio_enabled"] = $("max_ratio_checkbox").checked;
settings["max_ratio"] = max_ratio;
let max_seeding_time = -1;
- if ($("max_seeding_time_checkbox").getProperty("checked")) {
- max_seeding_time = $("max_seeding_time_value").getProperty("value").toInt();
+ if ($("max_seeding_time_checkbox").checked) {
+ max_seeding_time = $("max_seeding_time_value").value.toInt();
if (isNaN(max_seeding_time) || (max_seeding_time < 0) || (max_seeding_time > 525600)) {
alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
return;
}
}
- settings["max_seeding_time_enabled"] = $("max_seeding_time_checkbox").getProperty("checked");
+ settings["max_seeding_time_enabled"] = $("max_seeding_time_checkbox").checked;
settings["max_seeding_time"] = max_seeding_time;
- settings["max_ratio_act"] = $("max_ratio_act").getProperty("value").toInt();
+ settings["max_ratio_act"] = $("max_ratio_act").value.toInt();
let max_inactive_seeding_time = -1;
- if ($("max_inactive_seeding_time_checkbox").getProperty("checked")) {
- max_inactive_seeding_time = $("max_inactive_seeding_time_value").getProperty("value").toInt();
+ if ($("max_inactive_seeding_time_checkbox").checked) {
+ max_inactive_seeding_time = $("max_inactive_seeding_time_value").value.toInt();
if (isNaN(max_inactive_seeding_time) || (max_inactive_seeding_time < 0) || (max_inactive_seeding_time > 525600)) {
alert("QBT_TR(Seeding time limit must be between 0 and 525600 minutes.)QBT_TR[CONTEXT=HttpServer]");
return;
}
}
- settings["max_inactive_seeding_time_enabled"] = $("max_inactive_seeding_time_checkbox").getProperty("checked");
+ settings["max_inactive_seeding_time_enabled"] = $("max_inactive_seeding_time_checkbox").checked;
settings["max_inactive_seeding_time"] = max_inactive_seeding_time;
- settings["max_ratio_act"] = $("max_ratio_act").getProperty("value").toInt();
+ settings["max_ratio_act"] = $("max_ratio_act").value.toInt();
// Add trackers
- settings["add_trackers_enabled"] = $("add_trackers_checkbox").getProperty("checked");
- settings["add_trackers"] = $("add_trackers_textarea").getProperty("value");
+ settings["add_trackers_enabled"] = $("add_trackers_checkbox").checked;
+ settings["add_trackers"] = $("add_trackers_textarea").value;
// RSS Tab
- settings["rss_processing_enabled"] = $("enable_fetching_rss_feeds_checkbox").getProperty("checked");
- settings["rss_refresh_interval"] = Number($("feed_refresh_interval").getProperty("value"));
- settings["rss_fetch_delay"] = Number($("feedFetchDelay").getProperty("value"));
- settings["rss_max_articles_per_feed"] = Number($("maximum_article_number").getProperty("value"));
- settings["rss_auto_downloading_enabled"] = $("enable_auto_downloading_rss_torrents_checkbox").getProperty("checked");
- settings["rss_download_repack_proper_episodes"] = $("downlock_repack_proper_episodes").getProperty("checked");
- settings["rss_smart_episode_filters"] = $("rss_filter_textarea").getProperty("value");
+ settings["rss_processing_enabled"] = $("enable_fetching_rss_feeds_checkbox").checked;
+ settings["rss_refresh_interval"] = Number($("feed_refresh_interval").value);
+ settings["rss_fetch_delay"] = Number($("feedFetchDelay").value);
+ settings["rss_max_articles_per_feed"] = Number($("maximum_article_number").value);
+ settings["rss_auto_downloading_enabled"] = $("enable_auto_downloading_rss_torrents_checkbox").checked;
+ settings["rss_download_repack_proper_episodes"] = $("downlock_repack_proper_episodes").checked;
+ settings["rss_smart_episode_filters"] = $("rss_filter_textarea").value;
// WebUI tab
// Language
- settings["locale"] = $("locale_select").getProperty("value");
- settings["performance_warning"] = $("performanceWarning").getProperty("checked");
+ settings["locale"] = $("locale_select").value;
+ settings["performance_warning"] = $("performanceWarning").checked;
// HTTP Server
- settings["web_ui_domain_list"] = $("webui_domain_textarea").getProperty("value");
- const web_ui_address = $("webui_address_value").getProperty("value").toString();
- const web_ui_port = $("webui_port_value").getProperty("value").toInt();
+ settings["web_ui_domain_list"] = $("webui_domain_textarea").value;
+ const web_ui_address = $("webui_address_value").value.toString();
+ const web_ui_port = $("webui_port_value").value.toInt();
if (isNaN(web_ui_port) || (web_ui_port < 1) || (web_ui_port > 65535)) {
alert("QBT_TR(The port used for the WebUI must be between 1 and 65535.)QBT_TR[CONTEXT=HttpServer]");
return;
}
settings["web_ui_address"] = web_ui_address;
settings["web_ui_port"] = web_ui_port;
- settings["web_ui_upnp"] = $("webui_upnp_checkbox").getProperty("checked");
+ settings["web_ui_upnp"] = $("webui_upnp_checkbox").checked;
- const useHTTPS = $("use_https_checkbox").getProperty("checked");
+ const useHTTPS = $("use_https_checkbox").checked;
settings["use_https"] = useHTTPS;
- const httpsCertificate = $("ssl_cert_text").getProperty("value");
+ const httpsCertificate = $("ssl_cert_text").value;
settings["web_ui_https_cert_path"] = httpsCertificate;
if (useHTTPS && (httpsCertificate.length === 0)) {
alert("QBT_TR(HTTPS certificate should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
return;
}
- const httpsKey = $("ssl_key_text").getProperty("value");
+ const httpsKey = $("ssl_key_text").value;
settings["web_ui_https_key_path"] = httpsKey;
if (useHTTPS && (httpsKey.length === 0)) {
alert("QBT_TR(HTTPS key should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
@@ -2749,12 +2749,12 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
}
// Authentication
- const web_ui_username = $("webui_username_text").getProperty("value");
+ const web_ui_username = $("webui_username_text").value;
if (web_ui_username.length < 3) {
alert("QBT_TR(The WebUI username must be at least 3 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
return;
}
- const web_ui_password = $("webui_password_text").getProperty("value");
+ const web_ui_password = $("webui_password_text").value;
if ((0 < web_ui_password.length) && (web_ui_password.length < 6)) {
alert("QBT_TR(The WebUI password must be at least 6 characters long.)QBT_TR[CONTEXT=OptionsDialog]");
return;
@@ -2763,16 +2763,16 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings["web_ui_username"] = web_ui_username;
if (web_ui_password.length > 0)
settings["web_ui_password"] = web_ui_password;
- settings["bypass_local_auth"] = $("bypass_local_auth_checkbox").getProperty("checked");
- settings["bypass_auth_subnet_whitelist_enabled"] = $("bypass_auth_subnet_whitelist_checkbox").getProperty("checked");
- settings["bypass_auth_subnet_whitelist"] = $("bypass_auth_subnet_whitelist_textarea").getProperty("value");
- settings["web_ui_max_auth_fail_count"] = Number($("webUIMaxAuthFailCountInput").getProperty("value"));
- settings["web_ui_ban_duration"] = Number($("webUIBanDurationInput").getProperty("value"));
- settings["web_ui_session_timeout"] = Number($("webUISessionTimeoutInput").getProperty("value"));
+ settings["bypass_local_auth"] = $("bypass_local_auth_checkbox").checked;
+ settings["bypass_auth_subnet_whitelist_enabled"] = $("bypass_auth_subnet_whitelist_checkbox").checked;
+ settings["bypass_auth_subnet_whitelist"] = $("bypass_auth_subnet_whitelist_textarea").value;
+ settings["web_ui_max_auth_fail_count"] = Number($("webUIMaxAuthFailCountInput").value);
+ settings["web_ui_ban_duration"] = Number($("webUIBanDurationInput").value);
+ settings["web_ui_session_timeout"] = Number($("webUISessionTimeoutInput").value);
// Use alternative WebUI
- const alternative_webui_enabled = $("use_alt_webui_checkbox").getProperty("checked");
- const webui_files_location_textarea = $("webui_files_location_textarea").getProperty("value");
+ const alternative_webui_enabled = $("use_alt_webui_checkbox").checked;
+ const webui_files_location_textarea = $("webui_files_location_textarea").value;
if (alternative_webui_enabled && (webui_files_location_textarea.trim() === "")) {
alert("QBT_TR(The alternative WebUI files location cannot be blank.)QBT_TR[CONTEXT=OptionsDialog]");
return;
@@ -2781,95 +2781,95 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings["alternative_webui_path"] = webui_files_location_textarea;
// Security
- settings["web_ui_clickjacking_protection_enabled"] = $("clickjacking_protection_checkbox").getProperty("checked");
- settings["web_ui_csrf_protection_enabled"] = $("csrf_protection_checkbox").getProperty("checked");
- settings["web_ui_secure_cookie_enabled"] = $("secureCookieCheckbox").getProperty("checked");
- settings["web_ui_host_header_validation_enabled"] = $("host_header_validation_checkbox").getProperty("checked");
+ settings["web_ui_clickjacking_protection_enabled"] = $("clickjacking_protection_checkbox").checked;
+ settings["web_ui_csrf_protection_enabled"] = $("csrf_protection_checkbox").checked;
+ settings["web_ui_secure_cookie_enabled"] = $("secureCookieCheckbox").checked;
+ settings["web_ui_host_header_validation_enabled"] = $("host_header_validation_checkbox").checked;
// Custom HTTP headers
- settings["web_ui_use_custom_http_headers_enabled"] = $("webUIUseCustomHTTPHeadersCheckbox").getProperty("checked");
- settings["web_ui_custom_http_headers"] = $("webUICustomHTTPHeadersTextarea").getProperty("value");
+ settings["web_ui_use_custom_http_headers_enabled"] = $("webUIUseCustomHTTPHeadersCheckbox").checked;
+ settings["web_ui_custom_http_headers"] = $("webUICustomHTTPHeadersTextarea").value;
// Reverse Proxy
- settings["web_ui_reverse_proxy_enabled"] = $("webUIReverseProxySupportCheckbox").getProperty("checked");
- settings["web_ui_reverse_proxies_list"] = $("webUIReverseProxiesListTextarea").getProperty("value");
+ settings["web_ui_reverse_proxy_enabled"] = $("webUIReverseProxySupportCheckbox").checked;
+ settings["web_ui_reverse_proxies_list"] = $("webUIReverseProxiesListTextarea").value;
// Update my dynamic domain name
- settings["dyndns_enabled"] = $("use_dyndns_checkbox").getProperty("checked");
- settings["dyndns_service"] = Number($("dyndns_select").getProperty("value"));
- settings["dyndns_domain"] = $("dyndns_domain_text").getProperty("value");
- settings["dyndns_username"] = $("dyndns_username_text").getProperty("value");
- settings["dyndns_password"] = $("dyndns_password_text").getProperty("value");
+ settings["dyndns_enabled"] = $("use_dyndns_checkbox").checked;
+ settings["dyndns_service"] = Number($("dyndns_select").value);
+ settings["dyndns_domain"] = $("dyndns_domain_text").value;
+ settings["dyndns_username"] = $("dyndns_username_text").value;
+ settings["dyndns_password"] = $("dyndns_password_text").value;
// Update advanced settings
// qBittorrent section
- settings["resume_data_storage_type"] = $("resumeDataStorageType").getProperty("value");
- settings["torrent_content_remove_option"] = $("torrentContentRemoveOption").getProperty("value");
- settings["memory_working_set_limit"] = Number($("memoryWorkingSetLimit").getProperty("value"));
- settings["current_network_interface"] = $("networkInterface").getProperty("value");
- settings["current_interface_address"] = $("optionalIPAddressToBind").getProperty("value");
- settings["save_resume_data_interval"] = Number($("saveResumeDataInterval").getProperty("value"));
- settings["torrent_file_size_limit"] = ($("torrentFileSizeLimit").getProperty("value") * 1024 * 1024);
- settings["recheck_completed_torrents"] = $("recheckTorrentsOnCompletion").getProperty("checked");
- settings["app_instance_name"] = $("appInstanceName").getProperty("value");
- settings["refresh_interval"] = Number($("refreshInterval").getProperty("value"));
- settings["resolve_peer_countries"] = $("resolvePeerCountries").getProperty("checked");
- settings["reannounce_when_address_changed"] = $("reannounceWhenAddressChanged").getProperty("checked");
+ settings["resume_data_storage_type"] = $("resumeDataStorageType").value;
+ settings["torrent_content_remove_option"] = $("torrentContentRemoveOption").value;
+ settings["memory_working_set_limit"] = Number($("memoryWorkingSetLimit").value);
+ settings["current_network_interface"] = $("networkInterface").value;
+ settings["current_interface_address"] = $("optionalIPAddressToBind").value;
+ settings["save_resume_data_interval"] = Number($("saveResumeDataInterval").value);
+ settings["torrent_file_size_limit"] = ($("torrentFileSizeLimit").value * 1024 * 1024);
+ settings["recheck_completed_torrents"] = $("recheckTorrentsOnCompletion").checked;
+ settings["app_instance_name"] = $("appInstanceName").value;
+ settings["refresh_interval"] = Number($("refreshInterval").value);
+ settings["resolve_peer_countries"] = $("resolvePeerCountries").checked;
+ settings["reannounce_when_address_changed"] = $("reannounceWhenAddressChanged").checked;
// libtorrent section
- settings["bdecode_depth_limit"] = Number($("bdecodeDepthLimit").getProperty("value"));
- settings["bdecode_token_limit"] = Number($("bdecodeTokenLimit").getProperty("value"));
- settings["async_io_threads"] = Number($("asyncIOThreads").getProperty("value"));
- settings["hashing_threads"] = Number($("hashingThreads").getProperty("value"));
- settings["file_pool_size"] = Number($("filePoolSize").getProperty("value"));
- settings["checking_memory_use"] = Number($("outstandMemoryWhenCheckingTorrents").getProperty("value"));
- settings["disk_cache"] = Number($("diskCache").getProperty("value"));
- settings["disk_cache_ttl"] = Number($("diskCacheExpiryInterval").getProperty("value"));
- settings["disk_queue_size"] = (Number($("diskQueueSize").getProperty("value")) * 1024);
- settings["disk_io_type"] = Number($("diskIOType").getProperty("value"));
- settings["disk_io_read_mode"] = Number($("diskIOReadMode").getProperty("value"));
- settings["disk_io_write_mode"] = Number($("diskIOWriteMode").getProperty("value"));
- settings["enable_coalesce_read_write"] = $("coalesceReadsAndWrites").getProperty("checked");
- settings["enable_piece_extent_affinity"] = $("pieceExtentAffinity").getProperty("checked");
- settings["enable_upload_suggestions"] = $("sendUploadPieceSuggestions").getProperty("checked");
- settings["send_buffer_watermark"] = Number($("sendBufferWatermark").getProperty("value"));
- settings["send_buffer_low_watermark"] = Number($("sendBufferLowWatermark").getProperty("value"));
- settings["send_buffer_watermark_factor"] = Number($("sendBufferWatermarkFactor").getProperty("value"));
- settings["connection_speed"] = Number($("connectionSpeed").getProperty("value"));
- settings["socket_send_buffer_size"] = ($("socketSendBufferSize").getProperty("value") * 1024);
- settings["socket_receive_buffer_size"] = ($("socketReceiveBufferSize").getProperty("value") * 1024);
- settings["socket_backlog_size"] = Number($("socketBacklogSize").getProperty("value"));
- settings["outgoing_ports_min"] = Number($("outgoingPortsMin").getProperty("value"));
- settings["outgoing_ports_max"] = Number($("outgoingPortsMax").getProperty("value"));
- settings["upnp_lease_duration"] = Number($("UPnPLeaseDuration").getProperty("value"));
- settings["peer_tos"] = Number($("peerToS").getProperty("value"));
- settings["utp_tcp_mixed_mode"] = Number($("utpTCPMixedModeAlgorithm").getProperty("value"));
- settings["idn_support_enabled"] = $("IDNSupportCheckbox").getProperty("checked");
- settings["enable_multi_connections_from_same_ip"] = $("allowMultipleConnectionsFromTheSameIPAddress").getProperty("checked");
- settings["validate_https_tracker_certificate"] = $("validateHTTPSTrackerCertificate").getProperty("checked");
- settings["ssrf_mitigation"] = $("mitigateSSRF").getProperty("checked");
- settings["block_peers_on_privileged_ports"] = $("blockPeersOnPrivilegedPorts").getProperty("checked");
- settings["enable_embedded_tracker"] = $("enableEmbeddedTracker").getProperty("checked");
- settings["embedded_tracker_port"] = Number($("embeddedTrackerPort").getProperty("value"));
- settings["embedded_tracker_port_forwarding"] = $("embeddedTrackerPortForwarding").getProperty("checked");
- settings["mark_of_the_web"] = $("markOfTheWeb").getProperty("checked");
- settings["python_executable_path"] = $("pythonExecutablePath").getProperty("value");
- settings["upload_slots_behavior"] = Number($("uploadSlotsBehavior").getProperty("value"));
- settings["upload_choking_algorithm"] = Number($("uploadChokingAlgorithm").getProperty("value"));
- settings["announce_to_all_trackers"] = $("announceAllTrackers").getProperty("checked");
- settings["announce_to_all_tiers"] = $("announceAllTiers").getProperty("checked");
- settings["announce_ip"] = $("announceIP").getProperty("value");
- settings["max_concurrent_http_announces"] = Number($("maxConcurrentHTTPAnnounces").getProperty("value"));
- settings["stop_tracker_timeout"] = Number($("stopTrackerTimeout").getProperty("value"));
- settings["peer_turnover"] = Number($("peerTurnover").getProperty("value"));
- settings["peer_turnover_cutoff"] = Number($("peerTurnoverCutoff").getProperty("value"));
- settings["peer_turnover_interval"] = Number($("peerTurnoverInterval").getProperty("value"));
- settings["request_queue_size"] = Number($("requestQueueSize").getProperty("value"));
- settings["dht_bootstrap_nodes"] = $("dhtBootstrapNodes").getProperty("value");
- settings["i2p_inbound_quantity"] = Number($("i2pInboundQuantity").getProperty("value"));
- settings["i2p_outbound_quantity"] = Number($("i2pOutboundQuantity").getProperty("value"));
- settings["i2p_inbound_length"] = Number($("i2pInboundLength").getProperty("value"));
- settings["i2p_outbound_length"] = Number($("i2pOutboundLength").getProperty("value"));
+ settings["bdecode_depth_limit"] = Number($("bdecodeDepthLimit").value);
+ settings["bdecode_token_limit"] = Number($("bdecodeTokenLimit").value);
+ settings["async_io_threads"] = Number($("asyncIOThreads").value);
+ settings["hashing_threads"] = Number($("hashingThreads").value);
+ settings["file_pool_size"] = Number($("filePoolSize").value);
+ settings["checking_memory_use"] = Number($("outstandMemoryWhenCheckingTorrents").value);
+ settings["disk_cache"] = Number($("diskCache").value);
+ settings["disk_cache_ttl"] = Number($("diskCacheExpiryInterval").value);
+ settings["disk_queue_size"] = (Number($("diskQueueSize").value) * 1024);
+ settings["disk_io_type"] = Number($("diskIOType").value);
+ settings["disk_io_read_mode"] = Number($("diskIOReadMode").value);
+ settings["disk_io_write_mode"] = Number($("diskIOWriteMode").value);
+ settings["enable_coalesce_read_write"] = $("coalesceReadsAndWrites").checked;
+ settings["enable_piece_extent_affinity"] = $("pieceExtentAffinity").checked;
+ settings["enable_upload_suggestions"] = $("sendUploadPieceSuggestions").checked;
+ settings["send_buffer_watermark"] = Number($("sendBufferWatermark").value);
+ settings["send_buffer_low_watermark"] = Number($("sendBufferLowWatermark").value);
+ settings["send_buffer_watermark_factor"] = Number($("sendBufferWatermarkFactor").value);
+ settings["connection_speed"] = Number($("connectionSpeed").value);
+ settings["socket_send_buffer_size"] = ($("socketSendBufferSize").value * 1024);
+ settings["socket_receive_buffer_size"] = ($("socketReceiveBufferSize").value * 1024);
+ settings["socket_backlog_size"] = Number($("socketBacklogSize").value);
+ settings["outgoing_ports_min"] = Number($("outgoingPortsMin").value);
+ settings["outgoing_ports_max"] = Number($("outgoingPortsMax").value);
+ settings["upnp_lease_duration"] = Number($("UPnPLeaseDuration").value);
+ settings["peer_tos"] = Number($("peerToS").value);
+ settings["utp_tcp_mixed_mode"] = Number($("utpTCPMixedModeAlgorithm").value);
+ settings["idn_support_enabled"] = $("IDNSupportCheckbox").checked;
+ settings["enable_multi_connections_from_same_ip"] = $("allowMultipleConnectionsFromTheSameIPAddress").checked;
+ settings["validate_https_tracker_certificate"] = $("validateHTTPSTrackerCertificate").checked;
+ settings["ssrf_mitigation"] = $("mitigateSSRF").checked;
+ settings["block_peers_on_privileged_ports"] = $("blockPeersOnPrivilegedPorts").checked;
+ settings["enable_embedded_tracker"] = $("enableEmbeddedTracker").checked;
+ settings["embedded_tracker_port"] = Number($("embeddedTrackerPort").value);
+ settings["embedded_tracker_port_forwarding"] = $("embeddedTrackerPortForwarding").checked;
+ settings["mark_of_the_web"] = $("markOfTheWeb").checked;
+ settings["python_executable_path"] = $("pythonExecutablePath").value;
+ settings["upload_slots_behavior"] = Number($("uploadSlotsBehavior").value);
+ settings["upload_choking_algorithm"] = Number($("uploadChokingAlgorithm").value);
+ settings["announce_to_all_trackers"] = $("announceAllTrackers").checked;
+ settings["announce_to_all_tiers"] = $("announceAllTiers").checked;
+ settings["announce_ip"] = $("announceIP").value;
+ settings["max_concurrent_http_announces"] = Number($("maxConcurrentHTTPAnnounces").value);
+ settings["stop_tracker_timeout"] = Number($("stopTrackerTimeout").value);
+ settings["peer_turnover"] = Number($("peerTurnover").value);
+ settings["peer_turnover_cutoff"] = Number($("peerTurnoverCutoff").value);
+ settings["peer_turnover_interval"] = Number($("peerTurnoverInterval").value);
+ settings["request_queue_size"] = Number($("requestQueueSize").value);
+ settings["dht_bootstrap_nodes"] = $("dhtBootstrapNodes").value;
+ settings["i2p_inbound_quantity"] = Number($("i2pInboundQuantity").value);
+ settings["i2p_outbound_quantity"] = Number($("i2pOutboundQuantity").value);
+ settings["i2p_inbound_length"] = Number($("i2pInboundLength").value);
+ settings["i2p_outbound_length"] = Number($("i2pOutboundLength").value);
// Send it to qBT
window.parent.qBittorrent.Cache.preferences.set({
@@ -2915,7 +2915,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
$("rowMarkOfTheWeb").style.display = "none";
$("networkInterface").addEvent("change", function() {
- updateInterfaceAddresses($(this).getProperty("value"), "");
+ updateInterfaceAddresses($(this).value, "");
});
loadPreferences();
diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html
index 3573bf91e..805a389a2 100644
--- a/src/webui/www/private/views/rss.html
+++ b/src/webui/www/private/views/rss.html
@@ -405,12 +405,12 @@
$("rssDetailsView").append((() => {
const torrentName = document.createElement("p");
torrentName.innerText = article.title;
- torrentName.setAttribute("id", "rssTorrentDetailsName");
+ torrentName.id = "rssTorrentDetailsName";
return torrentName;
})());
$("rssDetailsView").append((() => {
const torrentDate = document.createElement("div");
- torrentDate.setAttribute("id", "rssTorrentDetailsDate");
+ torrentDate.id = "rssTorrentDetailsDate";
const torrentDateDesc = document.createElement("b");
torrentDateDesc.innerText = "QBT_TR(Date: )QBT_TR[CONTEXT=RSSWidget]";
diff --git a/src/webui/www/public/scripts/login.js b/src/webui/www/public/scripts/login.js
index 00cb5c412..730aeec26 100644
--- a/src/webui/www/public/scripts/login.js
+++ b/src/webui/www/public/scripts/login.js
@@ -131,7 +131,7 @@ function submitLoginForm(event) {
document.addEventListener("DOMContentLoaded", () => {
const loginForm = document.getElementById("loginform");
- loginForm.setAttribute("method", "POST");
+ loginForm.method = "POST";
loginForm.addEventListener("submit", submitLoginForm);
setupI18n();