Code style improved

This commit is contained in:
nobody 2021-11-28 09:28:49 +01:00
parent 05ea59029f
commit 3ae0eccc3d
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 45 additions and 46 deletions

View File

@ -104,7 +104,8 @@ requestAnalyzer.getLocalTarget = function (requestDetails, initiator) {
destinationHost,
destinationPath,
destinationSearchString,
initiator);
initiator
);
};
@ -124,7 +125,7 @@ requestAnalyzer._matchBasePath = function (hostMappings, channelPath) {
// eslint-disable-next-line max-len
requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channelHost, channelPath, destinationSearchString, initiator) {
let resourcePath, versionNumber, resourcePattern, filename, shorthandResource;
let resourcePath, versionNumber, resourcePattern, shorthandResource;
storageManager.type.get(Setting.LOGGING, function (items) {
requestAnalyzer.logging = items.enableLogging;
@ -158,9 +159,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
}
for (let resourceMold of Object.keys(resourceMappings)) {
if (!resourcePattern.startsWith(resourceMold)) {
continue;
}
if (resourcePattern.startsWith(resourceMold)) {
let targetPath, versionDelivered, versionRequested, bundle;
targetPath = resourceMappings[resourceMold].path;
targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber);
@ -182,7 +181,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
// Get bundle name
bundle = targets.determineBundle(targetPath);
if (bundle !== '') {
targetPath = requestAnalyzer._getPathOfBundle(initiator, channelPath, targetPath, bundle);
targetPath = requestAnalyzer._getPathOfBundle(initiator, channelHost, channelPath, targetPath, bundle);
}
if (targetPath === false) {
break;
@ -201,6 +200,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
'bundle': bundle
};
}
}
if (requestAnalyzer.logging && !IgnoredHost[channelHost]) {
console.warn(`${LogString.PREFIX} ${LogString.MISSING_RESOURCE} ${channelHost}${channelPath}`);
@ -209,7 +209,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
return false;
};
requestAnalyzer._getPathOfBundle = function (initiator, channelPath, targetPath, bundle) {
requestAnalyzer._getPathOfBundle = function (initiator, channelHost, channelPath, targetPath, bundle) {
let filename = channelPath.split('/').pop();
if (bundle === 'MathJax (Bundle)' && filename !== 'MathJax.js') {
filename = channelPath.replace(Resource.MATHJAX, '');
@ -219,8 +219,7 @@ requestAnalyzer._getPathOfBundle = function (initiator, channelPath, targetPath,
return false;
}
}
return helpers.formatFilename(
filename.endsWith('.js')
return helpers.formatFilename(filename.endsWith('.js')
? `${targetPath + filename}m`
: targetPath + filename);
};

View File

@ -69,8 +69,8 @@ body {
.div-selected-icon {
margin-top: 10px;
width: 100%;
padding-right: 25px;
width: 100%;
}
.div-selected-icon > label {