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/misc.js?locale=${LANG}&v=${CACHEID}"></script>
15 defaultEventType
: "keydown",
17 "Enter": function(event
) {
18 $("setLocationButton").click();
19 event
.preventDefault();
21 "Escape": function(event
) {
22 window
.parent
.qBittorrent
.Client
.closeWindows();
23 event
.preventDefault();
25 "Esc": function(event
) {
26 window
.parent
.qBittorrent
.Client
.closeWindows();
27 event
.preventDefault();
32 window
.addEventListener("DOMContentLoaded", () => {
33 const path
= new URI().getData("path");
35 // set text field to current value
37 $("setLocation").value
= decodeURIComponent(path
);
39 $("setLocation").focus();
40 $("setLocationButton").addEventListener("click", (e
) => {
45 const location
= $("setLocation").value
.trim();
46 if ((location
=== null) || (location
=== "")) {
47 $("error_div").textContent
= "QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]";
51 const hashesList
= new URI().getData("hashes");
53 url
: "api/v2/torrents/setLocation",
59 onSuccess: function() {
60 window
.parent
.qBittorrent
.Client
.closeWindows();
62 onFailure: function(xhr
) {
63 $("error_div").textContent
= xhr
.response
;
72 <div style=
"padding: 10px 10px 0px 10px;">
73 <label for=
"setLocation" style=
"font-weight: bold;">QBT_TR(Location:)QBT_TR[CONTEXT=TransferListWidget]
</label>
74 <input type=
"text" id=
"setLocation" autocorrect=
"off" autocapitalize=
"none" style=
"width: 99%;">
75 <div style=
"float: none; width: 99%;" id=
"error_div"> </div>
76 <div style=
"text-align: center; padding-top: 10px;">
77 <input type=
"button" value=
"QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id=
"setLocationButton">