WebUI: Use Map instead of Mootools Hash in Torrents table
[qBittorrent.git] / src / webui / www / private / download.html
bloba9ae77030dc1da0f8db97525a7cdcd27714524b5
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Add Torrent Links)QBT_TR[CONTEXT=downloadFromURL]</title>
7 <link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
8 <link rel="stylesheet" href="css/Window.css?v=${CACHEID}" type="text/css">
9 <script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
10 <script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
11 <script src="scripts/download.js?v=${CACHEID}"></script>
12 <script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
13 <script src="scripts/pathAutofill.js?v=${CACHEID}"></script>
14 </head>
16 <body>
17 <iframe id="download_frame" name="download_frame" class="invisible" title="" src="about:blank"></iframe>
18 <form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="downloadForm" style="text-align: center;" target="download_frame" autocorrect="off" autocapitalize="none">
19 <div style="text-align: center;">
20 <br>
21 <h2><label for="urls">QBT_TR(Add torrent links)QBT_TR[CONTEXT=AddNewTorrentDialog]</label></h2>
22 <textarea id="urls" rows="10" name="urls"></textarea>
23 <p><i>QBT_TR(One link per line (HTTP links, Magnet links and info-hashes are supported))QBT_TR[CONTEXT=AddNewTorrentDialog]</i></p>
24 <fieldset class="settings" style="border: 0; text-align: left; margin-top: 6px;">
25 <legend>QBT_TR(Torrent options)QBT_TR[CONTEXT=AddNewTorrentDialog]</legend>
26 <table style="margin: auto;">
27 <tbody>
28 <tr>
29 <td>
30 <label for="autoTMM">QBT_TR(Torrent Management Mode:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
31 </td>
32 <td>
33 <select id="autoTMM" name="autoTMM" onchange="qBittorrent.Download.changeTMM(this)">
34 <option selected value="false">QBT_TR(Manual)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
35 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
36 </select>
37 </td>
38 </tr>
39 <tr>
40 <td>
41 <label for="savepath">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
42 </td>
43 <td>
44 <input type="text" id="savepath" name="savepath" class="pathDirectory" style="width: 16em;">
45 </td>
46 </tr>
47 <tr>
48 <td>
49 <label for="cookie">QBT_TR(Cookie:)QBT_TR[CONTEXT=HttpServer]</label>
50 </td>
51 <td>
52 <input type="text" id="cookie" name="cookie" style="width: 16em;">
53 </td>
54 </tr>
55 <tr>
56 <td>
57 <label for="rename">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
58 </td>
59 <td>
60 <input type="text" id="rename" name="rename" style="width: 16em;">
61 </td>
62 </tr>
63 <tr>
64 <td>
65 <label id="categoryLabel" for="categorySelect">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
66 </td>
67 <td>
68 <div class="select-watched-folder-editable">
69 <select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
70 <option selected value="\other"></option>
71 </select>
72 <input type="text" name="category" aria-labelledby="categoryLabel">
73 </div>
74 </td>
75 </tr>
76 <tr>
77 <td>
78 <label for="startTorrent">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
79 </td>
80 <td>
81 <input type="hidden" id="startTorrentHidden" name="stopped">
82 <input type="checkbox" id="startTorrent">
83 </td>
84 </tr>
85 <tr>
86 <td>
87 <label for="addToTopOfQueue">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
88 </td>
89 <td>
90 <input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true">
91 </td>
92 </tr>
93 <tr>
94 <td>
95 <label for="stopCondition">QBT_TR(Stop condition:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
96 </td>
97 <td>
98 <select id="stopCondition" name="stopCondition">
99 <option selected value="None">QBT_TR(None)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
100 <option value="MetadataReceived">QBT_TR(Metadata received)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
101 <option value="FilesChecked">QBT_TR(Files checked)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
102 </select>
103 </td>
104 </tr>
105 <tr>
106 <td>
107 <label for="skip_checking">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
108 </td>
109 <td>
110 <input type="checkbox" id="skip_checking" name="skip_checking" value="true">
111 </td>
112 </tr>
113 <tr>
114 <td>
115 <label for="contentLayout">QBT_TR(Content layout:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
116 </td>
117 <td>
118 <select id="contentLayout" name="contentLayout">
119 <option selected value="Original">QBT_TR(Original)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
120 <option value="Subfolder">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
121 <option value="NoSubfolder">QBT_TR(Don't create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
122 </select>
123 </td>
124 </tr>
125 <tr>
126 <td>
127 <label for="sequentialDownload">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
128 </td>
129 <td>
130 <input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true">
131 </td>
132 </tr>
133 <tr>
134 <td>
135 <label for="firstLastPiecePrio">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
136 </td>
137 <td>
138 <input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true">
139 </td>
140 </tr>
141 <tr>
142 <td>
143 <label for="dlLimitText">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
144 </td>
145 <td>
146 <input type="hidden" id="dlLimitHidden" name="dlLimit">
147 <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s">
148 </td>
149 </tr>
150 <tr>
151 <td>
152 <label for="upLimitText">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
153 </td>
154 <td>
155 <input type="hidden" id="upLimitHidden" name="upLimit">
156 <input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s">
157 </td>
158 </tr>
159 </tbody>
160 </table>
161 <div id="submitbutton" style="margin-top: 12px; text-align: center;">
162 <button type="submit" id="submitButton">QBT_TR(Download)QBT_TR[CONTEXT=downloadFromURL]</button>
163 </div>
164 </fieldset>
165 </div>
166 </form>
167 <div id="download_spinner" class="mochaSpinner"></div>
169 <script>
170 "use strict";
172 const encodedUrls = new URI().getData("urls");
173 if (encodedUrls) {
174 const urls = encodedUrls.split("|").map((url) => {
175 return decodeURIComponent(url);
178 if (urls.length)
179 $("urls").value = urls.join("\n");
182 let submitted = false;
184 $("downloadForm").addEventListener("submit", () => {
185 $("startTorrentHidden").value = $("startTorrent").checked ? "false" : "true";
187 $("dlLimitHidden").value = $("dlLimitText").value.toInt() * 1024;
188 $("upLimitHidden").value = $("upLimitText").value.toInt() * 1024;
190 $("download_spinner").style.display = "block";
191 submitted = true;
194 $("download_frame").addEventListener("load", () => {
195 if (submitted)
196 window.parent.qBittorrent.Client.closeWindows();
199 window.qBittorrent.pathAutofill.attachPathAutofill();
200 </script>
201 </body>
203 </html>