2017-11-02 12:14:27 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="${LANG}">
|
2018-04-05 06:59:31 +03:00
|
|
|
|
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>
|
2019-04-17 15:09:03 +03:00
|
|
|
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
|
2018-04-01 20:04:42 +03:00
|
|
|
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
|
|
|
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
2019-04-17 15:09:03 +03:00
|
|
|
<script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
|
2018-03-21 09:34:37 +03:00
|
|
|
<script>
|
2018-11-30 13:30:26 +03:00
|
|
|
'use strict';
|
|
|
|
|
2019-01-11 02:49:35 +03:00
|
|
|
new Keyboard({
|
2017-07-04 12:54:43 +03:00
|
|
|
defaultEventType: 'keydown',
|
|
|
|
events: {
|
2019-01-14 09:02:07 +03:00
|
|
|
'Enter': function(event) {
|
2017-07-04 12:54:43 +03:00
|
|
|
$('renameButton').click();
|
|
|
|
event.preventDefault();
|
2019-01-11 02:49:35 +03:00
|
|
|
},
|
|
|
|
'Escape': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
|
|
|
},
|
|
|
|
'Esc': function(event) {
|
|
|
|
window.parent.closeWindows();
|
|
|
|
event.preventDefault();
|
2017-07-04 12:54:43 +03:00
|
|
|
}
|
|
|
|
}
|
2019-01-11 02:49:35 +03:00
|
|
|
}).activate();
|
2017-07-04 12:54:43 +03:00
|
|
|
|
|
|
|
window.addEvent('domready', function() {
|
2019-05-30 09:05:16 +03:00
|
|
|
const name = new URI().getData('name');
|
2017-07-04 12:54:43 +03:00
|
|
|
// set text field to current value
|
|
|
|
if (name)
|
2019-06-21 08:15:32 +03:00
|
|
|
$('rename').value = decodeURIComponent(name);
|
2017-07-04 12:54:43 +03:00
|
|
|
|
|
|
|
$('rename').focus();
|
|
|
|
$('renameButton').addEvent('click', function(e) {
|
|
|
|
new Event(e).stop();
|
|
|
|
// check field
|
2019-05-30 09:05:16 +03:00
|
|
|
const name = $('rename').value.trim();
|
2017-07-04 12:54:43 +03:00
|
|
|
if (name === null || name === "")
|
|
|
|
return false;
|
|
|
|
|
2019-05-30 09:05:16 +03:00
|
|
|
const hash = new URI().getData('hash');
|
2017-07-04 12:54:43 +03:00
|
|
|
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
|
|
|
|
},
|
2018-04-05 06:59:31 +03:00
|
|
|
onComplete: function() {
|
2017-07-04 12:54:43 +03:00
|
|
|
window.parent.closeWindows();
|
|
|
|
}
|
|
|
|
}).send();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
2018-04-05 06:59:31 +03:00
|
|
|
|
2017-07-04 12:54:43 +03:00
|
|
|
<body>
|
|
|
|
<div style="padding: 10px 10px 0px 10px;">
|
|
|
|
<p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p>
|
2018-04-05 06:59:31 +03:00
|
|
|
<input type="text" id="rename" value="" maxlength="100" style="width: 220px;" />
|
2017-07-04 12:54:43 +03:00
|
|
|
<div style="text-align: center; padding-top: 10px;">
|
2018-04-05 06:59:31 +03:00
|
|
|
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
|
2017-07-04 12:54:43 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
2018-04-05 06:59:31 +03:00
|
|
|
|
2017-07-04 12:54:43 +03:00
|
|
|
</html>
|