WebUI: provide semantic information of table body
[qBittorrent.git] / src / webui / www / private / download.html
blob7be8e6e9692036ebb299fc3a4788b545c794557d
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 class="vcenter">QBT_TR(Download Torrents from their URLs or Magnet links)QBT_TR[CONTEXT=HttpServer]</h2>
22 <textarea id="urls" rows="10" name="urls"></textarea>
23 <p>QBT_TR(Only one link per line)QBT_TR[CONTEXT=HttpServer]</p>
24 <fieldset class="settings" style="border: 0; text-align: left; margin-top: 6px;">
25 <table style="margin: auto;">
26 <tbody>
27 <tr>
28 <td>
29 <label for="autoTMM">QBT_TR(Torrent Management Mode:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
30 </td>
31 <td>
32 <select id="autoTMM" name="autoTMM" onchange="qBittorrent.Download.changeTMM(this)">
33 <option selected value="false">QBT_TR(Manual)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
34 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
35 </select>
36 </td>
37 </tr>
38 <tr>
39 <td>
40 <label for="savepath">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
41 </td>
42 <td>
43 <input type="text" id="savepath" name="savepath" class="pathDirectory" style="width: 16em;" />
44 </td>
45 </tr>
46 <tr>
47 <td>
48 <label for="cookie">QBT_TR(Cookie:)QBT_TR[CONTEXT=HttpServer]</label>
49 </td>
50 <td>
51 <input type="text" id="cookie" name="cookie" style="width: 16em;" />
52 </td>
53 </tr>
54 <tr>
55 <td>
56 <label for="rename">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
57 </td>
58 <td>
59 <input type="text" id="rename" name="rename" style="width: 16em;" />
60 </td>
61 </tr>
62 <tr>
63 <td>
64 <label for="category">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
65 </td>
66 <td>
67 <div class="select-watched-folder-editable">
68 <select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
69 <option selected value="\other"></option>
70 </select>
71 <input name="category" type="text" />
72 </div>
73 </td>
74 </tr>
75 <tr>
76 <td>
77 <label for="startTorrent">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
78 </td>
79 <td>
80 <input type="hidden" id="startTorrentHidden" name="stopped" />
81 <input type="checkbox" id="startTorrent" />
82 </td>
83 </tr>
84 <tr>
85 <td>
86 <label for="addToTopOfQueue">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
87 </td>
88 <td>
89 <input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true" />
90 </td>
91 </tr>
92 <tr>
93 <td>
94 <label for="stopCondition">QBT_TR(Stop condition:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
95 </td>
96 <td>
97 <select id="stopCondition" name="stopCondition">
98 <option selected value="None">QBT_TR(None)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
99 <option value="MetadataReceived">QBT_TR(Metadata received)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
100 <option value="FilesChecked">QBT_TR(Files checked)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
101 </select>
102 </td>
103 </tr>
104 <tr>
105 <td>
106 <label for="skip_checking">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
107 </td>
108 <td>
109 <input type="checkbox" id="skip_checking" name="skip_checking" value="true" />
110 </td>
111 </tr>
112 <tr>
113 <td>
114 <label for="contentLayout">QBT_TR(Content layout:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
115 </td>
116 <td>
117 <select id="contentLayout" name="contentLayout">
118 <option selected value="Original">QBT_TR(Original)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
119 <option value="Subfolder">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
120 <option value="NoSubfolder">QBT_TR(Don't create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
121 </select>
122 </td>
123 </tr>
124 <tr>
125 <td>
126 <label for="sequentialDownload">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
127 </td>
128 <td>
129 <input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true" />
130 </td>
131 </tr>
132 <tr>
133 <td>
134 <label for="firstLastPiecePrio">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
135 </td>
136 <td>
137 <input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true" />
138 </td>
139 </tr>
140 <tr>
141 <td>
142 <label for="dlLimitText">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
143 </td>
144 <td>
145 <input type="hidden" id="dlLimitHidden" name="dlLimit" />
146 <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s" />
147 </td>
148 </tr>
149 <tr>
150 <td>
151 <label for="upLimitText">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
152 </td>
153 <td>
154 <input type="hidden" id="upLimitHidden" name="upLimit" />
155 <input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s" />
156 </td>
157 </tr>
158 </tbody>
159 </table>
160 <div id="submitbutton" style="margin-top: 12px; text-align: center;">
161 <button type="submit" id="submitButton">QBT_TR(Download)QBT_TR[CONTEXT=downloadFromURL]</button>
162 </div>
163 </fieldset>
164 </div>
165 </form>
166 <div id="download_spinner" class="mochaSpinner"></div>
168 <script>
169 "use strict";
171 const encodedUrls = new URI().getData("urls");
172 if (encodedUrls) {
173 const urls = encodedUrls.split("|").map((url) => {
174 return decodeURIComponent(url);
177 if (urls.length)
178 $("urls").value = urls.join("\n");
181 let submitted = false;
183 $("downloadForm").addEventListener("submit", () => {
184 $("startTorrentHidden").value = $("startTorrent").checked ? "false" : "true";
186 $("dlLimitHidden").value = $("dlLimitText").value.toInt() * 1024;
187 $("upLimitHidden").value = $("upLimitText").value.toInt() * 1024;
189 $("download_spinner").style.display = "block";
190 submitted = true;
193 $("download_frame").addEventListener("load", () => {
194 if (submitted)
195 window.parent.qBittorrent.Client.closeWindows();
198 window.qBittorrent.pathAutofill.attachPathAutofill();
199 </script>
200 </body>
202 </html>