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