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>
|
2018-12-28 13:35:49 -05:00
|
|
|
<link rel="stylesheet" href="css/style.css?v=${VERSION}" 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-12-28 13:35:49 -05:00
|
|
|
<script src="scripts/misc.js?locale=${LANG}&v=${VERSION}"></script>
|
2018-03-21 14:34:37 +08:00
|
|
|
<script>
|
2018-11-30 18:30:26 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-01-10 15:49:35 -08:00
|
|
|
new Keyboard({
|
2017-08-06 05:04:39 -04:00
|
|
|
defaultEventType: 'keydown',
|
|
|
|
events: {
|
2019-01-13 22:02:07 -08:00
|
|
|
'Enter': function(event) {
|
2017-08-06 05:04:39 -04:00
|
|
|
$('setLocationButton').click();
|
|
|
|
event.preventDefault();
|
2019-01-10 15:49:35 -08:00
|
|
|
},
|
|
|
|
'Escape': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
|
|
|
},
|
|
|
|
'Esc': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
2017-08-06 05:04:39 -04:00
|
|
|
}
|
|
|
|
}
|
2019-01-10 15:49:35 -08:00
|
|
|
}).activate();
|
2017-08-06 05:04:39 -04:00
|
|
|
|
|
|
|
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();
|
2018-06-08 09:37:34 +03:00
|
|
|
if (location === null || location === "") {
|
|
|
|
$('error_div').set('text', 'QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]');
|
2017-08-06 05:04:39 -04:00
|
|
|
return false;
|
2018-06-08 09:37:34 +03:00
|
|
|
}
|
2017-08-06 05:04:39 -04:00
|
|
|
|
|
|
|
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-06-08 09:37:34 +03:00
|
|
|
onSuccess: function() {
|
2017-08-06 05:04:39 -04:00
|
|
|
window.parent.closeWindows();
|
2018-06-08 09:37:34 +03:00
|
|
|
},
|
|
|
|
onFailure: function(xhr) {
|
|
|
|
$('error_div').set('text', xhr.response);
|
2017-08-06 05:04:39 -04:00
|
|
|
}
|
|
|
|
}).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>
|
2019-01-25 19:01:39 +01:00
|
|
|
<input type="text" id="setLocation" value="" maxlength="100" autocorrect="off" autocapitalize="none" style="width: 370px;" />
|
2018-06-08 09:37:34 +03:00
|
|
|
<div style="float: none; width: 370px;" id="error_div"> </div>
|
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>
|