2017-11-02 12:14:27 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="${LANG}">
|
2018-04-05 11:59:31 +08:00
|
|
|
|
2017-08-06 05:04:39 -04:00
|
|
|
<head>
|
2018-03-21 14:34:37 +08:00
|
|
|
<meta charset="UTF-8" />
|
2017-08-06 17:08:14 +08:00
|
|
|
<title>QBT_TR(Set location)QBT_TR[CONTEXT=HttpServer]</title>
|
2017-08-06 05:04:39 -04: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>
|
2018-06-07 20:55:00 +03:00
|
|
|
<script src="scripts/misc.js"></script>
|
2018-03-21 14:34:37 +08:00
|
|
|
<script>
|
2017-08-06 05:04:39 -04:00
|
|
|
var setLocationKeyboardEvents = new Keyboard({
|
|
|
|
defaultEventType: 'keydown',
|
|
|
|
events: {
|
2018-04-05 11:59:31 +08:00
|
|
|
'enter': function(event) {
|
2017-08-06 05:04:39 -04:00
|
|
|
$('setLocationButton').click();
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
setLocationKeyboardEvents.activate();
|
|
|
|
|
|
|
|
window.addEvent('domready', function() {
|
2018-06-07 20:55:00 +03:00
|
|
|
var path = new URI().getData('path');
|
|
|
|
// set text field to current value
|
|
|
|
if (path)
|
|
|
|
$('setLocation').value = escapeHtml(decodeURIComponent(path));
|
|
|
|
|
2017-08-06 05:04:39 -04:00
|
|
|
$('setLocation').focus();
|
|
|
|
$('setLocationButton').addEvent('click', function(e) {
|
|
|
|
new Event(e).stop();
|
|
|
|
// check field
|
|
|
|
var location = $('setLocation').value.trim();
|
|
|
|
if (location === null || location === "")
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var hashesList = new URI().getData('hashes');
|
|
|
|
new Request({
|
2017-10-14 16:27:21 +03:00
|
|
|
url: 'api/v2/torrents/setLocation',
|
2017-08-06 05:04:39 -04:00
|
|
|
method: 'post',
|
|
|
|
data: {
|
|
|
|
hashes: hashesList,
|
|
|
|
location: location
|
|
|
|
},
|
2018-04-05 11:59:31 +08:00
|
|
|
onComplete: function() {
|
2017-08-06 05:04:39 -04:00
|
|
|
window.parent.closeWindows();
|
|
|
|
}
|
|
|
|
}).send();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
2018-04-05 11:59:31 +08:00
|
|
|
|
2017-08-06 05:04:39 -04:00
|
|
|
<body>
|
|
|
|
<div style="padding: 10px 10px 0px 10px;">
|
|
|
|
<p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p>
|
2018-06-07 20:55:00 +03:00
|
|
|
<input type="text" id="setLocation" value="" maxlength="100" style="width: 370px;" />
|
2017-08-06 05:04:39 -04:00
|
|
|
<div style="text-align: center; padding-top: 10px;">
|
2018-04-05 11:59:31 +08:00
|
|
|
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="setLocationButton" />
|
2017-08-06 05:04:39 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2018-04-05 11:59:31 +08:00
|
|
|
|
2017-08-06 05:04:39 -04:00
|
|
|
</html>
|