Sync translations from Transifex and run lupdate
[qBittorrent.git] / src / webui / www / private / rename.html
blob1284812dbcd1212bf456141b740e94b127c219a1
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8" />
6 <title>QBT_TR(Rename)QBT_TR[CONTEXT=TransferListWidget]</title>
7 <link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
8 <script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
9 <script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
10 <script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
11 <script>
12 'use strict';
14 new Keyboard({
15 defaultEventType: 'keydown',
16 events: {
17 'Enter': function(event) {
18 $('renameButton').click();
19 event.preventDefault();
21 'Escape': function(event) {
22 window.parent.closeWindows();
23 event.preventDefault();
25 'Esc': function(event) {
26 window.parent.closeWindows();
27 event.preventDefault();
30 }).activate();
32 window.addEvent('domready', function() {
33 const name = new URI().getData('name');
34 // set text field to current value
35 if (name)
36 $('rename').value = name;
38 $('rename').focus();
39 $('renameButton').addEvent('click', function(e) {
40 new Event(e).stop();
41 // check field
42 const name = $('rename').value.trim();
43 if (name === null || name === "")
44 return false;
46 const hash = new URI().getData('hash');
47 if (hash) {
48 new Request({
49 url: 'api/v2/torrents/rename',
50 method: 'post',
51 data: {
52 hash: hash,
53 name: name
55 onComplete: function() {
56 window.parent.closeWindows();
58 }).send();
60 });
61 });
62 </script>
63 </head>
65 <body>
66 <div style="padding: 10px 10px 0px 10px;">
67 <p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p>
68 <input type="text" id="rename" style="width: 99%;" />
69 <div style="text-align: center; padding-top: 10px;">
70 <input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
71 </div>
72 </div>
73 </body>
75 </html>