Clean up functions in global scope

This commit is contained in:
Chocobo1
2024-02-08 12:03:10 +08:00
parent 9b64d50660
commit f7e9ff0fb0
24 changed files with 294 additions and 270 deletions

View File

@@ -14,11 +14,11 @@
defaultEventType: 'keydown',
events: {
'Escape': function(event) {
window.parent.closeWindows();
window.parent.qBittorrent.Client.closeWindows();
event.preventDefault();
},
'Esc': function(event) {
window.parent.closeWindows();
window.parent.qBittorrent.Client.closeWindows();
event.preventDefault();
}
}
@@ -49,7 +49,7 @@
alert("QBT_TR(Unable to add peers. Please ensure you are adhering to the IP:port format.)QBT_TR[CONTEXT=HttpServer]");
},
onSuccess: function() {
window.parent.closeWindows();
window.parent.qBittorrent.Client.closeWindows();
}
}).send();
});
@@ -62,7 +62,7 @@
<p>QBT_TR(List of peers to add (one IP per line):)QBT_TR[CONTEXT=PeersAdditionDialog]</p>
<textarea id="peers" rows="10" style="width: 100%;" placeholder="QBT_TR(Format: IPv4:port / [IPv6]:port)QBT_TR[CONTEXT=PeersAdditionDialog]"></textarea>
<div style="margin-top: 10px; text-align: center;">
<button type="button" onclick="parent.closeWindows();">QBT_TR(Cancel)QBT_TR[CONTEXT=PeersAdditionDialog]</button>
<button type="button" onclick="parent.qBittorrent.Client.closeWindows();">QBT_TR(Cancel)QBT_TR[CONTEXT=PeersAdditionDialog]</button>
<button type="button" id="addPeersOk">QBT_TR(Ok)QBT_TR[CONTEXT=PeersAdditionDialog]</button>
</div>
</div>