diff --git a/src/webui/www/.eslintrc.json b/src/webui/www/.eslintrc.json
index c2cb0a275..92f607d69 100644
--- a/src/webui/www/.eslintrc.json
+++ b/src/webui/www/.eslintrc.json
@@ -9,6 +9,8 @@
],
"rules": {
"no-undef": "off",
- "no-unused-vars": "off"
+ "no-unused-vars": "off",
+ "nonblock-statement-body-position": ["error", "below"],
+ "semi": "error"
}
}
diff --git a/src/webui/www/private/addpeers.html b/src/webui/www/private/addpeers.html
index 68d2b5daa..b665e5e75 100644
--- a/src/webui/www/private/addpeers.html
+++ b/src/webui/www/private/addpeers.html
@@ -36,7 +36,7 @@
const peers = $('peers').get('value').trim().split(/[\r\n]+/);
if (peers.length === 0)
- return
+ return;
new Request({
url: 'api/v2/torrents/addPeers',
diff --git a/src/webui/www/private/downloadlimit.html b/src/webui/www/private/downloadlimit.html
index 87a327bcf..4371c9fb1 100644
--- a/src/webui/www/private/downloadlimit.html
+++ b/src/webui/www/private/downloadlimit.html
@@ -53,7 +53,7 @@
}
}).send();
}
- }
+ };
diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js
index eaa120e18..3f3ddf44d 100644
--- a/src/webui/www/private/scripts/client.js
+++ b/src/webui/www/private/scripts/client.js
@@ -91,7 +91,7 @@ const getShowFiltersSidebar = function() {
// Show Filters Sidebar is enabled by default
const show = LocalPreferences.get('show_filters_sidebar');
return (show === null) || (show === 'true');
-}
+};
function genHash(string) {
// origins:
@@ -112,7 +112,8 @@ const fetchQbtVersion = function() {
url: 'api/v2/app/version',
method: 'get',
onSuccess: function(info) {
- if (!info) return;
+ if (!info)
+ return;
sessionStorage.setItem('qbtVersion', info);
}
}).send();
@@ -245,7 +246,7 @@ window.addEvent('load', function() {
toggleFilterDisplay = function(filter) {
const element = filter + "FilterList";
LocalPreferences.set('filter_' + filter + "_collapsed", !$(element).hasClass("invisible"));
- $(element).toggleClass("invisible")
+ $(element).toggleClass("invisible");
const parent = $(element).getParent(".filterWrapper");
const toggleIcon = $(parent).getChildren(".filterTitle img");
if (toggleIcon)
diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js
index 812299dbe..6bac90071 100644
--- a/src/webui/www/private/scripts/contextmenu.js
+++ b/src/webui/www/private/scripts/contextmenu.js
@@ -605,6 +605,7 @@ window.qBittorrent.ContextMenu = (function() {
this.hideItem('newFolder');
this.hideItem('updateAll');
this.showItem('copyFeedURL');
+ break;
}
}
});
@@ -661,6 +662,7 @@ window.qBittorrent.ContextMenu = (function() {
this.showItem('deleteRule');
this.hideItem('renameRule');
this.showItem('clearDownloadedEpisodes');
+ break;
}
}
});
diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js
index b67768dba..0f10d4553 100644
--- a/src/webui/www/private/scripts/dynamicTable.js
+++ b/src/webui/www/private/scripts/dynamicTable.js
@@ -241,7 +241,8 @@ window.qBittorrent.DynamicTable = (function() {
const val = LocalPreferences.get('columns_order_' + this.dynamicTableDivId).split(',');
val.erase(el.columnName);
let pos = val.indexOf(this.lastHoverTh.columnName);
- if (this.dropSide === 'right') ++pos;
+ if (this.dropSide === 'right')
+ ++pos;
val.splice(pos, 0, el.columnName);
LocalPreferences.set('columns_order_' + this.dynamicTableDivId, val.join(','));
this.loadColumnsOrder();
@@ -383,10 +384,11 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (this.getRowValue(row1) > this.getRowValue(row2))
return 1;
- else return 0;
+ else
+ return 0;
};
column['updateTd'] = function(td, row) {
- const value = this.getRowValue(row)
+ const value = this.getRowValue(row);
td.set('text', value);
td.set('title', value);
};
@@ -401,7 +403,8 @@ window.qBittorrent.DynamicTable = (function() {
loadColumnsOrder: function() {
const columnsOrder = [];
const val = LocalPreferences.get('columns_order_' + this.dynamicTableDivId);
- if (val === null || val === undefined) return;
+ if (val === null || val === undefined)
+ return;
val.split(',').forEach(function(v) {
if ((v in this.columns) && (!columnsOrder.contains(v)))
columnsOrder.push(v);
@@ -989,7 +992,8 @@ window.qBittorrent.DynamicTable = (function() {
// status
this.columns['status'].updateTd = function(td, row) {
const state = this.getRowValue(row);
- if (!state) return;
+ if (!state)
+ return;
let status;
switch (state) {
@@ -1071,7 +1075,8 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (row1_val > row2_val)
return 1;
- else return 0;
+ else
+ return 0;
};
// name, category, tags
@@ -1155,7 +1160,8 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (num_seeds1 > num_seeds2)
return 1;
- else return 0;
+ else
+ return 0;
};
// num_leechs
@@ -1402,7 +1408,8 @@ window.qBittorrent.DynamicTable = (function() {
const rows = this.rows.getValues();
for (let i = 0; i < rows.length; ++i)
- if (this.applyFilter(rows[i], filterName, categoryHash, tagHash, trackerHash, null)) ++cnt;
+ if (this.applyFilter(rows[i], filterName, categoryHash, tagHash, trackerHash, null))
+ ++cnt;
return cnt;
},
@@ -1608,13 +1615,13 @@ window.qBittorrent.DynamicTable = (function() {
const size = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), false);
td.set('text', size);
td.set('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);
- }
+ };
this.columns['fileSize'].updateTd = displaySize;
this.columns['nbSeeders'].updateTd = displayNum;
@@ -1635,7 +1642,7 @@ window.qBittorrent.DynamicTable = (function() {
return {
min: minSize,
max: maxSize
- }
+ };
};
const getSeedsFilters = function() {
@@ -1651,7 +1658,7 @@ window.qBittorrent.DynamicTable = (function() {
return {
min: minSeeds,
max: maxSeeds
- }
+ };
};
let filteredRows = [];
@@ -1666,12 +1673,18 @@ window.qBittorrent.DynamicTable = (function() {
for (let i = 0; i < rows.length; ++i) {
const row = rows[i];
- if (searchInTorrentName && !window.qBittorrent.Misc.containsAllTerms(row.full_data.fileName, searchTerms)) continue;
- if ((filterTerms.length > 0) && !window.qBittorrent.Misc.containsAllTerms(row.full_data.fileName, filterTerms)) continue;
- if ((sizeFilters.min > 0.00) && (row.full_data.fileSize < sizeFilters.min)) continue;
- if ((sizeFilters.max > 0.00) && (row.full_data.fileSize > sizeFilters.max)) continue;
- if ((seedsFilters.min > 0) && (row.full_data.nbSeeders < seedsFilters.min)) continue;
- if ((seedsFilters.max > 0) && (row.full_data.nbSeeders > seedsFilters.max)) continue;
+ if (searchInTorrentName && !window.qBittorrent.Misc.containsAllTerms(row.full_data.fileName, searchTerms))
+ continue;
+ if ((filterTerms.length > 0) && !window.qBittorrent.Misc.containsAllTerms(row.full_data.fileName, filterTerms))
+ continue;
+ if ((sizeFilters.min > 0.00) && (row.full_data.fileSize < sizeFilters.min))
+ continue;
+ if ((sizeFilters.max > 0.00) && (row.full_data.fileSize > sizeFilters.max))
+ continue;
+ if ((seedsFilters.min > 0) && (row.full_data.nbSeeders < seedsFilters.min))
+ continue;
+ if ((seedsFilters.max > 0) && (row.full_data.nbSeeders > seedsFilters.max))
+ continue;
filteredRows.push(row);
}
@@ -2226,10 +2239,11 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (this.getRowValue(row1) > this.getRowValue(row2))
return 1;
- else return 0;
+ else
+ return 0;
};
column['updateTd'] = function(td, row) {
- const value = this.getRowValue(row)
+ const value = this.getRowValue(row);
td.set('text', value);
td.set('title', value);
};
@@ -2322,10 +2336,11 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (this.getRowValue(row1) > this.getRowValue(row2))
return 1;
- else return 0;
+ else
+ return 0;
};
column['updateTd'] = function(td, row) {
- const value = this.getRowValue(row)
+ const value = this.getRowValue(row);
td.set('text', value);
td.set('title', value);
};
@@ -2408,10 +2423,11 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (this.getRowValue(row1) > this.getRowValue(row2))
return 1;
- else return 0;
+ else
+ return 0;
};
column['updateTd'] = function(td, row) {
- const value = this.getRowValue(row)
+ const value = this.getRowValue(row);
td.set('text', value);
td.set('title', value);
};
@@ -2495,10 +2511,11 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (this.getRowValue(row1) > this.getRowValue(row2))
return 1;
- else return 0;
+ else
+ return 0;
};
column['updateTd'] = function(td, row) {
- const value = this.getRowValue(row)
+ const value = this.getRowValue(row);
td.set('text', value);
td.set('title', value);
};
@@ -2545,10 +2562,11 @@ window.qBittorrent.DynamicTable = (function() {
return -1;
else if (this.getRowValue(row1) > this.getRowValue(row2))
return 1;
- else return 0;
+ else
+ return 0;
};
column['updateTd'] = function(td, row) {
- const value = this.getRowValue(row)
+ const value = this.getRowValue(row);
td.set('text', value);
td.set('title', value);
};
diff --git a/src/webui/www/private/scripts/misc.js b/src/webui/www/private/scripts/misc.js
index d456648b4..0c5685f0c 100644
--- a/src/webui/www/private/scripts/misc.js
+++ b/src/webui/www/private/scripts/misc.js
@@ -72,9 +72,12 @@ window.qBittorrent.Misc = (function() {
}
function friendlyUnitPrecision(sizeUnit) {
- if (sizeUnit <= 2) return 1; // KiB, MiB
- else if (sizeUnit === 3) return 2; // GiB
- else return 3; // TiB, PiB, EiB
+ if (sizeUnit <= 2) // KiB, MiB
+ return 1;
+ else if (sizeUnit === 3) // GiB
+ return 2;
+ else // TiB, PiB, EiB
+ return 3;
}
let ret;
@@ -90,7 +93,7 @@ window.qBittorrent.Misc = (function() {
if (isSpeed)
ret += "QBT_TR(/s)QBT_TR[CONTEXT=misc]";
return ret;
- }
+ };
/*
* JS counterpart of the function in src/misc.cpp
@@ -116,7 +119,7 @@ window.qBittorrent.Misc = (function() {
const years = days / 365;
days = days % 365;
return "QBT_TR(%1y %2d)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(years)).replace("%2", parseInt(days));
- }
+ };
const friendlyPercentage = function(value) {
let percentage = (value * 100).round(1);
@@ -125,11 +128,11 @@ window.qBittorrent.Misc = (function() {
if (percentage > 100)
percentage = 100;
return percentage.toFixed(1) + "%";
- }
+ };
const friendlyFloat = function(value, precision) {
return parseFloat(value).toFixed(precision);
- }
+ };
/*
* From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
@@ -164,7 +167,7 @@ window.qBittorrent.Misc = (function() {
const parseHtmlLinks = function(text) {
const exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
return text.replace(exp, "$1");
- }
+ };
const escapeHtml = function(str) {
const div = document.createElement('div');
@@ -172,7 +175,7 @@ window.qBittorrent.Misc = (function() {
const escapedString = div.innerHTML;
div.remove();
return escapedString;
- }
+ };
const safeTrim = function(value) {
try {
@@ -183,13 +186,13 @@ window.qBittorrent.Misc = (function() {
return "";
throw e;
}
- }
+ };
const toFixedPointString = function(number, digits) {
// Do not round up number
const power = Math.pow(10, digits);
return (Math.floor(power * number) / power).toFixed(digits);
- }
+ };
/**
*
@@ -199,7 +202,7 @@ window.qBittorrent.Misc = (function() {
*/
const containsAllTerms = function(text, terms) {
const textToSearch = text.toLowerCase();
- return terms.every((function(term) {
+ return terms.every(function(term) {
const isTermRequired = (term[0] === '+');
const isTermExcluded = (term[0] === '-');
if (isTermRequired || isTermExcluded) {
@@ -212,8 +215,8 @@ window.qBittorrent.Misc = (function() {
const textContainsTerm = (textToSearch.indexOf(term) !== -1);
return isTermExcluded ? !textContainsTerm : textContainsTerm;
- }));
- }
+ });
+ };
return exports();
})();
diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js
index 299aa6170..4f8a0e3ba 100644
--- a/src/webui/www/private/scripts/mocha-init.js
+++ b/src/webui/www/private/scripts/mocha-init.js
@@ -879,7 +879,7 @@ const initializeWindows = function() {
hashes = torrentsTable.getFilteredTorrentsHashes('all', CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
break;
default:
- hashes = trackerList.get(trackerHashInt).torrents
+ hashes = trackerList.get(trackerHashInt).torrents;
break;
}
@@ -962,7 +962,8 @@ const initializeWindows = function() {
const hashes = torrentsTable.selectedRowsIds();
for (const hash of hashes) {
const row = torrentsTable.rows.get(hash);
- if (!row) return
+ if (!row)
+ return;
const name = row.full_data.name;
const url = new URI("api/v2/torrents/export");
diff --git a/src/webui/www/private/scripts/preferences.js b/src/webui/www/private/scripts/preferences.js
index d8efa6111..37f738941 100644
--- a/src/webui/www/private/scripts/preferences.js
+++ b/src/webui/www/private/scripts/preferences.js
@@ -55,7 +55,7 @@ window.qBittorrent.LocalPreferences = (function() {
console.error(err);
}
}
- })
+ });
return exports();
})();
diff --git a/src/webui/www/private/scripts/progressbar.js b/src/webui/www/private/scripts/progressbar.js
index 30ffa5136..e83746bd8 100644
--- a/src/webui/www/private/scripts/progressbar.js
+++ b/src/webui/www/private/scripts/progressbar.js
@@ -52,8 +52,10 @@ window.qBittorrent.ProgressBar = (function() {
'lightbg': '#fff',
'lightfg': '#000'
};
- if (parameters && $type(parameters) == 'object') $extend(vals, parameters);
- if (vals.height < 12) vals.height = 12;
+ if (parameters && $type(parameters) == 'object')
+ $extend(vals, parameters);
+ if (vals.height < 12)
+ vals.height = 12;
const obj = new Element('div', {
'id': vals.id,
'class': 'progressbar_wrapper',
@@ -102,8 +104,10 @@ window.qBittorrent.ProgressBar = (function() {
obj.getValue = ProgressBar_getValue;
obj.setValue = ProgressBar_setValue;
obj.setWidth = ProgressBar_setWidth;
- if (vals.width) obj.setValue(vals.value);
- else setTimeout('ProgressBar_checkForParent("' + obj.id + '")', 1);
+ if (vals.width)
+ obj.setValue(vals.value);
+ else
+ setTimeout('ProgressBar_checkForParent("' + obj.id + '")', 1);
return obj;
}
});
@@ -114,9 +118,12 @@ window.qBittorrent.ProgressBar = (function() {
function ProgressBar_setValue(value) {
value = parseFloat(value);
- if (isNaN(value)) value = 0;
- if (value > 100) value = 100;
- if (value < 0) value = 0;
+ if (isNaN(value))
+ value = 0;
+ if (value > 100)
+ value = 100;
+ if (value < 0)
+ value = 0;
this.vals.value = value;
this.vals.dark.empty();
this.vals.light.empty();
@@ -139,8 +146,10 @@ window.qBittorrent.ProgressBar = (function() {
function ProgressBar_checkForParent(id) {
const obj = $(id);
- if (!obj) return;
- if (!obj.parentNode) return setTimeout('ProgressBar_checkForParent("' + id + '")', 1);
+ if (!obj)
+ return;
+ if (!obj.parentNode)
+ return setTimeout('ProgressBar_checkForParent("' + id + '")', 1);
obj.setStyle('width', '100%');
const w = obj.offsetWidth;
obj.vals.dark.setStyle('width', w);
diff --git a/src/webui/www/private/scripts/prop-files.js b/src/webui/www/private/scripts/prop-files.js
index d66092ad2..2a1ae80a1 100644
--- a/src/webui/www/private/scripts/prop-files.js
+++ b/src/webui/www/private/scripts/prop-files.js
@@ -310,7 +310,8 @@ window.qBittorrent.PropFiles = (function() {
};
const setFilePriority = function(ids, fileIds, priority) {
- if (current_hash === "") return;
+ if (current_hash === "")
+ return;
clearTimeout(loadTorrentFilesDataTimer);
new Request({
@@ -513,7 +514,8 @@ window.qBittorrent.PropFiles = (function() {
const filesPriorityMenuClicked = function(priority) {
const selectedRows = torrentFilesTable.selectedRowsIds();
- if (selectedRows.length === 0) return;
+ if (selectedRows.length === 0)
+ return;
const rowIds = [];
const fileIds = [];
@@ -544,11 +546,14 @@ window.qBittorrent.PropFiles = (function() {
actions: {
Rename: function(element, ref) {
const hash = torrentsTable.getCurrentTorrentID();
- if (!hash) return;
+ if (!hash)
+ return;
const rowId = torrentFilesTable.selectedRowsIds()[0];
- if (rowId === undefined) return;
+ if (rowId === undefined)
+ return;
const row = torrentFilesTable.rows[rowId];
- if (!row) return;
+ if (!row)
+ return;
const node = torrentFilesTable.getNode(rowId);
const path = node.path;
@@ -621,7 +626,8 @@ window.qBittorrent.PropFiles = (function() {
torrentFilesTable.setFilter(value);
clearTimeout(torrentFilesFilterInputTimer);
torrentFilesFilterInputTimer = setTimeout(function() {
- if (current_hash === "") return;
+ if (current_hash === "")
+ return;
torrentFilesTable.updateTable(false);
if (value.trim() === "")
diff --git a/src/webui/www/private/scripts/prop-peers.js b/src/webui/www/private/scripts/prop-peers.js
index 46ac08e2f..be5af9d91 100644
--- a/src/webui/www/private/scripts/prop-peers.js
+++ b/src/webui/www/private/scripts/prop-peers.js
@@ -36,7 +36,7 @@ window.qBittorrent.PropPeers = (function() {
const exports = function() {
return {
updateData: updateData
- }
+ };
};
const torrentPeersTable = new window.qBittorrent.DynamicTable.TorrentPeersTable();
diff --git a/src/webui/www/private/scripts/prop-trackers.js b/src/webui/www/private/scripts/prop-trackers.js
index 718d170ba..49aa5fc0d 100644
--- a/src/webui/www/private/scripts/prop-trackers.js
+++ b/src/webui/www/private/scripts/prop-trackers.js
@@ -165,7 +165,8 @@ window.qBittorrent.PropTrackers = (function() {
});
const addTrackerFN = function() {
- if (current_hash.length === 0) return;
+ if (current_hash.length === 0)
+ return;
new MochaUI.Window({
id: 'trackersPage',
title: "QBT_TR(Trackers addition dialog)QBT_TR[CONTEXT=TrackersAdditionDialog]",
@@ -186,7 +187,8 @@ window.qBittorrent.PropTrackers = (function() {
};
const editTrackerFN = function(element) {
- if (current_hash.length === 0) return;
+ if (current_hash.length === 0)
+ return;
const trackerUrl = encodeURIComponent(element.childNodes[1].innerText);
new MochaUI.Window({
@@ -209,7 +211,8 @@ window.qBittorrent.PropTrackers = (function() {
};
const removeTrackerFN = function(element) {
- if (current_hash.length === 0) return;
+ if (current_hash.length === 0)
+ return;
const selectedTrackers = torrentTrackersTable.selectedRowsIds();
new Request({
diff --git a/src/webui/www/private/scripts/speedslider.js b/src/webui/www/private/scripts/speedslider.js
index da71b62c2..ae30ed8e0 100644
--- a/src/webui/www/private/scripts/speedslider.js
+++ b/src/webui/www/private/scripts/speedslider.js
@@ -54,7 +54,8 @@ MochaUI.extend({
// And create slider
if (hashes[0] == 'global') {
let up_limit = maximum;
- if (up_limit < 0) up_limit = 0;
+ if (up_limit < 0)
+ up_limit = 0;
maximum = 10000;
new Slider($('uplimitSliderarea'), $('uplimitSliderknob'), {
steps: maximum,
@@ -97,7 +98,8 @@ MochaUI.extend({
up_limit = 0;
break;
}
- if (up_limit < 0) up_limit = 0;
+ if (up_limit < 0)
+ up_limit = 0;
new Slider($('uplimitSliderarea'), $('uplimitSliderknob'), {
steps: maximum,
offset: 0,
@@ -156,7 +158,8 @@ MochaUI.extend({
// And create slider
if (hashes[0] == 'global') {
let dl_limit = maximum;
- if (dl_limit < 0) dl_limit = 0;
+ if (dl_limit < 0)
+ dl_limit = 0;
maximum = 10000;
new Slider($('dllimitSliderarea'), $('dllimitSliderknob'), {
steps: maximum,
@@ -199,7 +202,8 @@ MochaUI.extend({
dl_limit = 0;
break;
}
- if (dl_limit < 0) dl_limit = 0;
+ if (dl_limit < 0)
+ dl_limit = 0;
new Slider($('dllimitSliderarea'), $('dllimitSliderknob'), {
steps: maximum,
offset: 0,
diff --git a/src/webui/www/private/uploadlimit.html b/src/webui/www/private/uploadlimit.html
index e59926f98..044a8cf05 100644
--- a/src/webui/www/private/uploadlimit.html
+++ b/src/webui/www/private/uploadlimit.html
@@ -53,7 +53,7 @@
}
}).send();
}
- }
+ };
diff --git a/src/webui/www/private/views/about.html b/src/webui/www/private/views/about.html
index 8494ae063..52cfb7a99 100644
--- a/src/webui/www/private/views/about.html
+++ b/src/webui/www/private/views/about.html
@@ -679,7 +679,8 @@
method: 'get',
noCache: true,
onSuccess: function(info) {
- if (!info) return;
+ if (!info)
+ return;
$('qtVersion').textContent = info.qt;
$('libtorrentVersion').textContent = info.libtorrent;
diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html
index 36c53ab6f..98d71c480 100644
--- a/src/webui/www/private/views/preferences.html
+++ b/src/webui/www/private/views/preferences.html
@@ -1619,7 +1619,8 @@
alert("Could not contact qBittorrent");
},
onSuccess: function(ifaces) {
- if (!ifaces) return;
+ if (!ifaces)
+ return;
$('networkInterface').options.add(new Option('QBT_TR(Any interface)QBT_TR[CONTEXT=OptionsDialog]', ''));
ifaces.forEach(function(item, index) {
@@ -1644,7 +1645,8 @@
alert("Could not contact qBittorrent");
},
onSuccess: function(addresses) {
- if (!addresses) return;
+ if (!addresses)
+ return;
$('optionalIPAddressToBind').options.add(new Option('QBT_TR(All addresses)QBT_TR[CONTEXT=OptionDialog]', ''));
$('optionalIPAddressToBind').options.add(new Option('QBT_TR(All IPv4 addresses)QBT_TR[CONTEXT=OptionDialog]', '0.0.0.0'));
diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html
index c87239b54..73b815544 100644
--- a/src/webui/www/private/views/rss.html
+++ b/src/webui/www/private/views/rss.html
@@ -227,7 +227,7 @@
.filter((row) => row.full_data.dataUid !== '')
.each((row) => feedsToUpdate.add(row));
});
- feedsToUpdate.forEach((feed) => refreshFeed(feed.full_data.dataUid))
+ feedsToUpdate.forEach((feed) => refreshFeed(feed.full_data.dataUid));
},
markRead: markSelectedAsRead,
rename: (el) => {
@@ -307,11 +307,11 @@
const unload = () => {
clearInterval(feedRefreshTimer);
- }
+ };
const load = () => {
feedRefreshTimer = setInterval(updateRssFeedList, serverSyncRssDataInterval);
- }
+ };
const addRSSFeed = () => {
let path = '';
@@ -365,7 +365,7 @@
width: 350,
height: 100
});
- }
+ };
const showRssFeed = (path) => {
rssArticleTable.clear();
diff --git a/src/webui/www/private/views/rssDownloader.html b/src/webui/www/private/views/rssDownloader.html
index c21622274..e0f965504 100644
--- a/src/webui/www/private/views/rssDownloader.html
+++ b/src/webui/www/private/views/rssDownloader.html
@@ -414,14 +414,14 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
$('rulesTable').addEventListener('click', (e) => {
rssDownloaderRulesTable.deselectAll();
rssDownloaderRulesTable.deselectRow();
- showRule('')
+ showRule('');
});
$('rulesTable').addEventListener('contextmenu', (e) => {
if (e.toElement.nodeName === 'DIV') {
rssDownloaderRulesTable.deselectAll();
rssDownloaderRulesTable.deselectRow();
rssDownloaderRuleContextMenu.updateMenuItems();
- showRule('')
+ showRule('');
}
});
// get all categories and add to combobox
@@ -455,7 +455,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
else
flatten(root[child]);
}
- }
+ };
flatten(response);
}
}).send();
@@ -485,7 +485,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
rulesList = response;
}
}).send();
- }
+ };
const modifyRuleState = (rule, setting, newState, callback = () => {}) => {
rulesList[rule][setting] = newState;
@@ -501,7 +501,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
callback();
}
}).send();
- }
+ };
const addRule = () => {
new MochaUI.Window({
@@ -566,7 +566,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
width: 350,
height: 85
});
- }
+ };
const saveSettings = () => {
let lastSelectedRow = rssDownloaderRulesTable.selectedRows[rssDownloaderRulesTable.selectedRows.length - 1];
@@ -624,7 +624,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
updateMatchingArticles(rule);
}
}).send();
- }
+ };
const updateMatchingArticles = (ruleName) => {
new Request.JSON({
@@ -654,7 +654,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
rssDownloaderArticlesTable.updateTable(false);
}
}).send();
- }
+ };
const showRule = (ruleName) => {
if (ruleName === '') {
@@ -755,7 +755,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
rssDownloaderFeedSelectionTable.updateTable(false);
updateMatchingArticles(ruleName);
}
- }
+ };
const setElementTitles = () => {
let mainPart;
@@ -791,7 +791,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
episodeFilterTitle = episodeFilterTitle.replace(//g, '').replace(/<\/b>/g, '');
$('episodeFilterText').title = episodeFilterTitle;
- }
+ };
initRssDownloader();
return exports();
diff --git a/src/webui/www/private/views/search.html b/src/webui/www/private/views/search.html
index f6c55e380..e1b6db077 100644
--- a/src/webui/www/private/views/search.html
+++ b/src/webui/www/private/views/search.html
@@ -341,7 +341,8 @@
let category = $('categorySelect').getProperty('value');
const plugins = $('pluginsSelect').getProperty('value');
- if (!pattern || !category || !plugins) return;
+ if (!pattern || !category || !plugins)
+ return;
resetFilters();
@@ -390,7 +391,8 @@
});
// only proceed if at least 1 row was selected
- if (!urls.length) return;
+ if (!urls.length)
+ return;
showDownloadPage(urls);
};
@@ -490,7 +492,8 @@
if ((selectedPlugin === "all") || (selectedPlugin === "enabled")) {
const uniqueCategories = {};
for (const plugin of searchPlugins) {
- if ((selectedPlugin === "enabled") && !plugin.enabled) continue
+ if ((selectedPlugin === "enabled") && !plugin.enabled)
+ continue;
for (const category of plugin.supportedCategories) {
if (uniqueCategories[category.id] === undefined) {
uniqueCategories[category.id] = category;
@@ -503,7 +506,7 @@
}
else {
const plugin = getPlugin(selectedPlugin);
- const plugins = (plugin === null) ? [] : plugin.supportedCategories
+ const plugins = (plugin === null) ? [] : plugin.supportedCategories;
populateCategorySelect(plugins);
}
@@ -542,8 +545,10 @@
const allPlugins = searchPlugins.sort(function(pluginA, pluginB) {
const a = pluginA.fullName.toLowerCase();
const b = pluginB.fullName.toLowerCase();
- if (a < b) return -1;
- if (a > b) return 1;
+ if (a < b)
+ return -1;
+ if (a > b)
+ return 1;
return 0;
});