MOBILE-3072 siteplugins: Add version to CSS URL
parent
79cfc44e0d
commit
8f8efe4052
|
@ -142,6 +142,11 @@ export class CoreSitePluginsHelperProvider {
|
||||||
url = this.textUtils.concatenatePaths(site.getURL(), url);
|
url = this.textUtils.concatenatePaths(site.getURL(), url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (url && handlerSchema.styles.version) {
|
||||||
|
// Add the version to the URL to prevent getting a cached file.
|
||||||
|
url += (url.indexOf('?') != -1 ? '&' : '?') + 'version=' + handlerSchema.styles.version;
|
||||||
|
}
|
||||||
|
|
||||||
const uniqueName = this.sitePluginsProvider.getHandlerUniqueName(plugin, handlerName),
|
const uniqueName = this.sitePluginsProvider.getHandlerUniqueName(plugin, handlerName),
|
||||||
componentId = uniqueName + '#main';
|
componentId = uniqueName + '#main';
|
||||||
|
|
||||||
|
|
|
@ -2197,9 +2197,27 @@ export class CoreFilepoolProvider {
|
||||||
filename = this.urlUtils.getLastFileWithoutParams(fileUrl);
|
filename = this.urlUtils.getLastFileWithoutParams(fileUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there are hashes in the URL, extract them.
|
||||||
|
const index = filename.indexOf('#');
|
||||||
|
let hashes;
|
||||||
|
|
||||||
|
if (index != -1) {
|
||||||
|
hashes = filename.split('#');
|
||||||
|
|
||||||
|
// Remove the URL from the array.
|
||||||
|
hashes.shift();
|
||||||
|
|
||||||
|
filename = filename.substr(0, index);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the extension from the filename.
|
// Remove the extension from the filename.
|
||||||
filename = this.mimeUtils.removeExtension(filename);
|
filename = this.mimeUtils.removeExtension(filename);
|
||||||
|
|
||||||
|
if (hashes) {
|
||||||
|
// Add hashes to the name.
|
||||||
|
filename += '_' + hashes.join('_');
|
||||||
|
}
|
||||||
|
|
||||||
return this.textUtils.removeSpecialCharactersForFiles(filename);
|
return this.textUtils.removeSpecialCharactersForFiles(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue