mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 21:28:07 -06:00
80 lines
3.0 KiB
HTML
80 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="${LANG}">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>QBT_TR(Please choose a folder name)QBT_TR[CONTEXT=RSSWidget]</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/misc.js?locale=${LANG}&v=${CACHEID}"></script>
|
|
<script src="scripts/pathAutofill.js?v=${CACHEID}"></script>
|
|
<script>
|
|
"use strict";
|
|
|
|
new Keyboard({
|
|
defaultEventType: "keydown",
|
|
events: {
|
|
"Enter": (event) => {
|
|
$("submitButton").click();
|
|
event.preventDefault();
|
|
},
|
|
"Escape": (event) => {
|
|
window.parent.qBittorrent.Client.closeWindows();
|
|
event.preventDefault();
|
|
},
|
|
"Esc": (event) => {
|
|
window.parent.qBittorrent.Client.closeWindows();
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
}).activate();
|
|
window.addEvent("domready", () => {
|
|
$("folderName").focus();
|
|
const path = new URI().getData("path");
|
|
$("submitButton").addEvent("click", (e) => {
|
|
new Event(e).stop();
|
|
// check field
|
|
const folderName = $("folderName").value.trim();
|
|
if (folderName === "") {
|
|
alert("QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]");
|
|
return;
|
|
}
|
|
|
|
$("submitButton").disabled = true;
|
|
|
|
new Request({
|
|
url: "api/v2/rss/addFolder",
|
|
method: "post",
|
|
data: {
|
|
path: path ? (path + "\\" + folderName) : folderName
|
|
},
|
|
onSuccess: (response) => {
|
|
window.parent.qBittorrent.Rss.updateRssFeedList();
|
|
window.parent.qBittorrent.Client.closeWindows();
|
|
},
|
|
onFailure: (response) => {
|
|
if (response.status === 409)
|
|
alert(response.responseText);
|
|
$("submitButton").disabled = false;
|
|
}
|
|
}).send();
|
|
});
|
|
});
|
|
|
|
window.qBittorrent.pathAutofill.attachPathAutofill();
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div style="padding: 10px 10px 0px 10px;">
|
|
<label for="folderName" style="font-weight: bold;">QBT_TR(Folder name:)QBT_TR[CONTEXT=RSSWidget]</label>
|
|
<input type="text" id="folderName" class="pathDirectory" 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>
|