mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
modify absoluteJsImportUrl helper to add buildversion to path if config is set
This commit is contained in:
@@ -113,6 +113,7 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
'modes'=>$ci->config->item('theme_modes'),
|
||||
],
|
||||
'fhcomplete_build_version' => $ci->config->item('fhcomplete_build_version'),
|
||||
'use_fhcomplete_build_version_in_path' => $ci->config->item('use_fhcomplete_build_version_in_path'),
|
||||
);
|
||||
|
||||
$toPrint = "\n";
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
const absoluteJsImportUrl = function(relativeurl)
|
||||
{
|
||||
const absoluteurl = FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ relativeurl
|
||||
+ '?'
|
||||
+ FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version;
|
||||
return absoluteurl;
|
||||
}
|
||||
if(true === FHC_JS_DATA_STORAGE_OBJECT.use_fhcomplete_build_version_in_path)
|
||||
{
|
||||
const absoluteurl = FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ relativeurl.replace(
|
||||
/^public\//,
|
||||
'public/' + FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version + '/'
|
||||
);
|
||||
return absoluteurl;
|
||||
}
|
||||
else
|
||||
{
|
||||
const absoluteurl = FHC_JS_DATA_STORAGE_OBJECT.app_root
|
||||
+ relativeurl
|
||||
+ '?'
|
||||
+ FHC_JS_DATA_STORAGE_OBJECT.fhcomplete_build_version;
|
||||
return absoluteurl;
|
||||
}
|
||||
};
|
||||
|
||||
export { absoluteJsImportUrl };
|
||||
|
||||
Reference in New Issue
Block a user