mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
58 lines
2.2 KiB
HTML
58 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="${LANG}" class="dark">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>QBT_TR(Add web seeds)QBT_TR[CONTEXT=HttpServer]</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 src="scripts/localpreferences.js?v=${CACHEID}"></script>
|
|
<script src="scripts/color-scheme.js?v=${CACHEID}"></script>
|
|
<script>
|
|
"use strict";
|
|
|
|
window.addEventListener("DOMContentLoaded", () => {
|
|
window.addEventListener("keydown", (event) => {
|
|
switch (event.key) {
|
|
case "Escape":
|
|
event.preventDefault();
|
|
window.parent.qBittorrent.Client.closeFrameWindow(window);
|
|
break;
|
|
}
|
|
});
|
|
|
|
document.getElementById("urls").focus();
|
|
document.getElementById("addWebSeedsButton").addEventListener("click", (e) => {
|
|
e.stopPropagation();
|
|
|
|
fetch("api/v2/torrents/addWebSeeds", {
|
|
method: "POST",
|
|
body: new URLSearchParams({
|
|
hash: new URLSearchParams(window.location.search).get("hash"),
|
|
urls: document.getElementById("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|")
|
|
})
|
|
})
|
|
.then((response) => {
|
|
if (!response.ok)
|
|
return;
|
|
|
|
window.parent.qBittorrent.Client.closeFrameWindow(window);
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div style="text-align: center;">
|
|
<br>
|
|
<label for="urls">QBT_TR(List of web seeds to add (one per line):)QBT_TR[CONTEXT=HttpServer]</label>
|
|
<textarea name="list" id="urls" rows="10" cols="1"></textarea>
|
|
<br>
|
|
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="addWebSeedsButton">
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|