Initial import: Carteasy Shop (Dev-Stand)
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 694 B |
@@ -0,0 +1,79 @@
|
||||
.colored {
|
||||
/* resets */ margin: 0; padding: 0;
|
||||
background-color: #E8E8E8;
|
||||
overflow: hidden;
|
||||
}
|
||||
.colored PRE {
|
||||
margin: 0;
|
||||
padding: 0 0 0 45px;
|
||||
font: 12px "Consolas","Courier New",Courier,mono;
|
||||
overflow: auto;
|
||||
line-height: 100%;
|
||||
|
||||
/* One of lines below fixes hidden horizontal bar in FF with single long line of code.
|
||||
NOTE: since v1.4 this fix is added to JS file instead.
|
||||
padding-bottom: 3px;
|
||||
line-height: 1.5em;
|
||||
*/
|
||||
}
|
||||
.colored PRE ol {
|
||||
/* resets */ margin: 0; padding: 0;
|
||||
color: #222222;
|
||||
list-style-image: none;
|
||||
list-style-position: outside;
|
||||
list-style-type: decimal-leading-zero;
|
||||
}
|
||||
.colored PRE ol li {
|
||||
margin: 0;
|
||||
padding: 0 0 0 10px;
|
||||
border-left: 1px solid #CCCCCC;
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
.colored .bar {
|
||||
/* resets */ margin: 0; padding: 0;
|
||||
padding-left: 45px;
|
||||
height: 19px;
|
||||
background: #EEEEEE url(jquery.chili-toolbar-bg.png) repeat-x 0 100%;
|
||||
border-bottom: 1px solid #CCCCCC;
|
||||
}
|
||||
.colored .tools {
|
||||
padding: 0 8px 0 0;
|
||||
font: normal 10px Verdana,Helvetica,Geneva,Arial,sans-serif;
|
||||
}
|
||||
.colored .tools a {
|
||||
display: block;
|
||||
float: left;
|
||||
padding-right: 4px;
|
||||
color: #B2B2B2;
|
||||
text-decoration: none;
|
||||
outline: 0;
|
||||
border: 0 !important;
|
||||
}
|
||||
.colored .tools a span {
|
||||
display: block;
|
||||
height: 15px;
|
||||
padding: 4px 4px 0 8px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.colored .tools a:hover {
|
||||
background: #EEEEEE url(jquery.chili-toolbar-bg.png) repeat-x 100% 0;
|
||||
}
|
||||
.colored .tools a:hover span {
|
||||
color: black;
|
||||
background: #EEEEEE url(jquery.chili-toolbar-bg.png) repeat-x 0 0;
|
||||
}
|
||||
/* Hide useless elements in print layouts... */
|
||||
@media print {
|
||||
.colored {
|
||||
margin: 0; padding: 0;
|
||||
border: 0 none;
|
||||
}
|
||||
.colored PRE {
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.colored PRE ol li {
|
||||
border-bottom: 0 none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* ChiliToolbar v1.4
|
||||
*
|
||||
* Copyright (c) 2008 Orkan (orkans@gmail.com)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* Installation:
|
||||
* Put these two lines in <HEAD> section, after jquery.chili.js
|
||||
* <script src="jquery.chili-toolbar.js" type="text/javascript"></script>
|
||||
* <link href="jquery.chili-toolbar.css" type="text/css" rel="styleshee
|
||||
*
|
||||
* $Rev: 27 $
|
||||
* $Date:: 2008-09-15 #$
|
||||
*
|
||||
* Depends:
|
||||
* jquery.chili.js
|
||||
*
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
ChiliBook.Toolbar = {
|
||||
Version: "1.4",
|
||||
Chili: $.fn.chili,
|
||||
Command: {
|
||||
ViewSource: {
|
||||
Label: "view plain",
|
||||
Cmd: function(el){
|
||||
var wnd = window.open("", ChiliBook.Toolbar.Utils.PopUpTarget, "width=750, height=400, resizable=1, scrollbars=0");
|
||||
wnd.document.write('<textarea style="width:99%;height:99%">'+$.data(el, "chili.text").replace("&", "&")+'</textarea>');
|
||||
wnd.document.close();
|
||||
}
|
||||
},
|
||||
CopyToClipboard: {
|
||||
Label: "copy to clipboard",
|
||||
Cmd: function(el){
|
||||
if(window.clipboardData) {
|
||||
window.clipboardData.setData("text", $.data(el, "chili.text"));
|
||||
ChiliBook.Toolbar.Lang.Clipboard_Y && alert(ChiliBook.Toolbar.Lang.Clipboard_Y);
|
||||
}
|
||||
else if(ChiliBook.Toolbar.Clipboard.Swf) {
|
||||
if(!ChiliBook.Toolbar.Clipboard.Div) ChiliBook.Toolbar.Clipboard.Div = $("<div/>").appendTo(document.body);
|
||||
ChiliBook.Toolbar.Clipboard.Div.html('<embed src="'+ChiliBook.Toolbar.Clipboard.Swf+'" FlashVars="clipboard='+encodeURIComponent($.data(el, "chili.text"))+'" width="0" height="0" type="application/x-shockwave-flash"></embed>');
|
||||
ChiliBook.Toolbar.Lang.Clipboard_Y && alert(ChiliBook.Toolbar.Lang.Clipboard_Y);
|
||||
}
|
||||
else ChiliBook.Toolbar.Lang.Clipboard_N && alert(ChiliBook.Toolbar.Lang.Clipboard_N);
|
||||
}
|
||||
},
|
||||
PrintSource: {
|
||||
Label: "print",
|
||||
Cmd: function(el){
|
||||
var ifr = $("<iframe/>").css({position:"absolute", width:0, height:0, left:0, top:0}).appendTo(document.body).get(0);
|
||||
var doc = ifr.contentWindow.document;
|
||||
var p = el.parentNode;
|
||||
|
||||
ChiliBook.Toolbar.Utils.CopyStyles(doc);
|
||||
doc.write('<'+p.tagName+' class="'+p.className+'"><'+el.tagName+' class="'+el.className+'">'+el.innerHTML+'</'+el.tagName+'></'+p.tagName+'>');
|
||||
doc.close();
|
||||
|
||||
ifr.contentWindow.focus();
|
||||
ifr.contentWindow.print();
|
||||
alert(ChiliBook.Toolbar.Lang.Printing);
|
||||
document.body.removeChild(ifr);
|
||||
}
|
||||
},
|
||||
About: {
|
||||
Label: "?",
|
||||
Cmd: function(el){
|
||||
var tpl = '<div class="colored" style="height:200px; text-align:center"><strong><a href="http://orkan.jaslo4u.pl/chili_toolbar/" target="{T}">ChiliToolbar v{V}</a></strong><div style="padding:1em 22px">Highlight your snippets with<br />jQuery's <a href="http://noteslog.com/chili/" target="{T}">Chili</a> code highlighter<br />and display it in a<br /><a href="http://www.dreamprojections.com/syntaxhighlighter/?ref=about" target="{T}">SyntaxHighlighter</a> way!<br /><br />© 2008 <a href="mailto:orkans@gmail.com" target="{T}">Orkan</a><br /><br /><input type="button" value="OK" onClick="window.close()" style="padding:0 1em" /></div></div>';
|
||||
var wnd = window.open("", "", "width=300, height=200, scrollbars=0");
|
||||
var doc = wnd.document;
|
||||
|
||||
ChiliBook.Toolbar.Utils.CopyStyles(doc);
|
||||
|
||||
doc.write(tpl.replace('{V}', ChiliBook.Toolbar.Version).replace('{T}', ChiliBook.Toolbar.Utils.PopUpTarget));
|
||||
doc.close();
|
||||
wnd.focus();
|
||||
}
|
||||
}
|
||||
},
|
||||
Clipboard: {
|
||||
Swf: "documentation/chili-toolbar/clipboard.swf",
|
||||
Div: null
|
||||
},
|
||||
Utils: {
|
||||
CopyStyles: function(doc) {
|
||||
for(var i = 0; i < document.styleSheets.length; i++)
|
||||
{
|
||||
var style = document.styleSheets[i];
|
||||
var owner = style.ownerNode ? style.ownerNode : style.owningElement;
|
||||
var media = typeof style.media == "string" ? style.media : style.media.mediaText;
|
||||
|
||||
if(owner.tagName.toLowerCase() == 'link') doc.write('<link href="'+owner.href+'" rel="stylesheet" type="text/css" '+(media?'media="'+media+'"':"")+' />');
|
||||
else doc.write('<style type="text/css" '+(media ? 'media="'+media+'"' : "")+'>'+(style.cssText ? style.cssText : owner.textContent)+'</style>');
|
||||
}
|
||||
doc.write('<style type="text/css" media="all">\nhtml,body {margin:0;padding:0}\n</style>');
|
||||
},
|
||||
IEOverflowFix: "1.5em",
|
||||
FFOverflowFix: "1.5em",
|
||||
PopUpTarget: "main"
|
||||
},
|
||||
Lang: {
|
||||
Clipboard_Y: "The code is in your clipboard now",
|
||||
Clipboard_N: "Sorry, the code cannot be copied to your clipboard",
|
||||
Printing: "Printing..."
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$.fn.chili = function(options) {
|
||||
|
||||
// Prepare toolbar
|
||||
this.bind("chili.before_coloring", function()
|
||||
{
|
||||
var self = this,
|
||||
$this = $(this),
|
||||
$bar = $("<div/>").addClass("bar"),
|
||||
$tools = $("<div/>").addClass("tools");
|
||||
|
||||
$.each(ChiliBook.Toolbar.Command, function(key, obj){ // TODO: need some improvements here
|
||||
$('<a href="javascript:;"><span>'+obj.Label+'</span></a>')
|
||||
.click(function(){ obj.Cmd(self); })
|
||||
.appendTo($tools);
|
||||
});
|
||||
|
||||
$this.before($bar.append($tools));
|
||||
$this.data("chili.text", $this.text());
|
||||
});
|
||||
|
||||
this.bind("chili.after_coloring", function()
|
||||
{
|
||||
// Browser specific overflow bug fixes
|
||||
if(this.scrollWidth > this.offsetWidth)
|
||||
{
|
||||
var fixCSS = null;
|
||||
|
||||
if($.browser.msie && ChiliBook.Toolbar.Utils.IEOverflowFix)
|
||||
{
|
||||
fixCSS = {"padding-bottom": ChiliBook.Toolbar.Utils.IEOverflowFix, "overflow-y": "hidden"};
|
||||
}
|
||||
else
|
||||
{
|
||||
// Note: this bug should be applied to elements with single line of code only
|
||||
if($.browser.mozilla && ChiliBook.Toolbar.Utils.FFOverflowFix)
|
||||
{
|
||||
// I dont know why with ChiliBook.lineNumbers == true theres no <li> elements at "chili.after_coloring" hook ?
|
||||
// This happens when ChiliBook.recipeFolder is in use...
|
||||
// var lines = (ChiliBook.lineNumbers || (options && options.lineNumbers)) ? $(this).find('li') : $(this).html().match(/<br>/ig) || [];
|
||||
// if(lines.length == 1)
|
||||
|
||||
var li = $(this).find('li').length;
|
||||
var nl = $(this).html().match(/(\x0A|<br>)/ig);
|
||||
|
||||
if( (li == 1) || (nl && nl.length == 1) || (!li && !nl) )
|
||||
{
|
||||
fixCSS = {"line-height": ChiliBook.Toolbar.Utils.FFOverflowFix};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(fixCSS)
|
||||
{
|
||||
$(this).css(fixCSS);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Apply Chili
|
||||
ChiliBook.Toolbar.Chili.apply(this, [options]);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* ChiliToolbar v1.4
|
||||
*
|
||||
* Copyright (c) 2008 Orkan (orkans@gmail.com)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* Installation:
|
||||
* Put these two lines in <HEAD> section, after jquery.chili.js
|
||||
* <script src="jquery.chili-toolbar.js" type="text/javascript"></script>
|
||||
* <link href="jquery.chili-toolbar.css" type="text/css" rel="styleshee
|
||||
*
|
||||
* $Rev: 27 $
|
||||
* $Date:: 2008-09-15 #$
|
||||
*
|
||||
* Depends:
|
||||
* jquery.chili.js
|
||||
*
|
||||
*/
|
||||
|
||||
;(function($){ChiliBook.Toolbar={Version:"1.4",Chili:$.fn.chili,Command:{ViewSource:{Label:"view plain",Cmd:function(el){var wnd=window.open("",ChiliBook.Toolbar.Utils.PopUpTarget,"width=750, height=400, resizable=1, scrollbars=0");wnd.document.write('<textarea style="width:99%;height:99%">'+$.data(el,"chili.text").replace("&","&")+'</textarea>');wnd.document.close()}},CopyToClipboard:{Label:"copy to clipboard",Cmd:function(el){if(window.clipboardData){window.clipboardData.setData("text",$.data(el,"chili.text"));ChiliBook.Toolbar.Lang.Clipboard_Y&&alert(ChiliBook.Toolbar.Lang.Clipboard_Y)}else if(ChiliBook.Toolbar.Clipboard.Swf){if(!ChiliBook.Toolbar.Clipboard.Div)ChiliBook.Toolbar.Clipboard.Div=$("<div/>").appendTo(document.body);ChiliBook.Toolbar.Clipboard.Div.html('<embed src="'+ChiliBook.Toolbar.Clipboard.Swf+'" FlashVars="clipboard='+encodeURIComponent($.data(el,"chili.text"))+'" width="0" height="0" type="application/x-shockwave-flash"></embed>');ChiliBook.Toolbar.Lang.Clipboard_Y&&alert(ChiliBook.Toolbar.Lang.Clipboard_Y)}else ChiliBook.Toolbar.Lang.Clipboard_N&&alert(ChiliBook.Toolbar.Lang.Clipboard_N)}},PrintSource:{Label:"print",Cmd:function(el){var ifr=$("<iframe/>").css({position:"absolute",width:0,height:0,left:0,top:0}).appendTo(document.body).get(0);var doc=ifr.contentWindow.document;var p=el.parentNode;ChiliBook.Toolbar.Utils.CopyStyles(doc);doc.write('<'+p.tagName+' class="'+p.className+'"><'+el.tagName+' class="'+el.className+'">'+el.innerHTML+'</'+el.tagName+'></'+p.tagName+'>');doc.close();ifr.contentWindow.focus();ifr.contentWindow.print();alert(ChiliBook.Toolbar.Lang.Printing);document.body.removeChild(ifr)}},About:{Label:"?",Cmd:function(el){var tpl='<div class="colored" style="height:200px; text-align:center"><strong><a href="http://orkan.jaslo4u.pl/chili_toolbar/" target="{T}">ChiliToolbar v{V}</a></strong><div style="padding:1em 22px">Highlight your snippets with<br />jQuery's <a href="http://noteslog.com/chili/" target="{T}">Chili</a> code highlighter<br />and display it in a<br /><a href="http://www.dreamprojections.com/syntaxhighlighter/?ref=about" target="{T}">SyntaxHighlighter</a> way!<br /><br />© 2008 <a href="mailto:orkans@gmail.com" target="{T}">Orkan</a><br /><br /><input type="button" value="OK" onClick="window.close()" style="padding:0 1em" /></div></div>';var wnd=window.open("","","width=300, height=200, scrollbars=0");var doc=wnd.document;ChiliBook.Toolbar.Utils.CopyStyles(doc);doc.write(tpl.replace('{V}',ChiliBook.Toolbar.Version).replace('{T}',ChiliBook.Toolbar.Utils.PopUpTarget));doc.close();wnd.focus()}}},Clipboard:{Swf:"documentation/chili-toolbar/clipboard.swf",Div:null},Utils:{CopyStyles:function(doc){for(var i=0;i<document.styleSheets.length;i++){var style=document.styleSheets[i];var owner=style.ownerNode?style.ownerNode:style.owningElement;var media=typeof style.media=="string"?style.media:style.media.mediaText;if(owner.tagName.toLowerCase()=='link')doc.write('<link href="'+owner.href+'" rel="stylesheet" type="text/css" '+(media?'media="'+media+'"':"")+' />');else doc.write('<style type="text/css" '+(media?'media="'+media+'"':"")+'>'+(style.cssText?style.cssText:owner.textContent)+'</style>')}doc.write('<style type="text/css" media="all">\nhtml,body {margin:0;padding:0}\n</style>')},IEOverflowFix:"1.5em",FFOverflowFix:"1.5em",PopUpTarget:"main"},Lang:{Clipboard_Y:"The code is in your clipboard now",Clipboard_N:"Sorry, the code cannot be copied to your clipboard",Printing:"Printing..."}};$.fn.chili=function(options){this.bind("chili.before_coloring",function(){var self=this,$this=$(this),$bar=$("<div/>").addClass("bar"),$tools=$("<div/>").addClass("tools");$.each(ChiliBook.Toolbar.Command,function(key,obj){$('<a href="javascript:;"><span>'+obj.Label+'</span></a>').click(function(){obj.Cmd(self)}).appendTo($tools)});$this.before($bar.append($tools));$this.data("chili.text",$this.text())});this.bind("chili.after_coloring",function(){if(this.scrollWidth>this.offsetWidth){var fixCSS=null;if($.browser.msie&&ChiliBook.Toolbar.Utils.IEOverflowFix){fixCSS={"padding-bottom":ChiliBook.Toolbar.Utils.IEOverflowFix,"overflow-y":"hidden"}}else{if($.browser.mozilla&&ChiliBook.Toolbar.Utils.FFOverflowFix){var li=$(this).find('li').length;var nl=$(this).html().match(/(\x0A|<br>)/ig);if((li==1)||(nl&&nl.length==1)||(!li&&!nl)){fixCSS={"line-height":ChiliBook.Toolbar.Utils.FFOverflowFix}}}}if(fixCSS){$(this).css(fixCSS)}}});ChiliBook.Toolbar.Chili.apply(this,[options])}})(jQuery);
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* ChiliToolbar v1.4
|
||||
*
|
||||
* Copyright (c) 2008 Orkan (orkans@gmail.com)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* Installation:
|
||||
* Put these two lines in <HEAD> section, after jquery.chili.js
|
||||
* <script src="jquery.chili-toolbar.js" type="text/javascript"></script>
|
||||
* <link href="jquery.chili-toolbar.css" type="text/css" rel="styleshee
|
||||
*
|
||||
* $Rev: 27 $
|
||||
* $Date:: 2008-09-15 #$
|
||||
*
|
||||
* Depends:
|
||||
* jquery.chili.js
|
||||
*
|
||||
*/
|
||||
|
||||
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';(c($){3.2={1q:"1.4",Y:$.1J.f,1y:{1V:{u:"1Y 22",w:c(9){6 r=D.1o("",3.2.g.1e,"A=25, o=24, 23=1, 1p=0");r.h.q(\'<1C 5="A:1z%;o:1z%">\'+$.M(9,"f.d").1d("&","&1L;")+\'</1C>\');r.h.N()}},1M:{u:"1f 1H H",w:c(9){e(D.1x){D.1x.2z("d",$.M(9,"f.d"));3.2.k.E&&J(3.2.k.E)}P e(3.2.t.18){e(!3.2.t.U)3.2.t.U=$("<l/>").1b(h.L);3.2.t.U.1u(\'<1w 2r="\'+3.2.t.18+\'" 2p="H=\'+2n($.M(9,"f.d"))+\'" A="0" o="0" C="27/x-2o-2t"></1w>\');3.2.k.E&&J(3.2.k.E)}P 3.2.k.16&&J(3.2.k.16)}},2v:{u:"1E",w:c(9){6 B=$("<2c/>").G({2b:"2a",A:0,o:0,29:0,2f:0}).1b(h.L).2k(0);6 8=B.17.h;6 p=9.2j;3.2.g.X(8);8.q(\'<\'+p.z+\' 11="\'+p.1t+\'"><\'+9.z+\' 11="\'+9.1t+\'">\'+9.2h+\'</\'+9.z+\'></\'+p.z+\'>\');8.N();B.17.1k();B.17.1E();J(3.2.k.Z);h.L.2g(B)}},2e:{u:"?",w:c(9){6 1h=\'<l 11="28" 5="o:2d; d-2l:2m"><1l><a m="10://2u.2w.2x/2y/" Q="{T}">2s v{V}</a></1l><l 5="R:1s 2q">1U 13 1O 1S<j />1ms <a m="10://21.W/f/" Q="{T}">Y</a> 1c 20<j />1W 1X 1Z 1K a<j /><a m="10://1P.1N.W/1Q/?1T=1R" Q="{T}">2i</a> 2K!<j /><j />&1f; 3j <a m="3h:3a@36.W" Q="{T}">37</a><j /><j /><3b C="3f" 3o="3d" 3e="D.N()" 5="R:0 1s" /></l></l>\';6 r=D.1o("","","A=3g, o=3c, 1p=0");6 8=r.h;3.2.g.X(8);8.q(1h.1d(\'{V}\',3.2.1q).1d(\'{T}\',3.2.g.1e));8.N();r.1k()}}},t:{18:"H.38",U:1B},g:{X:c(8){39(6 i=0;i<h.1j.12;i++){6 5=h.1j[i];6 K=5.1i?5.1i:5.2A;6 b=3i 5.b=="3q"?5.b:5.b.3s;e(K.z.3t()==\'1n\')8.q(\'<1n m="\'+K.m+\'" 3r="3p" C="d/G" \'+(b?\'b="\'+b+\'"\':"")+\' />\');P 8.q(\'<5 C="d/G" \'+(b?\'b="\'+b+\'"\':"")+\'>\'+(5.1r?5.1r:K.3k)+\'</5>\')}8.q(\'<5 C="d/G" b="3l">\\3m,L {3n:0;R:0}\\n</5>\')},15:"1.1g",19:"1.1g",1e:"34"},k:{E:"35 1c 2J 1K 13 H 2L",16:"2M, 2O 1c 2N 2I 2H 1H 13 H",Z:"Z..."}};$.1J.f=c(1I){7.1A("f.2C",c(){6 1v=7,$7=$(7),$1a=$("<l/>").1F("1a"),$I=$("<l/>").1F("I");$.2B(3.2.1y,c(2D,14){$(\'<a m="2E:;"><1G>\'+14.u+\'</1G></a>\').2G(c(){14.w(1v)}).1b($I)});$7.2F($1a.2P($I));$7.M("f.d",$7.d())});7.1A("f.2Q",c(){e(7.30>7.2Z){6 F=1B;e($.1D.31&&3.2.g.15){F={"R-32":3.2.g.15,"33-y":"2Y"}}P{e($.1D.2X&&3.2.g.19){6 S=$(7).2S(\'S\').12;6 O=$(7).1u().2R(/(\\2T|<j>)/2U);e((S==1)||(O&&O.12==1)||(!S&&!O)){F={"2W-o":3.2.g.19}}}}e(F){$(7).G(F)}}});3.2.Y.2V(7,[1I])}})(1m);',62,216,'||Toolbar|ChiliBook||style|var|this|doc|el||media|function|text|if|chili|Utils|document||br|Lang|div|href||height||write|wnd||Clipboard|Label||Cmd|||tagName|width|ifr|type|window|Clipboard_Y|fixCSS|css|clipboard|tools|alert|owner|body|data|close|nl|else|target|padding|li||Div||com|CopyStyles|Chili|Printing|http|class|length|your|obj|IEOverflowFix|Clipboard_N|contentWindow|Swf|FFOverflowFix|bar|appendTo|code|replace|PopUpTarget|copy|5em|tpl|ownerNode|styleSheets|focus|strong|jQuery|link|open|scrollbars|Version|cssText|1em|className|html|self|embed|clipboardData|Command|99|bind|null|textarea|browser|print|addClass|span|to|options|fn|in|amp|CopyToClipboard|dreamprojections|snippets|www|syntaxhighlighter|about|with|ref|Highlight|ViewSource|and|display|view|it|highlighter|noteslog|plain|resizable|400|750|039|application|colored|left|absolute|position|iframe|200px|About|top|removeChild|innerHTML|SyntaxHighlighter|parentNode|get|align|center|encodeURIComponent|shockwave|FlashVars|22px|src|ChiliToolbar|flash|orkan|PrintSource|jaslo4u|pl|chili_toolbar|setData|owningElement|each|before_coloring|key|javascript|before|click|copied|be|is|way|now|Sorry|cannot|the|append|after_coloring|match|find|x0A|ig|apply|line|mozilla|hidden|offsetWidth|scrollWidth|msie|bottom|overflow|main|The|gmail|Orkan|swf|for|orkans|input|200|OK|onClick|button|300|mailto|typeof|2008|textContent|all|nhtml|margin|value|stylesheet|string|rel|mediaText|toLowerCase'.split('|'),0,{}))
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: "cpp"
|
||||
, _case: true
|
||||
, _main: {
|
||||
mlcom : {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, com : {
|
||||
_match: /\/\/.*/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, preproc : {
|
||||
_match: /[\^\n]\s*#\w+/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, string : {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number : {
|
||||
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, datatype: {
|
||||
_match: /\b(?:wint_t|wctype_t|wctrans_t|wchar_t|va_list|uintptr_t|tm|time_t|terminate_function|size_t|signed|sig_atomic_t|short|ptrdiff_t|mbstate_t|long|ldiv_t|lconv|jmp_buf|intptr_t|int|fpos_t|float|double|div_t|clock_t|char|bool|_wfinddatai64_t|_wfinddata_t|_utimbuf|_timeb|_stati64|_stat|_purecall_handler|_onexit_t|_off_t|_finddatai64_t|_finddata_t|_exception|_diskfree_t|_dev_t|_complex|__wfinddata64_t|__wchar_t|__timeb64|__time64_t|__stat64|__int8|__int64|__int32|__int16|__finddata64_t|_PNH|_HFILE|_HEAPINFO|_FPIEEE_RECORD|_EXCEPTION_POINTERS|WPARAM|WORD|WCHAR|VOID|USN|USHORT|ULONG_PTR|ULONGLONG|ULONG64|ULONG32|ULONG|UINT_PTR|UINT64|UINT32|UINT|UHALF_PTR|UCHAR|TCHAR|TBYTE|SSIZE_T|SIZE_T|SHORT|SERVICE_STATUS_HANDLE|SC_LOCK|SC_HANDLE|PWSTR|PWORD|PWCHAR|PVOID|PUSHORT|PULONG_PTR|PULONGLONG|PULONG64|PULONG32|PULONG|PUINT_PTR|PUINT64|PUINT32|PUINT|PUHALF_PTR|PUCHAR|PTSTR|PTCHAR|PTBYTE|PSTR|PSSIZE_T|PSIZE_T|PSHORT|POINTER_64|POINTER_32|PLONG_PTR|PLONGLONG|PLONG64|PLONG32|PLONG|PLCID|PINT_PTR|PINT64|PINT32|PINT|PHKEY|PHANDLE|PHALF_PTR|PFLOAT|PDWORD_PTR|PDWORDLONG|PDWORD64|PDWORD32|PCWSTR|PCTSTR|PCSTR|PCHAR|PBYTE|PBOOLEAN|PBOOL|LRESULT|LPWSTR|LPWORD|LPVOID|LPTSTR|LPSTR|LPLONG|LPINT|LPHANDLE|LPDWORD|LPCWSTR|LPCVOID|LPCTSTR|LPCSTR|LPCOLORREF|LPBYTE|LPBOOL|LPARAM|LONG_PTR|LONGLONG|LONG64|LONG32|LONG|LGRPID|LCTYPE|LCID|LANGID|INT_PTR|INT64|INT32|INT|HWND|HWINSTA|HSZ|HRSRC|HRGN|HRESULT|HPEN|HPALETTE|HMONITOR|HMODULE|HMETAFILE|HMENU|HLOCAL|HKL|HKEY|HINSTANCE|HICON|HHOOK|HGLOBAL|HGDIOBJ|HFONT|HFILE|HENHMETAFILE|HDWP|HDROP|HDESK|HDDEDATA|HDC|HCURSOR|HCONVLIST|HCONV|HCOLORSPACE|HBRUSH|HBITMAP|HANDLE|HALF_PTR|HACCEL|FLOAT|FILE|DWORD_PTR|DWORDLONG|DWORD64|DWORD32|DWORD|COLORREF|CHAR|BYTE|BOOLEAN|BOOL|ATOM)\b/
|
||||
, _style: "color: blue;"
|
||||
}
|
||||
, keyword : {
|
||||
_match: /\b(?:while|whcar_t|volatile|void|virtual|uuid|using|union|typename|typeid|typedef|try|true|throw|thread|this|template|switch|struct|static_cast|static|sizeof|selectany|return|reinterpret_cast|register|public|protected|private|nothrow|noreturn|noinline|new|namespace|naked|mutable|inline|if|goto|friend|for|false|extern|explicit|enum|else|dynamic_cast|do|dllimport|dllexport|deprecated|delete|default|continue|const_cast|const|class|catch|case|break|__try|__finally|__exception|__declspec)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: "cs"
|
||||
, _case: true
|
||||
, _main: {
|
||||
mlcom : {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, com : {
|
||||
_match: /\/\/.*/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string : {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, preproc: {
|
||||
_match: /^\s*#.*/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, number : {
|
||||
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:while|volatile|void|virtual|using|ushort|unsafe|unchecked|ulong|uint|typeof|try|true|throw|this|switch|struct|string|static|stackalloc|sizeof|short|sealed|sbyte|return|ref|readonly|public|protected|private|params|override|out|operator|object|null|new|namespace|long|lock|is|internal|interface|int|in|implicit|if|goto|foreach|for|float|fixed|finally|false|extern|explicit|event|enum|else|double|do|delegate|default|decimal|continue|const|class|checked|char|catch|case|byte|break|bool|base|as|abstract)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: 'css'
|
||||
, _case: true
|
||||
, _main: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: olive;"
|
||||
}
|
||||
, directive: {
|
||||
_match: /@\w+/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, block: {
|
||||
_match: /\{([\w\W]*?)\}/
|
||||
, _replace: function( all, pairs ) {
|
||||
return '{' + this.x( pairs, '/definition' ) + '}';
|
||||
}
|
||||
}
|
||||
, 'class': {
|
||||
_match: /\.\w+/
|
||||
, _style: "color: #CC0066; font-weight: bold;"
|
||||
}
|
||||
, id: {
|
||||
_match: /#\w+/
|
||||
, _style: "color: IndianRed; font-weight: bold;"
|
||||
}
|
||||
, pseudo: {
|
||||
_match: /:\w+/
|
||||
, _style: "color: #CC9900;"
|
||||
}
|
||||
, element: {
|
||||
_match: /\w+/
|
||||
, _style: "color: Purple; font-weight: bold;"
|
||||
}
|
||||
}
|
||||
, definition: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(?:zoom|z-index|writing-mode|word-wrap|word-spacing|word-break|width|widows|white-space|volume|voice-family|visibility|vertical-align|unicode-bidi|top|text-underline-position|text-transform|text-shadow|text-overflow|text-kashida-space|text-justify|text-indent|text-decoration|text-autospace|text-align-last|text-align|table-layout|stress|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|size|scrollbar-track-color|scrollbar-shadow-color|scrollbar-highlight-color|scrollbar-face-color|scrollbar-dark-shadow-color|scrollbar-base-color|scrollbar-arrow-color|scrollbar-3d-light-color|ruby-position|ruby-overhang|ruby-align|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-Y|overflow-X|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|line-break|letter-spacing|left|layout-grid-type|layout-grid-mode|layout-grid-line|layout-grid-char-spacing|layout-grid-char|layout-grid|layout-flow|layer-background-image|layer-background-color|include-source|ime-mode|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|filter|empty-cells|elevation|display|direction|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|caption-side|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|behavior|background-repeat|background-position-y|background-position-x|background-position|background-image|background-color|background-attachment|background|azimuth|accelerator)\s*:/
|
||||
, _style: "color: #330066;"
|
||||
}
|
||||
, special: {
|
||||
_match: /\b(?:-use-link-source|-set-link-source|-replace|-moz-user-select|-moz-user-modify|-moz-user-input|-moz-user-focus|-moz-outline-width|-moz-outline-style|-moz-outline-color|-moz-outline|-moz-opacity|-moz-border-top-colors|-moz-border-right-colors|-moz-border-radius-topright|-moz-border-radius-topleft|-moz-border-radius-bottomright|-moz-border-radius-bottomleft|-moz-border-radius|-moz-border-left-colors|-moz-border-bottom-colors|-moz-binding)\s*:/
|
||||
, _style: "color: #330066; text-decoration: underline;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/
|
||||
, _style: "color: #3366FF;"
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number: {
|
||||
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, color : {
|
||||
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: "pas"
|
||||
, _case: true
|
||||
, _main: {
|
||||
mlcom: {
|
||||
_match: /(?:\(\*[\w\W]*?\*\))|(?:{(?!\$)[\w\W]*?})/
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, com: {
|
||||
_match: /\/\/.*/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number: {
|
||||
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:\$[a-zA-Z0-9]+\b)/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, direct: {
|
||||
_match: /\{\$[a-zA-Z]+ .+\}/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?: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|initialization|int64|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|protected|pshortstring|pstring|public|published|pvariant|pwidechar|pwidestring|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)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: 'html'
|
||||
, _case: false
|
||||
, _main: {
|
||||
doctype: {
|
||||
_match: /<!DOCTYPE\b[\w\W]*?>/
|
||||
, _style: "color: #CC6600;"
|
||||
}
|
||||
, ie_style: {
|
||||
_match: /(<!--\[[^\]]*\]>)([\w\W]*?)(<!\[[^\]]*\]-->)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='ie_style'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '//style' )
|
||||
+ "<span class='ie_style'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: DarkSlateGray; font-weight: bold;"
|
||||
}
|
||||
, comment: {
|
||||
_match: /<!--[\w\W]*?-->/
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, script: {
|
||||
_match: /(<script\s+[^>]*>)([\w\W]*?)(<\/script\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'js' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
, style: {
|
||||
_match: /(<style\s+[^>]*>)([\w\W]*?)(<\/style\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'css' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
// matches a starting tag of an element (with attrs)
|
||||
// like "<div ... >" or "<img ... />"
|
||||
, tag_start: {
|
||||
_match: /(<\w+)((?:[?%]>|[\w\W])*?)(\/>|>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='tag_start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '/tag_attrs' )
|
||||
+ "<span class='tag_start'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
// matches an ending tag
|
||||
// like "</div>"
|
||||
, tag_end: {
|
||||
_match: /<\/\w+\s*>|\/>/
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
, entity: {
|
||||
_match: /&\w+?;/
|
||||
, _style: "color: blue;"
|
||||
}
|
||||
}
|
||||
, tag_attrs: {
|
||||
// matches a name/value pair
|
||||
attr: {
|
||||
// before in $1, name in $2, between in $3, value in $4
|
||||
_match: /(\W*?)([\w-]+)(\s*=\s*)((?:\'[^\']*(?:\\.[^\']*)*\')|(?:\"[^\"]*(?:\\.[^\"]*)*\"))/
|
||||
, _replace: "$1<span class='attr_name'>$2</span>$3<span class='attr_value'>$4</span>"
|
||||
, _style: { attr_name: "color: green;", attr_value: "color: maroon;" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: "java"
|
||||
, _case: true
|
||||
, _main: {
|
||||
mlcom : {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, com : {
|
||||
_match: /\/\/.*/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string : {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number : {
|
||||
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:0x[a-f0-9]+)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, meta : {
|
||||
_match: /(?!\@interface\b)\@[\$\w]+\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:while|volatile|void|try|true|transient|throws|throw|this|synchronized|switch|super|strictfp|static|short|return|public|protected|private|package|null|new|native|long|interface|int|instanceof|import|implements|if|goto|for|float|finally|final|false|extends|enum|else|double|do|default|continue|const|class|char|catch|case|byte|break|boolean|assert|abstract)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,534 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
||||
( function($) {
|
||||
|
||||
ChiliBook = { //implied global
|
||||
|
||||
version: "2.0" // 2008-05-12
|
||||
|
||||
// options --------------------------------------------------------------------
|
||||
|
||||
, automatic: true
|
||||
, automaticSelector: "code"
|
||||
|
||||
, codeLanguage: function( el ) {
|
||||
var recipeName = $( el ).attr( "class" );
|
||||
return recipeName ? recipeName : '';
|
||||
}
|
||||
|
||||
, recipeLoading: true
|
||||
, recipeFolder: "" // used like: recipeFolder + recipeName + '.js'
|
||||
|
||||
, replaceSpace: " " // use an empty string for not replacing
|
||||
, replaceTab: "    " // use an empty string for not replacing
|
||||
, replaceNewLine: " <br/>" // use an empty string for not replacing
|
||||
|
||||
// ------------------------------------------------------------- end of options
|
||||
|
||||
, data: {} // use this for your data
|
||||
|
||||
, defaultReplacement: '<span class="$0">$$</span>' // TODO: make this an option again
|
||||
, recipes: {} //repository
|
||||
, queue: {} //register
|
||||
|
||||
//fix for IE: copy of PREformatted text strips off all html, losing newlines
|
||||
, preFixCopy: document.selection && document.selection.createRange
|
||||
, preContent: ""
|
||||
, preElement: null
|
||||
|
||||
, unique: function() {
|
||||
return (new Date()).valueOf();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$.fn.chili = function( options ) {
|
||||
var book = $.extend( {}, ChiliBook, options || {} );
|
||||
|
||||
function cook( ingredients, recipe, blockName ) {
|
||||
|
||||
function prepareBlock( recipe, blockName ) {
|
||||
var steps = [];
|
||||
for( var stepName in recipe[ blockName ] ) {
|
||||
steps.push( prepareStep( recipe, blockName, stepName ) );
|
||||
}
|
||||
return steps;
|
||||
} // prepareBlock
|
||||
|
||||
function prepareStep( recipe, blockName, stepName ) {
|
||||
var step = recipe[ blockName ][ stepName ];
|
||||
var exp = ( typeof step._match == "string" ) ? step._match : step._match.source;
|
||||
return {
|
||||
recipe: recipe
|
||||
, blockName: blockName
|
||||
, stepName: stepName
|
||||
, exp: "(" + exp + ")"
|
||||
, length: 1 // add 1 to account for the newly added parentheses
|
||||
+ (exp // count number of submatches in here
|
||||
.replace( /\\./g, "%" ) // disable any escaped character
|
||||
.replace( /\[.*?\]/g, "%" ) // disable any character class
|
||||
.match( /\((?!\?)/g ) // match any open parenthesis, not followed by a ?
|
||||
|| [] // make sure it is an empty array if there are no matches
|
||||
).length // get the number of matches
|
||||
, replacement: step._replace ? step._replace : book.defaultReplacement
|
||||
};
|
||||
} // prepareStep
|
||||
|
||||
function knowHow( steps ) {
|
||||
var prevLength = 1;
|
||||
var exps = [];
|
||||
for (var i = 0; i < steps.length; i++) {
|
||||
var exp = steps[ i ].exp;
|
||||
// adjust backreferences
|
||||
exp = exp.replace( /\\\\|\\(\d+)/g, function( m, aNum ) {
|
||||
return !aNum ? m : "\\" + ( prevLength + 1 + parseInt( aNum, 10 ) );
|
||||
} );
|
||||
exps.push( exp );
|
||||
prevLength += steps[ i ].length;
|
||||
}
|
||||
var prolog = '((?:\\s|\\S)*?)';
|
||||
var epilog = '((?:\\s|\\S)+)';
|
||||
var source = '(?:' + exps.join( "|" ) + ')';
|
||||
source = prolog + source + '|' + epilog;
|
||||
return new RegExp( source, recipe._case ? "g" : "gi" );
|
||||
} // knowHow
|
||||
|
||||
function escapeHTML( str ) {
|
||||
return str.replace( /&/g, "&" ).replace( /</g, "<" );
|
||||
} // escapeHTML
|
||||
|
||||
function replaceSpaces( str ) {
|
||||
return str.replace( / +/g, function( spaces ) {
|
||||
return spaces.replace( / /g, replaceSpace );
|
||||
} );
|
||||
} // replaceSpaces
|
||||
|
||||
function filter( str ) {
|
||||
str = escapeHTML( str );
|
||||
if( replaceSpace ) {
|
||||
str = replaceSpaces( str );
|
||||
}
|
||||
return str;
|
||||
} // filter
|
||||
|
||||
function applyRecipe( subject, recipe ) {
|
||||
return cook( subject, recipe );
|
||||
} // applyRecipe
|
||||
|
||||
function applyBlock( subject, recipe, blockName ) {
|
||||
return cook( subject, recipe, blockName );
|
||||
} // applyBlock
|
||||
|
||||
function applyStep( subject, recipe, blockName, stepName ) {
|
||||
var replaceSpace = book.replaceSpace;
|
||||
|
||||
var step = prepareStep( recipe, blockName, stepName );
|
||||
var steps = [step];
|
||||
|
||||
var perfect = subject.replace( knowHow( steps ), function() {
|
||||
return chef.apply( { steps: steps }, arguments );
|
||||
} );
|
||||
return perfect;
|
||||
} // applyStep
|
||||
|
||||
function applyModule( subject, module, context ) {
|
||||
if( ! module ) {
|
||||
return filter( subject );
|
||||
}
|
||||
|
||||
var sub = module.split( '/' );
|
||||
var recipeName = '';
|
||||
var blockName = '';
|
||||
var stepName = '';
|
||||
switch( sub.length ) {
|
||||
case 1:
|
||||
recipeName = sub[0];
|
||||
break;
|
||||
case 2:
|
||||
recipeName = sub[0]; blockName = sub[1];
|
||||
break;
|
||||
case 3:
|
||||
recipeName = sub[0]; blockName = sub[1]; stepName = sub[2];
|
||||
break;
|
||||
default:
|
||||
return filter( subject );
|
||||
}
|
||||
|
||||
function getRecipe( recipeName ) {
|
||||
var path = getPath( recipeName );
|
||||
var recipe = book.recipes[ path ];
|
||||
if( ! recipe ) {
|
||||
throw {msg:"recipe not available"};
|
||||
}
|
||||
return recipe;
|
||||
}
|
||||
|
||||
try {
|
||||
var recipe;
|
||||
if ( '' == stepName ) {
|
||||
if ( '' == blockName ) {
|
||||
if ( '' == recipeName ) {
|
||||
//nothing to do
|
||||
}
|
||||
else { // ( '' != recipeName )
|
||||
recipe = getRecipe( recipeName );
|
||||
return applyRecipe( subject, recipe );
|
||||
}
|
||||
}
|
||||
else { // ( '' != blockName )
|
||||
if( '' == recipeName ) {
|
||||
recipe = context.recipe;
|
||||
}
|
||||
else {
|
||||
recipe = getRecipe( recipeName );
|
||||
}
|
||||
if( ! (blockName in recipe) ) {
|
||||
return filter( subject );
|
||||
}
|
||||
return applyBlock( subject, recipe, blockName );
|
||||
}
|
||||
}
|
||||
else { // ( '' != stepName )
|
||||
if( '' == recipeName ) {
|
||||
recipe = context.recipe;
|
||||
}
|
||||
else {
|
||||
recipe = getRecipe( recipeName );
|
||||
}
|
||||
if( '' == blockName ) {
|
||||
blockName = context.blockName;
|
||||
}
|
||||
if( ! (blockName in recipe) ) {
|
||||
return filter( subject );
|
||||
}
|
||||
if( ! (stepName in recipe[blockName]) ) {
|
||||
return filter( subject );
|
||||
}
|
||||
return applyStep( subject, recipe, blockName, stepName );
|
||||
}
|
||||
}
|
||||
catch( e ) {
|
||||
if (e.msg && e.msg == "recipe not available") {
|
||||
var cue = 'chili_' + book.unique();
|
||||
if( book.recipeLoading ) {
|
||||
var path = getPath( recipeName );
|
||||
if( ! book.queue[ path ] ) {
|
||||
/* this is a new recipe to download */
|
||||
try {
|
||||
book.queue[ path ] = [ {cue: cue, subject: subject, module: module, context: context} ];
|
||||
$.getJSON( path, function( recipeLoaded ) {
|
||||
book.recipes[ path ] = recipeLoaded;
|
||||
var q = book.queue[ path ];
|
||||
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
|
||||
var replacement = applyModule( q[ i ].subject, q[ i ].module, q[ i ].context );
|
||||
if( book.replaceTab ) {
|
||||
replacement = replacement.replace( /\t/g, book.replaceTab );
|
||||
}
|
||||
if( book.replaceNewLine ) {
|
||||
replacement = replacement.replace( /\n/g, book.replaceNewLine );
|
||||
}
|
||||
$( '#' + q[ i ].cue ).replaceWith( replacement );
|
||||
}
|
||||
} );
|
||||
}
|
||||
catch( recipeNotAvailable ) {
|
||||
alert( "the recipe for '" + recipeName + "' was not found in '" + path + "'" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not a new recipe, so just enqueue this element */
|
||||
book.queue[ path ].push( {cue: cue, subject: subject, module: module, context: context} );
|
||||
}
|
||||
return '<span id="' + cue + '">' + filter( subject ) + '</span>';
|
||||
}
|
||||
return filter( subject );
|
||||
}
|
||||
else {
|
||||
return filter( subject );
|
||||
}
|
||||
}
|
||||
} // applyModule
|
||||
|
||||
function addPrefix( prefix, replacement ) {
|
||||
var aux = replacement.replace( /(<span\s+class\s*=\s*(["']))((?:(?!__)\w)+\2\s*>)/ig, "$1" + prefix + "__$3" );
|
||||
return aux;
|
||||
} // addPrefix
|
||||
|
||||
function chef() {
|
||||
if (! arguments[ 0 ]) {
|
||||
return '';
|
||||
}
|
||||
var steps = this.steps;
|
||||
var i = 0; // iterate steps
|
||||
var j = 2; // iterate chef's arguments
|
||||
var prolog = arguments[ 1 ];
|
||||
var epilog = arguments[ arguments.length - 3 ];
|
||||
if (! epilog) {
|
||||
var step;
|
||||
while( step = steps[ i++ ] ) {
|
||||
var aux = arguments; // this unmasks chef's arguments inside the next function
|
||||
if( aux[ j ] ) {
|
||||
var replacement = '';
|
||||
if( $.isFunction( step.replacement ) ) {
|
||||
var matches = []; //Array.slice.call( aux, j, step.length );
|
||||
for (var k = 0, kTop = step.length; k < kTop; k++) {
|
||||
matches.push( aux[ j + k ] );
|
||||
}
|
||||
matches.push( aux[ aux.length - 2 ] );
|
||||
matches.push( aux[ aux.length - 1 ] );
|
||||
replacement = step.replacement
|
||||
.apply( {
|
||||
x: function() {
|
||||
var subject = arguments[0];
|
||||
var module = arguments[1];
|
||||
var context = {
|
||||
recipe: step.recipe
|
||||
, blockName: step.blockName
|
||||
};
|
||||
return applyModule( subject, module, context );
|
||||
}
|
||||
}, matches );
|
||||
}
|
||||
else { //we expect step.replacement to be a string
|
||||
replacement = step.replacement
|
||||
.replace( /(\\\$)|(?:\$\$)|(?:\$(\d+))/g, function( m, escaped, K ) {
|
||||
if( escaped ) { /* \$ */
|
||||
return "$";
|
||||
}
|
||||
else if( !K ) { /* $$ */
|
||||
return filter( aux[ j ] );
|
||||
}
|
||||
else if( K == "0" ) { /* $0 */
|
||||
return step.stepName;
|
||||
}
|
||||
else { /* $K */
|
||||
return filter( aux[ j + parseInt( K, 10 ) ] );
|
||||
}
|
||||
} );
|
||||
}
|
||||
replacement = addPrefix( step.recipe._name, replacement );
|
||||
return filter( prolog ) + replacement;
|
||||
}
|
||||
else {
|
||||
j+= step.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return filter( epilog );
|
||||
}
|
||||
} // chef
|
||||
|
||||
if( ! blockName ) {
|
||||
blockName = '_main';
|
||||
checkSpices( recipe );
|
||||
}
|
||||
if( ! (blockName in recipe) ) {
|
||||
return filter( ingredients );
|
||||
}
|
||||
var replaceSpace = book.replaceSpace;
|
||||
var steps = prepareBlock( recipe, blockName );
|
||||
var kh = knowHow( steps );
|
||||
var perfect = ingredients.replace( kh, function() {
|
||||
return chef.apply( { steps: steps }, arguments );
|
||||
} );
|
||||
return perfect;
|
||||
|
||||
} // cook
|
||||
|
||||
function load_stylesheet_inline( sourceCode ) {
|
||||
if( document.createElement ) {
|
||||
var e = document.createElement( "style" );
|
||||
e.type = "text/css";
|
||||
if( e.styleSheet ) { // IE
|
||||
e.styleSheet.cssText = sourceCode;
|
||||
}
|
||||
else {
|
||||
var t = document.createTextNode( sourceCode );
|
||||
e.appendChild( t );
|
||||
}
|
||||
document.getElementsByTagName( "head" )[0].appendChild( e );
|
||||
}
|
||||
} // load_stylesheet_inline
|
||||
|
||||
function checkSpices( recipe ) {
|
||||
var name = recipe._name;
|
||||
if( ! book.queue[ name ] ) {
|
||||
|
||||
var content = ['/* Chili -- ' + name + ' */'];
|
||||
for (var blockName in recipe) {
|
||||
if( blockName.search( /^_(?!main\b)/ ) < 0 ) {
|
||||
for (var stepName in recipe[ blockName ]) {
|
||||
var step = recipe[ blockName ][ stepName ];
|
||||
if( '_style' in step ) {
|
||||
if( step[ '_style' ].constructor == String ) {
|
||||
content.push( '.' + name + '__' + stepName + ' { ' + step[ '_style' ] + ' }' );
|
||||
}
|
||||
else {
|
||||
for (var className in step[ '_style' ]) {
|
||||
content.push( '.' + name + '__' + className + ' { ' + step[ '_style' ][ className ] + ' }' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
content = content.join('\n');
|
||||
|
||||
load_stylesheet_inline( content );
|
||||
|
||||
book.queue[ name ] = true;
|
||||
}
|
||||
} // checkSpices
|
||||
|
||||
function askDish( el ) {
|
||||
var recipeName = book.codeLanguage( el );
|
||||
if( '' != recipeName ) {
|
||||
var path = getPath( recipeName );
|
||||
if( book.recipeLoading ) {
|
||||
/* dynamic setups come here */
|
||||
if( ! book.queue[ path ] ) {
|
||||
/* this is a new recipe to download */
|
||||
try {
|
||||
book.queue[ path ] = [ el ];
|
||||
$.getJSON( path, function( recipeLoaded ) {
|
||||
book.recipes[ path ] = recipeLoaded;
|
||||
var q = book.queue[ path ];
|
||||
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
|
||||
makeDish( q[ i ], path );
|
||||
}
|
||||
} );
|
||||
}
|
||||
catch( recipeNotAvailable ) {
|
||||
alert( "the recipe for '" + recipeName + "' was not found in '" + path + "'" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not a new recipe, so just enqueue this element */
|
||||
book.queue[ path ].push( el );
|
||||
}
|
||||
/* a recipe could have been already downloaded */
|
||||
makeDish( el, path );
|
||||
}
|
||||
else {
|
||||
/* static setups come here */
|
||||
makeDish( el, path );
|
||||
}
|
||||
}
|
||||
} // askDish
|
||||
|
||||
function makeDish( el, recipePath ) {
|
||||
var recipe = book.recipes[ recipePath ];
|
||||
if( ! recipe ) {
|
||||
return;
|
||||
}
|
||||
var $el = $( el );
|
||||
var ingredients = $el.text();
|
||||
if( ! ingredients ) {
|
||||
return;
|
||||
}
|
||||
// hack for IE: \r is used instead of \n
|
||||
ingredients = ingredients.replace(/\r\n?/g, "\n");
|
||||
|
||||
var dish = cook( ingredients, recipe ); // all happens here
|
||||
|
||||
if( book.replaceTab ) {
|
||||
dish = dish.replace( /\t/g, book.replaceTab );
|
||||
}
|
||||
if( book.replaceNewLine ) {
|
||||
dish = dish.replace( /\n/g, book.replaceNewLine );
|
||||
}
|
||||
|
||||
el.innerHTML = dish; //much faster than $el.html( dish );
|
||||
|
||||
if( ChiliBook.preFixCopy ) {
|
||||
$el
|
||||
.parents()
|
||||
.filter( "pre" )
|
||||
.bind( "mousedown", function() {
|
||||
ChiliBook.preElement = this;
|
||||
} )
|
||||
.bind( "mouseup", function() {
|
||||
if( ChiliBook.preElement == this ) {
|
||||
ChiliBook.preContent = document.selection.createRange().htmlText;
|
||||
}
|
||||
} )
|
||||
;
|
||||
}
|
||||
} // makeDish
|
||||
|
||||
function getPath( recipeName ) {
|
||||
return book.recipeFolder + recipeName + ".js";
|
||||
} // getPath
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// the coloring starts here
|
||||
this
|
||||
.each( function() {
|
||||
var $this = $( this );
|
||||
$this.trigger( 'chili.before_coloring' );
|
||||
askDish( this );
|
||||
$this.trigger( 'chili.after_coloring' );
|
||||
} );
|
||||
|
||||
return this;
|
||||
//-----------------------------------------------------------------------------
|
||||
};
|
||||
|
||||
|
||||
|
||||
//main
|
||||
$( function() {
|
||||
|
||||
if( ChiliBook.automatic ) {
|
||||
$( ChiliBook.automaticSelector ).chili();
|
||||
}
|
||||
|
||||
if( ChiliBook.preFixCopy ) {
|
||||
function preformatted( text ) {
|
||||
if( '' == text ) {
|
||||
return "";
|
||||
}
|
||||
do {
|
||||
var newline_flag = ChiliBook.unique();
|
||||
}
|
||||
while( text.indexOf( newline_flag ) > -1 );
|
||||
text = text.replace( /\<br[^>]*?\>/ig, newline_flag );
|
||||
var el = document.createElement( '<pre>' );
|
||||
el.innerHTML = text;
|
||||
text = el.innerText.replace( new RegExp( newline_flag, "g" ), '\r\n' );
|
||||
return text;
|
||||
}
|
||||
|
||||
$( "body" )
|
||||
.bind( "copy", function() {
|
||||
if( '' != ChiliBook.preContent ) {
|
||||
window.clipboardData.setData( 'Text', preformatted( ChiliBook.preContent ) );
|
||||
event.returnValue = false;
|
||||
}
|
||||
} )
|
||||
.bind( "mousedown", function() {
|
||||
ChiliBook.preContent = "";
|
||||
} )
|
||||
.bind( "mouseup", function() {
|
||||
ChiliBook.preElement = null;
|
||||
} )
|
||||
;
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
} ) ( jQuery );
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: 'js'
|
||||
, _case: true
|
||||
, _main: {
|
||||
ml_comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: 'color: gray;'
|
||||
}
|
||||
, sl_comment: {
|
||||
_match: /\/\/.*/
|
||||
, _style: 'color: green;'
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: 'color: teal;'
|
||||
}
|
||||
, num: {
|
||||
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
|
||||
, _style: 'color: red;'
|
||||
}
|
||||
, reg_not: { //this prevents "a / b / c" to be interpreted as a reg_exp
|
||||
_match: /(?:\w+\s*)\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*(?:\s*\w+)/
|
||||
, _replace: function( all ) {
|
||||
return this.x( all, '//num' );
|
||||
}
|
||||
}
|
||||
, reg_exp: {
|
||||
_match: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/
|
||||
, _style: 'color: maroon;'
|
||||
}
|
||||
, brace: {
|
||||
_match: /[\{\}]/
|
||||
, _style: 'color: red; font-weight: bold;'
|
||||
}
|
||||
, statement: {
|
||||
_match: /\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/
|
||||
, _style: 'color: navy; font-weight: bold;'
|
||||
}
|
||||
, error: {
|
||||
_match: /\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/
|
||||
, _style: 'color: Coral;'
|
||||
}
|
||||
, object: {
|
||||
_match: /\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/
|
||||
, _style: 'color: DeepPink;'
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(undefined|arguments|NaN|Infinity)\b/
|
||||
, _style: 'color: Purple; font-weight: bold;'
|
||||
}
|
||||
, 'function': {
|
||||
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
|
||||
, _style: 'color: olive;'
|
||||
}
|
||||
, operator: {
|
||||
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
|
||||
, _style: 'color: RoyalBlue; font-weight: bold;'
|
||||
}
|
||||
, liveconnect: {
|
||||
_match: /\b(sun|netscape|java|Packages|JavaPackage|JavaObject|JavaClass|JavaArray|JSObject|JSException)\b/
|
||||
, _style: 'text-decoration: overline;'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: "ls"
|
||||
, _case: false
|
||||
, _main: {
|
||||
mlcom: {
|
||||
_match: /((?:^|\n)%REM\b.*)([\w\W]*?)(\n%END\s*REM\b.*)/
|
||||
, _replace: '<span class="directive">$1</span><span class="mlcom">$2</span><span class="directive">$3</span>'
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, com: {
|
||||
_match: /(?:\'.*)|(?:\bREM\b.*)/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, mlstr: {
|
||||
_match: /(?:\{[^}]*\})|(?:\|[^|]*\|)/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, str: {
|
||||
_match: /(?:\"[^\"].*?\")|\"\"/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, keyd: {
|
||||
_match: /\b(?:Ustring|Uchr|Ucase|Trim|Time|Strtoken|Strrightback|Strright|Strleftback|Strleft|String|Str|Space|Rtrim|Rightc|Rightbp|Rightb|Right|Oct|Midc|Midbp|Midb|Mid|Ltrim|Leftc|Leftbp|Leftb|Left|Lcase|Inputbp|Inputbox|Inputb|Input|Implode|Hex|Format|Error|Environ|Dir|Date|Curdrive|Curdir|Command|Chr|Bin)[$](?:\s)/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, keyw: {
|
||||
_match: /\b(?:Yield|Year|Xor|Write|With|Width|While|Wend|Weekday|Vartype|Variant|Val|Ustring|Uselsx|Use|Until|Unlock|Unicode|Uni|Uchr|Ucase|Ubound|Typename|Type|True|Trim|Today|To|Timevalue|Timeserial|Timer|Timenumber|Time|Then|Text|Tan|Tab|Sub|Strtoken|Strrightback|Strright|Strleftback|Strleft|String|Strconv|Strcompare|Strcomp|Str|Stop|Step|Static|Sqr|Split|Spc|Space|Sleep|Single|Sin|Shell|Shared|Sgn|Setfileattr|Setattr|Set|Sendkeys|Select|Seek|Second|Rtrim|Rset|Round|Rnd|Rmdir|Rightc|Rightbp|Rightb|Right|Return|Resume|Reset|Replace|Remove|Redim|Read|Randomize|Random|Put|Published|Public|Property|Private|Print|Preserve|Pitch|Pi|Output|Or|Option|Open|On|Oct|Null|Now|Nothing|Not|Nopitch|Nocase|Next|New|Name|Msgbox|Month|Mod|Mkdir|Minute|Midc|Midbp|Midb|Mid|Messagebox|Me|Ltrim|Lsserver|Lsi_info|Lset|Loop|Long|Log|Lof|Lock|Loc|Lmbcs|Listtag|List|Line|Like|Lib|Let|Lenc|Lenbp|Lenb|Len|Leftc|Leftbp|Leftb|Left|Lcase|Lbound|Kill|Join|Isunknown|Isscalar|Isobject|Isnumeric|Isnull|Islist|Isempty|Iselement|Isdate|Isarray|Isa|Is|Integer|Int|Instrc|Instrbp|Instrb|Instr|Inputbp|Inputbox|Inputb|Input|In|Implode|Imp|Imestatus|Imesetmode|If|Hour|Hex|Goto|Gosub|Getthreadinfo|Getfileattr|Getattr|Get|Function|Fulltrim|From|Freefile|Fraction|Format|Forall|For|Fix|Filelen|Filedatetime|Filecopy|Fileattr|False|Explicit|Exp|Exit|Execute|Event|Evaluate|Error|Err|Erl|Erase|Eqv|Eof|Environ|End|Elseif|Else|Double|Doevents|Do|Dir|Dim|Destroylock|Delete|Defvar|Defstr|Defsng|Deflng|Defint|Defdbl|Defcur|Defbyte|Defbool|Declare|Day|Datevalue|Dateserial|Datenumber|Date|Datatype|Cvdate|Cvar|Currency|Curdrive|Curdir|Cstr|Csng|Createlock|Cos|Const|Compare|Command|Codeunlock|Codelockcheck|Codelock|Close|Clng|Class|Cint|Chr|Chdrive|Chdir|Cdbl|Cdat|Ccur|Cbyte|Cbool|Case|Call|Byval|Byte|Boolean|Bind|Binary|Bin|Beep|Base|Atn2|Atn|Asin|Asc|As|Arrayunique|Arrayreplace|Arraygetindex|Arrayappend|Append|Appactivate|Any|And|Alias|Activateapp|Acos|Access|Abs)\b/
|
||||
, _style: "color: maroon; font-weight: bold;"
|
||||
}
|
||||
, directive: {
|
||||
_match: /((?:^|\n)(?:%if|%end|%elseif|%else)\b)|(?:(?:^|\n)%include\b.*)/
|
||||
, _style: "color: #5f5f5f;"
|
||||
}
|
||||
, notes: {
|
||||
_match: /\b(?:NotesXSLTransformer|NotesXMLProcessor|NotesViewNavigator|NotesViewEntryCollection|NotesViewEntry|NotesViewColumn|NotesView|NotesTimer|NotesStream|NotesSession|NotesSAXParser|NotesSAXException|NotesSAXAttributeList|NotesRichTextTable|NotesRichTextTab|NotesRichTextStyle|NotesRichTextSection|NotesRichTextRange|NotesRichTextParagraphStyle|NotesRichTextNavigator|NotesRichTextItem|NotesRichTextDocLink|NotesReplicationEntry|NotesReplication|NotesRegistration|NotesOutlineEntry|NotesOutline|NotesNoteCollection|NotesNewsLetter|NotesName|NotesMIMEHeader|NotesMIMEEntity|NotesLog|NotesItem|NotesInternational|NotesForm|NotesEmbeddedObject|NotesDocumentCollection|NotesDocument|NotesDbDirectory|NotesDateTime|NotesDateRange|NotesDatabase|NotesDXLImporter|NotesDXLExporter|NotesDOMXMLDeclNode|NotesDOMTextNode|NotesDOMProcessingInstructionNode|NotesDOMParser|NotesDOMNotationNode|NotesDOMNodeList|NotesDOMNode|NotesDOMNamedNodeMap|NotesDOMEntityReferenceNode|NotesDOMEntityNode|NotesDOMElementNode|NotesDOMDocumentTypeNode|NotesDOMDocumentNode|NotesDOMDocumentFragmentNode|NotesDOMCommentNode|NotesDOMCharacterDataNode|NotesDOMCDATASectionNode|NotesDOMAttributeNode|NotesColorObject|NotesAgent|NotesAdministrationProcess|NotesACLEntry|NotesACL)\b/
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
, notesui: {
|
||||
_match: /\b(?:NotesUIWorkspace|NotesUIView|NotesUIScheduler|NotesUIDocument|NotesUIDatabase|Navigator|Field|Button)\b/
|
||||
, _style: "color: purple;"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: "sql"
|
||||
, _case: false
|
||||
, _main: {
|
||||
mlcom: {
|
||||
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
|
||||
, _style: "color: gray;"
|
||||
}
|
||||
, com: {
|
||||
_match: /(?:--\s+.*)|(?:[^\\]\#.*)/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string: {
|
||||
_match: /([\"\'])(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/
|
||||
, _style: "color: purple;"
|
||||
}
|
||||
, quid: {
|
||||
_match: /(`)(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:NULL|TRUE|FALSE)\b/
|
||||
, _style: "color: gray; font-weight: bold;"
|
||||
}
|
||||
, number: {
|
||||
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, hexnum: {
|
||||
_match: /\b0[xX][\dA-Fa-f]+\b|\b[xX]([\'\"])[\dA-Fa-f]+\1/
|
||||
, _style: "color: red; font-weight: bold;"
|
||||
}
|
||||
, variable: {
|
||||
_match: /@([$.\w]+|([`\"\'])(?:(?:[^\2\\\r\n]*?(?:\2\2|\\.))*[^\2\\\r\n]*?)\2)/
|
||||
, _replace: '<span class="keyword">@</span><span class="variable">$1</span>'
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:A(?:CTION|DD|FTER|G(?:AINST|GREGATE)|L(?:GORITHM|L|TER)|N(?:ALYZE|D|Y)|S(?:C(?:II|)|ENSITIVE|)|UTO_INCREMENT|VG(?:_ROW_LENGTH|))|B(?:ACKUP|DB|E(?:FORE|GIN|RKELEYDB|TWEEN)|I(?:GINT|N(?:ARY|LOG)|T)|LOB|O(?:OL(?:EAN|)|TH)|TREE|Y(?:TE|))|C(?:A(?:CHE|LL|S(?:CADE(?:D|)|E))|H(?:A(?:IN|NGE(?:D|)|R(?:ACTER|SET|))|ECK(?:SUM|))|IPHER|L(?:IENT|OSE)|O(?:DE|L(?:LAT(?:E|ION)|UMN(?:S|))|M(?:M(?:ENT|IT(?:TED|))|P(?:ACT|RESSED))|N(?:CURRENT|DITION|NECTION|S(?:ISTENT|TRAINT)|T(?:AINS|INUE)|VERT))|R(?:EATE|OSS)|U(?:BE|R(?:RENT_(?:DATE|TIME(?:STAMP|)|USER)|SOR)))|D(?:A(?:T(?:A(?:BASE(?:S|)|)|E(?:TIME|))|Y(?:_(?:HOUR|MI(?:CROSECOND|NUTE)|SECOND)|))|E(?:ALLOCATE|C(?:IMAL|LARE|)|F(?:AULT|INER)|L(?:AY(?:ED|_KEY_WRITE)|ETE)|S(?:C(?:RIBE|)|_KEY_FILE)|TERMINISTIC)|I(?:RECTORY|S(?:ABLE|CARD|TINCT(?:ROW|))|V)|O(?:UBLE|)|ROP|U(?:AL|MPFILE|PLICATE)|YNAMIC)|E(?:ACH|LSE(?:IF|)|N(?:ABLE|CLOSED|D|GINE(?:S|)|UM)|RRORS|SCAPE(?:D|)|VENTS|X(?:ECUTE|I(?:STS|T)|P(?:ANSION|LAIN)|TENDED))|F(?:A(?:LSE|ST)|ETCH|I(?:ELDS|LE|RST|XED)|L(?:OAT(?:4|8|)|USH)|O(?:R(?:CE|EIGN|)|UND)|R(?:AC_SECOND|OM)|U(?:LL(?:TEXT|)|NCTION))|G(?:E(?:OMETRY(?:COLLECTION|)|T_FORMAT)|LOBAL|R(?:ANT(?:S|)|OUP))|H(?:A(?:NDLER|SH|VING)|ELP|IGH_PRIORITY|O(?:STS|UR(?:_(?:MI(?:CROSECOND|NUTE)|SECOND)|)))|I(?:DENTIFIED|F|GNORE|MPORT|N(?:DEX(?:ES|)|FILE|N(?:ER|O(?:BASE|DB))|OUT|SE(?:NSITIVE|RT(?:_METHOD|))|T(?:1|2|3|4|8|E(?:GER|RVAL)|O|)|VOKER|)|O_THREAD|S(?:OLATION|SUER|)|TERATE)|JOIN|K(?:EY(?:S|)|ILL)|L(?:A(?:NGUAGE|ST)|E(?:A(?:DING|VE(?:S|))|FT|VEL)|I(?:KE|MIT|NES(?:TRING|))|O(?:AD|C(?:AL(?:TIME(?:STAMP|)|)|K(?:S|))|GS|NG(?:BLOB|TEXT|)|OP|W_PRIORITY))|M(?:A(?:STER(?:_(?:CONNECT_RETRY|HOST|LOG_(?:FILE|POS)|P(?:ASSWORD|ORT)|S(?:ERVER_ID|SL(?:_(?:C(?:A(?:PATH|)|ERT|IPHER)|KEY)|))|USER)|)|TCH|X_(?:CONNECTIONS_PER_HOUR|QUERIES_PER_HOUR|ROWS|U(?:PDATES_PER_HOUR|SER_CONNECTIONS)))|E(?:DIUM(?:BLOB|INT|TEXT|)|RGE)|I(?:CROSECOND|DDLEINT|GRATE|N(?:UTE(?:_(?:MICROSECOND|SECOND)|)|_ROWS))|O(?:D(?:E|IF(?:IES|Y)|)|NTH)|U(?:LTI(?:LINESTRING|PO(?:INT|LYGON))|TEX))|N(?:A(?:ME(?:S|)|T(?:IONAL|URAL))|CHAR|DB(?:CLUSTER|)|E(?:W|XT)|O(?:NE|T|_WRITE_TO_BINLOG|)|U(?:LL|MERIC)|VARCHAR)|O(?:FFSET|LD_PASSWORD|N(?:E(?:_SHOT|)|)|P(?:EN|TI(?:MIZE|ON(?:ALLY|)))|R(?:DER|)|UT(?:ER|FILE|))|P(?:A(?:CK_KEYS|RTIAL|SSWORD)|HASE|O(?:INT|LYGON)|R(?:E(?:CISION|PARE|V)|I(?:MARY|VILEGES)|OCE(?:DURE|SS(?:LIST|)))|URGE)|QU(?:ARTER|ERY|ICK)|R(?:AID(?:0|_(?:CHUNKS(?:IZE|)|TYPE))|E(?:A(?:D(?:S|)|L)|COVER|DUNDANT|FERENCES|GEXP|L(?:AY_(?:LOG_(?:FILE|POS)|THREAD)|EASE|OAD)|NAME|P(?:AIR|EAT(?:ABLE|)|L(?:ACE|ICATION))|QUIRE|S(?:ET|T(?:ORE|RICT)|UME)|TURN(?:S|)|VOKE)|IGHT|LIKE|O(?:LL(?:BACK|UP)|UTINE|W(?:S|_FORMAT|))|TREE)|S(?:AVEPOINT|CHEMA(?:S|)|E(?:C(?:OND(?:_MICROSECOND|)|URITY)|LECT|NSITIVE|PARATOR|RIAL(?:IZABLE|)|SSION|T)|H(?:ARE|OW|UTDOWN)|I(?:GNED|MPLE)|LAVE|MALLINT|NAPSHOT|O(?:ME|NAME|UNDS)|P(?:ATIAL|ECIFIC)|QL(?:EXCEPTION|STATE|WARNING|_(?:B(?:IG_RESULT|UFFER_RESULT)|CA(?:CHE|LC_FOUND_ROWS)|NO_CACHE|SMALL_RESULT|T(?:HREAD|SI_(?:DAY|FRAC_SECOND|HOUR|M(?:INUTE|ONTH)|QUARTER|SECOND|WEEK|YEAR)))|)|SL|T(?:A(?:RT(?:ING|)|TUS)|O(?:P|RAGE)|R(?:AIGHT_JOIN|I(?:NG|PED)))|U(?:BJECT|PER|SPEND))|T(?:ABLE(?:S(?:PACE|)|)|E(?:MP(?:ORARY|TABLE)|RMINATED|XT)|HEN|I(?:ME(?:STAMP(?:ADD|DIFF|)|)|NY(?:BLOB|INT|TEXT))|O|R(?:A(?:ILING|NSACTION)|IGGER(?:S|)|U(?:E|NCATE))|YPE(?:S|))|U(?:N(?:COMMITTED|D(?:EFINED|O)|I(?:CODE|ON|QUE)|KNOWN|LOCK|SIGNED|TIL)|P(?:DATE|GRADE)|S(?:AGE|E(?:R(?:_RESOURCES|)|_FRM|)|ING)|TC_(?:DATE|TIME(?:STAMP|)))|V(?:A(?:LUE(?:S|)|R(?:BINARY|CHAR(?:ACTER|)|IABLES|YING))|IEW)|W(?:ARNINGS|EEK|H(?:E(?:N|RE)|ILE)|ITH|ORK|RITE)|X(?:509|A|OR)|YEAR(?:_MONTH|)|ZEROFILL)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
, 'function': {
|
||||
_match: /\b(?:A(?:BS|COS|DD(?:DATE|TIME)|ES_(?:DECRYPT|ENCRYPT)|REA|S(?:BINARY|IN|TEXT|WK(?:B|T))|TAN(?:2|))|B(?:ENCHMARK|I(?:N|T_(?:AND|COUNT|LENGTH|OR|XOR)))|C(?:AST|E(?:IL(?:ING|)|NTROID)|HAR(?:ACTER_LENGTH|_LENGTH)|O(?:ALESCE|ERCIBILITY|MPRESS|N(?:CAT(?:_WS|)|NECTION_ID|V(?:ERT_TZ|))|S|T|UNT)|R(?:C32|OSSES)|UR(?:DATE|TIME))|D(?:A(?:TE(?:DIFF|_(?:ADD|FORMAT|SUB))|Y(?:NAME|OF(?:MONTH|WEEK|YEAR)))|E(?:CODE|GREES|S_(?:DECRYPT|ENCRYPT))|I(?:MENSION|SJOINT))|E(?:LT|N(?:C(?:ODE|RYPT)|DPOINT|VELOPE)|QUALS|X(?:P(?:ORT_SET|)|T(?:ERIORRING|RACT)))|F(?:I(?:ELD|ND_IN_SET)|LOOR|O(?:RMAT|UND_ROWS)|ROM_(?:DAYS|UNIXTIME))|G(?:E(?:OM(?:COLLFROM(?:TEXT|WKB)|ETRY(?:COLLECTIONFROM(?:TEXT|WKB)|FROM(?:TEXT|WKB)|N|TYPE)|FROM(?:TEXT|WKB))|T_LOCK)|LENGTH|R(?:EATEST|OUP_(?:CONCAT|UNIQUE_USERS)))|HEX|I(?:FNULL|N(?:ET_(?:ATON|NTOA)|STR|TER(?:IORRINGN|SECTS))|S(?:CLOSED|EMPTY|NULL|SIMPLE|_(?:FREE_LOCK|USED_LOCK)))|L(?:AST_(?:DAY|INSERT_ID)|CASE|E(?:AST|NGTH)|INE(?:FROM(?:TEXT|WKB)|STRINGFROM(?:TEXT|WKB))|N|O(?:AD_FILE|CATE|G(?:10|2|)|WER)|PAD|TRIM)|M(?:A(?:KE(?:DATE|TIME|_SET)|STER_POS_WAIT|X)|BR(?:CONTAINS|DISJOINT|EQUAL|INTERSECTS|OVERLAPS|TOUCHES|WITHIN)|D5|I(?:D|N)|LINEFROM(?:TEXT|WKB)|ONTHNAME|PO(?:INTFROM(?:TEXT|WKB)|LYFROM(?:TEXT|WKB))|ULTI(?:LINESTRINGFROM(?:TEXT|WKB)|PO(?:INTFROM(?:TEXT|WKB)|LYGONFROM(?:TEXT|WKB))))|N(?:AME_CONST|OW|U(?:LLIF|M(?:GEOMETRIES|INTERIORRINGS|POINTS)))|O(?:CT(?:ET_LENGTH|)|RD|VERLAPS)|P(?:ERIOD_(?:ADD|DIFF)|I|O(?:INT(?:FROM(?:TEXT|WKB)|N)|LY(?:FROM(?:TEXT|WKB)|GONFROM(?:TEXT|WKB))|SITION|W(?:ER|)))|QUOTE|R(?:A(?:DIANS|ND)|E(?:LEASE_LOCK|VERSE)|O(?:UND|W_COUNT)|PAD|TRIM)|S(?:E(?:C_TO_TIME|SSION_USER)|HA(?:1|)|I(?:GN|N)|LEEP|OUNDEX|PACE|QRT|RID|T(?:ARTPOINT|D(?:DEV(?:_(?:POP|SAMP)|)|)|R(?:CMP|_TO_DATE))|U(?:B(?:DATE|STR(?:ING(?:_INDEX|)|)|TIME)|M)|YS(?:DATE|TEM_USER))|T(?:AN|IME(?:DIFF|_(?:FORMAT|TO_SEC))|O(?:UCHES|_DAYS)|RIM)|U(?:CASE|N(?:COMPRESS(?:ED_LENGTH|)|HEX|I(?:QUE_USERS|X_TIMESTAMP))|PPER|UID)|V(?:AR(?:IANCE|_(?:POP|SAMP))|ERSION)|W(?:EEK(?:DAY|OFYEAR)|ITHIN)|X|Y(?:EARWEEK|))(?=\()/
|
||||
, _style: "color: #e17100;"
|
||||
}
|
||||
, id: {
|
||||
_match: /[$\w]+/
|
||||
, _style: "color: maroon;"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* this recipe uses a little trick for highlighting php code
|
||||
* 1: replace each php snippet with a placeholder
|
||||
* 2: highlight html without php and php snippets apart
|
||||
* 3: replace each placeholder with its highlighted php snippet
|
||||
*
|
||||
* the trick is not perfect only if the html without php is broken
|
||||
* however, in such a case many highlighters get fooled but Chili does not
|
||||
*
|
||||
* input: <p class="ex<?php echo $ex ? '"' : 'ample"' ?>>Hi!</p>
|
||||
* (html without php [<p class="ex>Hi!</p>] is broken)
|
||||
*
|
||||
* output of GeSHi 1.0.7.21: <span class="sy0"><</span>p <span class="kw2">class</span><span class="sy0">=</span><span class="st0">"ex<?php echo $ex ? '"</span><span class="st0">' : '</span>ample<span class="st0">"' ?>>Hi!</p></span>
|
||||
*
|
||||
* output of Chili 2.0: <span class="html__tag_start"><p</span> class="ex<span class="php__start"><?php</span> <span class="php__keyword">echo</span> <span class="php__keyword">$</span><span class="php__variable">ex</span> ? <span class="php__string1">'"'</span> : <span class="php__string1">'ample"'</span> <span class="php__end">?></span><span class="html__tag_start">></span>Hi!<span class="html__tag_end"></p></span>
|
||||
* --------------------------------------------------------------------------*/
|
||||
{
|
||||
_name: "php"
|
||||
, _case: true
|
||||
, _main: {
|
||||
all: {
|
||||
_match: /[\w\W]*/
|
||||
, _replace: function( all ) {
|
||||
var placeholder = String.fromCharCode(0);
|
||||
var blocks = [];
|
||||
var that = this;
|
||||
var no_php = all.replace( /<\?[\w\W]*?\?>|<\?[\w\W]*/g, function( block ) {
|
||||
blocks.push( that.x( block, '/block/php' ) );
|
||||
return placeholder;
|
||||
} );
|
||||
var html = this.x( no_php, 'html' );
|
||||
var count = 0;
|
||||
return html.replace( new RegExp( placeholder, "g" ), function() {
|
||||
return blocks[ count++ ];
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
, block: {
|
||||
php: {
|
||||
_match: /(<\?(?:php)?)([\w\W]*?)(\?>)|(<\?(?:php)?)([\w\W]*)/
|
||||
, _replace: function( all, open, content, close, open2, content2 ) {
|
||||
if( open2 ) {
|
||||
return "<span class='start'>" + this.x( open2 ) + "</span>"
|
||||
+ this.x( content2, '/php' );
|
||||
}
|
||||
else {
|
||||
return "<span class='start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '/php' )
|
||||
+ "<span class='end'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
}
|
||||
, _style: {
|
||||
start: "color: red; font-weight: bold"
|
||||
, end: "color: red;"
|
||||
}
|
||||
}
|
||||
}
|
||||
, php: {
|
||||
mlcom: {
|
||||
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
|
||||
, _style: "color: gray;"
|
||||
}
|
||||
, com: {
|
||||
_match: /(?:\/\/.*)|(?:[^\\]\#.*)/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string1: {
|
||||
_match: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/
|
||||
, _style: "color: purple;"
|
||||
}
|
||||
, string2: {
|
||||
_match: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/
|
||||
, _style: "color: gray; font-weight: bold;"
|
||||
}
|
||||
, number: {
|
||||
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const1: {
|
||||
_match: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const2: {
|
||||
_match: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, global: {
|
||||
_match: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
, variable: {
|
||||
_match: /\$(\w+)/
|
||||
, _replace: '<span class="keyword">$</span><span class="variable">$1</span>'
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, heredoc: {
|
||||
_match: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
|
||||
, _replace: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
ChiliBook.recipeLoading = false;
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "php.js" ] =
|
||||
/* ----------------------------------------------------------------------------
|
||||
* this recipe uses a little trick for highlighting php code
|
||||
* 1: replace each php snippet with a placeholder
|
||||
* 2: highlight html without php and php snippets apart
|
||||
* 3: replace each placeholder with its highlighted php snippet
|
||||
*
|
||||
* the trick is not perfect only if the html without php is broken
|
||||
* however, in such a case many highlighters get fooled but Chili does not
|
||||
*
|
||||
* input: <p class="ex<?php echo $ex ? '"' : 'ample"' ?>>Hi!</p>
|
||||
* (html without php [<p class="ex>Hi!</p>] is broken)
|
||||
*
|
||||
* output of GeSHi 1.0.7.21: <span class="sy0"><</span>p <span class="kw2">class</span><span class="sy0">=</span><span class="st0">"ex<?php echo $ex ? '"</span><span class="st0">' : '</span>ample<span class="st0">"' ?>>Hi!</p></span>
|
||||
*
|
||||
* output of Chili 2.0: <span class="html__tag_start"><p</span> class="ex<span class="php__start"><?php</span> <span class="php__keyword">echo</span> <span class="php__keyword">$</span><span class="php__variable">ex</span> ? <span class="php__string1">'"'</span> : <span class="php__string1">'ample"'</span> <span class="php__end">?></span><span class="html__tag_start">></span>Hi!<span class="html__tag_end"></p></span>
|
||||
* --------------------------------------------------------------------------*/
|
||||
{
|
||||
_name: "php"
|
||||
, _case: true
|
||||
, _main: {
|
||||
all: {
|
||||
_match: /[\w\W]*/
|
||||
, _replace: function( all ) {
|
||||
var placeholder = String.fromCharCode(0);
|
||||
var blocks = [];
|
||||
var that = this;
|
||||
var no_php = all.replace( /<\?[\w\W]*?\?>|<\?[\w\W]*/g, function( block ) {
|
||||
blocks.push( that.x( block, '/block/php' ) );
|
||||
return placeholder;
|
||||
} );
|
||||
var html = this.x( no_php, 'html' );
|
||||
var count = 0;
|
||||
return html.replace( new RegExp( placeholder, "g" ), function() {
|
||||
return blocks[ count++ ];
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
, block: {
|
||||
php: {
|
||||
_match: /(<\?(?:php)?)([\w\W]*?)(\?>)|(<\?(?:php)?)([\w\W]*)/
|
||||
, _replace: function( all, open, content, close, open2, content2 ) {
|
||||
if( open2 ) {
|
||||
return "<span class='start'>" + this.x( open2 ) + "</span>"
|
||||
+ this.x( content2, '/php' );
|
||||
}
|
||||
else {
|
||||
return "<span class='start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '/php' )
|
||||
+ "<span class='end'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
}
|
||||
, _style: {
|
||||
start: "color: red; font-weight: bold"
|
||||
, end: "color: red;"
|
||||
}
|
||||
}
|
||||
}
|
||||
, php: {
|
||||
mlcom: {
|
||||
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
|
||||
, _style: "color: gray;"
|
||||
}
|
||||
, com: {
|
||||
_match: /(?:\/\/.*)|(?:[^\\]\#.*)/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string1: {
|
||||
_match: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/
|
||||
, _style: "color: purple;"
|
||||
}
|
||||
, string2: {
|
||||
_match: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/
|
||||
, _style: "color: gray; font-weight: bold;"
|
||||
}
|
||||
, number: {
|
||||
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const1: {
|
||||
_match: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const2: {
|
||||
_match: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, global: {
|
||||
_match: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
, variable: {
|
||||
_match: /\$(\w+)/
|
||||
, _replace: '<span class="keyword">$</span><span class="variable">$1</span>'
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, heredoc: {
|
||||
_match: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
|
||||
, _replace: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "html.js" ] =
|
||||
{
|
||||
_name: 'html'
|
||||
, _case: false
|
||||
, _main: {
|
||||
doctype: {
|
||||
_match: /<!DOCTYPE\b[\w\W]*?>/
|
||||
, _style: "color: #CC6600;"
|
||||
}
|
||||
, ie_style: {
|
||||
_match: /(<!--\[[^\]]*\]>)([\w\W]*?)(<!\[[^\]]*\]-->)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='ie_style'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '//style' )
|
||||
+ "<span class='ie_style'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: DarkSlateGray; font-weight: bold;"
|
||||
}
|
||||
, comment: {
|
||||
_match: /<!--[\w\W]*?-->/
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, script: {
|
||||
_match: /(<script\s+[^>]*>)([\w\W]*?)(<\/script\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'js' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
, style: {
|
||||
_match: /(<style\s+[^>]*>)([\w\W]*?)(<\/style\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'css' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
// matches a starting tag of an element (with attrs)
|
||||
// like "<div ... >" or "<img ... />"
|
||||
, tag_start: {
|
||||
_match: /(<\w+)((?:[?%]>|[\w\W])*?)(\/>|>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='tag_start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '/tag_attrs' )
|
||||
+ "<span class='tag_start'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
// matches an ending tag
|
||||
// like "</div>"
|
||||
, tag_end: {
|
||||
_match: /<\/\w+\s*>|\/>/
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
, entity: {
|
||||
_match: /&\w+?;/
|
||||
, _style: "color: blue;"
|
||||
}
|
||||
}
|
||||
, tag_attrs: {
|
||||
// matches a name/value pair
|
||||
attr: {
|
||||
// before in $1, name in $2, between in $3, value in $4
|
||||
_match: /(\W*?)([\w-]+)(\s*=\s*)((?:\'[^\']*(?:\\.[^\']*)*\')|(?:\"[^\"]*(?:\\.[^\"]*)*\"))/
|
||||
, _replace: "$1<span class='attr_name'>$2</span>$3<span class='attr_value'>$4</span>"
|
||||
, _style: { attr_name: "color: green;", attr_value: "color: maroon;" }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "js.js" ] =
|
||||
{
|
||||
_name: 'js'
|
||||
, _case: true
|
||||
, _main: {
|
||||
ml_comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: 'color: gray;'
|
||||
}
|
||||
, sl_comment: {
|
||||
_match: /\/\/.*/
|
||||
, _style: 'color: green;'
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: 'color: teal;'
|
||||
}
|
||||
, num: {
|
||||
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
|
||||
, _style: 'color: red;'
|
||||
}
|
||||
, reg_not: { //this prevents "a / b / c" to be interpreted as a reg_exp
|
||||
_match: /(?:\w+\s*)\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*(?:\s*\w+)/
|
||||
, _replace: function( all ) {
|
||||
return this.x( all, '//num' );
|
||||
}
|
||||
}
|
||||
, reg_exp: {
|
||||
_match: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/
|
||||
, _style: 'color: maroon;'
|
||||
}
|
||||
, brace: {
|
||||
_match: /[\{\}]/
|
||||
, _style: 'color: red; font-weight: bold;'
|
||||
}
|
||||
, statement: {
|
||||
_match: /\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/
|
||||
, _style: 'color: navy; font-weight: bold;'
|
||||
}
|
||||
, error: {
|
||||
_match: /\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/
|
||||
, _style: 'color: Coral;'
|
||||
}
|
||||
, object: {
|
||||
_match: /\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/
|
||||
, _style: 'color: DeepPink;'
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(undefined|arguments|NaN|Infinity)\b/
|
||||
, _style: 'color: Purple; font-weight: bold;'
|
||||
}
|
||||
, 'function': {
|
||||
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
|
||||
, _style: 'color: olive;'
|
||||
}
|
||||
, operator: {
|
||||
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
|
||||
, _style: 'color: RoyalBlue; font-weight: bold;'
|
||||
}
|
||||
, liveconnect: {
|
||||
_match: /\b(sun|netscape|java|Packages|JavaPackage|JavaObject|JavaClass|JavaArray|JSObject|JSException)\b/
|
||||
, _style: 'text-decoration: overline;'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "css.js" ] =
|
||||
{
|
||||
_name: 'css'
|
||||
, _case: true
|
||||
, _main: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: olive;"
|
||||
}
|
||||
, directive: {
|
||||
_match: /@\w+/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, block: {
|
||||
_match: /\{([\w\W]*?)\}/
|
||||
, _replace: function( all, pairs ) {
|
||||
return '{' + this.x( pairs, '/definition' ) + '}';
|
||||
}
|
||||
}
|
||||
, 'class': {
|
||||
_match: /\.\w+/
|
||||
, _style: "color: #CC0066; font-weight: bold;"
|
||||
}
|
||||
, id: {
|
||||
_match: /#\w+/
|
||||
, _style: "color: IndianRed; font-weight: bold;"
|
||||
}
|
||||
, pseudo: {
|
||||
_match: /:\w+/
|
||||
, _style: "color: #CC9900;"
|
||||
}
|
||||
, element: {
|
||||
_match: /\w+/
|
||||
, _style: "color: Purple; font-weight: bold;"
|
||||
}
|
||||
}
|
||||
, definition: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(?:zoom|z-index|writing-mode|word-wrap|word-spacing|word-break|width|widows|white-space|volume|voice-family|visibility|vertical-align|unicode-bidi|top|text-underline-position|text-transform|text-shadow|text-overflow|text-kashida-space|text-justify|text-indent|text-decoration|text-autospace|text-align-last|text-align|table-layout|stress|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|size|scrollbar-track-color|scrollbar-shadow-color|scrollbar-highlight-color|scrollbar-face-color|scrollbar-dark-shadow-color|scrollbar-base-color|scrollbar-arrow-color|scrollbar-3d-light-color|ruby-position|ruby-overhang|ruby-align|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-Y|overflow-X|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|line-break|letter-spacing|left|layout-grid-type|layout-grid-mode|layout-grid-line|layout-grid-char-spacing|layout-grid-char|layout-grid|layout-flow|layer-background-image|layer-background-color|include-source|ime-mode|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|filter|empty-cells|elevation|display|direction|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|caption-side|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|behavior|background-repeat|background-position-y|background-position-x|background-position|background-image|background-color|background-attachment|background|azimuth|accelerator)\s*:/
|
||||
, _style: "color: #330066;"
|
||||
}
|
||||
, special: {
|
||||
_match: /\b(?:-use-link-source|-set-link-source|-replace|-moz-user-select|-moz-user-modify|-moz-user-input|-moz-user-focus|-moz-outline-width|-moz-outline-style|-moz-outline-color|-moz-outline|-moz-opacity|-moz-border-top-colors|-moz-border-right-colors|-moz-border-radius-topright|-moz-border-radius-topleft|-moz-border-radius-bottomright|-moz-border-radius-bottomleft|-moz-border-radius|-moz-border-left-colors|-moz-border-bottom-colors|-moz-binding)\s*:/
|
||||
, _style: "color: #330066; text-decoration: underline;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/
|
||||
, _style: "color: #3366FF;"
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number: {
|
||||
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, color : {
|
||||
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
*{ font-family:Arial, Helvetica, sans-serif; margin:0; padding:0; outline:none; }
|
||||
form{ padding:0/*!important*/; margin:0/*!important*/; }
|
||||
img{ border:0; }
|
||||
ul,ol{ padding:2px 5px; margin:0 0 0 20px; }
|
||||
|
||||
body{ font-size:72%; color: #666; background:#fff; margin:0px; padding:0px; }
|
||||
h1{ font-size:140%; float:left; width:auto; margin:0px 5px 0 0; }
|
||||
h2{ margin:20px 0 3px 0; }
|
||||
h3{ margin:10px 0 1px 0; }
|
||||
p{ margin:10px 0; }
|
||||
/*pre,code{ clear:both; display:block; }*/
|
||||
pre.code{
|
||||
background-color:#F7F7F7;
|
||||
border-color:#A7A7CC;
|
||||
border-style:solid;
|
||||
border-width:1px 1px 1px 5px;
|
||||
font-size:small;
|
||||
overflow-x:auto;
|
||||
padding:5px 5px 5px 15px;
|
||||
}
|
||||
|
||||
@media screen{
|
||||
/* LAYOUT - Layer 0: sticky footer */
|
||||
/*ALL*/html,body,#wrap{ min-height: 100%; height: auto !important; height: 100%; }
|
||||
/* FIXED HEADER/FOOTER: */
|
||||
#roof{ height:25px; position:fixed; width:100%; z-index:9999; left:0; top:0; }
|
||||
#head{ height:50px; line-height:1em; position:fixed; width:100%; z-index:9999; left:0; top:0px; }
|
||||
#foot{ height:80px; position:fixed; width:100%; z-index:9999; left:0; bottom:0; }
|
||||
#wrap{ margin:50px 0 80px 0; padding:20px; }
|
||||
}
|
||||
|
||||
@media debug{
|
||||
#wrap{ background:#ffeeee;/*IE8*/ background:#eeffee;/*IE7*/ }
|
||||
html > body #wrap{ background:#eeeeff;/*MOZ*/ }
|
||||
}
|
||||
|
||||
/* ---------------------------------------------- */
|
||||
|
||||
#roof{
|
||||
color:#777; font-size:94%; color:#00A;
|
||||
background: #FAFAFA;
|
||||
box-shadow: 0 1px 0 rgba(255,255,255,0.4),0 0 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
#head{
|
||||
background: -webkit-linear-gradient(#FAFAFA,#EAEAEA);
|
||||
background: -moz-linear-gradient(#FAFAFA,#EAEAEA);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')";
|
||||
box-shadow: 0 1px 0 rgba(255,255,255,0.4),0 0 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
#body{
|
||||
line-height:1.5em; font-size:12px;
|
||||
}
|
||||
#foot{
|
||||
border: #e0e0e0 solid 2px;
|
||||
border-width: 2px 0 0 0;
|
||||
background: -webkit-linear-gradient(#FAFAFA,#EAEAEA);
|
||||
background: -moz-linear-gradient(#FAFAFA,#EAEAEA);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')";
|
||||
}
|
||||
#share{ }
|
||||
|
||||
/* --- */
|
||||
|
||||
#ad{ position:absolute; left:10px; /*background:#090;*/ padding:0px; width:130px !important; overflow:hidden !important; }
|
||||
#ad iframe{ width:160px !important; overflow:hidden !important; }
|
||||
#documentation{ margin-left:130px; }
|
||||
|
||||
/* --- */
|
||||
|
||||
#search{ text-align:right; padding:0; margin:5px 0; border:0; display:inline; clear:none; width:200px; }
|
||||
#search *{ display:inline; float:left; clear:none; }
|
||||
#search label{ color:#C00; font-weight:bold; font-size:100%; margin:2px 5px 0 0; }
|
||||
#search input{ font-weight:bold; font-size:95%; }
|
||||
|
||||
/* --- */
|
||||
|
||||
.license-info{ padding:10px 20px; margin:0px 50px; border:#77cc77 solid 1px; background:#f3f9f3; }
|
||||
.hint{ padding:3px; background:#FFFF99; color:#000; border-bottom:#CC9900 solid 1px; margin:0 0 10px 0; }
|
||||
|
||||
/* ---------------------------------------------- */
|
||||
|
||||
/* Utilities */
|
||||
.P5{ padding:5px; }
|
||||
.Warning,.No,.Error{ color:red; }
|
||||
.Success,.Yes,.Y{ color:green; }
|
||||
.Bold,.B{ font-weight:bold; }
|
||||
|
||||
/* FROM: http://roscoecreations.com/help/css/global2.css */
|
||||
.Clear:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
|
||||
.Clear {display: inline-block;}
|
||||
html[xmlns] .Clear {display: block;}
|
||||
* html .Clear {height: 1%;}
|
||||
/* - END - */
|
||||
|
||||
/* tabs css */
|
||||
@media projection,screen{.tabs-hide{display:none}}@media print{.tabs-nav{display:none}}.tabs-nav{list-style:none;margin:0;padding:0 0 0 4px}.tabs-nav:after{display:block;clear:both;content:" "}.tabs-nav li{float:left;margin:0 0 0 1px}.tabs-nav a{display:block;position:relative;top:1px;z-index:2;padding:6px 10px 0;height:18px;color:#27537a;font-size:12px;font-weight:bold;line-height:1.2;text-align:center;text-decoration:none;background:url(/@/js/tabs/tab.png) no-repeat}.tabs-nav .tabs-selected a{padding-top:7px;color:#000}.tabs-nav .tabs-selected a,.tabs-nav a:hover,.tabs-nav a:focus,.tabs-nav a:active{background-position:0 -50px;outline:0}.tabs-nav .tabs-disabled a:hover,.tabs-nav .tabs-disabled a:focus,.tabs-nav .tabs-disabled a:active{background-position:0 0}.tabs-nav .tabs-selected a:link,.tabs-nav .tabs-selected a:visited,.tabs-nav .tabs-disabled a:link,.tabs-nav .tabs-disabled a:visited{cursor:text;cursor:default}.tabs-nav a:hover,.tabs-nav a:focus,.tabs-nav a:active{cursor:pointer;cursor:hand}.tabs-nav .tabs-disabled{opacity:.4}.tabs-container{border-top:1px solid #97a5b0;padding:1em 8px;background:#fff}.tabs-loading span{padding:0 0 0 20px;background:url(/@/js/tabs/loading.gif) no-repeat 0 50%}.tabs-nav li{margin:0px;padding:0px 4px 0px 0px}.tabs-nav a{position:relative;padding:5px 3px 0px 3px;font-size:100%;font-weight:normal;line-height:1;height:16px;border:#ccc solid;border-width:1px 1px 0px 1px;background:#f5f5f5;color:#333!important}.tabs-nav a:hover{color:#339!important;text-decoration:underline}.tabs-nav .tabs-selected a{padding-top:6px;border-width:1px 1px 0px 1px;background:#e7e7e7;color:#000!important}.tabs-nav .tabs-disabled a{border-color:#ccc;color:#555!important}.tabs-container{border-top:1px solid #e0e0e0;padding:0px 0px;background:transparent}* html .tabs-nav a{display:inline-block;height:23px}.tabs-nav li > a{}
|
||||
|
||||
.tabs-nav{ font-size:110%; }
|
||||
.tabs-nav a{
|
||||
margin:0 3px 0 0;
|
||||
padding:5px 12px; display:block;
|
||||
font-weight:bold;
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
.tabs-container{
|
||||
padding:0 20px 20px 20px;
|
||||
border-top:#e0e0e0 solid 2px;
|
||||
border-left:#e0e0e0 solid 2px;
|
||||
height:100%;
|
||||
min-height:100%;
|
||||
}
|
||||
#documentation{}
|
||||
|
After Width: | Height: | Size: 150 B |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 293 B |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 198 B |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 917 B |