Code moved

This commit is contained in:
nobody 2020-11-05 07:07:52 +01:00
parent 4db68ae83d
commit d792f67294
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 31 additions and 58 deletions

View File

@ -233,6 +233,36 @@ const FrameworkAndBundle = {
'resources/twitter-bootstrap/2.3.2/': 'Bootstrap'
};
const CDNs = {
'ajax.googleapis.com': 'Google Hosted Libraries',
'ajax.aspnetcdn.com': 'Microsoft Ajax CDN',
'ajax.microsoft.com': 'Microsoft Ajax CDN [Deprecated]',
'cdnjs.cloudflare.com': 'CDNJS (Cloudflare)',
'code.jquery.com': 'jQuery CDN (MaxCDN)',
'cdn.jsdelivr.net': 'jsDelivr (Cloudflare)',
'yastatic.net': 'Yandex CDN',
'yandex.st': 'Yandex CDN [Deprecated]',
'apps.bdimg.com': 'Baidu CDN',
'libs.baidu.com': 'Baidu CDN [Deprecated]',
'lib.sinaapp.com': 'Sina Public Resources',
'upcdn.b0.upaiyun.com': 'UpYun Library',
'cdn.bootcss.com': 'BootCDN #1',
'sdn.geekzu.org': 'Geekzu Public Service [Mirror]',
'ajax.proxy.ustclug.org': 'USTC Linux User Group [Mirror]',
'unpkg.com': 'UNPKG (Cloudflare)',
'stackpath.bootstrapcdn.com': 'StackPath BootstrapCDN',
'maxcdn.bootstrapcdn.com': 'MaxCDN Bootstrap CDN',
'use.fontawesome.com': 'Font Awesome CDN',
'ajax.cloudflare.com': 'Cloudflare CDN',
'akamai-webcdn.kgstatic.net': 'Akamai WebCDN',
'netdna.bootstrapcdn.com': 'NetDNA',
'pagecdn.io': 'PageCDN',
'fonts.googleapis.com': 'Google Fonts',
'gitcdn.github.io': 'GitHub',
'cdn.bootcdn.net': 'BootCDN #2',
'vjs.zencdn.net': 'Video.js CDN',
};
// Supported charsets for TextDecoder()
// https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder
const EncodingTypes = {

View File

@ -175,64 +175,7 @@ helpers.generateRandomHexString = function (length) {
};
helpers.determineCdnName = function (domainName) {
switch (domainName) {
case 'ajax.googleapis.com':
return 'Google Hosted Libraries';
case 'ajax.aspnetcdn.com':
return 'Microsoft Ajax CDN';
case 'ajax.microsoft.com':
return 'Microsoft Ajax CDN [Deprecated]';
case 'cdnjs.cloudflare.com':
return 'CDNJS (Cloudflare)';
case 'code.jquery.com':
return 'jQuery CDN (MaxCDN)';
case 'cdn.jsdelivr.net':
return 'jsDelivr (Cloudflare)';
case 'yastatic.net':
return 'Yandex CDN';
case 'yandex.st':
return 'Yandex CDN [Deprecated]';
case 'apps.bdimg.com':
return 'Baidu CDN';
case 'libs.baidu.com':
return 'Baidu CDN [Deprecated]';
case 'lib.sinaapp.com':
return 'Sina Public Resources';
case 'upcdn.b0.upaiyun.com':
return 'UpYun Library';
case 'cdn.bootcss.com':
return 'BootCDN #1';
case 'sdn.geekzu.org':
return 'Geekzu Public Service [Mirror]';
case 'ajax.proxy.ustclug.org':
return 'USTC Linux User Group [Mirror]';
case 'unpkg.com':
return 'UNPKG (Cloudflare)';
case 'stackpath.bootstrapcdn.com':
return 'StackPath BootstrapCDN';
case 'maxcdn.bootstrapcdn.com':
return 'MaxCDN Bootstrap CDN';
case 'use.fontawesome.com':
return 'Font Awesome CDN';
case 'ajax.cloudflare.com':
return 'Cloudflare CDN';
case 'akamai-webcdn.kgstatic.net':
return 'Akamai WebCDN';
case 'netdna.bootstrapcdn.com':
return 'NetDNA';
case 'pagecdn.io':
return 'PageCDN';
case 'fonts.googleapis.com':
return 'Google Fonts';
case 'gitcdn.github.io':
return 'GitHub';
case 'cdn.bootcdn.net':
return 'BootCDN #2';
case 'vjs.zencdn.net':
return 'Video.js CDN';
default:
return 'Unknown';
}
return CDNs[domainName] || 'Unknown';
};
helpers.determineScriptDirection = function (language) {