mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-01-22 07:27:47 +01:00
Updated shorthands.js
This commit is contained in:
parent
f2a1eddd85
commit
4e9f5f4c6a
@ -130,7 +130,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
|
||||
|
||||
for (let resourceMold of Object.keys(resourceMappings)) {
|
||||
if (resourcePattern.startsWith(resourceMold)) {
|
||||
let targetPath, hostShorthands, versionDelivered, versionRequested;
|
||||
let targetPath, versionDelivered, versionRequested;
|
||||
|
||||
targetPath = resourceMappings[resourceMold].path;
|
||||
targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber);
|
||||
@ -140,14 +140,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
|
||||
|
||||
versionRequested = versionNumber === null ? 'latest' : versionNumber[0];
|
||||
|
||||
hostShorthands = shorthands[channelHost];
|
||||
|
||||
if (hostShorthands && hostShorthands[targetPath]) {
|
||||
let shorthand = hostShorthands[targetPath];
|
||||
|
||||
targetPath = shorthand.path;
|
||||
versionDelivered = shorthand.version;
|
||||
} else if (versionNumber === null) {
|
||||
if (versionNumber === null) {
|
||||
versionDelivered = targetPath.match(Resource.VERSION_EXPRESSION).toString();
|
||||
}
|
||||
|
||||
|
@ -22,69 +22,7 @@
|
||||
* Shorthands
|
||||
*/
|
||||
|
||||
var shorthands = {
|
||||
|
||||
// Google Hosted Libraries [Deprecated]
|
||||
'ajax.googleapis.com': {
|
||||
'resources/jquery/1.8/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.8.3/jquery.min.jsm',
|
||||
'version': '1.8.3'
|
||||
},
|
||||
'resources/jquery/1.7/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.7.2/jquery.min.jsm',
|
||||
'version': '1.7.2'
|
||||
},
|
||||
'resources/jquery/1.6/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.6.4/jquery.min.jsm',
|
||||
'version': '1.6.4'
|
||||
},
|
||||
'resources/jquery/1.5/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.5.2/jquery.min.jsm',
|
||||
'version': '1.5.2'
|
||||
},
|
||||
'resources/jquery/1.4/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.4.4/jquery.min.jsm',
|
||||
'version': '1.4.4'
|
||||
},
|
||||
'resources/jquery/1.3/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.3.2/jquery.min.jsm',
|
||||
'version': '1.3.2'
|
||||
},
|
||||
'resources/jquery/1.2/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.2.6/jquery.min.jsm',
|
||||
'version': '1.2.6'
|
||||
}
|
||||
},
|
||||
// jQuery CDN [Deprecated]
|
||||
'code.jquery.com': {
|
||||
'resources/jquery/1.7/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.7.0/jquery.min.jsm',
|
||||
'version': '1.7.0'
|
||||
},
|
||||
'resources/jquery/1.6/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.6.0/jquery.min.jsm',
|
||||
'version': '1.6.0'
|
||||
},
|
||||
'resources/jquery/1.5/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.5.0/jquery.min.jsm',
|
||||
'version': '1.5.0'
|
||||
},
|
||||
'resources/jquery/1.4/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.4.0/jquery.min.jsm',
|
||||
'version': '1.4.0'
|
||||
},
|
||||
'resources/jquery/1.3/jquery.min.jsm': {
|
||||
'path': 'resources/jquery/1.3.0/jquery.min.jsm',
|
||||
'version': '1.3.0'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Geekzu Public Service [Mirror]
|
||||
shorthands['sdn.geekzu.org'] = shorthands['ajax.googleapis.com'];
|
||||
|
||||
// USTC Linux User Group [Mirror]
|
||||
shorthands['ajax.proxy.ustclug.org'] = shorthands['ajax.googleapis.com'];
|
||||
var shorthands = {};
|
||||
|
||||
shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
||||
/*
|
||||
@ -99,7 +37,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
||||
if (Regex.JSDELIVR_COMBINE.test(channelHost + channelPath)) {
|
||||
return {
|
||||
'source': channelHost,
|
||||
'version': 'beta',
|
||||
'versionDelivered': 'beta',
|
||||
'path': 'resources/jsdelivr-combine-jquery-hogan-algoliasearch-autocomplete.jsm',
|
||||
'bundle': ''
|
||||
};
|
||||
@ -107,28 +45,28 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
||||
// https://gitlab.com/nobody42/localcdn/-/issues/55
|
||||
return {
|
||||
'source': channelHost,
|
||||
'version': 'beta',
|
||||
'versionDelivered': 'beta',
|
||||
'path': 'resources/algoliasearch3.33.0_algoliasearchLite_algoliasearchHelper.jsm',
|
||||
'bundle': ''
|
||||
};
|
||||
} else if (Regex.GOOGLE_MATERIAL_ICONS.test(channelHost + channelPath + searchString)) {
|
||||
return {
|
||||
'source': channelHost,
|
||||
'version': '3.0.1',
|
||||
'versionDelivered': '3.0.1',
|
||||
'path': 'resources/google-material-design-icons/google-material-design-icons.css',
|
||||
'bundle': ''
|
||||
};
|
||||
} else if (Regex.BOOTSTRAP_DATEPICKER_3.test(channelPath)) {
|
||||
return {
|
||||
'source': channelHost,
|
||||
'version': '1.9.0',
|
||||
'versionDelivered': '1.9.0',
|
||||
'path': 'resources/bootstrap-datepicker/1.9.0/bootstrap-datepicker3.standalone.min.css',
|
||||
'bundle': ''
|
||||
};
|
||||
} else if (Regex.BOOTSTRAP_DATEPICKER.test(channelPath)) {
|
||||
return {
|
||||
'source': channelHost,
|
||||
'version': '1.9.0',
|
||||
'versionDelivered': '1.9.0',
|
||||
'path': 'resources/bootstrap-datepicker/1.9.0/bootstrap-datepicker.standalone.min.css',
|
||||
'bundle': ''
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user