6 <title>QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]
</title>
7 <link rel=
"stylesheet" href=
"css/style.css?v=${CACHEID}" type=
"text/css">
8 <script src=
"scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
9 <script src=
"scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
10 <script src=
"scripts/lib/mocha.min.js"></script>
11 <script src=
"scripts/speedslider.js?v=${CACHEID}"></script>
15 <div style=
"width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
16 <div id=
"uplimitSlider" class=
"slider">
17 <div id=
"uplimitUpdate" class=
"update">
18 <label for=
"uplimitUpdatevalue">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget]
</label>
19 <input type=
"text" id=
"uplimitUpdatevalue" size=
"6" placeholder=
"∞" style=
"text-align: center;">
20 <span id=
"upLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]
</span>
22 <div class=
"sliderWrapper">
23 <div id=
"uplimitSliderknob" class=
"sliderknob"></div>
24 <div id=
"uplimitSliderarea" class=
"sliderarea"></div>
26 <div class=
"clear"></div>
28 <input type=
"button" id=
"applyButton" value=
"QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick=
"setUpLimit()">
34 const hashes
= new URI().getData("hashes").split("|");
35 const setUpLimit = function() {
36 const limit
= $("uplimitUpdatevalue").value
.toInt() * 1024;
37 if (hashes
[0] === "global") {
39 url
: "api/v2/transfer/setUploadLimit",
44 onComplete: function() {
45 window
.parent
.updateMainData();
46 window
.parent
.qBittorrent
.Client
.closeWindows();
52 url
: "api/v2/torrents/setUploadLimit",
55 "hashes": hashes
.join("|"),
58 onComplete: function() {
59 window
.parent
.qBittorrent
.Client
.closeWindows();
66 defaultEventType
: "keydown",
68 "Enter": function(event
) {
69 $("applyButton").click();
70 event
.preventDefault();
72 "Escape": function(event
) {
73 window
.parent
.qBittorrent
.Client
.closeWindows();
74 event
.preventDefault();
76 "Esc": function(event
) {
77 window
.parent
.qBittorrent
.Client
.closeWindows();
78 event
.preventDefault();
83 $("uplimitUpdatevalue").focus();
85 MochaUI
.addUpLimitSlider(hashes
);