diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 8426bdb..0a92bc8 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ -A fork of yash dotclear pluggin. -More infos soon. +# Yash 3 +C'est un fork avec des modifications mineures du plugin Yash de Dotclear http://plugins.dotaddict.org/dc2/details/yash (By pep and contributors GNU/GPL v2) + +# devel Level +alpha version + +# Modifications apportées: + +Le plugin Yash insère 2 appels à des scripts javascripts, et ajoute des variables JS dans le footer de la page. +Yash3 concatène tout ça pour ne mettre qu'un seul script en référence. +Il y aura quand même des appels à des scripts js (syntaxhighlighter) en fonction du type de code que vous souhaitez coloriser. \ No newline at end of file diff --git a/_admin.php b/_admin.php old mode 100644 new mode 100755 index 246b408..7336a7d --- a/_admin.php +++ b/_admin.php @@ -27,8 +27,8 @@ __('YASH').__('Yet Another Syntax Highlighter'); $_menu['Blog']->addItem(__('YASH3'), 'plugin.php?p=yash3', - urldecode(dcPage::getPF('yash/icon.png')), + urldecode(dcPage::getPF('yash3/icon.png')), preg_match('/plugin.php\?p=yash3(&.*)?$/',$_SERVER['REQUEST_URI']), $core->auth->check('contentadmin',$core->blog->id)); -$core->addBehavior('adminPostEditor',array('yashBehaviors','adminPostEditor')); +$core->addBehavior('adminPostEditor',array('yash3Behaviors','adminPostEditor')); diff --git a/_define.php b/_define.php old mode 100644 new mode 100755 index c4f6ed9..9506ab8 --- a/_define.php +++ b/_define.php @@ -24,7 +24,7 @@ if (!defined('DC_RC_PATH')) { return; } $this->registerModule( /* Name */ "YASH Fork", - /* Description*/ "Fork of Yet Another Syntax Highlighter. Modification: Juste one javascript call on public pages for yash", + /* Description*/ "Fork of Yet Another Syntax Highlighter. Modification: Juste one javascript call on public pages for yash3", /* Author */ "Forked and modified by Gnieark, origin Pep and contributors", /* Version */ '1.6.3.2', array( diff --git a/_prepend.php b/_prepend.php old mode 100644 new mode 100755 index f1d2969..8101d14 --- a/_prepend.php +++ b/_prepend.php @@ -1,6 +1,6 @@ addBehavior('coreInitWikiPost',array('yashBehaviors','coreInitWikiPost')); +$core->addBehavior('coreInitWikiPost',array('yash3Behaviors','coreInitWikiPost')); diff --git a/_public.php b/_public.php old mode 100644 new mode 100755 index f9014d0..819eac6 --- a/_public.php +++ b/_public.php @@ -33,10 +33,10 @@ class dcYASH { global $core; - $core->blog->settings->addNamespace('yash'); - if ($core->blog->settings->yash->yash_active) + $core->blog->settings->addNamespace('yash3'); + if ($core->blog->settings->yash3->yash3_active) { - $custom_css = $core->blog->settings->yash->yash_custom_css; + $custom_css = $core->blog->settings->yash3->yash3_custom_css; if (!empty($custom_css)) { if (strpos('/',$custom_css) === 0) { $css = $custom_css; @@ -49,7 +49,7 @@ class dcYASH } } else { - $theme = (string)$core->blog->settings->yash->yash_theme; + $theme = (string)$core->blog->settings->yash3->yash3_theme; if ($theme == '') { $css = $core->blog->getPF('yash3/syntaxhighlighter/css/shThemeDefault.css'); } else { @@ -66,10 +66,9 @@ class dcYASH { global $core; - $core->blog->settings->addNamespace('yash'); - if ($core->blog->settings->yash->yash_active){ - //to do differents files if dotclear is path info or not - echo dcUtils::jsLoad($core->blog->getPF('yash3/syntaxhighlighter/js/shALLMinified.js')); + $core->blog->settings->addNamespace('yash3'); + if ($core->blog->settings->yash3->yash3_active){ + echo dcUtils::jsLoad($core->blog->getPF('yash3/syntaxhighlighter/js/shConcatened.js')); } } } diff --git a/icon-big.png b/icon-big.png old mode 100644 new mode 100755 diff --git a/icon.png b/icon.png old mode 100644 new mode 100755 diff --git a/inc/yash.behaviors.php b/inc/yash.behaviors.php.bak old mode 100644 new mode 100755 similarity index 73% rename from inc/yash.behaviors.php rename to inc/yash.behaviors.php.bak index dfb02ac..92b08c7 --- a/inc/yash.behaviors.php +++ b/inc/yash.behaviors.php.bak @@ -1,6 +1,6 @@ getVersion('yash')). + dcPage::jsLoad(urldecode(dcPage::getPF('yash3/js/post.js')),$core->getVersion('yash')). '\n"; } public static function coreInitWikiPost($wiki2xhtml) { - $wiki2xhtml->registerFunction('macro:yash',array('yashBehaviors','transform')); + $wiki2xhtml->registerFunction('macro:yash3',array('yashBehaviors','transform')); } public static function transform($text,$args) diff --git a/inc/yash3.behaviors.php b/inc/yash3.behaviors.php new file mode 100755 index 0000000..92b08c7 --- /dev/null +++ b/inc/yash3.behaviors.php @@ -0,0 +1,42 @@ +getVersion('yash')). + '\n"; + } + + public static function coreInitWikiPost($wiki2xhtml) + { + $wiki2xhtml->registerFunction('macro:yash3',array('yashBehaviors','transform')); + } + + public static function transform($text,$args) + { + $text = trim($text); + $real_args = explode(' ',$args); + $class = empty($real_args[1])?'plain':$real_args[1]; + return '
'.htmlspecialchars($text).'
'; + } +} diff --git a/index.php b/index.php old mode 100644 new mode 100755 index f28fe3e..977a5d1 --- a/index.php +++ b/index.php @@ -1,7 +1,12 @@ ?\/])\s*#', + '#[;,]([\]\}])#', '#\btrue\b#', '#\bfalse\b#', '#\breturn\s+#' ), + array( "", '$1', '$1', '!0', '!1', 'return '), + $input + ); +} +function yash3_minify_js($input) +{ + if( ! $input = trim($input)) return $input; + // Create chunk(s) of string(s), comment(s), regex(es) and text + global $SS, $CC; + $input = preg_split('#(' . $SS . '|' . $CC . '|\/[^\n]+?\/(?=[.,;]|[gimuy]|$))#', + $input, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + $output = ""; + foreach($input as $v) + { + if(trim($v) === "") continue; + if( + ($v[0] === '"' && substr($v, -1) === '"') || + ($v[0] === "'" && substr($v, -1) === "'") || + ($v[0] === '/' && substr($v, -1) === '/') + ){ + // Remove if not detected as important comment ... + if(strpos($v, '//') === 0 || (strpos($v, '/*') === 0 && strpos($v, '/*!') !== 0 && strpos($v, '/*@cc_on') !== 0)) continue; + $output .= $v; // String, comment or regex ... + } else { + $output .= _yash3_minify_js($v); + } + } + return preg_replace( + array( + '#(' . $CC . ')|([\{,])([\'])(\d+|[a-z_]\w*)\3(?=:)#i', + '#([\w\)\]])\[([\'"])([a-z_]\w*)\2\]#i' + ), + array( + '$1$2$4', + '$1.$3' + ), + $output); +} + // Setting default parameters if missing configuration -$core->blog->settings->addNamespace('yash'); -if (is_null($core->blog->settings->yash->yash_active)) { +$core->blog->settings->addNamespace('yash3'); +if (is_null($core->blog->settings->yash3->yash3_active)) { try { // Default state is active if the comments are configured to allow wiki syntax - $core->blog->settings->yash->put('yash_active',false,'boolean',true); - $core->blog->settings->yash->put('yash_theme','Default','string',true); - $core->blog->settings->yash->put('yash_custom_css','','string',true); + $core->blog->settings->yash3->put('yash3_active',false,'boolean',true); + $core->blog->settings->yash3->put('yash3_theme','Default','string',true); + $core->blog->settings->yash3->put('yash3_custom_css','','string',true); $core->blog->triggerBlog(); http::redirect($p_url); } @@ -39,12 +89,12 @@ if (is_null($core->blog->settings->yash->yash_active)) { } // Getting current parameters -$active = (boolean)$core->blog->settings->yash->yash_active; -$theme = (string)$core->blog->settings->yash->yash_theme; -$custom_css = (string)$core->blog->settings->yash->yash_custom_css; +$active = (boolean)$core->blog->settings->yash3->yash3_active; +$theme = (string)$core->blog->settings->yash3->yash3_theme; +$custom_css = (string)$core->blog->settings->yash3->yash3_custom_css; if (!empty($_REQUEST['popup'])) { - $yash_brushes = array( + $yash3_brushes = array( 'plain' => __('Plain Text'), 'applescript' => __('AppleScript'), 'as3' => __('ActionScript3'), @@ -80,15 +130,15 @@ if (!empty($_REQUEST['popup'])) { ''. ''. ''.__('YASH - Syntax Selector').''. - dcPage::jsLoad(urldecode(dcPage::getPF('yash/js/popup.js')),$core->getVersion('yash')). + dcPage::jsLoad(urldecode(dcPage::getPF('yash3/js/popup.js')),$core->getVersion('yash3')). ''. ''. '

'.__('YASH - Syntax Selector').'

'. - '
'. + ''. '

'. - '

'.__('Cancel').' - '. - ''.__('Ok').'

'. + form::combo('syntax',array_flip($yash3_brushes)).'

'. + '

'.__('Cancel').' - '. + ''.__('Ok').'

'. '
'. ''. ''; @@ -99,13 +149,30 @@ if (!empty($_REQUEST['popup'])) { if (!empty($_POST['saveconfig'])) { try { - $core->blog->settings->addNameSpace('yash'); + $core->blog->settings->addNameSpace('yash3'); $active = (empty($_POST['active'])) ? false : true; $theme = (empty($_POST['theme'])) ? 'Default' : $_POST['theme']; $custom_css = (empty($_POST['custom_css'])) ? '' : html::sanitizeURL($_POST['custom_css']); - $core->blog->settings->yash->put('yash_active',$active,'boolean'); - $core->blog->settings->yash->put('yash_theme',$theme,'string'); - $core->blog->settings->yash->put('yash_custom_css',$custom_css,'string'); + $core->blog->settings->yash3->put('yash3_active',$active,'boolean'); + $core->blog->settings->yash3->put('yash3_theme',$theme,'string'); + $core->blog->settings->yash3->put('yash3_custom_css',$custom_css,'string'); + + //To do, créer le file minifié ici yash3/syntaxhighlighter/js/shConcatened.js + + if(file_exists(dirname(__FILE__)."/syntaxhighlighter/js/shConcatened.js")){ + //delete It + unlink(dirname(__FILE__)."/syntaxhighlighter/js/shConcatened.js"); + } + //concat js files and minify them + $fContent = yash3_minify_js( + get_file_content(dirname(__FILE__)."/syntaxhighlighter/js/shCore.js"). + get_file_content(dirname(__FILE__)."/syntaxhighlighter/js/shAutoloader.js"). + dcUtils::jsVar('yash_path',$core->blog->getPF('yash/syntaxhighlighter/js/')). + get_file_content(dirname(__FILE__)."/js/public.js") + ); + //write the fiule + file_put_contents(dirname(__FILE__)."/syntaxhighlighter/js/shConcatened.js",$fContent); + $core->blog->triggerBlog(); dcPage::addSuccessNotice(__('Configuration successfully updated.')); http::redirect($p_url); @@ -146,7 +213,7 @@ $combo_theme = array( ); ?> -
+

@@ -166,7 +233,7 @@ $combo_theme = array(

-

+

formNonce(); ?>

diff --git a/js/popup.js b/js/popup.js old mode 100644 new mode 100755 index 1f9f947..f38cc7d --- a/js/popup.js +++ b/js/popup.js @@ -1,21 +1,21 @@ $(function() { - $('#yash-cancel').click(function() { + $('#yash3-cancel').click(function() { window.close(); return false; }); - $('#yash-ok').click(function() { + $('#yash3-ok').click(function() { sendClose(); window.close(); return false; }); function sendClose() { - var insert_form = $('#yash-form').get(0); + var insert_form = $('#yash3-form').get(0); if (insert_form == undefined) { return; } var tb = window.opener.the_toolbar; - var data = tb.elements.yash.data; + var data = tb.elements.yash3.data; data.syntax = insert_form.syntax.value; - tb.elements.yash.fncall[tb.mode].call(tb); + tb.elements.yash3.fncall[tb.mode].call(tb); }; }); diff --git a/js/popup.js.bak b/js/popup.js.bak new file mode 100755 index 0000000..1f9f947 --- /dev/null +++ b/js/popup.js.bak @@ -0,0 +1,21 @@ +$(function() { + $('#yash-cancel').click(function() { + window.close(); + return false; + }); + + $('#yash-ok').click(function() { + sendClose(); + window.close(); + return false; + }); + + function sendClose() { + var insert_form = $('#yash-form').get(0); + if (insert_form == undefined) { return; } + var tb = window.opener.the_toolbar; + var data = tb.elements.yash.data; + data.syntax = insert_form.syntax.value; + tb.elements.yash.fncall[tb.mode].call(tb); + }; +}); diff --git a/js/post.js b/js/post.js old mode 100644 new mode 100755 index c1becb3..092282e --- a/js/post.js +++ b/js/post.js @@ -1,4 +1,4 @@ -jsToolBar.prototype.elements.yashSpace = {type: 'space', +jsToolBar.prototype.elements.yash3Space = {type: 'space', format: { wysiwyg: true, wiki: true, @@ -7,47 +7,47 @@ jsToolBar.prototype.elements.yashSpace = {type: 'space', } }; -jsToolBar.prototype.elements.yash = { +jsToolBar.prototype.elements.yash3 = { type: 'button', title: 'Highlighted Code', context: 'post', - icon: 'index.php?pf=yash/icon.png', + icon: 'index.php?pf=yash3/icon.png', fn:{}, fncall:{}, - open_url:'plugin.php?p=yash&popup=1', + open_url:'plugin.php?p=yash3&popup=1', data:{}, popup: function() { window.the_toolbar = this; - this.elements.yash.data = {}; + this.elements.yash3.data = {}; - var p_win = window.open(this.elements.yash.open_url,'dc_popup', + var p_win = window.open(this.elements.yash3.open_url,'dc_popup', 'alwaysRaised=yes,dependent=yes,toolbar=yes,height=240,width=480,'+ 'menubar=no,resizable=yes,scrollbars=yes,status=no'); } }; -jsToolBar.prototype.elements.yash.fn.wiki = function() { - this.elements.yash.popup.call(this); +jsToolBar.prototype.elements.yash3.fn.wiki = function() { + this.elements.yash3.popup.call(this); }; -jsToolBar.prototype.elements.yash.fn.xhtml = function() { - this.elements.yash.popup.call(this); +jsToolBar.prototype.elements.yash3.fn.xhtml = function() { + this.elements.yash3.popup.call(this); }; -jsToolBar.prototype.elements.yash.fn.markdown = function() { - this.elements.yash.popup.call(this); +jsToolBar.prototype.elements.yash3.fn.markdown = function() { + this.elements.yash3.popup.call(this); }; -jsToolBar.prototype.elements.yash.fncall.wiki = function() { - var stag = '\n///yash ' + this.elements.yash.data.syntax + '\n'; +jsToolBar.prototype.elements.yash3.fncall.wiki = function() { + var stag = '\n///yash3 ' + this.elements.yash.data.syntax + '\n'; var etag = '\n///\n'; this.encloseSelection(stag,etag); }; -jsToolBar.prototype.elements.yash.fncall.xhtml = function() { - var stag = '
\n';
+jsToolBar.prototype.elements.yash3.fncall.xhtml = function() {
+	var stag = '
\n';
 	var etag = '\n
\n'; this.encloseSelection(stag,etag); }; -jsToolBar.prototype.elements.yash.fncall.markdown = function() { - var stag = '
\n';
+jsToolBar.prototype.elements.yash3.fncall.markdown = function() {
+	var stag = '
\n';
 	var etag = '\n
\n'; this.encloseSelection(stag,etag); }; diff --git a/js/post.js.bak b/js/post.js.bak new file mode 100755 index 0000000..c1becb3 --- /dev/null +++ b/js/post.js.bak @@ -0,0 +1,53 @@ +jsToolBar.prototype.elements.yashSpace = {type: 'space', + format: { + wysiwyg: true, + wiki: true, + xhtml: true, + markdown: true + } +}; + +jsToolBar.prototype.elements.yash = { + type: 'button', + title: 'Highlighted Code', + context: 'post', + icon: 'index.php?pf=yash/icon.png', + fn:{}, + fncall:{}, + open_url:'plugin.php?p=yash&popup=1', + data:{}, + popup: function() { + window.the_toolbar = this; + this.elements.yash.data = {}; + + var p_win = window.open(this.elements.yash.open_url,'dc_popup', + 'alwaysRaised=yes,dependent=yes,toolbar=yes,height=240,width=480,'+ + 'menubar=no,resizable=yes,scrollbars=yes,status=no'); + } +}; + +jsToolBar.prototype.elements.yash.fn.wiki = function() { + this.elements.yash.popup.call(this); +}; +jsToolBar.prototype.elements.yash.fn.xhtml = function() { + this.elements.yash.popup.call(this); +}; +jsToolBar.prototype.elements.yash.fn.markdown = function() { + this.elements.yash.popup.call(this); +}; + +jsToolBar.prototype.elements.yash.fncall.wiki = function() { + var stag = '\n///yash ' + this.elements.yash.data.syntax + '\n'; + var etag = '\n///\n'; + this.encloseSelection(stag,etag); +}; +jsToolBar.prototype.elements.yash.fncall.xhtml = function() { + var stag = '
\n';
+	var etag = '\n
\n'; + this.encloseSelection(stag,etag); +}; +jsToolBar.prototype.elements.yash.fncall.markdown = function() { + var stag = '
\n';
+	var etag = '\n
\n'; + this.encloseSelection(stag,etag); +}; diff --git a/js/public.js b/js/public.js old mode 100644 new mode 100755 index d1f7fe3..2c33d3d --- a/js/public.js +++ b/js/public.js @@ -2,7 +2,7 @@ function shGetPath() { var args = arguments, result = []; for(var i = 0; i < args.length; i++) - result.push(args[i].replace('@', yash_path)); + result.push(args[i].replace('@', yash3_path)); return result; }; SyntaxHighlighter.autoloader.apply(null, shGetPath( diff --git a/js/public.js.bak b/js/public.js.bak new file mode 100755 index 0000000..d1f7fe3 --- /dev/null +++ b/js/public.js.bak @@ -0,0 +1,37 @@ +function shGetPath() +{ + var args = arguments, result = []; + for(var i = 0; i < args.length; i++) + result.push(args[i].replace('@', yash_path)); + return result; +}; +SyntaxHighlighter.autoloader.apply(null, shGetPath( + 'applescript @shBrushAppleScript.js', + 'actionscript3 as3 @shBrushAS3.js', + 'bash shell @shBrushBash.js', + 'coldfusion cf @shBrushColdFusion.js', + 'cpp c @shBrushCpp.js', + 'c# c-sharp csharp @shBrushCSharp.js', + 'css @shBrushCss.js', + 'delphi pascal @shBrushDelphi.js', + 'diff patch pas @shBrushDiff.js', + 'erl erlang @shBrushErlang.js', + 'groovy @shBrushGroovy.js', + 'java @shBrushJava.js', + 'jfx javafx @shBrushJavaFX.js', + 'js jscript javascript @shBrushJScript.js', + 'perl pl @shBrushPerl.js', + 'php @shBrushPhp.js', + 'text plain @shBrushPlain.js', + 'ps powershell @shBrushPowerShell.js', + 'py python @shBrushPython.js', + 'ruby rails ror rb @shBrushRuby.js', + 'sass scss @shBrushSass.js', + 'scala @shBrushScala.js', + 'sql @shBrushSql.js', + 'vb vbnet @shBrushVb.js', + 'xml xhtml xslt html @shBrushXml.js', + 'yaml yaml @shBrushYaml.js' +)); +SyntaxHighlighter.defaults['toolbar'] = false; +SyntaxHighlighter.all(); diff --git a/locales/_pot/main.pot b/locales/_pot/main.pot old mode 100644 new mode 100755 diff --git a/locales/fr/main.po b/locales/fr/main.po old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/LGPL-LICENSE b/syntaxhighlighter/LGPL-LICENSE old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/MIT-LICENSE b/syntaxhighlighter/MIT-LICENSE old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shCore.css b/syntaxhighlighter/css/shCore.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeDefault.css b/syntaxhighlighter/css/shThemeDefault.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeDjango.css b/syntaxhighlighter/css/shThemeDjango.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeEclipse.css b/syntaxhighlighter/css/shThemeEclipse.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeEmacs.css b/syntaxhighlighter/css/shThemeEmacs.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeFadeToGrey.css b/syntaxhighlighter/css/shThemeFadeToGrey.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeMDUltra.css b/syntaxhighlighter/css/shThemeMDUltra.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeMaterial.css b/syntaxhighlighter/css/shThemeMaterial.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeMidnight.css b/syntaxhighlighter/css/shThemeMidnight.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeRDark.css b/syntaxhighlighter/css/shThemeRDark.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeSolarizedDark.css b/syntaxhighlighter/css/shThemeSolarizedDark.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeSolarizedLight.css b/syntaxhighlighter/css/shThemeSolarizedLight.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/css/shThemeTomorrowNight.css b/syntaxhighlighter/css/shThemeTomorrowNight.css old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shALLMinified.js b/syntaxhighlighter/js/shALLMinified.js old mode 100644 new mode 100755 index 8809700..7b7b595 --- a/syntaxhighlighter/js/shALLMinified.js +++ b/syntaxhighlighter/js/shALLMinified.js @@ -1 +1 @@ -function shGetPath(){for(var a=arguments,b=[],c=0;c-1}},i=0;if(c=c===a?"":String(c),d=d===a?"":String(d),f.match.call(d,n))throw new SyntaxError("invalid duplicate regular expression flag");for(c=f.replace.call(c,/^\(\?([\w$]+)\)/,function(a,b){if(f.test.call(/[gy]/,b))throw new SyntaxError("can't use flag g or y in mode modifier");return d=f.replace.call(d+b,n,""),""}),b.forEach(d,/[\s\S]/,function(a){if(s.indexOf(a[0])<0)throw new SyntaxError("invalid regular expression flag "+a[0])});i"}else if(c)return"\\"+(+c+f);return a},i=[];if(!x(a,"array")||!a.length)throw new TypeError("patterns must be a nonempty array");for(k=0;k1&&w(c,"")>-1&&(e=new RegExp(this.source,f.replace.call(u(this),"g","")),f.replace.call(String(b).slice(c.index),e,function(){var b;for(b=1;bc.index&&(this.lastIndex=c.index)}return this.global||(this.lastIndex=g),c},g.test=function(a){return!!g.exec.call(this,a)},g.match=function(a){if(b.isRegExp(a)){if(a.global){var c=f.match.apply(this,arguments);return a.lastIndex=0,c}}else a=new RegExp(a);return g.exec.call(a,this)},g.replace=function(a,c){var e,g,h,i,d=b.isRegExp(a);return d?(a.xregexp&&(e=a.xregexp.captureNames),a.global||(i=a.lastIndex)):a+="",x(c,"function")?g=f.replace.call(String(this),a,function(){var f,b=arguments;if(e)for(b[0]=new String(b[0]),f=0;fa.length-3)throw new SyntaxError("backreference to undefined group "+b);return a[d]||""}throw new SyntaxError("invalid token "+b)})})),d&&(a.global?a.lastIndex=0:a.lastIndex=i),g},g.split=function(c,d){if(!b.isRegExp(c))return f.split.apply(this,arguments);var j,e=String(this),g=c.lastIndex,h=[],i=0;return d=(d===a?-1:d)>>>0,b.forEach(e,c,function(a){a.index+a[0].length>i&&(h.push(e.slice(i,a.index)),a.length>1&&a.indexd?h.slice(0,d):h},d=c.on,d(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(a,b){if("B"===a[1]&&b===j)return a[0];throw new SyntaxError("invalid escape "+a[0])},{scope:"all"}),d(/\[(\^?)]/,function(a){return a[1]?"[\\s\\S]":"\\b\\B"}),d(/(?:\(\?#[^)]*\))+/,function(a){return f.test.call(o,a.input.slice(a.index+a[0].length))?"":"(?:)"}),d(/\\k<([\w$]+)>/,function(a){var b=isNaN(a[1])?w(this.captureNames,a[1])+1:+a[1],c=a.index+a[0].length;if(!b||b>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+a[0]);return"\\"+b+(c===a.input.length||isNaN(a.input.charAt(c))?"":"(?:)")}),d(/(?:\s+|#.*)+/,function(a){return f.test.call(o,a.input.slice(a.index+a[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),d(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),d(/\(\?P?<([\w$]+)>/,function(a){if(!isNaN(a[1]))throw new SyntaxError("can't use integer as capture name "+a[0]);return this.captureNames.push(a[1]),this.hasNamedCapture=!0,"("}),d(/\\(\d+)/,function(a,b){if(!(b===j&&/^[1-9]/.test(a[1])&&+a[1]<=this.captureNames.length)&&"0"!==a[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+a[0]);return a[0]},{scope:"all"}),d(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),"undefined"!=typeof exports&&(exports.XRegExp=b),b}(),"undefined"==typeof SyntaxHighlighter)var SyntaxHighlighter=function(){function b(a){return document.createElement("div").appendChild(document.createTextNode(a)).parentNode.innerHTML.replace(/"/g,""")}function c(a,b){return a.className.indexOf(b)!=-1}function d(a,b){c(a,b)||(a.className+=" "+b)}function e(a,b){a.className=a.className.replace(b,"")}function f(a){for(var b=[],c=0,d=a.length;c(.*?))\\]$"),e=0,f=XRegExp("(?[\\w-]+)\\s*:\\s*(?[\\w%#-]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");null!=(b=XRegExp.exec(a,f,e));){var g=b.value.replace(/^['"]|['"]$/g,"");if(null!=g&&d.test(g)){var h=XRegExp.exec(g,d);g=h.values.length>0?h.values.split(/\s*,\s*/):[]}c[b.name]=g,e=b.index+b[0].length}return c}function y(b,c){return null==b||0==b.length||"\n"==b?b:(b=b.replace(/'+a+""})),b)}function z(a,b){for(var c=a.toString();c.length|<br\s*\/?>/gi;return 1==a.config.bloggerMode&&(b=b.replace(c,"\n")),1==a.config.stripBrs&&(b=b.replace(c,"")),b}function D(a){return a.replace(/^\s+|\s+$/g,"")}function E(a){for(var b=g(C(a)),d=(new Array,/^\s*/),e=1e3,f=0,h=b.length;f0;f++){var i=b[f];if(0!=D(i).length){var j=d.exec(i);if(null==j)return a;e=Math.min(j[0].length,e)}}if(e>0)for(var f=0,h=b.length;fb.index?1:a.lengthb.length?1:0}function G(b,c){function d(a,b){return a[0]}var f=null,g=[],h=c.func?c.func:d;for(pos=0;null!=(f=XRegExp.exec(b,c.regex,pos));){var i=h(f,c);"string"==typeof i&&(i=[new a.Match(i,f.index,c.css)]),g=g.concat(i),pos=f.index+f[0].length}return g}function H(b){var c=/(.*)((>|<).*)/;return b.replace(a.regexLib.url,function(a){var b="",d=null;return(d=c.exec(a))&&(a=d[1],b=d[2]),''+a+""+b})}function I(){for(var a=document.getElementsByTagName("script"),b=[],c=0,d=a.length;cAbout SyntaxHighlighter
SyntaxHighlighter
version 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT)
JavaScript code syntax highlighter.
Copyright 2004-2013 Alex Gorbatchev.
If you like this script, please donate to
keep development active!
'}},vars:{highlighters:{}},brushes:{},regexLib:{multiLineCComments:XRegExp("/\\*.*?\\*/","gs"),singleLineCComments:/\/\/.*$/gm,singleLinePerlComments:/#.*$/gm,doubleQuotedString:/"([^\\"\n]|\\.)*"/g,singleQuotedString:/'([^\\'\n]|\\.)*'/g,multiLineDoubleQuotedString:XRegExp('"([^\\\\"]|\\\\.)*"',"gs"),multiLineSingleQuotedString:XRegExp("'([^\\\\']|\\\\.)*'","gs"),xmlComments:XRegExp("(<|<)!--.*?--(>|>)","gs"),url:/\w+:\/\/[\w-.\/?%&=:@;#]*/g,phpScriptTags:{left:/(<|<)\?(?:=|php)?/g,right:/\?(>|>)/g,eof:!0},aspScriptTags:{left:/(<|<)%=?/g,right:/%(>|>)/g},scriptScriptTags:{left:/(<|<)\s*script.*?(>|>)/gi,right:/(<|<)\/\s*script\s*(>|>)/gi}},toolbar:{getHtml:function(b){function f(b,c){return a.toolbar.getButtonHtml(b,c,a.config.strings[c])}for(var c='
',d=a.toolbar.items,e=d.list,g=0,h=e.length;g'+b(d)+""},handler:function(b){function e(a){var b=new RegExp(a+"_(\\w+)"),c=b.exec(d);return c?c[1]:null}var c=b.target,d=c.className||"",f=i(m(c,".syntaxhighlighter").id),g=e("command");f&&g&&a.toolbar.items[g].execute(f),b.preventDefault()},items:{list:["expandSource","help"],expandSource:{getHtml:function(b){if(1!=b.getParam("collapse"))return"";var c=b.getParam("title");return a.toolbar.getButtonHtml(b,"expandSource",c?c:a.config.strings.expandSource)},execute:function(a){var b=j(a.id);e(b,"collapsed")}},help:{execute:function(b){var c=r("","_blank",500,250,"scrollbars=0"),d=c.document;d.write(a.config.strings.aboutDialog),d.close(),c.focus()}}}},findElements:function(b,c){var d=c?[c]:f(document.getElementsByTagName(a.config.tagName)),e=a.config,g=[];if(e.useScriptTags&&(d=d.concat(I())),0===d.length)return g;for(var h=0,i=d.length;he)break;g.index==d.index&&g.length>d.length?a[b]=null:g.index>=d.index&&g.index'+c+"
"},getLineNumbersHtml:function(b,c){var d="",e=g(b).length,f=parseInt(this.getParam("first-line")),h=this.getParam("pad-line-numbers");1==h?h=(f+e-1).toString().length:1==isNaN(h)&&(h=0);for(var i=0;i'+m+"":"")+k)}return b},getTitleHtml:function(a){return a?""+b(a)+"":""},getMatchesHtml:function(a,b){function f(a){var b=a?a.brushName||e:e;return b?b+" ":""}for(var c=0,d="",e=this.getParam("brush",""),g=0,h=b.length;g'+(this.getParam("toolbar")?a.toolbar.getHtml(this):"")+''+this.getTitleHtml(this.getParam("title"))+""+(gutter?'":"")+'
'+this.getLineNumbersHtml(c)+"
'+d+"
"},getDiv:function(b){null===b&&(b=""),this.code=b;var c=this.create("div");return c.innerHTML=this.getHtml(b),this.getParam("toolbar")&&s(l(c,".toolbar"),"click",a.toolbar.handler),this.getParam("quick-code")&&s(l(c,".code"),"dblclick",K),c},init:function(b){this.id=o(),k(this),this.params=p(a.defaults,b||{}),1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1)},getKeywords:function(a){return a=a.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"|"),"\\b(?:"+a+")\\b"},forHtmlScript:function(a){var b={end:a.right.source};a.eof&&(b.end="(?:(?:"+b.end+")|$)"),this.htmlScript={left:{regex:a.left,css:"script"},right:{regex:a.right,css:"script"},code:XRegExp("(?"+a.left.source+")(?.*?)(?"+b.end+")","sgi")}}},a}();"undefined"!=typeof exports?exports.SyntaxHighlighter=SyntaxHighlighter:null,function(){var a=SyntaxHighlighter;a.autoloader=function(){function j(a,b){for(var c=0;c-1}},i=0;if(c=c===a?"":String(c),d=d===a?"":String(d),f.match.call(d,n))throw new SyntaxError("invalid duplicate regular expression flag");for(c=f.replace.call(c,/^\(\?([\w$]+)\)/,function(a,b){if(f.test.call(/[gy]/,b))throw new SyntaxError("can't use flag g or y in mode modifier");return d=f.replace.call(d+b,n,""),""}),b.forEach(d,/[\s\S]/,function(a){if(s.indexOf(a[0])<0)throw new SyntaxError("invalid regular expression flag "+a[0])});i"}else if(c)return"\\"+(+c+f);return a},i=[];if(!x(a,"array")||!a.length)throw new TypeError("patterns must be a nonempty array");for(k=0;k1&&w(c,"")>-1&&(e=new RegExp(this.source,f.replace.call(u(this),"g","")),f.replace.call(String(b).slice(c.index),e,function(){var b;for(b=1;bc.index&&(this.lastIndex=c.index)}return this.global||(this.lastIndex=g),c},g.test=function(a){return!!g.exec.call(this,a)},g.match=function(a){if(b.isRegExp(a)){if(a.global){var c=f.match.apply(this,arguments);return a.lastIndex=0,c}}else a=new RegExp(a);return g.exec.call(a,this)},g.replace=function(a,c){var e,g,h,i,d=b.isRegExp(a);return d?(a.xregexp&&(e=a.xregexp.captureNames),a.global||(i=a.lastIndex)):a+="",x(c,"function")?g=f.replace.call(String(this),a,function(){var f,b=arguments;if(e)for(b[0]=new String(b[0]),f=0;fa.length-3)throw new SyntaxError("backreference to undefined group "+b);return a[d]||""}throw new SyntaxError("invalid token "+b)})})),d&&(a.global?a.lastIndex=0:a.lastIndex=i),g},g.split=function(c,d){if(!b.isRegExp(c))return f.split.apply(this,arguments);var j,e=String(this),g=c.lastIndex,h=[],i=0;return d=(d===a?-1:d)>>>0,b.forEach(e,c,function(a){a.index+a[0].length>i&&(h.push(e.slice(i,a.index)),a.length>1&&a.indexd?h.slice(0,d):h},d=c.on,d(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(a,b){if("B"===a[1]&&b===j)return a[0];throw new SyntaxError("invalid escape "+a[0])},{scope:"all"}),d(/\[(\^?)]/,function(a){return a[1]?"[\\s\\S]":"\\b\\B"}),d(/(?:\(\?#[^)]*\))+/,function(a){return f.test.call(o,a.input.slice(a.index+a[0].length))?"":"(?:)"}),d(/\\k<([\w$]+)>/,function(a){var b=isNaN(a[1])?w(this.captureNames,a[1])+1:+a[1],c=a.index+a[0].length;if(!b||b>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+a[0]);return"\\"+b+(c===a.input.length||isNaN(a.input.charAt(c))?"":"(?:)")}),d(/(?:\s+|#.*)+/,function(a){return f.test.call(o,a.input.slice(a.index+a[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),d(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),d(/\(\?P?<([\w$]+)>/,function(a){if(!isNaN(a[1]))throw new SyntaxError("can't use integer as capture name "+a[0]);return this.captureNames.push(a[1]),this.hasNamedCapture=!0,"("}),d(/\\(\d+)/,function(a,b){if(!(b===j&&/^[1-9]/.test(a[1])&&+a[1]<=this.captureNames.length)&&"0"!==a[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+a[0]);return a[0]},{scope:"all"}),d(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),"undefined"!=typeof exports&&(exports.XRegExp=b),b}(),"undefined"==typeof SyntaxHighlighter)var SyntaxHighlighter=function(){function b(a){return document.createElement("div").appendChild(document.createTextNode(a)).parentNode.innerHTML.replace(/"/g,""")}function c(a,b){return a.className.indexOf(b)!=-1}function d(a,b){c(a,b)||(a.className+=" "+b)}function e(a,b){a.className=a.className.replace(b,"")}function f(a){for(var b=[],c=0,d=a.length;c(.*?))\\]$"),e=0,f=XRegExp("(?[\\w-]+)\\s*:\\s*(?[\\w%#-]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");null!=(b=XRegExp.exec(a,f,e));){var g=b.value.replace(/^['"]|['"]$/g,"");if(null!=g&&d.test(g)){var h=XRegExp.exec(g,d);g=h.values.length>0?h.values.split(/\s*,\s*/):[]}c[b.name]=g,e=b.index+b[0].length}return c}function y(b,c){return null==b||0==b.length||"\n"==b?b:(b=b.replace(/'+a+""})),b)}function z(a,b){for(var c=a.toString();c.length|<br\s*\/?>/gi;return 1==a.config.bloggerMode&&(b=b.replace(c,"\n")),1==a.config.stripBrs&&(b=b.replace(c,"")),b}function D(a){return a.replace(/^\s+|\s+$/g,"")}function E(a){for(var b=g(C(a)),d=(new Array,/^\s*/),e=1e3,f=0,h=b.length;f0;f++){var i=b[f];if(0!=D(i).length){var j=d.exec(i);if(null==j)return a;e=Math.min(j[0].length,e)}}if(e>0)for(var f=0,h=b.length;fb.index?1:a.lengthb.length?1:0}function G(b,c){function d(a,b){return a[0]}var f=null,g=[],h=c.func?c.func:d;for(pos=0;null!=(f=XRegExp.exec(b,c.regex,pos));){var i=h(f,c);"string"==typeof i&&(i=[new a.Match(i,f.index,c.css)]),g=g.concat(i),pos=f.index+f[0].length}return g}function H(b){var c=/(.*)((>|<).*)/;return b.replace(a.regexLib.url,function(a){var b="",d=null;return(d=c.exec(a))&&(a=d[1],b=d[2]),''+a+""+b})}function I(){for(var a=document.getElementsByTagName("script"),b=[],c=0,d=a.length;cAbout SyntaxHighlighter
SyntaxHighlighter
version 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT)
JavaScript code syntax highlighter.
Copyright 2004-2013 Alex Gorbatchev.
If you like this script, please donate to
keep development active!
'}},vars:{highlighters:{}},brushes:{},regexLib:{multiLineCComments:XRegExp("/\\*.*?\\*/","gs"),singleLineCComments:/\/\/.*$/gm,singleLinePerlComments:/#.*$/gm,doubleQuotedString:/"([^\\"\n]|\\.)*"/g,singleQuotedString:/'([^\\'\n]|\\.)*'/g,multiLineDoubleQuotedString:XRegExp('"([^\\\\"]|\\\\.)*"',"gs"),multiLineSingleQuotedString:XRegExp("'([^\\\\']|\\\\.)*'","gs"),xmlComments:XRegExp("(<|<)!--.*?--(>|>)","gs"),url:/\w+:\/\/[\w-.\/?%&=:@;#]*/g,phpScriptTags:{left:/(<|<)\?(?:=|php)?/g,right:/\?(>|>)/g,eof:!0},aspScriptTags:{left:/(<|<)%=?/g,right:/%(>|>)/g},scriptScriptTags:{left:/(<|<)\s*script.*?(>|>)/gi,right:/(<|<)\/\s*script\s*(>|>)/gi}},toolbar:{getHtml:function(b){function f(b,c){return a.toolbar.getButtonHtml(b,c,a.config.strings[c])}for(var c='
',d=a.toolbar.items,e=d.list,g=0,h=e.length;g'+b(d)+""},handler:function(b){function e(a){var b=new RegExp(a+"_(\\w+)"),c=b.exec(d);return c?c[1]:null}var c=b.target,d=c.className||"",f=i(m(c,".syntaxhighlighter").id),g=e("command");f&&g&&a.toolbar.items[g].execute(f),b.preventDefault()},items:{list:["expandSource","help"],expandSource:{getHtml:function(b){if(1!=b.getParam("collapse"))return"";var c=b.getParam("title");return a.toolbar.getButtonHtml(b,"expandSource",c?c:a.config.strings.expandSource)},execute:function(a){var b=j(a.id);e(b,"collapsed")}},help:{execute:function(b){var c=r("","_blank",500,250,"scrollbars=0"),d=c.document;d.write(a.config.strings.aboutDialog),d.close(),c.focus()}}}},findElements:function(b,c){var d=c?[c]:f(document.getElementsByTagName(a.config.tagName)),e=a.config,g=[];if(e.useScriptTags&&(d=d.concat(I())),0===d.length)return g;for(var h=0,i=d.length;he)break;g.index==d.index&&g.length>d.length?a[b]=null:g.index>=d.index&&g.index'+c+"
"},getLineNumbersHtml:function(b,c){var d="",e=g(b).length,f=parseInt(this.getParam("first-line")),h=this.getParam("pad-line-numbers");1==h?h=(f+e-1).toString().length:1==isNaN(h)&&(h=0);for(var i=0;i'+m+"":"")+k)}return b},getTitleHtml:function(a){return a?""+b(a)+"":""},getMatchesHtml:function(a,b){function f(a){var b=a?a.brushName||e:e;return b?b+" ":""}for(var c=0,d="",e=this.getParam("brush",""),g=0,h=b.length;g'+(this.getParam("toolbar")?a.toolbar.getHtml(this):"")+''+this.getTitleHtml(this.getParam("title"))+""+(gutter?'":"")+'
'+this.getLineNumbersHtml(c)+"
'+d+"
"},getDiv:function(b){null===b&&(b=""),this.code=b;var c=this.create("div");return c.innerHTML=this.getHtml(b),this.getParam("toolbar")&&s(l(c,".toolbar"),"click",a.toolbar.handler),this.getParam("quick-code")&&s(l(c,".code"),"dblclick",K),c},init:function(b){this.id=o(),k(this),this.params=p(a.defaults,b||{}),1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1)},getKeywords:function(a){return a=a.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"|"),"\\b(?:"+a+")\\b"},forHtmlScript:function(a){var b={end:a.right.source};a.eof&&(b.end="(?:(?:"+b.end+")|$)"),this.htmlScript={left:{regex:a.left,css:"script"},right:{regex:a.right,css:"script"},code:XRegExp("(?"+a.left.source+")(?.*?)(?"+b.end+")","sgi")}}},a}();"undefined"!=typeof exports?exports.SyntaxHighlighter=SyntaxHighlighter:null,function(){var a=SyntaxHighlighter;a.autoloader=function(){function j(a,b){for(var c=0;c-1}},i=0;if(c=c===a?"":String(c),d=d===a?"":String(d),f.match.call(d,n))throw new SyntaxError("invalid duplicate regular expression flag");for(c=f.replace.call(c,/^\(\?([\w$]+)\)/,function(a,b){if(f.test.call(/[gy]/,b))throw new SyntaxError("can't use flag g or y in mode modifier");return d=f.replace.call(d+b,n,""),""}),b.forEach(d,/[\s\S]/,function(a){if(s.indexOf(a[0])<0)throw new SyntaxError("invalid regular expression flag "+a[0])});i"}else if(c)return"\\"+(+c+f);return a},i=[];if(!x(a,"array")||!a.length)throw new TypeError("patterns must be a nonempty array");for(k=0;k1&&w(c,"")>-1&&(e=new RegExp(this.source,f.replace.call(u(this),"g","")),f.replace.call(String(b).slice(c.index),e,function(){var b;for(b=1;bc.index&&(this.lastIndex=c.index)}return this.global||(this.lastIndex=g),c},g.test=function(a){return!!g.exec.call(this,a)},g.match=function(a){if(b.isRegExp(a)){if(a.global){var c=f.match.apply(this,arguments);return a.lastIndex=0,c}}else a=new RegExp(a);return g.exec.call(a,this)},g.replace=function(a,c){var e,g,h,i,d=b.isRegExp(a);return d?(a.xregexp&&(e=a.xregexp.captureNames),a.global||(i=a.lastIndex)):a+="",x(c,"function")?g=f.replace.call(String(this),a,function(){var f,b=arguments;if(e)for(b[0]=new String(b[0]),f=0;fa.length-3)throw new SyntaxError("backreference to undefined group "+b);return a[d]||""}throw new SyntaxError("invalid token "+b)})})),d&&(a.global?a.lastIndex=0:a.lastIndex=i),g},g.split=function(c,d){if(!b.isRegExp(c))return f.split.apply(this,arguments);var j,e=String(this),g=c.lastIndex,h=[],i=0;return d=(d===a?-1:d)>>>0,b.forEach(e,c,function(a){a.index+a[0].length>i&&(h.push(e.slice(i,a.index)),a.length>1&&a.indexd?h.slice(0,d):h},d=c.on,d(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(a,b){if("B"===a[1]&&b===j)return a[0];throw new SyntaxError("invalid escape "+a[0])},{scope:"all"}),d(/\[(\^?)]/,function(a){return a[1]?"[\\s\\S]":"\\b\\B"}),d(/(?:\(\?#[^)]*\))+/,function(a){return f.test.call(o,a.input.slice(a.index+a[0].length))?"":"(?:)"}),d(/\\k<([\w$]+)>/,function(a){var b=isNaN(a[1])?w(this.captureNames,a[1])+1:+a[1],c=a.index+a[0].length;if(!b||b>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+a[0]);return"\\"+b+(c===a.input.length||isNaN(a.input.charAt(c))?"":"(?:)")}),d(/(?:\s+|#.*)+/,function(a){return f.test.call(o,a.input.slice(a.index+a[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),d(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),d(/\(\?P?<([\w$]+)>/,function(a){if(!isNaN(a[1]))throw new SyntaxError("can't use integer as capture name "+a[0]);return this.captureNames.push(a[1]),this.hasNamedCapture=!0,"("}),d(/\\(\d+)/,function(a,b){if(!(b===j&&/^[1-9]/.test(a[1])&&+a[1]<=this.captureNames.length)&&"0"!==a[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+a[0]);return a[0]},{scope:"all"}),d(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),"undefined"!=typeof exports&&(exports.XRegExp=b),b}(),"undefined"==typeof SyntaxHighlighter)var SyntaxHighlighter=function(){function b(a){return document.createElement("div").appendChild(document.createTextNode(a)).parentNode.innerHTML.replace(/"/g,""")}function c(a,b){return a.className.indexOf(b)!=-1}function d(a,b){c(a,b)||(a.className+=" "+b)}function e(a,b){a.className=a.className.replace(b,"")}function f(a){for(var b=[],c=0,d=a.length;c(.*?))\\]$"),e=0,f=XRegExp("(?[\\w-]+)\\s*:\\s*(?[\\w%#-]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");null!=(b=XRegExp.exec(a,f,e));){var g=b.value.replace(/^['"]|['"]$/g,"");if(null!=g&&d.test(g)){var h=XRegExp.exec(g,d);g=h.values.length>0?h.values.split(/\s*,\s*/):[]}c[b.name]=g,e=b.index+b[0].length}return c}function y(b,c){return null==b||0==b.length||"\n"==b?b:(b=b.replace(/'+a+""})),b)}function z(a,b){for(var c=a.toString();c.length|<br\s*\/?>/gi;return 1==a.config.bloggerMode&&(b=b.replace(c,"\n")),1==a.config.stripBrs&&(b=b.replace(c,"")),b}function D(a){return a.replace(/^\s+|\s+$/g,"")}function E(a){for(var b=g(C(a)),d=(new Array,/^\s*/),e=1e3,f=0,h=b.length;f0;f++){var i=b[f];if(0!=D(i).length){var j=d.exec(i);if(null==j)return a;e=Math.min(j[0].length,e)}}if(e>0)for(var f=0,h=b.length;fb.index?1:a.lengthb.length?1:0}function G(b,c){function d(a,b){return a[0]}var f=null,g=[],h=c.func?c.func:d;for(pos=0;null!=(f=XRegExp.exec(b,c.regex,pos));){var i=h(f,c);"string"==typeof i&&(i=[new a.Match(i,f.index,c.css)]),g=g.concat(i),pos=f.index+f[0].length}return g}function H(b){var c=/(.*)((>|<).*)/;return b.replace(a.regexLib.url,function(a){var b="",d=null;return(d=c.exec(a))&&(a=d[1],b=d[2]),''+a+""+b})}function I(){for(var a=document.getElementsByTagName("script"),b=[],c=0,d=a.length;cAbout SyntaxHighlighter
SyntaxHighlighter
version 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT)
JavaScript code syntax highlighter.
Copyright 2004-2013 Alex Gorbatchev.
If you like this script, please donate to
keep development active!
'}},vars:{highlighters:{}},brushes:{},regexLib:{multiLineCComments:XRegExp("/\\*.*?\\*/","gs"),singleLineCComments:/\/\/.*$/gm,singleLinePerlComments:/#.*$/gm,doubleQuotedString:/"([^\\"\n]|\\.)*"/g,singleQuotedString:/'([^\\'\n]|\\.)*'/g,multiLineDoubleQuotedString:XRegExp('"([^\\\\"]|\\\\.)*"',"gs"),multiLineSingleQuotedString:XRegExp("'([^\\\\']|\\\\.)*'","gs"),xmlComments:XRegExp("(<|<)!--.*?--(>|>)","gs"),url:/\w+:\/\/[\w-.\/?%&=:@;#]*/g,phpScriptTags:{left:/(<|<)\?(?:=|php)?/g,right:/\?(>|>)/g,eof:!0},aspScriptTags:{left:/(<|<)%=?/g,right:/%(>|>)/g},scriptScriptTags:{left:/(<|<)\s*script.*?(>|>)/gi,right:/(<|<)\/\s*script\s*(>|>)/gi}},toolbar:{getHtml:function(b){function f(b,c){return a.toolbar.getButtonHtml(b,c,a.config.strings[c])}for(var c='
',d=a.toolbar.items,e=d.list,g=0,h=e.length;g'+b(d)+""},handler:function(b){function e(a){var b=new RegExp(a+"_(\\w+)"),c=b.exec(d);return c?c[1]:null}var c=b.target,d=c.className||"",f=i(m(c,".syntaxhighlighter").id),g=e("command");f&&g&&a.toolbar.items[g].execute(f),b.preventDefault()},items:{list:["expandSource","help"],expandSource:{getHtml:function(b){if(1!=b.getParam("collapse"))return"";var c=b.getParam("title");return a.toolbar.getButtonHtml(b,"expandSource",c?c:a.config.strings.expandSource)},execute:function(a){var b=j(a.id);e(b,"collapsed")}},help:{execute:function(b){var c=r("","_blank",500,250,"scrollbars=0"),d=c.document;d.write(a.config.strings.aboutDialog),d.close(),c.focus()}}}},findElements:function(b,c){var d=c?[c]:f(document.getElementsByTagName(a.config.tagName)),e=a.config,g=[];if(e.useScriptTags&&(d=d.concat(I())),0===d.length)return g;for(var h=0,i=d.length;he)break;g.index==d.index&&g.length>d.length?a[b]=null:g.index>=d.index&&g.index'+c+"
"},getLineNumbersHtml:function(b,c){var d="",e=g(b).length,f=parseInt(this.getParam("first-line")),h=this.getParam("pad-line-numbers");1==h?h=(f+e-1).toString().length:1==isNaN(h)&&(h=0);for(var i=0;i'+m+"":"")+k)}return b},getTitleHtml:function(a){return a?""+b(a)+"":""},getMatchesHtml:function(a,b){function f(a){var b=a?a.brushName||e:e;return b?b+" ":""}for(var c=0,d="",e=this.getParam("brush",""),g=0,h=b.length;g'+(this.getParam("toolbar")?a.toolbar.getHtml(this):"")+''+this.getTitleHtml(this.getParam("title"))+""+(gutter?'":"")+'
'+this.getLineNumbersHtml(c)+"
'+d+"
"},getDiv:function(b){null===b&&(b=""),this.code=b;var c=this.create("div");return c.innerHTML=this.getHtml(b),this.getParam("toolbar")&&s(l(c,".toolbar"),"click",a.toolbar.handler),this.getParam("quick-code")&&s(l(c,".code"),"dblclick",K),c},init:function(b){this.id=o(),k(this),this.params=p(a.defaults,b||{}),1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1)},getKeywords:function(a){return a=a.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"|"),"\\b(?:"+a+")\\b"},forHtmlScript:function(a){var b={end:a.right.source};a.eof&&(b.end="(?:(?:"+b.end+")|$)"),this.htmlScript={left:{regex:a.left,css:"script"},right:{regex:a.right,css:"script"},code:XRegExp("(?"+a.left.source+")(?.*?)(?"+b.end+")","sgi")}}},a}();"undefined"!=typeof exports?exports.SyntaxHighlighter=SyntaxHighlighter:null,function(){var a=SyntaxHighlighter;a.autoloader=function(){function j(a,b){for(var c=0;c tags to the document body + for (i = 0; i < elements.length; i++) + { + var url = brushes[elements[i].params.brush]; + + if(url && scripts[url] === undefined) + { + if(elements[i].params['html-script'] === 'true') + { + if(scripts[brushes['xml']] === undefined) { + loadScript(brushes['xml']); + scripts[url] = false; + } + } + + scripts[url] = false; + loadScript(url); + } + } + + function loadScript(url) + { + var script = document.createElement('script'), + done = false + ; + + script.src = url; + script.type = 'text/javascript'; + script.language = 'javascript'; + script.onload = script.onreadystatechange = function() + { + if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) + { + done = true; + scripts[url] = true; + checkAll(); + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + script.parentNode.removeChild(script); + } + }; + + // sync way of adding script tags to the page + document.body.appendChild(script); + }; + + function checkAll() + { + for(var url in scripts) + if (scripts[url] == false) + return; + + if (allCalled) + SyntaxHighlighter.highlight(allParams); + }; +}; + +})(); diff --git a/syntaxhighlighter/js/shBrushAS3.js b/syntaxhighlighter/js/shBrushAS3.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushAS3.js.bak b/syntaxhighlighter/js/shBrushAS3.js.bak new file mode 100755 index 0000000..a182beb --- /dev/null +++ b/syntaxhighlighter/js/shBrushAS3.js.bak @@ -0,0 +1,59 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Created by Peter Atoria @ http://iAtoria.com + + var inits = 'class interface function package'; + + var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + + 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + + 'extends false final finally flash_proxy for get if implements import in include Infinity ' + + 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + + 'Null Number Object object_proxy override parseFloat parseInt private protected public ' + + 'return set static String super switch this throw true try typeof uint undefined unescape ' + + 'use void while with' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable + { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['actionscript3', 'as3']; + + SyntaxHighlighter.brushes.AS3 = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushAppleScript.js b/syntaxhighlighter/js/shBrushAppleScript.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushAppleScript.js.bak b/syntaxhighlighter/js/shBrushAppleScript.js.bak new file mode 100755 index 0000000..e6db5d8 --- /dev/null +++ b/syntaxhighlighter/js/shBrushAppleScript.js.bak @@ -0,0 +1,100 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // AppleScript brush by David Chambers + // http://davidchambersdesign.com/ + var keywords = 'after before beginning continue copy each end every from return get global in local named of set some that the then times to where whose with without'; + var ordinals = 'first second third fourth fifth sixth seventh eighth ninth tenth last front back middle'; + var specials = 'activate add alias ask attachment boolean class constant delete duplicate empty exists id integer list make message modal modified new no pi properties quit real record remove rest result reveal reverse run running save string word yes'; + + this.regexList = [ + + { regex: /(--|#).*$/gm, + css: 'comments' }, + + { regex: /\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm, // support nested comments + css: 'comments' }, + + { regex: /"[\s\S]*?"/gm, + css: 'string' }, + + { regex: /(?:,|:|¬|'s\b|\(|\)|\{|\}|«|\b\w*»)/g, // operators + css: 'color1' }, + + { regex: /(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g, // numbers + css: 'color1' }, + + { regex: /(?:&(amp;|gt;|lt;)?|=|� |>|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g, + css: 'color2' }, + + { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g, + css: 'keyword' }, + + { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals + css: 'keyword' }, + + { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g, + css: 'color3' }, + + { regex: /\b(?:adding folder items to|after receiving|clipboard info|set the clipboard to|(the )?clipboard|entire contents|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|return(ed)?|second(?! item)(s)?|list (disks|folder)|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|starting at|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g, + css: 'color4' }, + + { regex: /\b(?:tracks|paragraph|text item(s)?)\b/g, + css: 'classes' }, + + { regex: /\b(?:AppleScript|album|video kind|grouping|length|text item delimiters|quoted form|POSIX path(?= of))\b/g, + css: 'properties' }, + + { regex: /\b(?:run|exists|count)\b/g, + css: 'commandNames' }, + + { regex: /\b(?:POSIX (file|path))\b/g, + css: 'additionClasses' }, + + { regex: /\b(?:message|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|regexp|string result|using( delimiters)?|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor))\b/g, + css: 'additionParameterNames' }, + + { regex: /\b(?:display(ing| (alert|dialog|mode))?|choose( ((remote )?application|color|folder|from list|URL))?|(do( shell)?|load|run|store) script|re_compile|find text)\b/g, + css: 'additionCommandNames' }, + + { regex: /\b(?:xxx)\b/g, + css: 'parameterNames' }, + + { regex: /\b(?:true|false|none)\b/g, + css: 'enumeratedValues' }, + + + { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['applescript']; + + SyntaxHighlighter.brushes.AppleScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); \ No newline at end of file diff --git a/syntaxhighlighter/js/shBrushBash.js b/syntaxhighlighter/js/shBrushBash.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushBash.js.bak b/syntaxhighlighter/js/shBrushBash.js.bak new file mode 100755 index 0000000..6c86444 --- /dev/null +++ b/syntaxhighlighter/js/shBrushBash.js.bak @@ -0,0 +1,75 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + function hereDocProcess(match, regexInfo) + { + var constructor = SyntaxHighlighter.Match, + result = [] + ; + if (match.here_doc != null) + result.push(new constructor(match.here_doc, match.index + match[0].indexOf(match.here_doc), 'string')); + + if (match.full_tag != null) + result.push(new constructor(match.full_tag, match.index, 'preprocessor')); + + if (match.end_tag != null) + result.push(new constructor(match.end_tag, match.index + match[0].lastIndexOf(match.end_tag), 'preprocessor')); + return result; + } + var keywords = 'if fi then elif else for do done until while break continue case esac function return in eq ne ge le'; + var commands = 'alias apropos awk basename base64 bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + + 'cksum clear cmp comm command cp cron crontab crypt csplit cut date dc dd ddrescue declare df ' + + 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + + 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + + 'free fsck ftp gawk gcc gdb getconf getopts grep groups gzip hash head history hostname id ifconfig ' + + 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + + 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + + 'mv nasm nc ndisasm netstat nice nl nohup nslookup objdump od open op passwd paste pathchk ping popd pr printcap ' + + 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + + 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + + 'sleep sort source split ssh strace strings su sudo sum symlink sync tail tar tee test time ' + + 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + + 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + + 'vi watch wc whereis which who whoami Wget xargs xxd yes chsh' + ; + + this.regexList = [ + { regex: /^#!.*$/gm, css: 'preprocessor bold' }, + { regex: /\/[\w-\/]+/gm, css: 'plain' }, + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' }, // commands + { regex: new XRegExp("(?(<|<){2}(?\\w+)) .*$(?[\\s\\S]*)(?^\\k$)",'gm'), func: hereDocProcess } + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['bash', 'shell', 'sh']; + + SyntaxHighlighter.brushes.Bash = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushCSharp.js b/syntaxhighlighter/js/shBrushCSharp.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushCSharp.js.bak b/syntaxhighlighter/js/shBrushCSharp.js.bak new file mode 100755 index 0000000..10d367e --- /dev/null +++ b/syntaxhighlighter/js/shBrushCSharp.js.bak @@ -0,0 +1,65 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var keywords = 'abstract as async await base bool break byte case catch char checked class const ' + + 'continue decimal default delegate do double else enum event explicit volatile ' + + 'extern false finally fixed float for foreach get goto if implicit in int ' + + 'interface internal is lock long namespace new null object operator out ' + + 'override params private protected public readonly ref return sbyte sealed set ' + + 'short sizeof stackalloc static string struct switch this throw true try ' + + 'typeof uint ulong unchecked unsafe ushort using virtual void while var ' + + 'from group by into select let where orderby join on equals ascending descending'; + + function fixComments(match, regexInfo) + { + var css = (match[0].indexOf("///") == 0) + ? 'color1' + : 'comments' + ; + + return [new SyntaxHighlighter.Match(match[0], match.index, css)]; + } + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword + { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' + { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['c#', 'c-sharp', 'csharp']; + + SyntaxHighlighter.brushes.CSharp = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushColdFusion.js b/syntaxhighlighter/js/shBrushColdFusion.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushColdFusion.js.bak b/syntaxhighlighter/js/shBrushColdFusion.js.bak new file mode 100755 index 0000000..a70a12f --- /dev/null +++ b/syntaxhighlighter/js/shBrushColdFusion.js.bak @@ -0,0 +1,100 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Jen + // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus + + var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + + 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + + 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + + 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + + 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + + 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + + 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + + 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + + 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + + 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + + 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + + 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + + 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + + 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + + 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + + 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + + 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + + 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + + 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + + 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + + 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + + 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + + 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + + 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + + 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + + 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + + 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + + 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + + 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + + 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + + 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + + 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + + 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + + 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + + 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + + 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + + 'XmlValidate Year YesNoFormat'; + + var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + + 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + + 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + + 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + + 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + + 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + + 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + + 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + + 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + + 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + + 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + + 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + + 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + + 'cfwindow cfxml cfzip cfzipparam'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments + { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['coldfusion','cf']; + + SyntaxHighlighter.brushes.ColdFusion = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushCpp.js b/syntaxhighlighter/js/shBrushCpp.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushCpp.js.bak b/syntaxhighlighter/js/shBrushCpp.js.bak new file mode 100755 index 0000000..625e5ae --- /dev/null +++ b/syntaxhighlighter/js/shBrushCpp.js.bak @@ -0,0 +1,97 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Copyright 2006 Shin, YoungJin + + var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + + 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + + 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + + 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + + 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + + 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + + 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + + 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + + 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + + 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + + 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + + 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + + 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + + 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + + 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + + 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + + 'char char16_t char32_t bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + + 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + + 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + + '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + + 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + + 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + + 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + + 'va_list wchar_t wctrans_t wctype_t wint_t signed'; + + var keywords = 'alignas alignof auto break case catch class const constexpr decltype __finally __exception __try ' + + 'const_cast continue private public protected __declspec ' + + 'default delete deprecated dllexport dllimport do dynamic_cast ' + + 'else enum explicit extern if for friend goto inline ' + + 'mutable naked namespace new noinline noreturn nothrow noexcept nullptr ' + + 'ref register reinterpret_cast return selectany ' + + 'sizeof static static_cast static_assert struct switch template this ' + + 'thread thread_local throw true false try typedef typeid typename union ' + + 'using uuid virtual void volatile whcar_t while'; + + var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + + 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + + 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + + 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + + 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + + 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + + 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + + 'fwrite getc getchar gets perror printf putc putchar puts remove ' + + 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + + 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + + 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + + 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + + 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + + 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + + 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + + 'clock ctime difftime gmtime localtime mktime strftime time'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /^ *#.*/gm, css: 'preprocessor' }, + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, + { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['cpp', 'cc', 'c++', 'c', 'h', 'hpp', 'h++']; + + SyntaxHighlighter.brushes.Cpp = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushCss.js b/syntaxhighlighter/js/shBrushCss.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushCss.js.bak b/syntaxhighlighter/js/shBrushCss.js.bak new file mode 100755 index 0000000..6c3627f --- /dev/null +++ b/syntaxhighlighter/js/shBrushCss.js.bak @@ -0,0 +1,95 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * 3.0.10 (Mon, 03 Oct 2016 06:03:52 GMT) - Franck : + some units and flexbox + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + function getKeywordsCSS(str) + { + return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; + }; + + function getValuesCSS(str) + { + return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; + }; + + var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + + 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + + 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + + 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + + 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + + 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + + 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + + 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + + 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + + 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + + 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + + 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + + 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + + 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index ' + + 'flex-direction flex-wrap flex-flow justify-content align-items align-content order flex-grow flex-shrink flex-basis flex align-self'; + + var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ + 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ + 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ + 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ + 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ + 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ + 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ + 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ + 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ + 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ + 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ + 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ + 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ + 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow ' + + 'flex row row-reverse column column-reverse nowrap wrap wrap-reverse flex-start flex-end center space-between space-around baseline stretch'; + + var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|ex|ch|rem|vh|vw|vmin|vmax|mm|q|cm|in|pc)/g, + css: 'value' }, // sizes + { regex: /!important/g, css: 'color3' }, // !important + { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values + { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts + ]; + + this.forHtmlScript({ + left: /(<|<)\s*style.*?(>|>)/gi, + right: /(<|<)\/\s*style\s*(>|>)/gi + }); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['css']; + + SyntaxHighlighter.brushes.CSS = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushDelphi.js b/syntaxhighlighter/js/shBrushDelphi.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushDelphi.js.bak b/syntaxhighlighter/js/shBrushDelphi.js.bak new file mode 100755 index 0000000..147065f --- /dev/null +++ b/syntaxhighlighter/js/shBrushDelphi.js.bak @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + + 'case char class comp const constructor currency destructor div do double ' + + 'downto else end except exports extended false file finalization finally ' + + 'for function goto if implementation in inherited int64 initialization ' + + 'integer interface is label library longint longword mod nil not object ' + + 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + + 'pint64 pointer private procedure program property pshortstring pstring ' + + 'pvariant pwidechar pwidestring protected public published raise real real48 ' + + 'record repeat set shl shortint shortstring shr single smallint string then ' + + 'threadvar to true try type unit until uses val var varirnt while widechar ' + + 'widestring with word write writeln xor'; + + this.regexList = [ + { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) + { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags + { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 + { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['delphi', 'pascal', 'pas']; + + SyntaxHighlighter.brushes.Delphi = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushDiff.js b/syntaxhighlighter/js/shBrushDiff.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushDiff.js.bak b/syntaxhighlighter/js/shBrushDiff.js.bak new file mode 100755 index 0000000..6797d30 --- /dev/null +++ b/syntaxhighlighter/js/shBrushDiff.js.bak @@ -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.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + this.regexList = [ + { regex: /^\+\+\+ .*$/gm, css: 'color2' }, // new file + { regex: /^\-\-\- .*$/gm, css: 'color2' }, // old file + { regex: /^\s.*$/gm, css: 'color1' }, // unchanged + { regex: /^@@.*@@.*$/gm, css: 'variable' }, // location + { regex: /^\+.*$/gm, css: 'string' }, // additions + { regex: /^\-.*$/gm, css: 'color3' } // deletions + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['diff', 'patch']; + + SyntaxHighlighter.brushes.Diff = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushErlang.js b/syntaxhighlighter/js/shBrushErlang.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushErlang.js.bak b/syntaxhighlighter/js/shBrushErlang.js.bak new file mode 100755 index 0000000..f40aade --- /dev/null +++ b/syntaxhighlighter/js/shBrushErlang.js.bak @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Jean-Lou Dupont + // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html + + // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 + var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ + 'case catch cond div end fun if let not of or orelse '+ + 'query receive rem try when xor'+ + // additional + ' module export import define'; + + this.regexList = [ + { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, + { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, + { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, + { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['erl', 'erlang']; + + SyntaxHighlighter.brushes.Erlang = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushGroovy.js b/syntaxhighlighter/js/shBrushGroovy.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushGroovy.js.bak b/syntaxhighlighter/js/shBrushGroovy.js.bak new file mode 100755 index 0000000..391b39c --- /dev/null +++ b/syntaxhighlighter/js/shBrushGroovy.js.bak @@ -0,0 +1,67 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Andres Almiray + // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter + + var keywords = 'as assert break case catch class continue def default do else extends finally ' + + 'if in implements import instanceof interface new package property return switch ' + + 'throw throws try while public protected private static'; + var types = 'void boolean byte char short int long float double'; + var constants = 'null'; + var methods = 'allProperties count get size '+ + 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + + 'findIndexOf grep inject max min reverseEach sort ' + + 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + + 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + + 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + + 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + + 'transformChar transformLine withOutputStream withPrintWriter withStream ' + + 'withStreams withWriter withWriterAppend write writeLine '+ + 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ + 'getText'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /""".*"""/g, css: 'string' }, // GStrings + { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword + { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type + { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['groovy']; + + SyntaxHighlighter.brushes.Groovy = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushHaxe.js b/syntaxhighlighter/js/shBrushHaxe.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushHaxe.js.bak b/syntaxhighlighter/js/shBrushHaxe.js.bak new file mode 100755 index 0000000..62bebf9 --- /dev/null +++ b/syntaxhighlighter/js/shBrushHaxe.js.bak @@ -0,0 +1,80 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function () +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush () + { + + var inits = 'class interface package macro enum typedef extends implements dynamic in for if while else do try switch case catch'; + + var keywords = 'return break continue new throw cast using import function public private inline static untyped callback true false null Int Float String Void Std Bool Dynamic Array Vector'; + + this.regexList = [ + { regex:SyntaxHighlighter.regexLib.singleLineCComments , css:'comments' }, + // one line comments + { regex:SyntaxHighlighter.regexLib.multiLineCComments , css:'comments' }, + // multiline comments + { regex:SyntaxHighlighter.regexLib.doubleQuotedString , css:'string' }, + // double quoted strings + { regex:SyntaxHighlighter.regexLib.singleQuotedString , css:'string' }, + // single quoted strings + { regex:/\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi , css:'value' }, + // numbers + { regex:new RegExp ( this.getKeywords ( inits ) , 'gm' ) , css:'color3' }, + // initializations + { regex:new RegExp ( this.getKeywords ( keywords ) , 'gm' ) , css:'keyword' }, + // keywords + { regex:new RegExp ( 'var' , 'gm' ) , css:'variable' }, + // variable + { regex:new RegExp ( 'trace' , 'gm' ) , css:'color1' }, + //compiler conditionals + { regex:new RegExp ( '#if' , 'gm' ) , css:'comments' }, + { regex:new RegExp ( '#elseif' , 'gm' ) , css:'comments' }, + { regex:new RegExp ( '#end' , 'gm' ) , css:'comments' }, + { regex:new RegExp ( '#error' , 'gm' ) , css:'comments' } + ]; + + //standard compiler conditionals flags + var flags = [ + "debug", "error", "cpp", "js", "neko", "php", "flash", "flash8", "flash9", "flash10", "flash10", "mobile", "desktop", "web", "ios", "android", "iphone" + ]; + + //append the flags to the array with a ! operator + var i; + var length = flags.length; + for ( i = 0 ; i <= length - 1 ; i ++ ) + { + this.regexList.push ( {regex:new RegExp ( flags[i] , 'gm' ) , css:'comments'} ); + this.regexList.push ( {regex:new RegExp ( '!' + flags[i] , 'gm' ) , css:'comments'} ); + } + + this.forHtmlScript ( SyntaxHighlighter.regexLib.scriptScriptTags ); + } + + ; + + Brush.prototype = new SyntaxHighlighter.Highlighter (); + Brush.aliases = ['haxe', 'hx']; + + SyntaxHighlighter.brushes.Haxe = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +}) (); diff --git a/syntaxhighlighter/js/shBrushJScript.js b/syntaxhighlighter/js/shBrushJScript.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushJScript.js.bak b/syntaxhighlighter/js/shBrushJScript.js.bak new file mode 100755 index 0000000..a2736f7 --- /dev/null +++ b/syntaxhighlighter/js/shBrushJScript.js.bak @@ -0,0 +1,52 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var keywords = 'break case catch class continue ' + + 'default delete do else enum export extends false ' + + 'for function if implements import in instanceof ' + + 'interface let new null package private protected ' + + 'static return super switch ' + + 'this throw true try typeof var while with yield'; + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: r.singleLineCComments, css: 'comments' }, // one line comments + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords + ]; + + this.forHtmlScript(r.scriptScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['js', 'jscript', 'javascript', 'json']; + + SyntaxHighlighter.brushes.JScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushJava.js b/syntaxhighlighter/js/shBrushJava.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushJava.js.bak b/syntaxhighlighter/js/shBrushJava.js.bak new file mode 100755 index 0000000..c3b75d0 --- /dev/null +++ b/syntaxhighlighter/js/shBrushJava.js.bak @@ -0,0 +1,57 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var keywords = 'abstract assert boolean break byte case catch char class const ' + + 'continue default do double else enum extends ' + + 'false final finally float for goto if implements import ' + + 'instanceof int interface long native new null ' + + 'package private protected public return ' + + 'short static strictfp super switch synchronized this throw throws true ' + + 'transient try void volatile while'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multiline comments + { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers + { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno + { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword + ]; + + this.forHtmlScript({ + left : /(<|<)%[@!=]?/g, + right : /%(>|>)/g + }); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['java']; + + SyntaxHighlighter.brushes.Java = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushJavaFX.js b/syntaxhighlighter/js/shBrushJavaFX.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushJavaFX.js.bak b/syntaxhighlighter/js/shBrushJavaFX.js.bak new file mode 100755 index 0000000..94ee9b7 --- /dev/null +++ b/syntaxhighlighter/js/shBrushJavaFX.js.bak @@ -0,0 +1,58 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Patrick Webster + // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html + var datatypes = 'Boolean Byte Character Double Duration ' + + 'Float Integer Long Number Short String Void' + ; + + var keywords = 'abstract after and as assert at before bind bound break catch class ' + + 'continue def delete else exclusive extends false finally first for from ' + + 'function if import in indexof init insert instanceof into inverse last ' + + 'lazy mixin mod nativearray new not null on or override package postinit ' + + 'protected public public-init public-read replace return reverse sizeof ' + + 'step super then this throw true try tween typeof var where while with ' + + 'attribute let private readonly static trigger' + ; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers + { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['jfx', 'javafx']; + + SyntaxHighlighter.brushes.JavaFX = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushPerl.js b/syntaxhighlighter/js/shBrushPerl.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushPerl.js.bak b/syntaxhighlighter/js/shBrushPerl.js.bak new file mode 100755 index 0000000..809e5c5 --- /dev/null +++ b/syntaxhighlighter/js/shBrushPerl.js.bak @@ -0,0 +1,96 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by David Simmons-Duffin and Marty Kube + + var funcs = + 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + + 'chroot close closedir connect cos crypt defined delete each endgrent ' + + 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + + 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + + 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + + 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + + 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + + 'getservbyname getservbyport getservent getsockname getsockopt glob ' + + 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + + 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + + 'oct open opendir ord pack pipe pop pos print printf prototype push ' + + 'quotemeta rand read readdir readline readlink readpipe recv rename ' + + 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + + 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + + 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + + 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + + 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + + 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + + 'undef unlink unpack unshift utime values vec wait waitpid warn write ' + + // feature + 'say'; + + var keywords = + 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + + 'for foreach goto if import last local my next no our package redo ref ' + + 'require return sub tie tied unless untie until use wantarray while ' + + // feature + 'given when default ' + + // Try::Tiny + 'try catch finally ' + + // Moose + 'has extends with before after around override augment'; + + this.regexList = [ + { regex: /(<<|<<)((\w+)|(['"])(.+?)\4)[\s\S]+?\n\3\5\n/g, css: 'string' }, // here doc (maybe html encoded) + { regex: /#.*$/gm, css: 'comments' }, + { regex: /^#!.*\n/g, css: 'preprocessor' }, // shebang + { regex: /-?\w+(?=\s*=(>|>))/g, css: 'string' }, // fat comma + + // is this too much? + { regex: /\bq[qwxr]?\([\s\S]*?\)/g, css: 'string' }, // quote-like operators () + { regex: /\bq[qwxr]?\{[\s\S]*?\}/g, css: 'string' }, // quote-like operators {} + { regex: /\bq[qwxr]?\[[\s\S]*?\]/g, css: 'string' }, // quote-like operators [] + { regex: /\bq[qwxr]?(<|<)[\s\S]*?(>|>)/g, css: 'string' }, // quote-like operators <> + { regex: /\bq[qwxr]?([^\w({<[])[\s\S]*?\1/g, css: 'string' }, // quote-like operators non-paired + + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + // currently ignoring single quote package separator and utf8 names + { regex: /(?:&|[$@%*]|\$#)\$?[a-zA-Z_](\w+|::)*/g, css: 'variable' }, + { regex: /\b__(?:END|DATA)__\b[\s\S]*$/g, css: 'comments' }, + + // don't capture the newline after =cut so that =cut\n\n=head1 will start a new pod section + { regex: /(^|\n)=\w[\s\S]*?(\n=cut\s*(?=\n)|$)/g, css: 'comments' }, // pod + + { regex: new RegExp(this.getKeywords(funcs), 'gm'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['perl', 'Perl', 'pl']; + + SyntaxHighlighter.brushes.Perl = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushPhp.js b/syntaxhighlighter/js/shBrushPhp.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushPhp.js.bak b/syntaxhighlighter/js/shBrushPhp.js.bak new file mode 100755 index 0000000..ebf072e --- /dev/null +++ b/syntaxhighlighter/js/shBrushPhp.js.bak @@ -0,0 +1,88 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var funcs = 'abs acos acosh addcslashes addslashes ' + + 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ + 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ + 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ + 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ + 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ + 'array_push array_rand array_reduce array_reverse array_search array_shift '+ + 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ + 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ + 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ + 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ + 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ + 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ + 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ + 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ + 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ + 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ + 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ + 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ + 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ + 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ + 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ + 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ + 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ + 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ + 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ + 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ + 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ + 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+ + 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ + 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ + 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ + 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ + 'strtoupper strtr strval substr substr_compare'; + + var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + + 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final finally for foreach ' + + 'function global goto if implements include include_once interface instanceof insteadof namespace new ' + + 'old_function or private protected public return require require_once static switch ' + + 'trait throw try use var while xor yield '; + + var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\$\w+/g, css: 'variable' }, // variables + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions + { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['php']; + + SyntaxHighlighter.brushes.Php = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushPlain.js b/syntaxhighlighter/js/shBrushPlain.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushPlain.js.bak b/syntaxhighlighter/js/shBrushPlain.js.bak new file mode 100755 index 0000000..ce8c2c4 --- /dev/null +++ b/syntaxhighlighter/js/shBrushPlain.js.bak @@ -0,0 +1,33 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['text', 'plain']; + + SyntaxHighlighter.brushes.Plain = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushPowerShell.js b/syntaxhighlighter/js/shBrushPowerShell.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushPowerShell.js.bak b/syntaxhighlighter/js/shBrushPowerShell.js.bak new file mode 100755 index 0000000..508151c --- /dev/null +++ b/syntaxhighlighter/js/shBrushPowerShell.js.bak @@ -0,0 +1,75 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Joel 'Jaykul' Bennett, http://PoshCode.org | http://HuddledMasses.org + var keywords = 'while validateset validaterange validatepattern validatelength validatecount ' + + 'until trap switch return ref process param parameter in if global: '+ + 'function foreach for finally filter end elseif else dynamicparam do default ' + + 'continue cmdletbinding break begin alias \\? % #script #private #local #global '+ + 'mandatory parametersetname position valuefrompipeline ' + + 'valuefrompipelinebypropertyname valuefromremainingarguments helpmessage '; + + var operators = ' and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' + + 'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' + + 'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' + + 'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' + + 'lt match ne not notcontains notlike notmatch or regex replace wildcard'; + + var verbs = 'write where wait use update unregister undo trace test tee take suspend ' + + 'stop start split sort skip show set send select scroll resume restore ' + + 'restart resolve resize reset rename remove register receive read push ' + + 'pop ping out new move measure limit join invoke import group get format ' + + 'foreach export expand exit enter enable disconnect disable debug cxnew ' + + 'copy convertto convertfrom convert connect complete compare clear ' + + 'checkpoint aggregate add'; + + // I can't find a way to match the comment based help in multi-line comments, because SH won't highlight in highlights, and javascript doesn't support lookbehind + var commenthelp = ' component description example externalhelp forwardhelpcategory forwardhelptargetname forwardhelptargetname functionality inputs link notes outputs parameter remotehelprunspace role synopsis'; + + this.regexList = [ + { regex: new RegExp('^\\s*#[#\\s]*\\.('+this.getKeywords(commenthelp)+').*$', 'gim'), css: 'preprocessor help bold' }, // comment-based help + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: /(<|<)#[\s\S]*?#(>|>)/gm, css: 'comments here' }, // multi-line comments + + { regex: new RegExp('@"\\n[\\s\\S]*?\\n"@', 'gm'), css: 'script string here' }, // double quoted here-strings + { regex: new RegExp("@'\\n[\\s\\S]*?\\n'@", 'gm'), css: 'script string single here' }, // single quoted here-strings + { regex: new RegExp('"(?:\\$\\([^\\)]*\\)|[^"]|`"|"")*[^`]"','g'), css: 'string' }, // double quoted strings + { regex: new RegExp("'(?:[^']|'')*'", 'g'), css: 'string single' }, // single quoted strings + + { regex: new RegExp('[\\$|@|@@](?:(?:global|script|private|env):)?[A-Z0-9_]+', 'gi'), css: 'variable' }, // $variables + { regex: new RegExp('(?:\\b'+verbs.replace(/ /g, '\\b|\\b')+')-[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'functions' }, // functions and cmdlets + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, // keywords + { regex: new RegExp('-'+this.getKeywords(operators), 'gmi'), css: 'operator value' }, // operators + { regex: new RegExp('\\[[A-Z_\\[][A-Z0-9_. `,\\[\\]]*\\]', 'gi'), css: 'constants' }, // .Net [Type]s + { regex: new RegExp('\\s+-(?!'+this.getKeywords(operators)+')[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'color1' }, // parameters + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['powershell', 'ps', 'posh']; + + SyntaxHighlighter.brushes.PowerShell = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushPython.js b/syntaxhighlighter/js/shBrushPython.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushPython.js.bak b/syntaxhighlighter/js/shBrushPython.js.bak new file mode 100755 index 0000000..4cc6f18 --- /dev/null +++ b/syntaxhighlighter/js/shBrushPython.js.bak @@ -0,0 +1,64 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Gheorghe Milas and Ahmad Sherif + + var keywords = 'and assert break class continue def del elif else ' + + 'except exec finally for from global if import in is ' + + 'lambda not or pass raise return try yield while'; + + var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + + 'chr classmethod cmp coerce compile complex delattr dict dir ' + + 'divmod enumerate eval execfile file filter float format frozenset ' + + 'getattr globals hasattr hash help hex id input int intern ' + + 'isinstance issubclass iter len list locals long map max min next ' + + 'object oct open ord pow print property range raw_input reduce ' + + 'reload repr reversed round set setattr slice sorted staticmethod ' + + 'str sum super tuple type type unichr unicode vars xrange zip'; + + var special = 'None True False self cls class_'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, + { regex: /^\s*@\w+/gm, css: 'decorator' }, + { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, + { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, + { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, + { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, + { regex: /\b\d+\.?\w*/g, css: 'value' }, + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, + { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['py', 'python']; + + SyntaxHighlighter.brushes.Python = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushRuby.js b/syntaxhighlighter/js/shBrushRuby.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushRuby.js.bak b/syntaxhighlighter/js/shBrushRuby.js.bak new file mode 100755 index 0000000..a77169c --- /dev/null +++ b/syntaxhighlighter/js/shBrushRuby.js.bak @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Erik Peterson. + + var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + + 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + + 'self super then throw true undef unless until when while yield'; + + var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + + 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + + 'ThreadGroup Thread Time TrueClass'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants + { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols + { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; + + SyntaxHighlighter.brushes.Ruby = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushSass.js b/syntaxhighlighter/js/shBrushSass.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushSass.js.bak b/syntaxhighlighter/js/shBrushSass.js.bak new file mode 100755 index 0000000..908190f --- /dev/null +++ b/syntaxhighlighter/js/shBrushSass.js.bak @@ -0,0 +1,103 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * 3.0.10 (Mon, 03 Oct 2016 06:03:52 GMT) - Franck : + some units and flexbox + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + function getKeywordsCSS(str) + { + return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; + }; + + function getValuesCSS(str) + { + return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; + }; + + function getKeywordsPrependedBy(keywords, by) + { + return '(?:' + keywords.replace(/^\s+|\s+$/g, '').replace(/\s+/g, '|' + by + '\\b').replace(/^/, by + '\\b') + ')\\b'; + } + + var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + + 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + + 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + + 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + + 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + + 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + + 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + + 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + + 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + + 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + + 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + + 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + + 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + + 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index zoom ' + + 'flex-direction flex-wrap flex-flow justify-content align-items align-content order flex-grow flex-shrink flex-basis flex align-self'; + + var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ + 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ + 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+ + 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ + 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ + 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ + 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ + 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ + 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ + 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ + 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ + 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ + 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ + 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow ' + + 'flex row row-reverse column column-reverse nowrap wrap wrap-reverse flex-start flex-end center space-between space-around baseline stretch'; + + var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; + + var statements = 'important default'; + var preprocessor = 'import extend debug warn if else for while mixin function include content media'; + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: r.singleLineCComments, css: 'comments' }, // singleline comments + { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.singleQuotedString, css: 'string' }, // single quoted strings + { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors + { regex: /\b(-?\d+)(\.\d+)?(px|em|rem|pt|\:|\%|ex|ch|rem|vh|vw|vmin|vmax|mm|q|cm|in|pc)\b/g, + css: 'value' }, // sizes + { regex: /\$[\w-]+/g, css: 'variable' }, // variables + { regex: new RegExp(getKeywordsPrependedBy(statements, '!'), 'g'), css: 'color3' }, // statements + { regex: new RegExp(getKeywordsPrependedBy(preprocessor, '@'), 'g'), css: 'preprocessor' }, // preprocessor + { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values + { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['sass', 'scss']; + + SyntaxHighlighter.brushes.Sass = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushScala.js b/syntaxhighlighter/js/shBrushScala.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushScala.js.bak b/syntaxhighlighter/js/shBrushScala.js.bak new file mode 100755 index 0000000..d88de78 --- /dev/null +++ b/syntaxhighlighter/js/shBrushScala.js.bak @@ -0,0 +1,51 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + // Contributed by Yegor Jbanov and David Bernard. + + var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + + 'override try lazy for var catch throw type extends class while with new final yield abstract ' + + 'else do if return protected private this package false'; + + var keyops = '[_:=><%#@]+'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings + { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords + { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['scala']; + + SyntaxHighlighter.brushes.Scala = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushSql.js b/syntaxhighlighter/js/shBrushSql.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushSql.js.bak b/syntaxhighlighter/js/shBrushSql.js.bak new file mode 100755 index 0000000..bb5e7cf --- /dev/null +++ b/syntaxhighlighter/js/shBrushSql.js.bak @@ -0,0 +1,67 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + + 'current_user day isnull left lower month nullif replace right ' + + 'session_user space substring sum system_user upper user year'; + + var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + + 'binary bit by cascade char character check checkpoint close collate ' + + 'column commit committed connect connection constraint contains continue ' + + 'create cube current current_date current_time cursor database date ' + + 'deallocate dec decimal declare default delete desc distinct double drop ' + + 'dynamic else end end-exec escape except exec execute false fetch first ' + + 'float for force foreign forward free from full function global goto grant ' + + 'group grouping having hour ignore index inner insensitive insert instead ' + + 'int integer intersect into is isolation key last level load local max min ' + + 'minute modify move name national nchar next no numeric of off on only ' + + 'open option order out output partial password precision prepare primary ' + + 'prior privileges procedure public read real references relative repeatable ' + + 'restrict return returns revoke rollback rollup rows rule schema scroll ' + + 'second section select sequence serializable set size smallint static ' + + 'statistics table temp temporary then time timestamp to top transaction ' + + 'translation trigger true truncate uncommitted union unique update values ' + + 'varchar varying view when where with work'; + + var operators = 'all and any between cross in join like not null or outer some'; + + this.regexList = [ + { regex: /--(.*)$/gm, css: 'comments' }, // one line comments + { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multi line comments + { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions + { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such + { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['sql']; + + SyntaxHighlighter.brushes.Sql = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); + diff --git a/syntaxhighlighter/js/shBrushTAP.js b/syntaxhighlighter/js/shBrushTAP.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushTAP.js.bak b/syntaxhighlighter/js/shBrushTAP.js.bak new file mode 100755 index 0000000..ab45ab5 --- /dev/null +++ b/syntaxhighlighter/js/shBrushTAP.js.bak @@ -0,0 +1,62 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; + + function Brush() { + // Contributed by Chad Granum + this.regexList = [ + // Plan + { regex: new RegExp('^1..\\d+', 'gm'), css: 'plain bold italic' }, + + // Match ok, not ok, and with test numbers + { regex: new RegExp('^ok( \\d+)?', 'gm'), css: 'keyword' }, + { regex: new RegExp('^not ok( \\d+)?', 'gm'), css: 'color3 bold' }, + + // Directives + { regex: new RegExp('(?!^\\s*)#.*$', 'gm'), css: 'variable bold' }, + + // Diagnostics + { regex: new RegExp('^#.*$', 'gm'), css: 'comments bold' }, + + // comments + { regex: new RegExp('^(?!(not )?ok)[^1].*$', 'gm'), css: 'comments' }, + + // Quoted items in messages + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, + ]; + } + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['tap', 'Tap', 'TAP']; + + SyntaxHighlighter.brushes.TAP = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); + diff --git a/syntaxhighlighter/js/shBrushTypeScript.js b/syntaxhighlighter/js/shBrushTypeScript.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushTypeScript.js.bak b/syntaxhighlighter/js/shBrushTypeScript.js.bak new file mode 100755 index 0000000..8ab57d6 --- /dev/null +++ b/syntaxhighlighter/js/shBrushTypeScript.js.bak @@ -0,0 +1,55 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +// Brush for the TypeScript language +// Based on the JavaScript brush - shBrushJScript.js - with some minor alterations + +; (function () +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var keywords = 'break case catch class continue ' + + 'default delete do else enum export extends false ' + + 'for function if implements import in instanceof ' + + 'interface let new null package private protected ' + + 'static return super switch ' + + 'this throw true try typeof var while with yield' + + ' any bool declare get module number public set string'; // TypeScript-specific, everything above is common with JavaScript + + var r = SyntaxHighlighter.regexLib; + + this.regexList = [ + { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings + { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings + { regex: r.singleLineCComments, css: 'comments' }, // one line comments + { regex: r.multiLineCComments, css: 'comments' }, // multiline comments + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords + ]; + + this.forHtmlScript(r.scriptScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['ts', 'typescript']; + + SyntaxHighlighter.brushes.TypeScript = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushVb.js b/syntaxhighlighter/js/shBrushVb.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushVb.js.bak b/syntaxhighlighter/js/shBrushVb.js.bak new file mode 100755 index 0000000..96d128f --- /dev/null +++ b/syntaxhighlighter/js/shBrushVb.js.bak @@ -0,0 +1,56 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + + 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + + 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + + 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + + 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + + 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + + 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + + 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + + 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + + 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + + 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + + 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + + 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + + 'Variant When While With WithEvents WriteOnly Xor'; + + this.regexList = [ + { regex: /'.*$/gm, css: 'comments' }, // one line comments + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings + { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion + { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword + ]; + + this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['vb', 'vbnet']; + + SyntaxHighlighter.brushes.Vb = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushXml.js b/syntaxhighlighter/js/shBrushXml.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushXml.js.bak b/syntaxhighlighter/js/shBrushXml.js.bak new file mode 100755 index 0000000..673c476 --- /dev/null +++ b/syntaxhighlighter/js/shBrushXml.js.bak @@ -0,0 +1,71 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + function process(match, regexInfo) + { + var constructor = SyntaxHighlighter.Match, + code = match[0], + tag = XRegExp.exec(code, XRegExp('(<|<)[\\s\\/\\?!]*(?[:\\w-\\.]+)', 'xg')), + result = [] + ; + + if (match.attributes != null) + { + var attributes, + pos = 0, + regex = XRegExp('(? [\\w:.-]+)' + + '\\s*=\\s*' + + '(? ".*?"|\'.*?\'|\\w+)', + 'xg'); + + while ((attributes = XRegExp.exec(code, regex, pos)) != null) + { + result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); + result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); + pos = attributes.index + attributes[0].length; + } + } + + if (tag != null) + result.push( + new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') + ); + + return result; + } + + this.regexList = [ + { regex: XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // + { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // + { regex: XRegExp('(<|<)[\\s\\/\\?!]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } + ]; + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['xml', 'xhtml', 'xslt', 'html', 'plist']; + + SyntaxHighlighter.brushes.Xml = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shBrushYaml.js b/syntaxhighlighter/js/shBrushYaml.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shBrushYaml.js.bak b/syntaxhighlighter/js/shBrushYaml.js.bak new file mode 100755 index 0000000..028a6e7 --- /dev/null +++ b/syntaxhighlighter/js/shBrushYaml.js.bak @@ -0,0 +1,49 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +;(function() +{ + // CommonJS + SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); + + function Brush() + { + var constants = '~ true false on off'; + + this.regexList = [ + { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // comment + { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted string + { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted string + { regex: /^\s*([a-z0-9\._-])+\s*:/gmi, css: 'variable' }, // key + { regex: /\s?(\.)([a-z0-9\._-])+\s?:/gmi, css: 'comments' }, // section + { regex: /\s(@|:)([a-z0-9\._-])+\s*$/gmi, css: 'variable bold' }, // variable, reference + { regex: /\s+\d+\s?$/gm, css: 'color2 bold' }, // integers + { regex: /(\{|\}|\[|\]|,|~|:)/gm, css: 'constants' }, // inline hash and array, comma, null + { regex: /^\s+(-)+/gm, css: 'string bold' }, // array list entry + { regex: /^---/gm, css: 'string bold' }, // category + { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' } // constants + ]; + + }; + + Brush.prototype = new SyntaxHighlighter.Highlighter(); + Brush.aliases = ['yaml', 'yml']; + + SyntaxHighlighter.brushes.Yaml = Brush; + + // CommonJS + typeof(exports) != 'undefined' ? exports.Brush = Brush : null; +})(); diff --git a/syntaxhighlighter/js/shCore.js b/syntaxhighlighter/js/shCore.js old mode 100644 new mode 100755 diff --git a/syntaxhighlighter/js/shCore.js.bak b/syntaxhighlighter/js/shCore.js.bak new file mode 100755 index 0000000..5810f13 --- /dev/null +++ b/syntaxhighlighter/js/shCore.js.bak @@ -0,0 +1,3000 @@ +/** + * SyntaxHighlighter + * http://alexgorbatchev.com/SyntaxHighlighter + * + * SyntaxHighlighter is donationware. If you are using it, please donate. + * http://alexgorbatchev.com/SyntaxHighlighter/donate.html + * + * @version + * 3.0.9 (Thu, 04 Dec 2014 12:32:21 GMT) + * + * @copyright + * Copyright (C) 2004-2013 Alex Gorbatchev. + * + * @license + * Dual licensed under the MIT and GPL licenses. + */ +/*! + * XRegExp v2.0.0 + * (c) 2007-2012 Steven Levithan + * MIT License + */ + +/** + * XRegExp provides augmented, extensible JavaScript regular expressions. You get new syntax, + * flags, and methods beyond what browsers support natively. XRegExp is also a regex utility belt + * with tools to make your client-side grepping simpler and more powerful, while freeing you from + * worrying about pesky cross-browser inconsistencies and the dubious `lastIndex` property. See + * XRegExp's documentation (http://xregexp.com/) for more details. + * @module xregexp + * @requires N/A + */ +var XRegExp; + +// Avoid running twice; that would reset tokens and could break references to native globals +XRegExp = XRegExp || (function (undef) { + "use strict"; + +/*-------------------------------------- + * Private variables + *------------------------------------*/ + + var self, + addToken, + add, + +// Optional features; can be installed and uninstalled + features = { + natives: false, + extensibility: false + }, + +// Store native methods to use and restore ("native" is an ES3 reserved keyword) + nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }, + +// Storage for fixed/extended native methods + fixed = {}, + +// Storage for cached regexes + cache = {}, + +// Storage for addon tokens + tokens = [], + +// Token scopes + defaultScope = "default", + classScope = "class", + +// Regexes that match native regex syntax + nativeTokens = { + // Any native multicharacter token in default scope (includes octals, excludes character classes) + "default": /^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/, + // Any native multicharacter token in character class scope (includes octals) + "class": /^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/ + }, + +// Any backreference in replacement strings + replacementToken = /\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g, + +// Any character with a later instance in the string + duplicateFlags = /([\s\S])(?=[\s\S]*\1)/g, + +// Any greedy/lazy quantifier + quantifier = /^(?:[?*+]|{\d+(?:,\d*)?})\??/, + +// Check for correct `exec` handling of nonparticipating capturing groups + compliantExecNpcg = nativ.exec.call(/()??/, "")[1] === undef, + +// Check for flag y support (Firefox 3+) + hasNativeY = RegExp.prototype.sticky !== undef, + +// Used to kill infinite recursion during XRegExp construction + isInsideConstructor = false, + +// Storage for known flags, including addon flags + registeredFlags = "gim" + (hasNativeY ? "y" : ""); + +/*-------------------------------------- + * Private helper functions + *------------------------------------*/ + +/** + * Attaches XRegExp.prototype properties and named capture supporting data to a regex object. + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or null. + * @param {Boolean} [isNative] Whether the regex was created by `RegExp` rather than `XRegExp`. + * @returns {RegExp} Augmented regex. + */ + function augment(regex, captureNames, isNative) { + var p; + // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + for (p in self.prototype) { + if (self.prototype.hasOwnProperty(p)) { + regex[p] = self.prototype[p]; + } + } + regex.xregexp = {captureNames: captureNames, isNative: !!isNative}; + return regex; + } + +/** + * Returns native `RegExp` flags used by a regex object. + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + function getNativeFlags(regex) { + //return nativ.exec.call(/\/([a-z]*)$/i, String(regex))[1]; + return (regex.global ? "g" : "") + + (regex.ignoreCase ? "i" : "") + + (regex.multiline ? "m" : "") + + (regex.extended ? "x" : "") + // Proposed for ES6, included in AS3 + (regex.sticky ? "y" : ""); // Proposed for ES6, included in Firefox 3+ + } + +/** + * Copies a regex object while preserving special properties for named capture and augmenting with + * `XRegExp.prototype` methods. The copy has a fresh `lastIndex` property (set to zero). Allows + * adding and removing flags while copying the regex. + * @private + * @param {RegExp} regex Regex to copy. + * @param {String} [addFlags] Flags to be added while copying the regex. + * @param {String} [removeFlags] Flags to be removed while copying the regex. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + function copy(regex, addFlags, removeFlags) { + if (!self.isRegExp(regex)) { + throw new TypeError("type RegExp expected"); + } + var flags = nativ.replace.call(getNativeFlags(regex) + (addFlags || ""), duplicateFlags, ""); + if (removeFlags) { + // Would need to escape `removeFlags` if this was public + flags = nativ.replace.call(flags, new RegExp("[" + removeFlags + "]+", "g"), ""); + } + if (regex.xregexp && !regex.xregexp.isNative) { + // Compiling the current (rather than precompilation) source preserves the effects of nonnative source flags + regex = augment(self(regex.source, flags), + regex.xregexp.captureNames ? regex.xregexp.captureNames.slice(0) : null); + } else { + // Augment with `XRegExp.prototype` methods, but use native `RegExp` (avoid searching for special tokens) + regex = augment(new RegExp(regex.source, flags), null, true); + } + return regex; + } + +/* + * Returns the last index at which a given value can be found in an array, or `-1` if it's not + * present. The array is searched backwards. + * @private + * @param {Array} array Array to search. + * @param {*} value Value to locate in the array. + * @returns {Number} Last zero-based index at which the item is found, or -1. + */ + function lastIndexOf(array, value) { + var i = array.length; + if (Array.prototype.lastIndexOf) { + return array.lastIndexOf(value); // Use the native method if available + } + while (i--) { + if (array[i] === value) { + return i; + } + } + return -1; + } + +/** + * Determines whether an object is of the specified type. + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in lowercase. + * @returns {Boolean} Whether the object matches the type. + */ + function isType(value, type) { + return Object.prototype.toString.call(value).toLowerCase() === "[object " + type + "]"; + } + +/** + * Prepares an options object from the given value. + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + function prepareOptions(value) { + value = value || {}; + if (value === "all" || value.all) { + value = {natives: true, extensibility: true}; + } else if (isType(value, "string")) { + value = self.forEach(value, /[^\s,]+/, function (m) { + this[m] = true; + }, {}); + } + return value; + } + +/** + * Runs built-in/custom tokens in reverse insertion order, until a match is found. + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Current regex scope. + * @param {Object} context Context object assigned to token handler functions. + * @returns {Object} Object with properties `output` (the substitution string returned by the + * successful token handler) and `match` (the token's match array), or null. + */ + function runTokens(pattern, pos, scope, context) { + var i = tokens.length, + result = null, + match, + t; + // Protect against constructing XRegExps within token handler and trigger functions + isInsideConstructor = true; + // Must reset `isInsideConstructor`, even if a `trigger` or `handler` throws + try { + while (i--) { // Run in reverse order + t = tokens[i]; + if ((t.scope === "all" || t.scope === scope) && (!t.trigger || t.trigger.call(context))) { + t.pattern.lastIndex = pos; + match = fixed.exec.call(t.pattern, pattern); // Fixed `exec` here allows use of named backreferences, etc. + if (match && match.index === pos) { + result = { + output: t.handler.call(context, match, scope), + match: match + }; + break; + } + } + } + } catch (err) { + throw err; + } finally { + isInsideConstructor = false; + } + return result; + } + +/** + * Enables or disables XRegExp syntax and flag extensibility. + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + function setExtensibility(on) { + self.addToken = addToken[on ? "on" : "off"]; + features.extensibility = on; + } + +/** + * Enables or disables native method overrides. + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + function setNatives(on) { + RegExp.prototype.exec = (on ? fixed : nativ).exec; + RegExp.prototype.test = (on ? fixed : nativ).test; + String.prototype.match = (on ? fixed : nativ).match; + String.prototype.replace = (on ? fixed : nativ).replace; + String.prototype.split = (on ? fixed : nativ).split; + features.natives = on; + } + +/*-------------------------------------- + * Constructor + *------------------------------------*/ + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing `RegExp` object to copy. + * @param {String} [flags] Any combination of flags: + *
  • `g` - global + *
  • `i` - ignore case + *
  • `m` - multiline anchors + *
  • `n` - explicit capture + *
  • `s` - dot matches all (aka singleline) + *
  • `x` - free-spacing and line comments (aka extended) + *
  • `y` - sticky (Firefox 3+ only) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * date = XRegExp('(? [0-9]{4}) -? # year \n\ + * (? [0-9]{2}) -? # month \n\ + * (? [0-9]{2}) # day ', 'x'); + * + * // Passing a regex object to copy it. The copy maintains special properties for named capture, + * // is augmented with `XRegExp.prototype` methods, and has a fresh `lastIndex` property (set to + * // zero). Native regexes are not recompiled using XRegExp syntax. + * XRegExp(/regex/); + */ + self = function (pattern, flags) { + if (self.isRegExp(pattern)) { + if (flags !== undef) { + throw new TypeError("can't supply flags when constructing one RegExp from another"); + } + return copy(pattern); + } + // Tokens become part of the regex construction process, so protect against infinite recursion + // when an XRegExp is constructed within a token handler function + if (isInsideConstructor) { + throw new Error("can't call the XRegExp constructor within token definition functions"); + } + + var output = [], + scope = defaultScope, + tokenContext = { + hasNamedCapture: false, + captureNames: [], + hasFlag: function (flag) { + return flags.indexOf(flag) > -1; + } + }, + pos = 0, + tokenResult, + match, + chr; + pattern = pattern === undef ? "" : String(pattern); + flags = flags === undef ? "" : String(flags); + + if (nativ.match.call(flags, duplicateFlags)) { // Don't use test/exec because they would update lastIndex + throw new SyntaxError("invalid duplicate regular expression flag"); + } + // Strip/apply leading mode modifier with any combination of flags except g or y: (?imnsx) + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function ($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError("can't use flag g or y in mode modifier"); + } + flags = nativ.replace.call(flags + $1, duplicateFlags, ""); + return ""; + }); + self.forEach(flags, /[\s\S]/, function (m) { + if (registeredFlags.indexOf(m[0]) < 0) { + throw new SyntaxError("invalid regular expression flag " + m[0]); + } + }); + + while (pos < pattern.length) { + // Check for custom tokens at the current position + tokenResult = runTokens(pattern, pos, scope, tokenContext); + if (tokenResult) { + output.push(tokenResult.output); + pos += (tokenResult.match[0].length || 1); + } else { + // Check for native tokens (except character classes) at the current position + match = nativ.exec.call(nativeTokens[scope], pattern.slice(pos)); + if (match) { + output.push(match[0]); + pos += match[0].length; + } else { + chr = pattern.charAt(pos); + if (chr === "[") { + scope = classScope; + } else if (chr === "]") { + scope = defaultScope; + } + // Advance position by one character + output.push(chr); + ++pos; + } + } + } + + return augment(new RegExp(output.join(""), nativ.replace.call(flags, /[^gimy]+/g, "")), + tokenContext.hasNamedCapture ? tokenContext.captureNames : null); + }; + +/*-------------------------------------- + * Public methods/properties + *------------------------------------*/ + +// Installed and uninstalled states for `XRegExp.addToken` + addToken = { + on: function (regex, handler, options) { + options = options || {}; + if (regex) { + tokens.push({ + pattern: copy(regex, "g" + (hasNativeY ? "y" : "")), + handler: handler, + scope: options.scope || defaultScope, + trigger: options.trigger || null + }); + } + // Providing `customFlags` with null `regex` and `handler` allows adding flags that do + // nothing, but don't throw an error + if (options.customFlags) { + registeredFlags = nativ.replace.call(registeredFlags + options.customFlags, duplicateFlags, ""); + } + }, + off: function () { + throw new Error("extensibility must be installed before using addToken"); + } + }; + +/** + * Extends or changes XRegExp syntax and allows custom flags. This is used internally and can be + * used to create XRegExp addons. `XRegExp.install('extensibility')` must be run before calling + * this function, or an error is thrown. If more than one token can match the same string, the last + * added wins. + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with two arguments: + *
  • The match array, with named backreference properties. + *
  • The regex scope where the match was found. + * @param {Object} [options] Options object with optional properties: + *
  • `scope` {String} Scopes where the token applies: 'default', 'class', or 'all'. + *
  • `trigger` {Function} Function that returns `true` when the token should be applied; e.g., + * if a flag is set. If `false` is returned, the matched string can be matched by other tokens. + * Has access to persistent properties of the regex being built, through `this` (including + * function `this.hasFlag`). + *
  • `customFlags` {String} Nonnative flags used by the token's handler or trigger functions. + * Prevents XRegExp from throwing an invalid flag error when the specified flags are used. + * @example + * + * // Basic usage: Adds \a for ALERT character + * XRegExp.addToken( + * /\\a/, + * function () {return '\\x07';}, + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + */ + self.addToken = addToken.off; + +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy is returned. + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + self.cache = function (pattern, flags) { + var key = pattern + "/" + (flags || ""); + return cache[key] || (cache[key] = self(pattern, flags)); + }; + +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + self.escape = function (str) { + return nativ.replace.call(str, /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }; + +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or null. + * @example + * + * // Basic use, with named backreference + * var match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * var pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + self.exec = function (str, regex, pos, sticky) { + var r2 = copy(regex, "g" + (sticky && hasNativeY ? "y" : ""), (sticky === false ? "y" : "")), + match; + r2.lastIndex = pos = pos || 0; + match = fixed.exec.call(r2, str); // Fixed `exec` required for `lastIndex` fix, etc. + if (sticky && match && match.index !== pos) { + match = null; + } + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + return match; + }; + +/** + * Executes a provided function once per regex match. + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + *
  • The match array, with named backreference properties. + *
  • The zero-based match index. + *
  • The string being traversed. + *
  • The regex object being used to traverse the string. + * @param {*} [context] Object to use as `this` when executing `callback`. + * @returns {*} Provided `context` object. + * @example + * + * // Extracts every other digit from a string + * XRegExp.forEach('1a2345', /\d/, function (match, i) { + * if (i % 2) this.push(+match[0]); + * }, []); + * // -> [2, 4] + */ + self.forEach = function (str, regex, callback, context) { + var pos = 0, + i = -1, + match; + while ((match = self.exec(str, regex, pos))) { + callback.call(context, match, ++i, str, regex); + pos = match.index + (match[0].length || 1); + } + return context; + }; + +/** + * Copies a regex object and adds flag `g`. The copy maintains special properties for named + * capture, is augmented with `XRegExp.prototype` methods, and has a fresh `lastIndex` property + * (set to zero). Native regexes are not recompiled using XRegExp syntax. + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * var globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + self.globalize = function (regex) { + return copy(regex, "g"); + }; + +/** + * Installs optional features according to the specified options. + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Overrides native regex methods with fixed/extended versions that support named + * // backreferences and fix numerous cross-browser bugs + * natives: true, + * + * // Enables extensibility of XRegExp syntax and flags + * extensibility: true + * }); + * + * // With an options string + * XRegExp.install('natives extensibility'); + * + * // Using a shortcut to install all optional features + * XRegExp.install('all'); + */ + self.install = function (options) { + options = prepareOptions(options); + if (!features.natives && options.natives) { + setNatives(true); + } + if (!features.extensibility && options.extensibility) { + setExtensibility(true); + } + }; + +/** + * Checks whether an individual optional feature is installed. + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + *
  • `natives` + *
  • `extensibility` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('natives'); + */ + self.isInstalled = function (feature) { + return !!(features[feature]); + }; + +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + self.isRegExp = function (value) { + return isType(value, "regexp"); + }; + +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and objects with `regex` + * and `backref` properties. When a backreference is specified, the named or numbered backreference + * is passed forward to the next regex or returned. + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = 'XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + self.matchChain = function (str, chain) { + return (function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : {regex: chain[level]}, + matches = [], + addMatch = function (match) { + matches.push(item.backref ? (match[item.backref] || "") : match[0]); + }, + i; + for (i = 0; i < values.length; ++i) { + self.forEach(values[i], item.regex, addMatch); + } + return ((level === chain.length - 1) || !matches.length) ? + matches : + recurseChain(matches, level + 1); + }([str], 0)); + }; + +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag `g` if + * using a regex. Replacement strings can use `${n}` for named and numbered backreferences. + * Replacement functions can use named backreferences via `arguments[0].name`. Also fixes browser + * bugs compared to the native `String.prototype.replace` and can be used reliably cross-browser. + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + *
  • $$ - Inserts a literal '$'. + *
  • $&, $0 - Inserts the matched substring. + *
  • $` - Inserts the string that precedes the matched substring (left context). + *
  • $' - Inserts the string that follows the matched substring (right context). + *
  • $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + *
  • ${n} - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + *
  • The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + *
  • 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + *
  • The zero-based index of the match within the total search string. + *
  • The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag `g`, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * var name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '${last}, ${first}'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, function (match) { + * return match.last + ', ' + match.first; + * }); + * // -> 'Smith, John' + * + * // Global string search/replacement + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + self.replace = function (str, search, replacement, scope) { + var isRegex = self.isRegExp(search), + search2 = search, + result; + if (isRegex) { + if (scope === undef && search.global) { + scope = "all"; // Follow flag g when `scope` isn't explicit + } + // Note that since a copy is used, `search`'s `lastIndex` isn't updated *during* replacement iterations + search2 = copy(search, scope === "all" ? "g" : "", scope === "all" ? "" : "g"); + } else if (scope === "all") { + search2 = new RegExp(self.escape(String(search)), "g"); + } + result = fixed.replace.call(String(str), search2, replacement); // Fixed `replace` required for named backreferences, etc. + if (isRegex && search.global) { + search.lastIndex = 0; // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + } + return result; + }; + +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + self.split = function (str, separator, limit) { + return fixed.split.call(str, separator, limit); + }; + +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + */ + self.test = function (str, regex, pos, sticky) { + // Do this the easy way :-) + return !!self.exec(str, regex, pos, sticky); + }; + +/** + * Uninstalls optional features according to the specified options. + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Restores native regex methods + * natives: true, + * + * // Disables additional syntax and flag extensions + * extensibility: true + * }); + * + * // With an options string + * XRegExp.uninstall('natives extensibility'); + * + * // Using a shortcut to uninstall all optional features + * XRegExp.uninstall('all'); + */ + self.uninstall = function (options) { + options = prepareOptions(options); + if (features.natives && options.natives) { + setNatives(false); + } + if (features.extensibility && options.extensibility) { + setExtensibility(false); + } + }; + +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly. Native + * flags used by provided regexes are ignored in favor of the `flags` argument. + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + * + * XRegExp.union([XRegExp('(?dogs)\\k'), XRegExp('(?cats)\\k')]); + * // -> XRegExp('(?dogs)\\k|(?cats)\\k') + */ + self.union = function (patterns, flags) { + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g, + numCaptures = 0, + numPriorCaptures, + captureNames, + rewrite = function (match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; + if (paren) { // Capturing group + ++numCaptures; + if (name) { // If the current capture has a name + return "(?<" + name + ">"; + } + } else if (backref) { // Backreference + return "\\" + (+backref + numPriorCaptures); + } + return match; + }, + output = [], + pattern, + i; + if (!(isType(patterns, "array") && patterns.length)) { + throw new TypeError("patterns must be a nonempty array"); + } + for (i = 0; i < patterns.length; ++i) { + pattern = patterns[i]; + if (self.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = (pattern.xregexp && pattern.xregexp.captureNames) || []; + // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns + // are independently valid; helps keep this simple. Named captures are put back + output.push(self(pattern.source).source.replace(parts, rewrite)); + } else { + output.push(self.escape(pattern)); + } + } + return self(output.join("|"), flags); + }; + +/** + * The XRegExp version number. + * @static + * @memberOf XRegExp + * @type String + */ + self.version = "2.0.0"; + +/*-------------------------------------- + * Fixed/extended native methods + *------------------------------------*/ + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Calling `XRegExp.install('natives')` uses this to + * override the native method. Use via `XRegExp.exec` without overriding natives. + * @private + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or null. + */ + fixed.exec = function (str) { + var match, name, r2, origLastIndex, i; + if (!this.global) { + origLastIndex = this.lastIndex; + } + match = nativ.exec.apply(this, arguments); + if (match) { + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1 && lastIndexOf(match, "") > -1) { + r2 = new RegExp(this.source, nativ.replace.call(getNativeFlags(this), "g", "")); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call(String(str).slice(match.index), r2, function () { + var i; + for (i = 1; i < arguments.length - 2; ++i) { + if (arguments[i] === undef) { + match[i] = undef; + } + } + }); + } + // Attach named capture properties + if (this.xregexp && this.xregexp.captureNames) { + for (i = 1; i < match.length; ++i) { + name = this.xregexp.captureNames[i - 1]; + if (name) { + match[name] = match[i]; + } + } + } + // Fix browsers that increment `lastIndex` after zero-length matches + if (this.global && !match[0].length && (this.lastIndex > match.index)) { + this.lastIndex = match.index; + } + } + if (!this.global) { + this.lastIndex = origLastIndex; // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + } + return match; + }; + +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. Calling `XRegExp.install('natives')` + * uses this to override the native method. + * @private + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + fixed.test = function (str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); + }; + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. Calling `XRegExp.install('natives')` uses this to + * override the native method. + * @private + * @param {RegExp} regex Regex to search with. + * @returns {Array} If `regex` uses flag g, an array of match strings or null. Without flag g, the + * result of calling `regex.exec(this)`. + */ + fixed.match = function (regex) { + if (!self.isRegExp(regex)) { + regex = new RegExp(regex); // Use native `RegExp` + } else if (regex.global) { + var result = nativ.match.apply(this, arguments); + regex.lastIndex = 0; // Fixes IE bug + return result; + } + return fixed.exec.call(regex, this); + }; + +/** + * Adds support for `${n}` tokens for named and numbered backreferences in replacement text, and + * provides named backreferences to replacement functions as `arguments[0].name`. Also fixes + * browser bugs in replacement text syntax when performing a replacement using a nonregex search + * value, and the value of a replacement regex's `lastIndex` property during replacement iterations + * and upon completion. Note that this doesn't support SpiderMonkey's proprietary third (`flags`) + * argument. Calling `XRegExp.install('natives')` uses this to override the native method. Use via + * `XRegExp.replace` without overriding natives. + * @private + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + fixed.replace = function (search, replacement) { + var isRegex = self.isRegExp(search), captureNames, result, str, origLastIndex; + if (isRegex) { + if (search.xregexp) { + captureNames = search.xregexp.captureNames; + } + if (!search.global) { + origLastIndex = search.lastIndex; + } + } else { + search += ""; + } + if (isType(replacement, "function")) { + result = nativ.replace.call(String(this), search, function () { + var args = arguments, i; + if (captureNames) { + // Change the `arguments[0]` string primitive to a `String` object that can store properties + args[0] = new String(args[0]); + // Store named backreferences on the first argument + for (i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + args[0][captureNames[i]] = args[i + 1]; + } + } + } + // Update `lastIndex` before calling `replacement`. + // Fixes IE, Chrome, Firefox, Safari bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } + return replacement.apply(null, args); + }); + } else { + str = String(this); // Ensure `args[args.length - 1]` will be a string when given nonstring `this` + result = nativ.replace.call(str, search, function () { + var args = arguments; // Keep this function's `arguments` available through closure + return nativ.replace.call(String(replacement), replacementToken, function ($0, $1, $2) { + var n; + // Named or numbered backreference with curly brackets + if ($1) { + /* XRegExp behavior for `${n}`: + * 1. Backreference to numbered capture, where `n` is 1+ digits. `0`, `00`, etc. is the entire match. + * 2. Backreference to named capture `n`, if it exists and is not a number overridden by numbered capture. + * 3. Otherwise, it's an error. + */ + n = +$1; // Type-convert; drop leading zeros + if (n <= args.length - 3) { + return args[n] || ""; + } + n = captureNames ? lastIndexOf(captureNames, $1) : -1; + if (n < 0) { + throw new SyntaxError("backreference to undefined group " + $0); + } + return args[n + 1] || ""; + } + // Else, special variable or numbered backreference (without curly brackets) + if ($2 === "$") return "$"; + if ($2 === "&" || +$2 === 0) return args[0]; // $&, $0 (not followed by 1-9), $00 + if ($2 === "`") return args[args.length - 1].slice(0, args[args.length - 2]); + if ($2 === "'") return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + // Else, numbered backreference (without curly brackets) + $2 = +$2; // Type-convert; drop leading zero + /* XRegExp behavior: + * - Backreferences without curly brackets end after 1 or 2 digits. Use `${..}` for more digits. + * - `$1` is an error if there are no capturing groups. + * - `$10` is an error if there are less than 10 capturing groups. Use `${1}0` instead. + * - `$01` is equivalent to `$1` if a capturing group exists, otherwise it's an error. + * - `$0` (not followed by 1-9), `$00`, and `$&` are the entire match. + * Native behavior, for comparison: + * - Backreferences end after 1 or 2 digits. Cannot use backreference to capturing group 100+. + * - `$1` is a literal `$1` if there are no capturing groups. + * - `$10` is `$1` followed by a literal `0` if there are less than 10 capturing groups. + * - `$01` is equivalent to `$1` if a capturing group exists, otherwise it's a literal `$01`. + * - `$0` is a literal `$0`. `$&` is the entire match. + */ + if (!isNaN($2)) { + if ($2 > args.length - 3) { + throw new SyntaxError("backreference to undefined group " + $0); + } + return args[$2] || ""; + } + throw new SyntaxError("invalid token " + $0); + }); + }); + } + if (isRegex) { + if (search.global) { + search.lastIndex = 0; // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + } else { + search.lastIndex = origLastIndex; // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + } + } + return result; + }; + +/** + * Fixes browser bugs in the native `String.prototype.split`. Calling `XRegExp.install('natives')` + * uses this to override the native method. Use via `XRegExp.split` without overriding natives. + * @private + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + fixed.split = function (separator, limit) { + if (!self.isRegExp(separator)) { + return nativ.split.apply(this, arguments); // use faster native method + } + var str = String(this), + origLastIndex = separator.lastIndex, + output = [], + lastLastIndex = 0, + lastLength; + /* Values for `limit`, per the spec: + * If undefined: pow(2,32) - 1 + * If 0, Infinity, or NaN: 0 + * If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + * If negative number: pow(2,32) - floor(abs(limit)) + * If other: Type-convert, then use the above rules + */ + limit = (limit === undef ? -1 : limit) >>> 0; + self.forEach(str, separator, function (match) { + if ((match.index + match[0].length) > lastLastIndex) { // != `if (match[0].length)` + output.push(str.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, "") || lastLength) { + output.push(""); + } + } else { + output.push(str.slice(lastLastIndex)); + } + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; + }; + +/*-------------------------------------- + * Built-in tokens + *------------------------------------*/ + +// Shortcut + add = addToken.on; + +/* Letter identity escapes that natively match literal characters: \p, \P, etc. + * Should be SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross- + * browser consistency and to reserve their syntax, but lets them be superseded by XRegExp addons. + */ + add(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/, + function (match, scope) { + // \B is allowed in default scope only + if (match[1] === "B" && scope === defaultScope) { + return match[0]; + } + throw new SyntaxError("invalid escape " + match[0]); + }, + {scope: "all"}); + +/* Empty character class: [] or [^] + * Fixes a critical cross-browser syntax inconsistency. Unless this is standardized (per the spec), + * regex syntax can't be accurately parsed because character class endings can't be determined. + */ + add(/\[(\^?)]/, + function (match) { + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in Firefox + return match[1] ? "[\\s\\S]" : "\\b\\B"; + }); + +/* Comment pattern: (?# ) + * Inline comments are an alternative to the line comments allowed in free-spacing mode (flag x). + */ + add(/(?:\(\?#[^)]*\))+/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + }); + +/* Named backreference: \k + * Backreference names can use the characters A-Z, a-z, 0-9, _, and $ only. + */ + add(/\\k<([\w$]+)>/, + function (match) { + var index = isNaN(match[1]) ? (lastIndexOf(this.captureNames, match[1]) + 1) : +match[1], + endIndex = match.index + match[0].length; + if (!index || index > this.captureNames.length) { + throw new SyntaxError("backreference to undefined group " + match[0]); + } + // Keep backreferences separate from subsequent literal numbers + return "\\" + index + ( + endIndex === match.input.length || isNaN(match.input.charAt(endIndex)) ? "" : "(?:)" + ); + }); + +/* Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + add(/(?:\s+|#.*)+/, + function (match) { + // Keep tokens separated unless the following token is a quantifier + return nativ.test.call(quantifier, match.input.slice(match.index + match[0].length)) ? "" : "(?:)"; + }, + { + trigger: function () { + return this.hasFlag("x"); + }, + customFlags: "x" + }); + +/* Dot, in dotall mode (aka singleline mode, flag s) only. + */ + add(/\./, + function () { + return "[\\s\\S]"; + }, + { + trigger: function () { + return this.hasFlag("s"); + }, + customFlags: "s" + }); + +/* Named capturing group; match the opening delimiter only: (? + * Capture names can use the characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. + * Supports Python-style (?P as an alternate syntax to avoid issues in recent Opera (which + * natively supports the Python-style syntax). Otherwise, XRegExp might treat numbered + * backreferences to Python-style named capture as octals. + */ + add(/\(\?P?<([\w$]+)>/, + function (match) { + if (!isNaN(match[1])) { + // Avoid incorrect lookups, since named backreferences are added to match arrays + throw new SyntaxError("can't use integer as capture name " + match[0]); + } + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return "("; + }); + +/* Numbered backreference or octal, plus any following digits: \0, \11, etc. + * Octals except \0 not followed by 0-9 and backreferences to unopened capture groups throw an + * error. Other matches are returned unaltered. IE <= 8 doesn't support backreferences greater than + * \99 in regex syntax. + */ + add(/\\(\d+)/, + function (match, scope) { + if (!(scope === defaultScope && /^[1-9]/.test(match[1]) && +match[1] <= this.captureNames.length) && + match[1] !== "0") { + throw new SyntaxError("can't use octal escape or backreference to undefined group " + match[0]); + } + return match[0]; + }, + {scope: "all"}); + +/* Capturing group; match the opening parenthesis only. + * Required for support of named capturing groups. Also adds explicit capture mode (flag n). + */ + add(/\((?!\?)/, + function () { + if (this.hasFlag("n")) { + return "(?:"; + } + this.captureNames.push(null); + return "("; + }, + {customFlags: "n"}); + +/*-------------------------------------- + * Expose XRegExp + *------------------------------------*/ + +// For CommonJS enviroments + if (typeof exports !== "undefined") { + exports.XRegExp = self; + } + + return self; + +}()); + +// +// Begin anonymous function. This is used to contain local scope variables without polutting global scope. +// +if (typeof(SyntaxHighlighter) == 'undefined') var SyntaxHighlighter = function() { + +// CommonJS +if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined') +{ + XRegExp = require('xregexp').XRegExp; +} + +// Shortcut object which will be assigned to the SyntaxHighlighter variable. +// This is a shorthand for local reference in order to avoid long namespace +// references to SyntaxHighlighter.whatever... +var sh = { + defaults : { + /** Additional CSS class names to be added to highlighter elements. */ + 'class-name' : '', + + /** First line number. */ + 'first-line' : 1, + + /** + * Pads line numbers. Possible values are: + * + * false - don't pad line numbers. + * true - automaticaly pad numbers with minimum required number of leading zeroes. + * [int] - length up to which pad line numbers. + */ + 'pad-line-numbers' : false, + + /** Lines to highlight. */ + 'highlight' : null, + + /** Title to be displayed above the code block. */ + 'title' : null, + + /** Enables or disables smart tabs. */ + 'smart-tabs' : true, + + /** Gets or sets tab size. */ + 'tab-size' : 4, + + /** Enables or disables gutter. */ + 'gutter' : true, + + /** Enables or disables toolbar. */ + 'toolbar' : true, + + /** Enables quick code copy and paste from double click. */ + 'quick-code' : true, + + /** Forces code view to be collapsed. */ + 'collapse' : false, + + /** Enables or disables automatic links. */ + 'auto-links' : true, + + /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */ + 'light' : false, + + 'unindent' : true, + + 'html-script' : false + }, + + config : { + space : ' ', + + /** Enables use of