Fixed: Unknown frameworks in statistics page (#151)

This commit is contained in:
nobody 2020-11-12 06:57:19 +01:00
parent 0a6d78e8c2
commit 9c210bd02d
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 5 additions and 23 deletions

View File

@ -216,28 +216,6 @@ const Links = {
'STATISTICS': chrome.extension.getURL('pages/statistics/statistics.html')
};
/**
* If a framework has been removed, this list should still display the names in the statistics
* Also used for bundles
* Note: Only the first two directory levels in 'resources'
* See: https://codeberg.org/nobody/LocalCDN/issues/151
*/
const FrameworkAndBundle = {
'resources/slick-carousel/1.9.0/': 'slick',
'resources/anchor-js/4.2.2/': 'AnchorJS',
'resources/plyr/3.5.10/': 'Plyr',
'resources/swiper/5.4.2/': 'Swiper',
'resources/select2/4.0.12/': 'Select2',
'resources/element-ui/2.13.2/': 'ElementUI',
'resources/bootstrap-datepicker/1.9.0/': 'Bootstrap DatePicker',
'resources/jquery.lazy/1.7.11/': 'jQuery Lazy',
'resources/waypoints/4.0.1/': 'Waypoints',
'resources/findify-bundle/6.9.15/': 'Findify',
'resources/twitter-bootstrap/4.5.0/': 'Bootstrap',
'resources/twitter-bootstrap/3.4.1/': 'Bootstrap',
'resources/twitter-bootstrap/2.3.2/': 'Bootstrap'
};
const CDNs = {
'ajax.googleapis.com': 'Google Hosted Libraries',
'ajax.aspnetcdn.com': 'Microsoft Ajax CDN',

View File

@ -187,7 +187,10 @@ statistics._displayNameOfFramework = function (str, type) {
filename = targets.determineResourceName(filename);
if (filename === 'Unknown') {
filename = FrameworkAndBundle[str];
filename = targets.determineBundle(str);
if (filename === '' && str.startsWith('resources/fontawesome/')) {
filename = 'Font Awesome (Fonts)'
}
}
version = str.match(Resource.VERSION_EXPRESSION);
if (version !== null && version.length > 0) {

View File

@ -44,6 +44,7 @@
<li>Added: Modaal v0.4.4 (<a href="https://codeberg.org/nobody/LocalCDN/issues/172">#172</a>)</li>
<li>Added: inview (Protonet) v1.1.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/172">#172</a>)</li>
<li>Fixed: Import settings (<a href="https://codeberg.org/nobody/LocalCDN/issues/138">#138</a>)</li>
<li>Fixed: Unknown frameworks in statistics page (<a href="https://codeberg.org/nobody/LocalCDN/issues/151">#151</a>)</li>
</ul>
<div id="generator-section">
<div class="topic-label">