2 <html lang=
"${LANG}" class=
"dark">
6 <title>QBT_TR(Rule renaming)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 src=
"scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
16 window
.addEventListener("DOMContentLoaded", () => {
17 window
.addEventListener("keydown", (event
) => {
20 event
.preventDefault();
21 $("renameButton").click();
24 event
.preventDefault();
25 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
30 const oldName
= new URI().getData("rule");
32 $("rename").value
= oldName
;
34 $("rename").setSelectionRange(0, oldName
.length
);
36 $("renameButton").addEventListener("click", (e
) => {
41 const newName
= $("rename").value
.trim();
43 alert("QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]");
47 if (newName
=== oldName
) {
48 alert("QBT_TR(Name is unchanged)QBT_TR[CONTEXT=HttpServer]");
52 $("renameButton").disabled
= true;
54 fetch("api/v2/rss/renameRule", {
56 body
: new URLSearchParams({
58 "newRuleName": newName
65 window
.parent
.qBittorrent
.RssDownloader
.updateRulesList();
66 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
74 <div style=
"padding: 10px 10px 0px 10px;">
75 <label for=
"rename">QBT_TR(Please type the new rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]
</label>
76 <input type=
"text" id=
"rename" style=
"width: 320px;">
77 <div style=
"text-align: center; padding-top: 10px;">
78 <input type=
"button" value=
"QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id=
"renameButton">