2017-11-02 12:14:27 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="${LANG}">
|
2018-04-05 11:59:31 +08:00
|
|
|
|
2009-11-25 10:03:04 +00:00
|
|
|
<head>
|
2018-03-21 14:34:37 +08:00
|
|
|
<meta charset="UTF-8" />
|
2017-05-01 01:45:02 +03:00
|
|
|
<title>QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]</title>
|
2014-12-14 10:00:00 +01:00
|
|
|
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
2018-04-02 01:04:42 +08:00
|
|
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
|
|
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
|
|
|
<script src="scripts/lib/mocha-yc.js"></script>
|
|
|
|
<script src="scripts/lib/parametrics.js"></script>
|
2009-11-25 10:03:04 +00:00
|
|
|
</head>
|
2018-04-05 11:59:31 +08:00
|
|
|
|
2009-11-25 10:03:04 +00:00
|
|
|
<body>
|
2018-04-05 11:59:31 +08:00
|
|
|
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
|
|
|
|
<div id="uplimitSlider" class="slider">
|
|
|
|
<div id="uplimitUpdate" class="update">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="uplimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="upLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div>
|
|
|
|
<div class="sliderWrapper">
|
|
|
|
<div id="uplimitSliderknob" class="sliderknob"></div>
|
|
|
|
<div id="uplimitSliderarea" class="sliderarea"></div>
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
|
|
|
<script>
|
2018-11-30 18:30:26 +08:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-05 11:59:31 +08:00
|
|
|
var hashes = new URI().getData('hashes').split('|');
|
2018-11-30 18:35:32 +08:00
|
|
|
var setUpLimit = function() {
|
2018-04-05 11:59:31 +08:00
|
|
|
var limit = $("uplimitUpdatevalue").value.toInt() * 1024;
|
|
|
|
if (hashes[0] == "global") {
|
|
|
|
new Request({
|
|
|
|
url: 'api/v2/transfer/setUploadLimit',
|
|
|
|
method: 'post',
|
|
|
|
data: {
|
|
|
|
'limit': limit
|
|
|
|
},
|
|
|
|
onComplete: function() {
|
|
|
|
window.parent.updateMainData();
|
|
|
|
window.parent.closeWindows();
|
|
|
|
}
|
|
|
|
}).send();
|
2014-12-14 10:00:00 +01:00
|
|
|
}
|
2018-04-05 11:59:31 +08:00
|
|
|
else {
|
|
|
|
new Request({
|
|
|
|
url: 'api/v2/torrents/setUploadLimit',
|
|
|
|
method: 'post',
|
|
|
|
data: {
|
|
|
|
'hashes': hashes.join('|'),
|
|
|
|
'limit': limit
|
|
|
|
},
|
|
|
|
onComplete: function() {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
}
|
|
|
|
}).send();
|
2014-12-14 10:00:00 +01:00
|
|
|
}
|
2018-04-05 11:59:31 +08:00
|
|
|
}
|
|
|
|
</script>
|
2019-01-10 15:49:35 -08:00
|
|
|
<input type="button" id="applyButton" value="QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick="setUpLimit()" />
|
2018-04-05 11:59:31 +08:00
|
|
|
</div>
|
2009-11-25 10:03:04 +00:00
|
|
|
|
2018-04-05 11:59:31 +08:00
|
|
|
<script>
|
2019-01-10 15:49:35 -08:00
|
|
|
new Keyboard({
|
|
|
|
defaultEventType: 'keydown',
|
|
|
|
events: {
|
|
|
|
'enter': function(event) {
|
|
|
|
$('applyButton').click();
|
|
|
|
event.preventDefault();
|
|
|
|
},
|
|
|
|
'Escape': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
|
|
|
},
|
|
|
|
'Esc': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).activate();
|
|
|
|
|
|
|
|
$('uplimitUpdatevalue').focus();
|
|
|
|
|
2018-04-05 11:59:31 +08:00
|
|
|
MochaUI.addUpLimitSlider(hashes);
|
|
|
|
</script>
|
2009-11-25 10:03:04 +00:00
|
|
|
|
|
|
|
</body>
|
2018-04-05 11:59:31 +08:00
|
|
|
|
2012-06-10 20:15:57 +03:00
|
|
|
</html>
|