Implemented: Number of supported CDNs & Frameworks (#93)
This commit is contained in:
parent
24b9744def
commit
410575ca96
|
@ -257,10 +257,14 @@ body {
|
|||
margin-right: 14px;
|
||||
}
|
||||
|
||||
#generated-rules {
|
||||
#generated-rules, #unsupported-frameworks {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#unsupported-frameworks {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.ruleset-generator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -343,14 +347,11 @@ body[dir="rtl"] .input-text {
|
|||
|
||||
.option-links {
|
||||
list-style-type: disclosure-closed;
|
||||
}
|
||||
|
||||
.option-links-div > ul {
|
||||
padding-top: 2rem;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.option-links-div > ul > li {
|
||||
.option-links > li {
|
||||
padding-bottom: .5rem;
|
||||
}
|
||||
|
||||
|
|
|
@ -237,18 +237,32 @@
|
|||
</div>
|
||||
|
||||
<div id="info-tab" class="tab-content">
|
||||
<div class="option-links-div option-group">
|
||||
<ul class="option-links">
|
||||
<li><a id="link-welcome-page" class="no-icon">Welcome page (In-App)</a></li>
|
||||
<li><a id="link-changelog" class="no-icon">Changelog (In-App)</a></li>
|
||||
<li><a id="link-donate" class="no-icon">Donate (In-App)</a></li>
|
||||
<li><a id="link-faq" class="no-icon">FAQ (In-App)</a></li>
|
||||
<li><a id="link-statistic" class="no-icon"><span data-i18n-content="internalStatisticsTitle">Statistics</span> <span>(In-App)</span></a></li><br>
|
||||
<li><a id="link-codeberg" href="https://codeberg.org/nobody/LocalCDN" target="_blank" rel="nofollow noopener noreferrer">Source (www.codeberg.org)</a></li>
|
||||
<li><a id="link-website" href="https://www.localcdn.org" target="_blank" rel="nofollow noopener noreferrer">Website (www.localcdn.org)</a></li>
|
||||
<li><a id="link-website-test" href="https://www.localcdn.org/test" target="_blank" rel="nofollow noopener noreferrer">Testing Utility (www.localcdn.org/test)</a></li>
|
||||
<li><a id="link-translate" href="https://hosted.weblate.org/projects/localcdn/localcdn/" target="_blank" rel="nofollow noopener noreferrer">Translate (www.weblate.org)</a></li>
|
||||
</ul>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<ul class="option-links">
|
||||
<li>Supported CDNs: <span id="supported-cdns"></span></li>
|
||||
<li>Supported Frameworks: <span id="supported-frameworks"></span></li>
|
||||
<ul id="unsupported-frameworks">
|
||||
<li>Font Awesome are not supported by your browser</li>
|
||||
<li>Google Material Icons are not supported by your browser</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<ul class="option-links">
|
||||
<li><a id="link-welcome-page" class="no-icon">Welcome page (In-App)</a></li>
|
||||
<li><a id="link-changelog" class="no-icon">Changelog (In-App)</a></li>
|
||||
<li><a id="link-donate" class="no-icon">Donate (In-App)</a></li>
|
||||
<li><a id="link-faq" class="no-icon">FAQ (In-App)</a></li>
|
||||
<li><a id="link-statistic" class="no-icon"><span data-i18n-content="internalStatisticsTitle">Statistics</span> <span>(In-App)</span></a></li><br>
|
||||
<li><a id="link-codeberg" href="https://codeberg.org/nobody/LocalCDN" target="_blank" rel="nofollow noopener noreferrer">Source (www.codeberg.org)</a></li>
|
||||
<li><a id="link-website" href="https://www.localcdn.org" target="_blank" rel="nofollow noopener noreferrer">Website (www.localcdn.org)</a></li>
|
||||
<li><a id="link-website-test" href="https://www.localcdn.org/test" target="_blank" rel="nofollow noopener noreferrer">Testing Utility (www.localcdn.org/test)</a></li>
|
||||
<li><a id="link-translate" href="https://hosted.weblate.org/projects/localcdn/localcdn/" target="_blank" rel="nofollow noopener noreferrer">Translate (www.weblate.org)</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<section class="notice notice-default hidden" id="notice-locale">
|
||||
|
|
|
@ -48,6 +48,7 @@ options._renderContents = function () {
|
|||
if (!chrome.browserAction.setIcon) {
|
||||
document.getElementById('icon-style-div').style.display = 'none';
|
||||
}
|
||||
options._renderInfoPanel();
|
||||
document.getElementById('label-version').textContent = helpers.formatVersion(chrome.runtime.getManifest().version);
|
||||
};
|
||||
|
||||
|
@ -242,7 +243,7 @@ options._configureLinkPrefetching = function (value) {
|
|||
};
|
||||
|
||||
options._serializeWhitelistedDomains = function (whitelistedDomains) {
|
||||
if (whitelistedDomains === undefined) return;
|
||||
if (whitelistedDomains === undefined) return '';
|
||||
|
||||
let domainWhitelist, whitelistedDomainKeys;
|
||||
|
||||
|
@ -269,6 +270,28 @@ options._parseDomainWhitelist = function (domainWhitelist) {
|
|||
return whitelistedDomains;
|
||||
};
|
||||
|
||||
options._renderInfoPanel = function () {
|
||||
let supportedFrameworks, supportedVersions, browserSpecific;
|
||||
|
||||
supportedFrameworks = {};
|
||||
supportedVersions = {};
|
||||
|
||||
// Chromium based browser does not support Google Material Icons and Font Awesome
|
||||
browserSpecific = BrowserType.CHROMIUM ? -1 : 1;
|
||||
|
||||
for (const val of Object.values(resources)) {
|
||||
const res = val['path'].split('/');
|
||||
supportedFrameworks[res[1]] = true;
|
||||
}
|
||||
document.getElementById('supported-cdns').textContent = Object.keys(mappings).length - 3;
|
||||
document.getElementById('supported-frameworks').textContent = Object.keys(supportedFrameworks).length + browserSpecific;
|
||||
|
||||
|
||||
if (BrowserType.CHROMIUM) {
|
||||
document.getElementById('unsupported-frameworks').style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Event Handlers
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue