mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 23:42:46 -07:00
WebUI: enforce string quotes coding style
This commit is contained in:
parent
6d073771ca
commit
cb90b6769c
58 changed files with 3522 additions and 3514 deletions
|
@ -21,7 +21,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined) {
|
||||
window.qBittorrent = {};
|
||||
|
@ -40,8 +40,8 @@ window.qBittorrent.Download = (function() {
|
|||
|
||||
const getCategories = function() {
|
||||
new Request.JSON({
|
||||
url: 'api/v2/torrents/categories',
|
||||
method: 'get',
|
||||
url: "api/v2/torrents/categories",
|
||||
method: "get",
|
||||
noCache: true,
|
||||
onSuccess: function(data) {
|
||||
if (data) {
|
||||
|
@ -49,9 +49,9 @@ window.qBittorrent.Download = (function() {
|
|||
for (const i in data) {
|
||||
const category = data[i];
|
||||
const option = new Element("option");
|
||||
option.set('value', category.name);
|
||||
option.set('html', category.name);
|
||||
$('categorySelect').appendChild(option);
|
||||
option.set("value", category.name);
|
||||
option.set("html", category.name);
|
||||
$("categorySelect").appendChild(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,36 +62,36 @@ window.qBittorrent.Download = (function() {
|
|||
const pref = window.parent.qBittorrent.Cache.preferences.get();
|
||||
|
||||
defaultSavePath = pref.save_path;
|
||||
$('savepath').setProperty('value', defaultSavePath);
|
||||
$('startTorrent').checked = !pref.add_stopped_enabled;
|
||||
$('addToTopOfQueue').checked = pref.add_to_top_of_queue;
|
||||
$("savepath").setProperty("value", defaultSavePath);
|
||||
$("startTorrent").checked = !pref.add_stopped_enabled;
|
||||
$("addToTopOfQueue").checked = pref.add_to_top_of_queue;
|
||||
|
||||
if (pref.auto_tmm_enabled === 1) {
|
||||
$('autoTMM').selectedIndex = 1;
|
||||
$('savepath').disabled = true;
|
||||
$("autoTMM").selectedIndex = 1;
|
||||
$("savepath").disabled = true;
|
||||
}
|
||||
else {
|
||||
$('autoTMM').selectedIndex = 0;
|
||||
$("autoTMM").selectedIndex = 0;
|
||||
}
|
||||
|
||||
if (pref.torrent_stop_condition === "MetadataReceived") {
|
||||
$('stopCondition').selectedIndex = 1;
|
||||
$("stopCondition").selectedIndex = 1;
|
||||
}
|
||||
else if (pref.torrent_stop_condition === "FilesChecked") {
|
||||
$('stopCondition').selectedIndex = 2;
|
||||
$("stopCondition").selectedIndex = 2;
|
||||
}
|
||||
else {
|
||||
$('stopCondition').selectedIndex = 0;
|
||||
$("stopCondition").selectedIndex = 0;
|
||||
}
|
||||
|
||||
if (pref.torrent_content_layout === "Subfolder") {
|
||||
$('contentLayout').selectedIndex = 1;
|
||||
$("contentLayout").selectedIndex = 1;
|
||||
}
|
||||
else if (pref.torrent_content_layout === "NoSubfolder") {
|
||||
$('contentLayout').selectedIndex = 2;
|
||||
$("contentLayout").selectedIndex = 2;
|
||||
}
|
||||
else {
|
||||
$('contentLayout').selectedIndex = 0;
|
||||
$("contentLayout").selectedIndex = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -101,37 +101,37 @@ window.qBittorrent.Download = (function() {
|
|||
item.nextElementSibling.value = "";
|
||||
item.nextElementSibling.select();
|
||||
|
||||
if ($('autoTMM').selectedIndex === 1)
|
||||
$('savepath').value = defaultSavePath;
|
||||
if ($("autoTMM").selectedIndex === 1)
|
||||
$("savepath").value = defaultSavePath;
|
||||
}
|
||||
else {
|
||||
item.nextElementSibling.hidden = true;
|
||||
const text = item.options[item.selectedIndex].textContent;
|
||||
item.nextElementSibling.value = text;
|
||||
|
||||
if ($('autoTMM').selectedIndex === 1) {
|
||||
if ($("autoTMM").selectedIndex === 1) {
|
||||
const categoryName = item.value;
|
||||
const category = categories[categoryName];
|
||||
let savePath = defaultSavePath;
|
||||
if (category !== undefined)
|
||||
savePath = (category['savePath'] !== "") ? category['savePath'] : `${defaultSavePath}/${categoryName}`;
|
||||
$('savepath').value = savePath;
|
||||
savePath = (category["savePath"] !== "") ? category["savePath"] : `${defaultSavePath}/${categoryName}`;
|
||||
$("savepath").value = savePath;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const changeTMM = function(item) {
|
||||
if (item.selectedIndex === 1) {
|
||||
$('savepath').disabled = true;
|
||||
$("savepath").disabled = true;
|
||||
|
||||
const categorySelect = $('categorySelect');
|
||||
const categorySelect = $("categorySelect");
|
||||
const categoryName = categorySelect.options[categorySelect.selectedIndex].value;
|
||||
const category = categories[categoryName];
|
||||
$('savepath').value = (category === undefined) ? "" : category['savePath'];
|
||||
$("savepath").value = (category === undefined) ? "" : category["savePath"];
|
||||
}
|
||||
else {
|
||||
$('savepath').disabled = false;
|
||||
$('savepath').value = defaultSavePath;
|
||||
$("savepath").disabled = false;
|
||||
$("savepath").value = defaultSavePath;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue