qBittorrent/src/webui/www/private/rename.html

76 lines
2.5 KiB
HTML
Raw Normal View History

2017-11-02 12:14:27 +03:00
<!DOCTYPE html>
<html lang="${LANG}">
2018-04-05 06:59:31 +03:00
<head>
<meta charset="UTF-8" />
<title>QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]</title>
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
<script>
2018-11-30 13:30:26 +03:00
'use strict';
2019-01-11 02:49:35 +03:00
new Keyboard({
defaultEventType: 'keydown',
events: {
2019-01-14 09:02:07 +03:00
'Enter': function(event) {
$('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();
}
}
2019-01-11 02:49:35 +03:00
}).activate();
window.addEvent('domready', function() {
var name = new URI().getData('name');
// set text field to current value
if (name)
$('rename').value = decodeURIComponent(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({
url: 'api/v2/torrents/rename',
method: 'post',
data: {
hash: hash,
name: name
},
2018-04-05 06:59:31 +03:00
onComplete: function() {
window.parent.closeWindows();
}
}).send();
}
});
});
</script>
</head>
2018-04-05 06:59:31 +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;" />
<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" />
</div>
</div>
</body>
2018-04-05 06:59:31 +03:00
</html>