Enable customizing the save statistics time interval
[qBittorrent.git] / src / webui / www / private / newfolder.html
blob74be677e85367ef259f3ca2e5b26011f70bcb1bc
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Please choose a folder name)QBT_TR[CONTEXT=RSSWidget]</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 src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
11 <script src="scripts/pathAutofill.js?v=${CACHEID}"></script>
12 <script>
13 "use strict";
15 new Keyboard({
16 defaultEventType: "keydown",
17 events: {
18 "Enter": (event) => {
19 $("submitButton").click();
20 event.preventDefault();
22 "Escape": (event) => {
23 window.parent.qBittorrent.Client.closeWindows();
24 event.preventDefault();
26 "Esc": (event) => {
27 window.parent.qBittorrent.Client.closeWindows();
28 event.preventDefault();
31 }).activate();
32 window.addEventListener("DOMContentLoaded", () => {
33 $("folderName").focus();
34 const path = new URI().getData("path");
35 $("submitButton").addEventListener("click", (e) => {
36 e.preventDefault();
37 e.stopPropagation();
39 // check field
40 const folderName = $("folderName").value.trim();
41 if (folderName === "") {
42 alert("QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]");
43 return;
46 $("submitButton").disabled = true;
48 new Request({
49 url: "api/v2/rss/addFolder",
50 method: "post",
51 data: {
52 path: path ? (path + "\\" + folderName) : folderName
54 onSuccess: (response) => {
55 window.parent.qBittorrent.Rss.updateRssFeedList();
56 window.parent.qBittorrent.Client.closeWindows();
58 onFailure: (response) => {
59 if (response.status === 409)
60 alert(response.responseText);
61 $("submitButton").disabled = false;
63 }).send();
64 });
65 });
67 window.qBittorrent.pathAutofill.attachPathAutofill();
68 </script>
69 </head>
71 <body>
72 <div style="padding: 10px 10px 0px 10px;">
73 <label for="folderName" style="font-weight: bold;">QBT_TR(Folder name:)QBT_TR[CONTEXT=RSSWidget]</label>
74 <input type="text" id="folderName" class="pathDirectory" style="width: 320px;">
75 <div style="text-align: center; padding-top: 10px;">
76 <input type="button" value="QBT_TR(OK)QBT_TR[CONTEXT=HttpServer]" id="submitButton">
77 </div>
78 </div>
79 </body>
81 </html>