Merge pull request #13006 from SeproDE/webui-rss-fixes

Fix issues regarding WebUI RSS implementation
This commit is contained in:
Mike Tzou 2020-06-14 12:17:12 +08:00 committed by GitHub
commit 59f365b343
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 75 additions and 20 deletions

View file

@ -66,7 +66,7 @@
<select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
<option selected value="\other"></option>
</select>
<input name="category" type="text" value="" />
<input name="category" type="text" />
</div>
</td>
</tr>

View file

@ -132,9 +132,9 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Category)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="categoryName" value="" maxlength="100" style="width: 220px;" />
<input type="text" id="categoryName" maxlength="100" style="width: 220px;" />
<p style="font-weight: bold;">QBT_TR(Save path)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="savePath" value="" style="width: 220px;" />
<input type="text" id="savePath" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="categoryNameButton" />
</div>

View file

@ -68,7 +68,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Feed URL:)QBT_TR[CONTEXT=RSSWidget]</p>
<input type="text" id="feedURL" value="" maxlength="100" style="width: 320px;" />
<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>

View file

@ -67,7 +67,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Folder name:)QBT_TR[CONTEXT=RSSWidget]</p>
<input type="text" id="folderName" value="" maxlength="100" style="width: 320px;" />
<input type="text" id="folderName" 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>

View file

@ -60,7 +60,7 @@
<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;" />
<input type="text" id="name" 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>

View file

@ -95,7 +95,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p id="legendText" style="font-weight: bold;">QBT_TR(Comma-separated tags:)QBT_TR[CONTEXT=TransferListWidget]</p>
<input type="text" id="tagName" value="" maxlength="100" style="width: 220px;" />
<input type="text" id="tagName" maxlength="100" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Add)QBT_TR[CONTEXT=HttpServer]" id="tagNameButton" />
</div>

View file

@ -65,7 +65,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="rename" value="" maxlength="100" style="width: 220px;" />
<input type="text" id="rename" maxlength="100" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
</div>

View file

@ -78,7 +78,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(New feed name:)QBT_TR[CONTEXT=RSSWidget]</p>
<input type="text" id="rename" value="" maxlength="100" style="width: 320px;" />
<input type="text" id="rename" style="width: 320px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
</div>

View file

@ -80,7 +80,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(New name:)QBT_TR[CONTEXT=TorrentContentTreeView]</p>
<input type="text" id="rename" value="" maxlength="100" style="width: 220px;" />
<input type="text" id="rename" maxlength="100" style="width: 220px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
</div>

View file

@ -71,7 +71,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p>QBT_TR(Please type the new rule name)QBT_TR[CONTEXT=AutomatedRssDownloader]</p>
<input type="text" id="rename" value="" maxlength="100" style="width: 320px;" />
<input type="text" id="rename" maxlength="100" style="width: 320px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="renameButton" />
</div>

View file

@ -68,7 +68,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="setLocation" value="" autocorrect="off" autocapitalize="none" style="width: 370px;" />
<input type="text" id="setLocation" autocorrect="off" autocapitalize="none" style="width: 370px;" />
<div style="float: none; width: 370px;" id="error_div">&nbsp;</div>
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="setLocationButton" />

View file

@ -54,7 +54,7 @@
<select id="categorySelect" onchange="qBittorrent.Download.changeCategorySelect(this)">
<option selected value="\other"></option>
</select>
<input name="category" type="text" value="" />
<input name="category" type="text" />
</div>
</td>
</tr>

View file

@ -31,6 +31,7 @@
.fullWidth {
width: 100%;
max-width: none;
box-sizing: border-box;
}
.noWrap {
@ -78,6 +79,50 @@
#lastMatchDiv {
float: right;
}
#ruleSettings {
padding: 4px 10px 4px 10px
}
#topMenuBar {
height: 26px;
}
#rulesTableDesc {
vertical-align: middle;
}
.imageButton {
height: 22px;
width: 24px;
margin: 1px 2px 1px 2px;
border: 1px solid;
border-radius: 2px;
background-color: #efefef;
border-color: #767676;
background-position: center center;
vertical-align: middle;
}
.imageButton:hover {
background-color: #e5e5e5;
border-color: #4f4f4f;
}
.imageButton:active {
background-color: #f5f5f5;
border-color: #8d8d8d;
}
#newRuleButton {
float: right;
background-image: url('icons/document-new.svg');
}
#deleteRuleButton {
float: right;
background-image: url('icons/list-remove.svg');
}
</style>
<div id="RssDownloader" class="RssDownloader">
@ -85,7 +130,11 @@
QBT_TR(Auto downloading of RSS torrents is disabled now! You can enable it in application settings.)QBT_TR[CONTEXT=AutomatedRssDownloader]
</div>
<div id="leftRssDownloaderColumn">
<div id="topMenuBar">
<b id="rulesTableDesc">QBT_TR(Download Rules)QBT_TR[CONTEXT=AutomatedRssDownloader]</b>
<button id="newRuleButton" class="imageButton" onclick="qBittorrent.RssDownloader.addRule()"></button>
<button id="deleteRuleButton" class="imageButton" onclick="qBittorrent.RssDownloader.removeSelectedRule()"></button>
</div>
<div id="rulesTable">
<div id="rulesSelectionCheckBoxList">
<div id="rssDownloaderRuleFixedHeaderDiv" class="dynamicTableFixedHeaderDiv invisible">
@ -281,7 +330,9 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
saveSettings: saveSettings,
rssDownloaderRulesTable: rssDownloaderRulesTable,
rssDownloaderFeedSelectionTable: rssDownloaderFeedSelectionTable,
setElementTitles: setElementTitles
setElementTitles: setElementTitles,
addRule: addRule,
removeSelectedRule: removeSelectedRule
};
};
@ -335,10 +386,7 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
menu: 'rssDownloaderRuleMenu',
actions: {
addRule: addRule,
deleteRule: (el) => {
removeRule(rssDownloaderRulesTable.selectedRows
.map((sRow) => rssDownloaderRulesTable.rows[sRow].full_data.name));
},
deleteRule: removeSelectedRule,
renameRule: (el) => {
renameRule(rssDownloaderRulesTable.rows[rssDownloaderRulesTable.selectedRows[0]].full_data.name);
},
@ -478,7 +526,14 @@ Supports the formats: S01E01, 1x1, 2017.01.01 and 01.01.2017 (Date formats also
});
};
const removeRule = (rules) => {
const removeSelectedRule = () => {
if (rssDownloaderRulesTable.selectedRows.length === 0)
return;
removeRules(rssDownloaderRulesTable.selectedRows.map((sRow) =>
rssDownloaderRulesTable.rows[sRow].full_data.name));
};
const removeRules = (rules) => {
new MochaUI.Window({
id: 'removeRulePage',
title: 'QBT_TR(Rule deletion confirmation)QBT_TR[CONTEXT=AutomatedRssDownloader]',