From a0718dcd12c9cd76324774ee879c16822ddc009f Mon Sep 17 00:00:00 2001 From: ksdhans Date: Mon, 16 May 2016 22:19:19 +1200 Subject: [PATCH] Use SyntaxHighlighter's autoloader This patch enables SyntaxHighlighter's autoloader, so that the "brushes" are loaded on-demand. The result is more verbose than I'd hoped, because the full paths have to be given each time. Still, it works. --- code/SyntaxHighlightedPage.php | 39 +++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/code/SyntaxHighlightedPage.php b/code/SyntaxHighlightedPage.php index e3fb9be..f1e4594 100644 --- a/code/SyntaxHighlightedPage.php +++ b/code/SyntaxHighlightedPage.php @@ -9,13 +9,42 @@ public function contentcontrollerInit() //TODO: these javascripts aren"t working: Requirements::javascript(SYNTAX_DIR."/thirdparty/syntaxhighlighter/scripts/shCore.js"); - Requirements::javascript(SYNTAX_DIR."/thirdparty/syntaxhighlighter/scripts/shBrushPlain.js"); - Requirements::javascript(SYNTAX_DIR."/thirdparty/syntaxhighlighter/scripts/shBrushPhp.js"); - Requirements::javascript(SYNTAX_DIR."/thirdparty/syntaxhighlighter/scripts/shBrushJScript.js"); - Requirements::javascript(SYNTAX_DIR."/thirdparty/syntaxhighlighter/scripts/shBrushCss.js"); + Requirements::javascript(SYNTAX_DIR."/thirdparty/syntaxhighlighter/scripts/shAutoloader.js"); Requirements::css(SYNTAX_DIR."/thirdparty/syntaxhighlighter/styles/shCore.css"); Requirements::css(SYNTAX_DIR."/thirdparty/syntaxhighlighter/styles/shThemeDefault.css"); - Requirements::customScript("SyntaxHighlighter.all();"); + + $baseDir = SYNTAX_DIR; + Requirements::customScript(<<