mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
feat(core): ✨ only load the inline script if EnablePreferences is true
This commit is contained in:
parent
e5af1717bd
commit
52f4bab1a5
|
@ -65,11 +65,13 @@ class SkinHooks implements
|
|||
return;
|
||||
}
|
||||
|
||||
$script = file_get_contents( MW_INSTALL_PATH . '/skins/Citizen/resources/skins.citizen.scripts/inline.js' );
|
||||
$script = Html::inlineScript( $script );
|
||||
// TODO: Consider turning on cache after this is more stable
|
||||
$script = RL\ResourceLoader::filter( 'minify-js', $script, [ 'cache' => false ] );
|
||||
$out->addHeadItem( 'skin.citizen.inline', $script );
|
||||
if ( $this->getConfigValue( 'CitizenEnablePreferences', $out ) === true ) {
|
||||
$script = file_get_contents( MW_INSTALL_PATH . '/skins/Citizen/resources/skins.citizen.scripts/inline.js' );
|
||||
$script = Html::inlineScript( $script );
|
||||
// TODO: Consider turning on cache after this is more stable
|
||||
$script = RL\ResourceLoader::filter( 'minify-js', $script, [ 'cache' => false ] );
|
||||
$out->addHeadItem( 'skin.citizen.inline', $script );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue