Allow to use proxy per subsystem
[qBittorrent.git] / src / webui / www / private / newrule.html
blob99cb8ba787e836220cb522f4a892f1f1b52113c9
1 <!DOCTYPE html>
2 <html lang="${LANG}">
4 <head>
5 <meta charset="UTF-8" />
6 <title>QBT_TR(New rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]</title>
7 <link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
8 <script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
9 <script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
10 <script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
11 <script>
12 'use strict';
14 new Keyboard({
15 defaultEventType: 'keydown',
16 events: {
17 'Enter': (event) => {
18 $('submitButton').click();
19 event.preventDefault();
21 'Escape': (event) => {
22 window.parent.MochaUI.closeWindow(window.parent.$('newRulePage'));
23 event.preventDefault();
25 'Esc': (event) => {
26 window.parent.MochaUI.closeWindow(window.parent.$('newRulePage'));
27 event.preventDefault();
30 }).activate();
31 window.addEvent('domready', () => {
32 $('name').focus();
33 $('submitButton').addEvent('click', (e) => {
34 new Event(e).stop();
35 // check field
36 const name = $('name').value.trim();
37 if (name === '') {
38 alert('QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]');
39 return;
41 $('submitButton').disabled = true;
42 new Request({
43 url: 'api/v2/rss/setRule',
44 noCache: true,
45 method: 'post',
46 data: {
47 ruleName: name,
48 ruleDef: '{}'
50 onSuccess: (response) => {
51 window.parent.qBittorrent.RssDownloader.updateRulesList();
52 window.parent.MochaUI.closeWindow(window.parent.$('newRulePage'));
54 }).send();
55 });
56 });
57 </script>
58 </head>
60 <body>
61 <div style="padding: 10px 10px 0px 10px;">
62 <p>QBT_TR(Please type the name of the new download rule.)QBT_TR[CONTEXT=AutomatedRssDownloader]</p>
63 <input type="text" id="name" style="width: 320px;" />
64 <div style="text-align: center; padding-top: 10px;">
65 <input type="button" value="QBT_TR(OK)QBT_TR[CONTEXT=HttpServer]" id="submitButton" />
66 </div>
67 </div>
68 </body>
70 </html>