6 <title>QBT_TR(Add Peers)QBT_TR[CONTEXT=PeersAdditionDialog]
</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>
14 defaultEventType
: "keydown",
16 "Escape": function(event
) {
17 window
.parent
.qBittorrent
.Client
.closeWindows();
18 event
.preventDefault();
20 "Esc": function(event
) {
21 window
.parent
.qBittorrent
.Client
.closeWindows();
22 event
.preventDefault();
27 window
.addEventListener("DOMContentLoaded", () => {
28 const hash
= new URI().getData("hash");
34 $("addPeersOk").addEventListener("click", (e
) => {
38 const peers
= $("peers").value
.trim().split(/[\r\n]+/);
39 if (peers
.length
=== 0)
43 url
: "api/v2/torrents/addPeers",
47 peers
: peers
.join("|")
49 onFailure: function() {
50 alert("QBT_TR(Unable to add peers. Please ensure you are adhering to the IP:port format.)QBT_TR[CONTEXT=HttpServer]");
52 onSuccess: function() {
53 window
.parent
.qBittorrent
.Client
.closeWindows();
62 <div style=
"padding: 10px 10px 0px 10px;">
63 <label for=
"peers">QBT_TR(List of peers to add (one IP per line):)QBT_TR[CONTEXT=PeersAdditionDialog]
</label>
64 <textarea id=
"peers" rows=
"10" style=
"width: 100%;" placeholder=
"QBT_TR(Format: IPv4:port / [IPv6]:port)QBT_TR[CONTEXT=PeersAdditionDialog]"></textarea>
65 <div style=
"margin-top: 10px; text-align: center;">
66 <button type=
"button" onclick=
"parent.qBittorrent.Client.closeWindows();">QBT_TR(Cancel)QBT_TR[CONTEXT=PeersAdditionDialog]
</button>
67 <button type=
"button" id=
"addPeersOk">QBT_TR(Ok)QBT_TR[CONTEXT=PeersAdditionDialog]
</button>