summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/code-syntax-highlighter/shBrushJScript.js
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-25 08:08:24 -0300
committerRenato Botelho <renato@netgate.com>2015-08-25 14:49:54 -0300
commit46bc6e545a17e77202aaf01ec0cd8d5a46567525 (patch)
tree32d18dda436ec739c67c489ceb771e8629cd926f /src/usr/local/www/code-syntax-highlighter/shBrushJScript.js
parent4d9801c2dbd2b3e54a39578ee62b93af66607227 (diff)
downloadpfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.zip
pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.tar.gz
Move main pfSense content to src/
Diffstat (limited to 'src/usr/local/www/code-syntax-highlighter/shBrushJScript.js')
-rw-r--r--src/usr/local/www/code-syntax-highlighter/shBrushJScript.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/usr/local/www/code-syntax-highlighter/shBrushJScript.js b/src/usr/local/www/code-syntax-highlighter/shBrushJScript.js
new file mode 100644
index 0000000..c68a2a5
--- /dev/null
+++ b/src/usr/local/www/code-syntax-highlighter/shBrushJScript.js
@@ -0,0 +1,22 @@
+dp.sh.Brushes.JScript = function()
+{
+ var keywords = 'abstract boolean break byte case catch char class const continue debugger ' +
+ 'default delete do double else enum export extends false final finally float ' +
+ 'for function goto if implements import in instanceof int interface long native ' +
+ 'new null package private protected public return short static super switch ' +
+ 'synchronized this throw throws transient true try typeof var void volatile while with';
+
+ 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('^\\s*#.*', 'gm'), css: 'preprocessor' }, // preprocessor tags like #region and #endregion
+ { regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' } // keywords
+ ];
+
+ this.CssClass = 'dp-c';
+}
+
+dp.sh.Brushes.JScript.prototype = new dp.sh.Highlighter();
+dp.sh.Brushes.JScript.Aliases = ['js', 'jscript', 'javascript'];
OpenPOWER on IntegriCloud