diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-07-02 05:13:16 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-07-02 05:13:16 +0000 |
commit | 2e8eada098c43e53c79a2aa9a4627267006b9a26 (patch) | |
tree | 00b22ccf1f884bdbbeaaf8ab9e9e912afde5007f /usr/local/www/code-syntax-highlighter/shBrushPhp.js | |
parent | 540b0ca74bc19669c7e03c65c1e62a5795c9b232 (diff) | |
download | pfsense-2e8eada098c43e53c79a2aa9a4627267006b9a26.zip pfsense-2e8eada098c43e53c79a2aa9a4627267006b9a26.tar.gz |
Add source code highlighting support
Diffstat (limited to 'usr/local/www/code-syntax-highlighter/shBrushPhp.js')
-rw-r--r-- | usr/local/www/code-syntax-highlighter/shBrushPhp.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/usr/local/www/code-syntax-highlighter/shBrushPhp.js b/usr/local/www/code-syntax-highlighter/shBrushPhp.js new file mode 100644 index 0000000..bcc3e3f --- /dev/null +++ b/usr/local/www/code-syntax-highlighter/shBrushPhp.js @@ -0,0 +1,23 @@ +dp.sh.Brushes.Php = function() +{ + var keywords = 'and or xor __FILE__ __LINE__ array as break case ' + + 'cfunction class const continue declare default die do echo else ' + + 'elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exit ' + + 'extends for foreach function global if include include_once isset list ' + + 'new old_function print require require_once return static switch unset use ' + + 'var while __FUNCTION__ __CLASS__'; + + this.regexList = [ + { regex: new RegExp('//.*$', 'gm'), css: 'comment' }, // one line comments + { regex: new RegExp('/\\*[\\s\\S]*?\\*/', 'g'), css: 'comment' }, // multiline comments + { regex: new RegExp('"(?:\\.|[^\\""])*"', 'g'), css: 'string' }, // double quoted strings + { regex: new RegExp('\'(?:\\.|[^\\\'\'])*\'', 'g'), css: 'string' }, // single quoted strings + { regex: new RegExp('\\$\\w+', 'g'), css: 'vars' }, // variables + { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; + + this.CssClass = 'dp-c'; +} + +dp.sh.Brushes.Php.prototype = new dp.sh.Highlighter(); +dp.sh.Brushes.Php.Aliases = ['php']; |