WebUI: Use Map instead of Mootools Hash in Torrents table
[qBittorrent.git] / src / webui / www / private / upload.html
blob87f03871dd1f236c32765c9ff232bd0368bc0dea
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Upload local torrent)QBT_TR[CONTEXT=HttpServer]</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/download.js?v=${CACHEID}"></script>
11 <script src="scripts/pathAutofill.js?v=${CACHEID}"></script>
12 </head>
14 <body>
15 <iframe id="upload_frame" name="upload_frame" class="invisible" title="" src="about:blank"></iframe>
16 <form action="api/v2/torrents/add" enctype="multipart/form-data" method="post" id="uploadForm" style="text-align: center;" target="upload_frame" autocorrect="off" autocapitalize="none">
17 <div style="margin-top: 25px; display: inline-block; border: 1px solid lightgrey; border-radius: 4px;">
18 <input type="file" id="fileselect" accept=".torrent, application/x-bittorrent" name="fileselect[]" multiple aria-label="QBT_TR(Select .torrent files)QBT_TR[CONTEXT=AddNewTorrentDialog]">
19 </div>
20 <fieldset class="settings" style="border: 0; text-align: left; margin-top: 12px;">
21 <legend>QBT_TR(Torrent options)QBT_TR[CONTEXT=AddNewTorrentDialog]</legend>
22 <table style="margin: auto;">
23 <tbody>
24 <tr>
25 <td>
26 <label for="autoTMM">QBT_TR(Torrent Management Mode:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
27 </td>
28 <td>
29 <select id="autoTMM" name="autoTMM" onchange="qBittorrent.Download.changeTMM(this)">
30 <option selected value="false">QBT_TR(Manual)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
31 <option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
32 </select>
33 </td>
34 </tr>
35 <tr>
36 <td>
37 <label for="savepath">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
38 </td>
39 <td>
40 <input type="text" id="savepath" name="savepath" class="pathDirectory" style="width: 16em;">
41 </td>
42 </tr>
43 <tr>
44 <td>
45 <label for="rename">QBT_TR(Rename torrent)QBT_TR[CONTEXT=HttpServer]</label>
46 </td>
47 <td>
48 <input type="text" id="rename" name="rename" style="width: 16em;">
49 </td>
50 </tr>
51 <tr>
52 <td>
53 <label id="categoryLabel" for="categorySelect">QBT_TR(Category:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
54 </td>
55 <td>
56 <div class="select-watched-folder-editable">
57 <select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
58 <option selected value="\other"></option>
59 </select>
60 <input type="text" name="category" aria-labelledby="categoryLabel">
61 </div>
62 </td>
63 </tr>
64 <tr>
65 <td>
66 <label for="startTorrent">QBT_TR(Start torrent)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
67 </td>
68 <td>
69 <input type="hidden" id="startTorrentHidden" name="stopped">
70 <input type="checkbox" id="startTorrent">
71 </td>
72 </tr>
73 <tr>
74 <td>
75 <label for="addToTopOfQueue">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
76 </td>
77 <td>
78 <input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true">
79 </td>
80 </tr>
81 <tr>
82 <td>
83 <label for="stopCondition">QBT_TR(Stop condition:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
84 </td>
85 <td>
86 <select id="stopCondition" name="stopCondition">
87 <option selected value="None">QBT_TR(None)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
88 <option value="MetadataReceived">QBT_TR(Metadata received)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
89 <option value="FilesChecked">QBT_TR(Files checked)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
90 </select>
91 </td>
92 </tr>
93 <tr>
94 <td>
95 <label for="skip_checking">QBT_TR(Skip hash check)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
96 </td>
97 <td>
98 <input type="checkbox" id="skip_checking" name="skip_checking" value="true">
99 </td>
100 </tr>
101 <tr>
102 <td>
103 <label for="contentLayout">QBT_TR(Content layout:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
104 </td>
105 <td>
106 <select id="contentLayout" name="contentLayout">
107 <option selected value="Original">QBT_TR(Original)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
108 <option value="Subfolder">QBT_TR(Create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
109 <option value="NoSubfolder">QBT_TR(Don't create subfolder)QBT_TR[CONTEXT=AddNewTorrentDialog]</option>
110 </select>
111 </td>
112 </tr>
113 <tr>
114 <td>
115 <label for="sequentialDownload">QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</label>
116 </td>
117 <td>
118 <input type="checkbox" id="sequentialDownload" name="sequentialDownload" value="true">
119 </td>
120 </tr>
121 <tr>
122 <td>
123 <label for="firstLastPiecePrio">QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</label>
124 </td>
125 <td>
126 <input type="checkbox" id="firstLastPiecePrio" name="firstLastPiecePrio" value="true">
127 </td>
128 </tr>
129 <tr>
130 <td>
131 <label for="dlLimitText">QBT_TR(Limit download rate)QBT_TR[CONTEXT=HttpServer]</label>
132 </td>
133 <td>
134 <input type="hidden" id="dlLimitHidden" name="dlLimit">
135 <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s">
136 </td>
137 </tr>
138 <tr>
139 <td>
140 <label for="upLimitText">QBT_TR(Limit upload rate)QBT_TR[CONTEXT=HttpServer]</label>
141 </td>
142 <td>
143 <input type="hidden" id="upLimitHidden" name="upLimit">
144 <input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s">
145 </td>
146 </tr>
147 </tbody>
148 </table>
149 <div id="submitbutton" style="margin-top: 30px; text-align: center;">
150 <button type="submit" style="font-size: 1em;">QBT_TR(Upload Torrents)QBT_TR[CONTEXT=HttpServer]</button>
151 </div>
152 </fieldset>
153 </form>
154 <div id="upload_spinner" class="mochaSpinner"></div>
156 <script>
157 "use strict";
159 let submitted = false;
161 $("uploadForm").addEventListener("submit", () => {
162 $("startTorrentHidden").value = $("startTorrent").checked ? "false" : "true";
164 $("dlLimitHidden").value = $("dlLimitText").value.toInt() * 1024;
165 $("upLimitHidden").value = $("upLimitText").value.toInt() * 1024;
167 $("upload_spinner").style.display = "block";
168 submitted = true;
171 $("upload_frame").addEventListener("load", () => {
172 if (submitted)
173 window.parent.qBittorrent.Client.closeWindows();
176 if ((Browser.platform === "ios") || ((Browser.platform === "mac") && (navigator.maxTouchPoints > 1)))
177 $("fileselect").accept = ".torrent";
179 window.qBittorrent.pathAutofill.attachPathAutofill();
180 </script>
181 </body>
183 </html>