2017-11-02 12:14:27 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="${LANG}">
|
2017-07-04 12:54:43 +03:00
|
|
|
<head>
|
2018-03-21 09:34:37 +03:00
|
|
|
<meta charset="UTF-8" />
|
2017-07-04 12:54:43 +03:00
|
|
|
<title>QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]</title>
|
|
|
|
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
2018-03-21 09:34:37 +03:00
|
|
|
<script src="scripts/mootools-1.2-core-yc.js"></script>
|
|
|
|
<script src="scripts/mootools-1.2-more.js"></script>
|
|
|
|
<script src="scripts/misc.js"></script>
|
|
|
|
<script>
|
2017-07-04 12:54:43 +03:00
|
|
|
var renameKeyboardEvents = new Keyboard({
|
|
|
|
defaultEventType: 'keydown',
|
|
|
|
events: {
|
|
|
|
'enter': function (event) {
|
|
|
|
$('renameButton').click();
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
renameKeyboardEvents.activate();
|
|
|
|
|
|
|
|
window.addEvent('domready', function() {
|
|
|
|
var name = new URI().getData('name');
|
|
|
|
// set text field to current value
|
|
|
|
if (name)
|
|
|
|
$('rename').value = escapeHtml(name);
|
|
|
|
|
|
|
|
$('rename').focus();
|
|
|
|
$('renameButton').addEvent('click', function(e) {
|
|
|
|
new Event(e).stop();
|
|
|
|
// check field
|
|
|
|
var name = $('rename').value.trim();
|
|
|
|
if (name === null || name === "")
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var hash = new URI().getData('hash');
|
|
|
|
if (hash) {
|
|
|
|
new Request({
|
2017-10-14 16:27:21 +03:00
|
|
|
url: 'api/v2/torrents/rename',
|
2017-07-04 12:54:43 +03:00
|
|
|
method: 'post',
|
|
|
|
data: {
|
|
|
|
hash: hash,
|
|
|
|
name: name
|
|
|
|
},
|
|
|
|
onComplete: function () {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
}
|
|
|
|
}).send();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div style="padding: 10px 10px 0px 10px;">
|
|
|
|
<p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p>
|
|
|
|
<input type="text" id="rename" value="" maxlength="100" style="width: 220px;"/>
|
|
|
|
<div style="text-align: center; padding-top: 10px;">
|
|
|
|
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|