Apply code formatting

This commit is contained in:
Chocobo1
2021-03-24 14:00:27 +08:00
parent 473ae25fd8
commit 6272c6d95d
19 changed files with 264 additions and 253 deletions

View File

@@ -83,8 +83,8 @@
<div id="aboutTranslatorsContent" class="aboutTabContent invisible">
<p>I would like to thank the people who volunteered to translate qBittorrent.<br>
Most of them translated via <a target="_blank" href="https://www.transifex.com/sledgehammer999/qbittorrent/">Transifex</a> and some of them are mentioned below:<br>
(the list might not be up to date)
Most of them translated via <a target="_blank" href="https://www.transifex.com/sledgehammer999/qbittorrent/">Transifex</a> and some of them are mentioned below:<br>
(the list might not be up to date)
</p>
<ul>
<li><u>Arabic:</u> SDERAWI (abz8868@msn.com), sn51234 (nesseyan@gmail.com) and Ibrahim Saed ibraheem_alex(Transifex)</li>
@@ -151,7 +151,8 @@
<li><a name="TOC1" href="#SEC1">GNU GENERAL PUBLIC
LICENSE
<!--TRANSLATORS: Don't translate the license; copy msgid's
verbatim!--></a>
verbatim!-->
</a>
<ul>
<li><a name="TOC2" href="#SEC2">Preamble</a></li>
<li><a name="TOC3" href="#SEC3">TERMS AND CONDITIONS
@@ -687,7 +688,7 @@
(function() {
$('qbittorrentVersion').innerText = ("qBittorrent " + qbtVersion()
+ " QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]");
+ " QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]");
new Request.JSON({
url: 'api/v2/app/buildInfo',

View File

@@ -25,7 +25,7 @@
</div>
<div class="formRow">
<span id="appendexttr">
<input type="checkbox" id="appendext_checkbox"/>
<input type="checkbox" id="appendext_checkbox" />
<label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label>
</span>
</div>
@@ -803,7 +803,8 @@
<fieldset class="settings">
<legend><input type="checkbox" id="use_alt_webui_checkbox" onclick="qBittorrent.Preferences.updateAlternativeWebUISettings();" />
<label for="use_alt_webui_checkbox">QBT_TR(Use alternative Web UI)QBT_TR[CONTEXT=OptionsDialog]</label></legend>
<label for="use_alt_webui_checkbox">QBT_TR(Use alternative Web UI)QBT_TR[CONTEXT=OptionsDialog]</label>
</legend>
<div class="formRow">
<label for="webui_files_location_textarea">QBT_TR(Files location:)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="text" id="webui_files_location_textarea" />
@@ -1199,7 +1200,7 @@
<td>
<input type="text" id="maxConcurrentHTTPAnnounces" style="width: 15em;" />
</td>
</tr>
</tr>
<tr>
<td>
<label for="stopTrackerTimeout">QBT_TR(Stop tracker timeout:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#stop_tracker_timeout" target="_blank">(?)</a></label>
@@ -1207,31 +1208,31 @@
<td>
<input type="text" id="stopTrackerTimeout" style="width: 15em;" />
</td>
</tr>
<tr>
</tr>
<tr>
<td>
<label for="peerTurnover">QBT_TR(Peer turnover disconnect percentage:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_turnover" target="_blank">(?)</a></label>
</td>
<td>
<input type="text" id="peerTurnover" style="width: 15em;" />&nbsp;&nbsp;%
</td>
</tr>
<tr>
</tr>
<tr>
<td>
<label for="peerTurnoverCutoff">QBT_TR(Peer turnover threshold percentage:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_turnover" target="_blank">(?)</a></label>
</td>
<td>
<input type="text" id="peerTurnoverCutoff" style="width: 15em;" />&nbsp;&nbsp;%
</td>
</tr>
<tr>
</tr>
<tr>
<td>
<label for="peerTurnoverInterval">QBT_TR(Peer turnover disconnect interval:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#peer_turnover" target="_blank">(?)</a></label>
</td>
<td>
<input type="text" id="peerTurnoverInterval" style="width: 15em;" />&nbsp;&nbsp;s
</td>
</tr>
</tr>
</table>
</fieldset>
</div>

View File

@@ -1,7 +1,7 @@
<div class="toolbarTabs">
<div id="torrentFilesFilterToolbar" class="invisible">
<input type="text" id="torrentFilesFilterInput" placeholder="QBT_TR(Filter files...)QBT_TR[CONTEXT=PropertiesWidget]" autocorrect="off" autocapitalize="none" />
</div>
<div id="torrentFilesFilterToolbar" class="invisible">
<input type="text" id="torrentFilesFilterInput" placeholder="QBT_TR(Filter files...)QBT_TR[CONTEXT=PropertiesWidget]" autocorrect="off" autocapitalize="none" />
</div>
<ul id="propertiesTabs" class="tab-menu">
<li id="PropGeneralLink" class="selected"><a>QBT_TR(General)QBT_TR[CONTEXT=PropTabBar]</a></li>
<li id="PropTrackersLink"><a>QBT_TR(Trackers)QBT_TR[CONTEXT=PropTabBar]</a></li>

View File

@@ -11,7 +11,8 @@
vertical-align: top;
}
#rssFeedFixedHeaderDiv .dynamicTableHeader, #rssArticleFixedHeaderDiv .dynamicTableHeader {
#rssFeedFixedHeaderDiv .dynamicTableHeader,
#rssArticleFixedHeaderDiv .dynamicTableHeader {
cursor: default;
}
@@ -33,7 +34,9 @@
margin: 0 10px 0 10px;
}
#leftRssColumn, #centerRssColumn, #rightRssColumn {
#leftRssColumn,
#centerRssColumn,
#rightRssColumn {
float: left;
/* should be 20 px but due to rounding differences some browsers don't render that properly */
width: calc(calc(100% - 21px) / 3);
@@ -44,7 +47,8 @@
overflow: auto;
}
#rssFeedTableDiv, #rssArticleTableDiv {
#rssFeedTableDiv,
#rssArticleTableDiv {
height: calc(100vh - 180px);
}
@@ -172,7 +176,7 @@
refreshAllFeeds: refreshAllFeeds,
moveItem: moveItem,
addRSSFeed: addRSSFeed,
markSelectedAsRead : markSelectedAsRead,
markSelectedAsRead: markSelectedAsRead,
openRssDownloader: openRssDownloader,
rssFeedTable: rssFeedTable
};
@@ -197,9 +201,9 @@
$('rssFetchingDisabled').removeClass('invisible');
// recalculate heights
let nonPageHeight = $('rssTopBar').getBoundingClientRect().height +
$('desktopHeader').getBoundingClientRect().height +
$('desktopFooterWrapper').getBoundingClientRect().height + 20;
let nonPageHeight = $('rssTopBar').getBoundingClientRect().height
+ $('desktopHeader').getBoundingClientRect().height
+ $('desktopFooterWrapper').getBoundingClientRect().height + 20;
$('rssDetailsView').style.height = 'calc(100vh - ' + nonPageHeight + 'px)';
let nonTableHeight = nonPageHeight + $('rssFeedFixedHeaderDiv').getBoundingClientRect().height;
@@ -274,7 +278,6 @@
});
rssFeedTable.setup('rssFeedTableDiv', 'rssFeedFixedHeaderDiv', rssFeedContextMenu);
const rssArticleContextMenu = new window.qBittorrent.ContextMenu.RssArticleContextMenu({
targets: '.rssArticleElement',
menu: 'rssArticleMenu',
@@ -435,8 +438,8 @@
//calculate height to fill screen
document.getElementById('rssDescription').style.height =
"calc(100% - " + document.getElementById('rssTorrentDetailsName').offsetHeight + "px - " +
document.getElementById('rssTorrentDetailsDate').offsetHeight + "px - 5px)";
"calc(100% - " + document.getElementById('rssTorrentDetailsName').offsetHeight + "px - "
+ document.getElementById('rssTorrentDetailsDate').offsetHeight + "px - 5px)";
}
};
@@ -479,8 +482,8 @@
if (rssFeedTable.rows.getLength() - 1 === flattenedResp.length) {
match = true;
for (let i = 0; i < flattenedResp.length; ++i) {
if ((flattenedResp[i].uid ? flattenedResp[i].uid : '') !== rssFeedTable.rows[i + 1].full_data.dataUid ||
flattenedResp[i].fullName !== rssFeedTable.rows[i + 1].full_data.dataPath) {
if ((flattenedResp[i].uid ? flattenedResp[i].uid : '') !== rssFeedTable.rows[i + 1].full_data.dataUid
|| flattenedResp[i].fullName !== rssFeedTable.rows[i + 1].full_data.dataPath) {
match = false;
break;
}
@@ -800,7 +803,7 @@
const markSelectedAsRead = () => {
let selectedDatapaths = rssFeedTable.selectedRows
.map((sRow) => rssFeedTable.rows[sRow].full_data.dataPath);
.map((sRow) => rssFeedTable.rows[sRow].full_data.dataPath);
// filter children
let reducedDatapaths = selectedDatapaths.filter((path) =>
selectedDatapaths.filter((innerPath) => path.slice(0, innerPath.length) === innerPath).length === 1
@@ -822,8 +825,8 @@
saveWindowSize(id);
},
resizeLimit: {
'x' :[800,2500],
'y' :[500,2000]
'x': [800, 2500],
'y': [500, 2000]
}
});
};

View File

@@ -12,7 +12,8 @@
float: left;
}
#rulesTable, #rssDownloaderArticlesTable {
#rulesTable,
#rssDownloaderArticlesTable {
overflow: auto;
width: 100%;
height: 100%;
@@ -68,7 +69,9 @@
margin-bottom: 10px;
}
#rulesTable table, #rssDownloaderFeedsTable table, #rssDownloaderArticlesTable table {
#rulesTable table,
#rssDownloaderFeedsTable table,
#rssDownloaderArticlesTable table {
width: 100%;
}
@@ -123,6 +126,7 @@
float: right;
background-image: url('icons/list-remove.svg');
}
</style>
<div id="RssDownloader" class="RssDownloader">
@@ -159,7 +163,7 @@
<fieldset class="settings" id="ruleSettings">
<legend>QBT_TR(Rule Definition)QBT_TR[CONTEXT=AutomatedRssDownloader]</legend>
<div class="formRow">
<input disabled type="checkbox" id="useRegEx" onclick="qBittorrent.RssDownloader.setElementTitles()"/>
<input disabled type="checkbox" id="useRegEx" onclick="qBittorrent.RssDownloader.setElementTitles()" />
<label for="useRegEx">QBT_TR(Use Regular Expressions)QBT_TR[CONTEXT=AutomatedRssDownloader]</label>
</div>
<table class="fullWidth">
@@ -366,8 +370,8 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
$('rulesTable').style.height = 'calc(100% - ' + $('rulesTableDesc').getBoundingClientRect().height + 'px)';
$('rssDownloaderArticlesTable').style.height = 'calc(100% - ' + $('articleTableDesc').getBoundingClientRect().height + 'px)';
let centerRowNotTableHeight = $('saveButton').getBoundingClientRect().height +
$('ruleSettings').getBoundingClientRect().height + 15;
let centerRowNotTableHeight = $('saveButton').getBoundingClientRect().height
+ $('ruleSettings').getBoundingClientRect().height + 15;
$('rssDownloaderFeeds').style.height = 'calc(100% - ' + centerRowNotTableHeight + 'px)';
@@ -447,7 +451,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
let flatten = (root) => {
for (let child in root) {
if (root[child].uid !== undefined)
feedList.push({name: child, url: root[child].url});
feedList.push({ name: child, url: root[child].url });
else
flatten(root[child]);
}
@@ -759,37 +763,36 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
mainPart = 'QBT_TR(Regex mode: use Perl-compatible regular expressions)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n';
}
else {
mainPart = 'QBT_TR(Wildcard mode: you can use)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n' +
' ● QBT_TR(? to match any single character)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(* to match zero or more of any characters)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Whitespaces count as AND operators (all words, any order))QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(| is used as OR operator)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n' +
'QBT_TR(If word order is important use * instead of whitespace.)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n';
mainPart = 'QBT_TR(Wildcard mode: you can use)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n'
+ ' ● QBT_TR(? to match any single character)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(* to match zero or more of any characters)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Whitespaces count as AND operators (all words, any order))QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(| is used as OR operator)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n'
+ 'QBT_TR(If word order is important use * instead of whitespace.)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n';
}
let secondPart = 'QBT_TR(An expression with an empty %1 clause (e.g. %2))QBT_TR[CONTEXT=AutomatedRssDownloader]'
.replace('%1', '|').replace('%2', 'expr|');
.replace('%1', '|').replace('%2', 'expr|');
$('mustContainText').title = mainPart + secondPart + 'QBT_TR( will match all articles.)QBT_TR[CONTEXT=AutomatedRssDownloader]';
$('mustNotContainText').title = mainPart + secondPart + 'QBT_TR( will exclude all articles.)QBT_TR[CONTEXT=AutomatedRssDownloader]';
let episodeFilterTitle = 'QBT_TR(Matches articles based on episode filter.)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n' +
'QBT_TR(Example: )QBT_TR[CONTEXT=AutomatedRssDownloader]' +
'1x2;8-15;5;30-;' +
'QBT_TR( will match 2, 5, 8 through 15, 30 and onward episodes of season one)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n' +
'QBT_TR(Episode filter rules: )QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n' +
' ● QBT_TR(Season number is a mandatory non-zero value)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Episode number is a mandatory positive value)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Filter must end with semicolon)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Three range types for episodes are supported: )QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Single number: <b>1x25;</b> matches episode 25 of season one)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Normal range: <b>1x25-40;</b> matches episodes 25 through 40 of season one)QBT_TR[CONTEXT=AutomatedRssDownloader]\n' +
' ● QBT_TR(Infinite range: <b>1x25-;</b> matches episodes 25 and upward of season one, and all episodes of later seasons)QBT_TR[CONTEXT=AutomatedRssDownloader]';
let episodeFilterTitle = 'QBT_TR(Matches articles based on episode filter.)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n'
+ 'QBT_TR(Example: )QBT_TR[CONTEXT=AutomatedRssDownloader]'
+ '1x2;8-15;5;30-;'
+ 'QBT_TR( will match 2, 5, 8 through 15, 30 and onward episodes of season one)QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n'
+ 'QBT_TR(Episode filter rules: )QBT_TR[CONTEXT=AutomatedRssDownloader]\n\n'
+ ' ● QBT_TR(Season number is a mandatory non-zero value)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Episode number is a mandatory positive value)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Filter must end with semicolon)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Three range types for episodes are supported: )QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Single number: <b>1x25;</b> matches episode 25 of season one)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Normal range: <b>1x25-40;</b> matches episodes 25 through 40 of season one)QBT_TR[CONTEXT=AutomatedRssDownloader]\n'
+ ' ● QBT_TR(Infinite range: <b>1x25-;</b> matches episodes 25 and upward of season one, and all episodes of later seasons)QBT_TR[CONTEXT=AutomatedRssDownloader]';
episodeFilterTitle = episodeFilterTitle.replace(/<b>/g, '').replace(/<\/b>/g, '');
$('episodeFilterText').title = episodeFilterTitle;
}
initRssDownloader();
return exports();
})();

