WebUI: Use Map instead of Mootools Hash in Torrents table
[qBittorrent.git] / src / webui / www / private / addtrackers.html
blob42f63dd97eacf5b9c9de90a827db5d2332f78622
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Add trackers)QBT_TR[CONTEXT=TrackersAdditionDialog]</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 "Escape": function(event) {
18 window.parent.qBittorrent.Client.closeWindows();
19 event.preventDefault();
21 "Esc": function(event) {
22 window.parent.qBittorrent.Client.closeWindows();
23 event.preventDefault();
26 }).activate();
28 $("trackersUrls").focus();
29 $("addTrackersButton").addEventListener("click", (e) => {
30 e.preventDefault();
31 e.stopPropagation();
33 const hash = new URI().getData("hash");
34 new Request({
35 url: "api/v2/torrents/addTrackers",
36 method: "post",
37 data: {
38 hash: hash,
39 urls: $("trackersUrls").value
41 onComplete: function() {
42 window.parent.qBittorrent.Client.closeWindows();
44 }).send();
45 });
46 });
47 </script>
48 </head>
50 <body>
51 <div style="text-align: center;">
52 <br>
53 <label for="trackersUrls">QBT_TR(List of trackers to add (one per line):)QBT_TR[CONTEXT=TrackersAdditionDialog]</label>
54 <textarea name="list" id="trackersUrls" rows="10" cols="1"></textarea>
55 <br>
56 <input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addTrackersButton">
57 </div>
58 </body>
60 </html>