1 <div id=
"confirmAutoTMMDialog">
2 <div class=
"genericConfirmGrid">
3 <span class=
"confirmGridItem confirmWarning"></span>
4 <span class=
"confirmGridItem dialogMessage" id=
"confirmAutoTmmMessage"></span>
8 <input type=
"button" value=
"QBT_TR(Yes)QBT_TR[CONTEXT=MainWindow]" id=
"confirmAutoTmmButton">
9 <input type=
"button" value=
"QBT_TR(No)QBT_TR[CONTEXT=MainWindow]" id=
"cancelAutoTmmButton">
16 const confirmButton
= document
.getElementById("confirmAutoTmmButton");
17 const cancelButton
= document
.getElementById("cancelAutoTmmButton");
18 const confirmText
= document
.getElementById("confirmAutoTmmMessage");
21 options
: { data
: { hashes
, enable
}, id
},
23 } = window
.MUI
.Windows
.instances
["confirmAutoTMMDialog"];
25 confirmText
.textContent
= "QBT_TR(Are you sure you want to enable Automatic Torrent Management for the selected torrent(s)? They may be relocated.)QBT_TR[CONTEXT=confirmAutoTMMDialog]";
27 cancelButton
.addEventListener("click", (e
) => { window
.qBittorrent
.Client
.closeWindow(id
); });
28 confirmButton
.addEventListener("click", (e
) => {
30 url
: "api/v2/torrents/setAutoManagement",
33 hashes
: hashes
.join("|"),
38 window
.qBittorrent
.Client
.closeWindow(id
);
41 alert("QBT_TR(Unable to set Auto Torrent Management for the selected torrents.)QBT_TR[CONTEXT=HttpServer]");
46 // set tabindex so window element receives keydown events
47 windowEl
.setAttribute("tabindex", "-1");
49 windowEl
.addEventListener("keydown", (e
) => {
52 confirmButton
.click();
55 window
.qBittorrent
.Client
.closeWindow(id
);