mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
WebUI: inline redundant function
This also fix share ratio dialog which had been broken in recent cleanup. PR #22252.
This commit is contained in:
parent
c65a68251e
commit
b052ad0923
2 changed files with 3 additions and 9 deletions
|
@ -37,7 +37,6 @@ window.qBittorrent.Misc ??= (() => {
|
|||
friendlyUnit: friendlyUnit,
|
||||
friendlyDuration: friendlyDuration,
|
||||
friendlyPercentage: friendlyPercentage,
|
||||
friendlyFloat: friendlyFloat,
|
||||
parseHtmlLinks: parseHtmlLinks,
|
||||
parseVersion: parseVersion,
|
||||
escapeHtml: escapeHtml,
|
||||
|
@ -172,10 +171,6 @@ window.qBittorrent.Misc ??= (() => {
|
|||
return `${percentage.toFixed(1)}%`;
|
||||
};
|
||||
|
||||
const friendlyFloat = (value, precision) => {
|
||||
return parseFloat(value).toFixed(precision);
|
||||
};
|
||||
|
||||
/*
|
||||
* JS counterpart of the function in src/misc.cpp
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
|
||||
<script src="scripts/localpreferences.js?v=${CACHEID}"></script>
|
||||
<script src="scripts/color-scheme.js?v=${CACHEID}"></script>
|
||||
<script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
|
@ -34,10 +33,10 @@
|
|||
const origValues = searchParams.get("orig").split("|");
|
||||
|
||||
const values = {
|
||||
ratioLimit: window.qBittorrent.Misc.friendlyFloat(origValues[0], 2),
|
||||
ratioLimit: Number(origValues[0]),
|
||||
seedingTimeLimit: Number(origValues[1]),
|
||||
inactiveSeedingTimeLimit: Number(origValues[2]),
|
||||
maxRatio: window.qBittorrent.Misc.friendlyFloat(origValues[3], 2),
|
||||
maxRatio: Number(origValues[3]),
|
||||
maxSeedingTime: Number(origValues[4]),
|
||||
maxInactiveSeedingTime: Number(origValues[5])
|
||||
};
|
||||
|
@ -58,7 +57,7 @@
|
|||
setSelectedRadioValue("shareLimit", "custom");
|
||||
if (values.ratioLimit >= 0) {
|
||||
$("setRatio").checked = true;
|
||||
$("ratio").value = values.ratioLimit;
|
||||
$("ratio").value = values.ratioLimit.toFixed(2);
|
||||
}
|
||||
if (values.seedingTimeLimit >= 0) {
|
||||
$("setTotalMinutes").checked = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue