mirror of
https://github.com/Carve/qbittorrent-webui-cjratliff.com.git
synced 2025-02-28 23:50:57 +01:00
59 lines
2.0 KiB
HTML
59 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="${LANG}">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Add web seeds</title>
|
|
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
|
|
<script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
|
|
<script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
|
|
<script>
|
|
"use strict";
|
|
|
|
window.addEventListener("DOMContentLoaded", () => {
|
|
new Keyboard({
|
|
defaultEventType: "keydown",
|
|
events: {
|
|
"Escape": function(event) {
|
|
window.parent.qBittorrent.Client.closeWindows();
|
|
event.preventDefault();
|
|
},
|
|
"Esc": function(event) {
|
|
window.parent.qBittorrent.Client.closeWindows();
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
}).activate();
|
|
|
|
$("urls").focus();
|
|
$("addWebSeedsButton").addEvent("click", (e) => {
|
|
e.stopPropagation();
|
|
const hash = new URI().getData("hash");
|
|
new Request({
|
|
url: "api/v2/torrents/addWebSeeds",
|
|
method: "post",
|
|
data: {
|
|
hash: hash,
|
|
urls: $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|")
|
|
},
|
|
onComplete: function() {
|
|
window.parent.qBittorrent.Client.closeWindows();
|
|
}
|
|
}).send();
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div style="text-align: center;">
|
|
<br>
|
|
<label for="urls">List of web seeds to add (one per line):</label>
|
|
<textarea name="list" id="urls" rows="10" cols="1"></textarea>
|
|
<br>
|
|
<input type="button" value="Add" id="addWebSeedsButton">
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|