WebUI: Use native function for selecting elements by ID

This commit is contained in:
skomerko
2025-04-12 11:57:27 +02:00
parent 7b3aa51bb1
commit 411ca0f668
48 changed files with 1303 additions and 1303 deletions

View File

@@ -22,15 +22,15 @@
}
});
$("urls").focus();
$("addWebSeedsButton").addEventListener("click", (e) => {
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: $("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|")
urls: document.getElementById("urls").value.split("\n").map(w => encodeURIComponent(w.trim())).filter(w => (w.length > 0)).join("|")
})
})
.then((response) => {