6 <title>QBT_TR(Torrent Download 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=
"dllimitSlider" class=
"slider">
17 <div id=
"dllimitUpdate" class=
"update">
18 <label for=
"dllimitUpdatevalue">QBT_TR(Download limit:)QBT_TR[CONTEXT=PropertiesWidget]
</label>
19 <input type=
"text" id=
"dllimitUpdatevalue" size=
"6" placeholder=
"∞" style=
"text-align: center;">
20 <span id=
"dlLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]
</span>
22 <div class=
"sliderWrapper">
23 <div id=
"dllimitSliderknob" class=
"sliderknob"></div>
24 <div id=
"dllimitSliderarea" class=
"sliderarea"></div>
26 <div class=
"clear"></div>
28 <input type=
"button" id=
"applyButton" value=
"QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick=
"setDlLimit()">
34 const hashes
= new URI().getData("hashes").split("|");
35 const setDlLimit = function() {
36 const limit
= $("dllimitUpdatevalue").value
.toInt() * 1024;
37 if (hashes
[0] === "global") {
39 url
: "api/v2/transfer/setDownloadLimit",
44 onComplete: function() {
45 window
.parent
.updateMainData();
46 window
.parent
.qBittorrent
.Client
.closeWindows();
52 url
: "api/v2/torrents/setDownloadLimit",
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 $("dllimitUpdatevalue").focus();
85 MochaUI
.addDlLimitSlider(hashes
);