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

View File

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