mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 16:37:21 -06:00
WebUI: don't auto infer radix parameter
This commit is contained in:
@@ -112,18 +112,18 @@ window.qBittorrent.Misc = (function() {
|
||||
return "QBT_TR(< 1m)QBT_TR[CONTEXT=misc]";
|
||||
let minutes = seconds / 60;
|
||||
if (minutes < 60)
|
||||
return "QBT_TR(%1m)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(minutes));
|
||||
return "QBT_TR(%1m)QBT_TR[CONTEXT=misc]".replace("%1", Math.floor(minutes));
|
||||
let hours = minutes / 60;
|
||||
minutes %= 60;
|
||||
if (hours < 24)
|
||||
return "QBT_TR(%1h %2m)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(hours)).replace("%2", parseInt(minutes));
|
||||
return "QBT_TR(%1h %2m)QBT_TR[CONTEXT=misc]".replace("%1", Math.floor(hours)).replace("%2", Math.floor(minutes));
|
||||
let days = hours / 24;
|
||||
hours %= 24;
|
||||
if (days < 365)
|
||||
return "QBT_TR(%1d %2h)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(days)).replace("%2", parseInt(hours));
|
||||
return "QBT_TR(%1d %2h)QBT_TR[CONTEXT=misc]".replace("%1", Math.floor(days)).replace("%2", Math.floor(hours));
|
||||
const years = days / 365;
|
||||
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", Math.floor(years)).replace("%2", Math.floor(days));
|
||||
};
|
||||
|
||||
const friendlyPercentage = function(value) {
|
||||
|
||||
@@ -127,7 +127,7 @@ window.qBittorrent.ProgressBar = (function() {
|
||||
this.vals.dark.textContent = displayedValue;
|
||||
this.vals.light.textContent = displayedValue;
|
||||
|
||||
const r = parseInt(this.vals.width * (value / 100));
|
||||
const r = parseInt((this.vals.width * (value / 100)), 10);
|
||||
this.vals.dark.setStyle("clip", `rect(0, ${r}px, ${this.vals.height}px, 0)`);
|
||||
this.vals.light.setStyle("clip", `rect(0, ${this.vals.width}px, ${this.vals.height}px, ${r}px)`);
|
||||
}
|
||||
|
||||
@@ -200,8 +200,7 @@ window.qBittorrent.PropFiles = (function() {
|
||||
|
||||
const updatePriorityCombo = function(id, selectedPriority) {
|
||||
const combobox = $("comboPrio" + id);
|
||||
|
||||
if (parseInt(combobox.value) !== selectedPriority)
|
||||
if (parseInt(combobox.value, 10) !== selectedPriority)
|
||||
selectComboboxPriority(combobox, selectedPriority);
|
||||
};
|
||||
|
||||
@@ -209,7 +208,7 @@ window.qBittorrent.PropFiles = (function() {
|
||||
const options = combobox.options;
|
||||
for (let i = 0; i < options.length; ++i) {
|
||||
const option = options[i];
|
||||
if (parseInt(option.value) === priority)
|
||||
if (parseInt(option.value, 10) === priority)
|
||||
option.selected = true;
|
||||
else
|
||||
option.selected = false;
|
||||
|
||||
Reference in New Issue
Block a user