diff --git a/source/Ox.UI/js/Code/SyntaxHighlighter.js b/source/Ox.UI/js/Code/SyntaxHighlighter.js index 54131d31..4840b288 100644 --- a/source/Ox.UI/js/Code/SyntaxHighlighter.js +++ b/source/Ox.UI/js/Code/SyntaxHighlighter.js @@ -4,6 +4,7 @@ Ox.SyntaxHighlighter Syntax Highlighter ([options[, self]]) -> Syntax Highlighter options Options + file JavaScript file (alternative to `source` option) lineLength If larger than zero, show edge of page offset First line number replace <[[]]|[]> Array of replacements @@ -24,6 +25,7 @@ Ox.SyntaxHighlighter = function(options, self) { self = self || {}; var that = Ox.Element({}, self) .defaults({ + file: '', lineLength: 0, offset: 1, replace: [], @@ -39,7 +41,14 @@ Ox.SyntaxHighlighter = function(options, self) { .update(renderSource) .addClass('OxSyntaxHighlighter'); - renderSource(); + if (self.options.file) { + Ox.get(self.options.file, function(source) { + self.options.source = source; + renderSource(); + }); + } else { + renderSource(); + } function renderSource() { var $lineNumbers, $line, $source, width,