Files
qBittorrent/src/webui/www/private/newfeed.html
tehcneko c79a9624af WebUI: Remove unnecessary script loading
Removed Mootools script in most iframes, there is no longer any Mootools usage in them.

PR #22772.
2025-05-27 14:33:22 +08:00

76 lines
2.9 KiB
HTML

<!DOCTYPE html>
<html lang="${LANG}" class="dark">
<head>
<meta charset="UTF-8">
<title>QBT_TR(Please type a RSS feed URL)QBT_TR[CONTEXT=RSSWidget]</title>
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css">
<script src="scripts/localpreferences.js?v=${CACHEID}"></script>
<script src="scripts/color-scheme.js?v=${CACHEID}"></script>
<script>
"use strict";
window.addEventListener("DOMContentLoaded", (event) => {
window.addEventListener("keydown", (event) => {
switch (event.key) {
case "Enter":
event.preventDefault();
document.getElementById("submitButton").click();
break;
case "Escape":
event.preventDefault();
window.parent.qBittorrent.Client.closeFrameWindow(window);
break;
}
});
document.getElementById("feedURL").focus();
document.getElementById("submitButton").addEventListener("click", (e) => {
e.preventDefault();
e.stopPropagation();
// check field
const feedURL = document.getElementById("feedURL").value.trim();
if (feedURL === "") {
alert("QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]");
return;
}
document.getElementById("submitButton").disabled = true;
const path = new URLSearchParams(window.location.search).get("path");
fetch("api/v2/rss/addFeed", {
method: "POST",
body: new URLSearchParams({
url: feedURL,
path: (((path !== null) && (path.length > 0)) ? `${path}\\${feedURL}` : "")
})
})
.then(async (response) => {
if (!response.ok) {
if (response.status === 409)
alert(await response.text());
document.getElementById("submitButton").disabled = false;
return;
}
window.parent.qBittorrent.Rss.updateRssFeedList();
window.parent.qBittorrent.Client.closeFrameWindow(window);
});
});
});
</script>
</head>
<body>
<div style="padding: 10px 10px 0px 10px;">
<label for="feedURL" style="font-weight: bold;">QBT_TR(Feed URL:)QBT_TR[CONTEXT=RSSWidget]</label>
<input type="text" id="feedURL" style="width: 320px;">
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(OK)QBT_TR[CONTEXT=HttpServer]" id="submitButton">
</div>
</div>
</body>
</html>