mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 14:12:30 -06:00
WebUI: Add RSS functionality
Implemented RSS Reader and AutoDownloader in reference WebUI.
This commit is contained in:
70
src/webui/www/private/newrule.html
Normal file
70
src/webui/www/private/newrule.html
Normal file
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="${LANG}">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]</title>
|
||||
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
|
||||
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
|
||||
<script src="scripts/lib/mootools-1.2-more.js"></script>
|
||||
<script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
events: {
|
||||
'Enter': (event) => {
|
||||
$('submitButton').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': (event) => {
|
||||
window.parent.MochaUI.closeWindow(window.parent.$('newRulePage'));
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': (event) => {
|
||||
window.parent.MochaUI.closeWindow(window.parent.$('newRulePage'));
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}).activate();
|
||||
window.addEvent('domready', () => {
|
||||
$('name').focus();
|
||||
$('submitButton').addEvent('click', (e) => {
|
||||
new Event(e).stop();
|
||||
// check field
|
||||
const name = $('name').value.trim();
|
||||
if (name === '') {
|
||||
alert('QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]');
|
||||
return;
|
||||
}
|
||||
$('submitButton').disabled = true;
|
||||
new Request({
|
||||
url: '/api/v2/rss/setRule',
|
||||
noCache: true,
|
||||
method: 'post',
|
||||
data: {
|
||||
ruleName: name,
|
||||
ruleDef: '{}'
|
||||
},
|
||||
onSuccess: (response) => {
|
||||
window.parent.qBittorrent.RssDownloader.updateRulesList();
|
||||
window.parent.MochaUI.closeWindow(window.parent.$('newRulePage'));
|
||||
}
|
||||
}).send();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style="padding: 10px 10px 0px 10px;">
|
||||
<p>QBT_TR(Please type the name of the new download rule.)QBT_TR[CONTEXT=AutomatedRssDownloader]</p>
|
||||
<input type="text" id="name" value="" maxlength="100" 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>
|
||||
Reference in New Issue
Block a user