diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-02 23:56:53 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-02 23:56:53 +0200 |
commit | dd5cc8dcafb2ec8450ba82872a64d59c14724a55 (patch) | |
tree | 8347af57526bd7e008948ff5911d7a25a84a3074 /apps/files_textviewer/js/syntaxhighlighter/shBrushDiff.js | |
parent | 3829b1e7b956b8c9740df2d6fea8b685abdc4875 (diff) | |
download | nextcloud-server-dd5cc8dcafb2ec8450ba82872a64d59c14724a55.tar.gz nextcloud-server-dd5cc8dcafb2ec8450ba82872a64d59c14724a55.zip |
add textviewer plugin
Diffstat (limited to 'apps/files_textviewer/js/syntaxhighlighter/shBrushDiff.js')
-rw-r--r-- | apps/files_textviewer/js/syntaxhighlighter/shBrushDiff.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/apps/files_textviewer/js/syntaxhighlighter/shBrushDiff.js b/apps/files_textviewer/js/syntaxhighlighter/shBrushDiff.js new file mode 100644 index 00000000000..e9b14fc580a --- /dev/null +++ b/apps/files_textviewer/js/syntaxhighlighter/shBrushDiff.js @@ -0,0 +1,41 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.83 (July 02 2010) + * + * @copyright + * Copyright (C) 2004-2010 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() + { + this.regexList = [ + { regex: /^\+\+\+.*$/gm, css: 'color2' }, + { regex: /^\-\-\-.*$/gm, css: 'color2' }, + { regex: /^\s.*$/gm, css: 'color1' }, + { regex: /^@@.*@@$/gm, css: 'variable' }, + { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, + { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['diff', 'patch']; + + SyntaxHighlighter.brushes.Diff = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); |