WebUI: Use Map instead of Mootools Hash in Torrents table
[qBittorrent.git] / src / webui / www / private / edittracker.html
blob4e476fcf75beff79db0397725e8a47d50bf329b7
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Tracker editing)QBT_TR[CONTEXT=TrackerListWidget]</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>
11 "use strict";
13 window.addEventListener("DOMContentLoaded", () => {
14 new Keyboard({
15 defaultEventType: "keydown",
16 events: {
17 "Enter": function(event) {
18 $("editTrackerButton").click();
19 event.preventDefault();
21 "Escape": function(event) {
22 window.parent.qBittorrent.Client.closeWindows();
23 event.preventDefault();
25 "Esc": function(event) {
26 window.parent.qBittorrent.Client.closeWindows();
27 event.preventDefault();
30 }).activate();
32 const currentUrl = new URI().getData("url");
33 if (!currentUrl)
34 return;
36 $("trackerUrl").value = currentUrl;
37 $("trackerUrl").focus();
39 $("editTrackerButton").addEventListener("click", (e) => {
40 e.preventDefault();
41 e.stopPropagation();
43 const hash = new URI().getData("hash");
44 new Request({
45 url: "api/v2/torrents/editTracker",
46 method: "post",
47 data: {
48 hash: hash,
49 origUrl: currentUrl,
50 newUrl: $("trackerUrl").value
52 onComplete: function() {
53 window.parent.qBittorrent.Client.closeWindows();
55 }).send();
56 });
57 });
58 </script>
59 </head>
61 <body>
62 <div style="text-align: center;">
63 <br>
64 <label for="trackerUrl">QBT_TR(Tracker URL:)QBT_TR[CONTEXT=TrackerListWidget]</label>
65 <div style="text-align: center; padding-top: 10px;">
66 <input type="text" id="trackerUrl" style="width: 90%;">
67 </div>
68 <br>
69 <input type="button" value="QBT_TR(Edit)QBT_TR[CONTEXT=HttpServer]" id="editTrackerButton">
70 </div>
71 </body>
73 </html>