View File

@@ -41,7 +41,10 @@
margin-right: 20px;
}
#searchMinSeedsFilter, #searchMaxSeedsFilter, #searchMinSizeFilter, #searchMaxSizeFilter {
#searchMinSeedsFilter,
#searchMaxSeedsFilter,
#searchMinSizeFilter,
#searchMaxSizeFilter {
width: 4em;
}
@@ -89,7 +92,7 @@
<tbody>
<tr>
<td>
There aren't any search plugins installed.<br/>Click the &quot;Search plugins...&quot; button at the bottom right of the window to install some.
There aren't any search plugins installed.<br />Click the &quot;Search plugins...&quot; button at the bottom right of the window to install some.
</td>
</tr>
</tbody>
@@ -167,14 +170,14 @@
</div>
<ul id="searchResultsTableMenu" class="contextMenu">
<li><a href="#Download"><img src="icons/download.svg" alt="QBT_TR(Download)QBT_TR[CONTEXT=SearchJobWidget]"/> QBT_TR(Download)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li class="separator"><a href="#OpenDescriptionUrl"><img src="icons/application-x-mswinurl.svg" alt="QBT_TR(Open description page)QBT_TR[CONTEXT=SearchJobWidget]"/> QBT_TR(Open description page)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li><a href="#Download"><img src="icons/download.svg" alt="QBT_TR(Download)QBT_TR[CONTEXT=SearchJobWidget]" /> QBT_TR(Download)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li class="separator"><a href="#OpenDescriptionUrl"><img src="icons/application-x-mswinurl.svg" alt="QBT_TR(Open description page)QBT_TR[CONTEXT=SearchJobWidget]" /> QBT_TR(Open description page)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li>
<a href="#" class="arrow-right"><img src="icons/edit-copy.svg" alt="QBT_TR(Copy)QBT_TR[CONTEXT=SearchJobWidget]"/> QBT_TR(Copy)QBT_TR[CONTEXT=SearchJobWidget]</a>
<a href="#" class="arrow-right"><img src="icons/edit-copy.svg" alt="QBT_TR(Copy)QBT_TR[CONTEXT=SearchJobWidget]" /> QBT_TR(Copy)QBT_TR[CONTEXT=SearchJobWidget]</a>
<ul>
<li><a href="#" id="copySearchTorrentName" class="copySearchDataToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Name)QBT_TR[CONTEXT=SearchJobWidget]"/> QBT_TR(Name)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li><a href="#" id="copySearchTorrentDownloadLink" class="copySearchDataToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Download link)QBT_TR[CONTEXT=SearchJobWidget]"/> QBT_TR(Download link)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li><a href="#" id="copySearchTorrentDescriptionUrl" class="copySearchDataToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Description page URL)QBT_TR[CONTEXT=SearchJobWidget]"/> QBT_TR(Description page URL)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li><a href="#" id="copySearchTorrentName" class="copySearchDataToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Name)QBT_TR[CONTEXT=SearchJobWidget]" /> QBT_TR(Name)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li><a href="#" id="copySearchTorrentDownloadLink" class="copySearchDataToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Download link)QBT_TR[CONTEXT=SearchJobWidget]" /> QBT_TR(Download link)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
<li><a href="#" id="copySearchTorrentDescriptionUrl" class="copySearchDataToClipboard"><img src="icons/edit-copy.svg" alt="QBT_TR(Description page URL)QBT_TR[CONTEXT=SearchJobWidget]" /> QBT_TR(Description page URL)QBT_TR[CONTEXT=SearchJobWidget]</a></li>
</ul>
</li>
</ul>
@@ -492,7 +495,7 @@
if (uniqueCategories[category.id] === undefined) {
uniqueCategories[category.id] = category;
}
}
}
}
// we must sort the ids to maintain consistent order.
const categories = Object.keys(uniqueCategories).sort().map(id => uniqueCategories[id]);

