WebUI: migrate to fetch API
[qBittorrent.git] / src / webui / www / private / confirmruleclear.html
blob8b562b2573e59140d410bf6c6459105449227fa1
1 <!DOCTYPE html>
2 <html lang="${LANG}" class="dark">
4 <head>
5 <meta charset="UTF-8">
6 <title>QBT_TR(Clear downloaded episodes)QBT_TR[CONTEXT=AutomatedRssDownloader]</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/localpreferences.js?v=${CACHEID}"></script>
11 <script src="scripts/color-scheme.js?v=${CACHEID}"></script>
12 <script>
13 "use strict";
15 window.addEventListener("DOMContentLoaded", () => {
16 const rules = new URI().getData("rules").split("|");
18 $("cancelBtn").focus();
19 $("cancelBtn").addEventListener("click", (e) => {
20 e.preventDefault();
21 e.stopPropagation();
22 window.parent.qBittorrent.Client.closeFrameWindow(window);
23 });
24 $("confirmBtn").addEventListener("click", (e) => {
25 e.preventDefault();
26 e.stopPropagation();
28 let completionCount = 0;
29 rules.forEach((rule) => {
30 window.parent.qBittorrent.RssDownloader.modifyRuleState(decodeURIComponent(rule), "previouslyMatchedEpisodes", [], () => {
31 ++completionCount;
32 if (completionCount === rules.length) {
33 window.parent.qBittorrent.RssDownloader.updateRulesList();
34 window.parent.qBittorrent.Client.closeFrameWindow(window);
36 });
37 });
38 });
39 });
40 </script>
41 </head>
43 <body>
44 <div style="padding: 10px 10px 0px 10px;">
45 <p>QBT_TR(Are you sure you want to clear the list of downloaded episodes for the selected rule?)QBT_TR[CONTEXT=AutomatedRssDownloader]</p>
46 <div style="text-align: right;">
47 <input type="button" id="cancelBtn" value="QBT_TR(No)QBT_TR[CONTEXT=MainWindow]">
48 <input type="button" id="confirmBtn" value="QBT_TR(Yes)QBT_TR[CONTEXT=MainWindow]">
49 </div>
50 </div>
51 </body>
53 </html>