2 <html lang=
"${LANG}" class=
"dark">
6 <title>QBT_TR(Set location)QBT_TR[CONTEXT=HttpServer]
</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 $("setLocationButton").click();
24 event
.preventDefault();
25 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
30 const path
= new URI().getData("path");
32 // set text field to current value
34 $("setLocation").value
= decodeURIComponent(path
);
36 $("setLocation").focus();
37 $("setLocationButton").addEventListener("click", (e
) => {
42 const location
= $("setLocation").value
.trim();
43 if ((location
=== null) || (location
=== "")) {
44 $("error_div").textContent
= "QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]";
48 fetch("api/v2/torrents/setLocation", {
50 body
: new URLSearchParams({
51 "hashes": new URI().getData("hashes"),
55 .then(async (response
) => {
57 $("error_div").textContent
= await response
.text();
61 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
69 <div style=
"padding: 10px 10px 0px 10px;">
70 <label for=
"setLocation" style=
"font-weight: bold;">QBT_TR(Location:)QBT_TR[CONTEXT=TransferListWidget]
</label>
71 <input type=
"text" id=
"setLocation" autocorrect=
"off" autocapitalize=
"none" style=
"width: 99%;">
72 <div style=
"float: none; width: 99%;" id=
"error_div"> </div>
73 <div style=
"text-align: center; padding-top: 10px;">
74 <input type=
"button" value=
"QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id=
"setLocationButton">