View File

@@ -72,8 +72,8 @@
</div>
<ul id="searchPluginsTableMenu" class="contextMenu">
<li><a href="#Enabled"><img src="icons/checked.svg" alt="QBT_TR(Enabled)QBT_TR[CONTEXT=PluginSelectDlg]"/> QBT_TR(Enabled)QBT_TR[CONTEXT=PluginSelectDlg]</a></li>
<li class="separator"><a href="#Uninstall"><img src="icons/list-remove.svg" alt="QBT_TR(Uninstall)QBT_TR[CONTEXT=PluginSelectDlg]"/> QBT_TR(Uninstall)QBT_TR[CONTEXT=PluginSelectDlg]</a></li>
<li><a href="#Enabled"><img src="icons/checked.svg" alt="QBT_TR(Enabled)QBT_TR[CONTEXT=PluginSelectDlg]" /> QBT_TR(Enabled)QBT_TR[CONTEXT=PluginSelectDlg]</a></li>
<li class="separator"><a href="#Uninstall"><img src="icons/list-remove.svg" alt="QBT_TR(Uninstall)QBT_TR[CONTEXT=PluginSelectDlg]" /> QBT_TR(Uninstall)QBT_TR[CONTEXT=PluginSelectDlg]</a></li>
</ul>
<script>