Ok so I made a new
personal website which I am hosting as a secondary context on one of my sites and for some reason it is loading SyntaxHighlighter assets even though they are not referenced anywhere on my template.
I use SyntaxHighlighter on the main site but not in this new context has anyone experienced anything like this before?
Looking at the SyntaxHighlighter snippet it seems like it's injecting into all templates, this is starting to look like bug.
Anyone have any idea how I can modify this snippet so it doesn't load only on the context it needs to be loaded in.
Thanks.
$brushes = empty($scriptProperties['brushes'])? 'JScript,Xml,Php,Css,Plain' : $scriptProperties['brushes'];
$brushArray = explode(',', $brushes);
$baseURL = $modx->getOption('sh.assets_url', null, $modx->getOption('assets_url') . 'components/syntaxhighlighter/');
$modx->regClientStartupScript($baseURL . 'scripts/shCore.js');
foreach($brushArray as $brush) {
$modx->regClientStartupScript($baseURL . 'scripts/' . 'shBrush' . $brush . '.js');
}
$modx->regClientCss($baseURL . 'css/' . 'shCore.css' );
$modx->regClientCss($baseURL . 'css/' . 'shThemeDefault.css' );
$modx->regClientScript('<script type="text/javascript">
SyntaxHighlighter.all();
</script>');
return '';