SyntaxHighlighter Evolved - Version 1.1.2

Version Description

Download this release

Release Info

Developer Viper007Bond
Plugin Icon wp plugin SyntaxHighlighter Evolved
Version 1.1.2
Comparing to
See all releases

Version 1.1.2

files/SyntaxHighlighter.css ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .dp-highlighter
2
+ .dp-highlighter ol,
3
+ .dp-highlighter ol li,
4
+ .dp-highlighter ol li span
5
+ {
6
+ font-weight: normal;
7
+ font-family: "Consolas", "Monaco", "Courier New", Courier, monospace !important;
8
+ font-size: 12px;
9
+ }
10
+
11
+ .dp-highlighter
12
+ {
13
+ background-color: #E7E5DC;
14
+ width: 99%;
15
+ overflow: auto;
16
+ margin: 18px 0 18px 0 !important;
17
+ padding-top: 1px; /* adds a little border on top when controls are hidden */
18
+ }
19
+
20
+ /* clear styles */
21
+ .dp-highlighter ol,
22
+ .dp-highlighter ol li,
23
+ .dp-highlighter ol li span
24
+ {
25
+ margin: 0;
26
+ padding: 0;
27
+ border: none;
28
+ }
29
+
30
+ .dp-highlighter a,
31
+ .dp-highlighter a:hover
32
+ {
33
+ background: none;
34
+ border: none;
35
+ padding: 0;
36
+ margin: 0;
37
+ }
38
+
39
+ .dp-highlighter .bar
40
+ {
41
+ padding-left: 45px;
42
+ }
43
+
44
+ .dp-highlighter.collapsed .bar,
45
+ .dp-highlighter.nogutter .bar
46
+ {
47
+ padding-left: 0px;
48
+ }
49
+
50
+ .dp-highlighter ol
51
+ {
52
+ list-style: decimal; /* for ie */
53
+ background-color: #fff;
54
+ margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
55
+ padding: 0px;
56
+ color: #5C5C5C;
57
+ }
58
+
59
+ .dp-highlighter.nogutter ol,
60
+ .dp-highlighter.nogutter ol li
61
+ {
62
+ list-style: none !important;
63
+ margin-left: 0px !important;
64
+ }
65
+
66
+ .dp-highlighter ol li,
67
+ .dp-highlighter .columns div
68
+ {
69
+ list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
70
+ list-style-position: outside !important;
71
+ border-left: 3px solid #6CE26C;
72
+ background-color: #F8F8F8;
73
+ color: #5C5C5C;
74
+ padding: 0 3px 0 10px !important;
75
+ margin: 0 !important;
76
+ line-height: 14px;
77
+ }
78
+
79
+ .dp-highlighter.nogutter ol li,
80
+ .dp-highlighter.nogutter .columns div
81
+ {
82
+ border: 0;
83
+ }
84
+
85
+ .dp-highlighter .columns
86
+ {
87
+ background-color: #F8F8F8;
88
+ color: gray;
89
+ overflow: hidden;
90
+ width: 100%;
91
+ }
92
+
93
+ .dp-highlighter .columns div
94
+ {
95
+ padding-bottom: 5px;
96
+ }
97
+
98
+ .dp-highlighter ol li.alt
99
+ {
100
+ background-color: #FFF;
101
+ color: inherit;
102
+ }
103
+
104
+ .dp-highlighter ol li span
105
+ {
106
+ color: black;
107
+ background-color: inherit;
108
+ }
109
+
110
+ /* Adjust some properties when collapsed */
111
+
112
+ .dp-highlighter.collapsed ol
113
+ {
114
+ margin: 0px;
115
+ }
116
+
117
+ .dp-highlighter.collapsed ol li
118
+ {
119
+ display: none;
120
+ }
121
+
122
+ /* Additional modifications when in print-view */
123
+
124
+ .dp-highlighter.printing
125
+ {
126
+ border: none;
127
+ }
128
+
129
+ .dp-highlighter.printing .tools
130
+ {
131
+ display: none !important;
132
+ }
133
+
134
+ .dp-highlighter.printing li
135
+ {
136
+ display: list-item !important;
137
+ }
138
+
139
+ /* Styles for the tools */
140
+
141
+ .dp-highlighter .tools
142
+ {
143
+ padding: 3px 8px 3px 10px;
144
+ font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
145
+ color: silver;
146
+ background-color: #f8f8f8;
147
+ padding-bottom: 10px;
148
+ border-left: 3px solid #6CE26C;
149
+ }
150
+
151
+ .dp-highlighter.nogutter .tools
152
+ {
153
+ border-left: 0;
154
+ }
155
+
156
+ .dp-highlighter.collapsed .tools
157
+ {
158
+ border-bottom: 0;
159
+ }
160
+
161
+ .dp-highlighter .tools a
162
+ {
163
+ font-size: 9px;
164
+ color: #a0a0a0;
165
+ background-color: inherit;
166
+ text-decoration: none;
167
+ margin-right: 10px;
168
+ }
169
+
170
+ .dp-highlighter .tools a:hover
171
+ {
172
+ color: red;
173
+ background-color: inherit;
174
+ text-decoration: underline;
175
+ }
176
+
177
+ /* About dialog styles */
178
+
179
+ .dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
180
+ .dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
181
+ .dp-about td { padding: 10px; vertical-align: top; }
182
+ .dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
183
+ .dp-about .title { color: red; background-color: inherit; font-weight: bold; }
184
+ .dp-about .para { margin: 0 0 4px 0; }
185
+ .dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
186
+ .dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
187
+
188
+ /* Language specific styles */
189
+
190
+ .dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
191
+ .dp-highlighter .string { color: blue; background-color: inherit; }
192
+ .dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
193
+ .dp-highlighter .preprocessor { color: gray; background-color: inherit; }
files/clipboard.swf ADDED
Binary file
files/shBrushCSharp.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.CSharp=function()
9
+ {var keywords='abstract as base bool break byte case catch char checked class const '+'continue decimal default delegate do double else enum event explicit '+'extern false finally fixed float for foreach get goto if implicit in int '+'interface internal is lock long namespace new null object operator out '+'override params private protected public readonly ref return sbyte sealed set '+'short sizeof stackalloc static string struct switch this throw true try '+'typeof uint ulong unchecked unsafe ushort using virtual void while';this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:'comment'},{regex:dp.sh.RegexLib.MultiLineCComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('^\\s*#.*','gm'),css:'preprocessor'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-c';this.Style='.dp-c .vars { color: #d00; }';}
10
+ dp.sh.Brushes.CSharp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSharp.Aliases=['c#','c-sharp','csharp'];
files/shBrushCpp.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Cpp=function()
9
+ {var datatypes='ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR '+'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH '+'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP '+'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY '+'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT '+'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE '+'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF '+'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR '+'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR '+'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT '+'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 '+'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR '+'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 '+'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT '+'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG '+'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM '+'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t '+'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS '+'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t '+'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t '+'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler '+'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function '+'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf '+'va_list wchar_t wctrans_t wctype_t wint_t signed';var keywords='break case catch class const __finally __exception __try '+'const_cast continue private public protected __declspec '+'default delete deprecated dllexport dllimport do dynamic_cast '+'else enum explicit extern if for friend goto inline '+'mutable naked namespace new noinline noreturn nothrow '+'register reinterpret_cast return selectany '+'sizeof static static_cast struct switch template this '+'thread throw true false try typedef typeid typename union '+'using uuid virtual void volatile whcar_t while';this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:'comment'},{regex:dp.sh.RegexLib.MultiLineCComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('^ *#.*','gm'),css:'preprocessor'},{regex:new RegExp(this.GetKeywords(datatypes),'gm'),css:'datatypes'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-cpp';this.Style='.dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }';}
10
+ dp.sh.Brushes.Cpp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Cpp.Aliases=['cpp','c','c++'];
files/shBrushCss.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.CSS=function()
9
+ {var keywords='ascent azimuth background-attachment background-color background-image background-position '+'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top '+'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color '+'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width '+'border-bottom-width border-left-width border-width border cap-height caption-side centerline clear clip color '+'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display '+'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font '+'height letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top '+'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans '+'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page '+'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position '+'quotes richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress '+'table-layout text-align text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em '+'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';var values='above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';var fonts='[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif';this.regexList=[{regex:dp.sh.RegexLib.MultiLineCComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('\\#[a-zA-Z0-9]{3,6}','g'),css:'value'},{regex:new RegExp('(-?\\d+)(\.\\d+)?(px|em|pt|\:|\%|)','g'),css:'value'},{regex:new RegExp('!important','g'),css:'important'},{regex:new RegExp(this.GetKeywordsCSS(keywords),'gm'),css:'keyword'},{regex:new RegExp(this.GetValuesCSS(values),'g'),css:'value'},{regex:new RegExp(this.GetValuesCSS(fonts),'g'),css:'value'}];this.CssClass='dp-css';this.Style='.dp-css .value { color: black; }'+'.dp-css .important { color: red; }';}
10
+ dp.sh.Highlighter.prototype.GetKeywordsCSS=function(str)
11
+ {return'\\b([a-z_]|)'+str.replace(/ /g,'(?=:)\\b|\\b([a-z_\\*]|\\*|)')+'(?=:)\\b';}
12
+ dp.sh.Highlighter.prototype.GetValuesCSS=function(str)
13
+ {return'\\b'+str.replace(/ /g,'(?!-)(?!:)\\b|\\b()')+'\:\\b';}
14
+ dp.sh.Brushes.CSS.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSS.Aliases=['css'];
files/shBrushDelphi.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Delphi=function()
9
+ {var keywords='abs addr and ansichar ansistring array as asm begin boolean byte cardinal '+'case char class comp const constructor currency destructor div do double '+'downto else end except exports extended false file finalization finally '+'for function goto if implementation in inherited int64 initialization '+'integer interface is label library longint longword mod nil not object '+'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended '+'pint64 pointer private procedure program property pshortstring pstring '+'pvariant pwidechar pwidestring protected public published raise real real48 '+'record repeat set shl shortint shortstring shr single smallint string then '+'threadvar to true try type unit until uses val var varirnt while widechar '+'widestring with word write writeln xor';this.regexList=[{regex:new RegExp('\\(\\*[\\s\\S]*?\\*\\)','gm'),css:'comment'},{regex:new RegExp('{(?!\\$)[\\s\\S]*?}','gm'),css:'comment'},{regex:dp.sh.RegexLib.SingleLineCComments,css:'comment'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('\\{\\$[a-zA-Z]+ .+\\}','g'),css:'directive'},{regex:new RegExp('\\b[\\d\\.]+\\b','g'),css:'number'},{regex:new RegExp('\\$[a-zA-Z0-9]+\\b','g'),css:'number'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-delphi';this.Style='.dp-delphi .number { color: blue; }'+'.dp-delphi .directive { color: #008284; }'+'.dp-delphi .vars { color: #000; }';}
10
+ dp.sh.Brushes.Delphi.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Delphi.Aliases=['delphi','pascal'];
files/shBrushJScript.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.JScript=function()
9
+ {var keywords='abstract boolean break byte case catch char class const continue debugger '+'default delete do double else enum export extends false final finally float '+'for function goto if implements import in instanceof int interface long native '+'new null package private protected public return short static super switch '+'synchronized this throw throws transient true try typeof var void volatile while with';this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:'comment'},{regex:dp.sh.RegexLib.MultiLineCComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('^\\s*#.*','gm'),css:'preprocessor'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-c';}
10
+ dp.sh.Brushes.JScript.prototype=new dp.sh.Highlighter();dp.sh.Brushes.JScript.Aliases=['js','jscript','javascript'];
files/shBrushJava.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Java=function()
9
+ {var keywords='abstract assert boolean break byte case catch char class const '+'continue default do double else enum extends '+'false final finally float for goto if implements import '+'instanceof int interface long native new null '+'package private protected public return '+'short static strictfp super switch synchronized this throw throws true '+'transient try void volatile while';this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:'comment'},{regex:dp.sh.RegexLib.MultiLineCComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b','gi'),css:'number'},{regex:new RegExp('(?!\\@interface\\b)\\@[\\$\\w]+\\b','g'),css:'annotation'},{regex:new RegExp('\\@interface\\b','g'),css:'keyword'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-j';this.Style='.dp-j .annotation { color: #646464; }'+'.dp-j .number { color: #C00000; }';}
10
+ dp.sh.Brushes.Java.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Java.Aliases=['java'];
files/shBrushPhp.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Php=function()
9
+ {var funcs='abs acos acosh addcslashes addslashes '+'array_change_key_case array_chunk array_combine array_count_values array_diff '+'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+'array_push array_rand array_reduce array_reverse array_search array_shift '+'array_slice array_splice array_sum array_udiff array_udiff_assoc '+'array_udiff_uassoc array_uintersect array_uintersect_assoc '+'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+'strtoupper strtr strval substr substr_compare';var keywords='and or xor __FILE__ __LINE__ array as break case '+'cfunction class const continue declare default die do else '+'elseif empty enddeclare endfor endforeach endif endswitch endwhile '+'extends for foreach function include include_once global if '+'new old_function return static switch use require require_once '+'var while __FUNCTION__ __CLASS__ '+'__METHOD__ abstract interface public implements extends private protected throw';this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:'comment'},{regex:dp.sh.RegexLib.MultiLineCComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp('\\$\\w+','g'),css:'vars'},{regex:new RegExp(this.GetKeywords(funcs),'gmi'),css:'func'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-c';}
10
+ dp.sh.Brushes.Php.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Php.Aliases=['php'];
files/shBrushPython.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Python=function()
9
+ {var keywords='and assert break class continue def del elif else '+'except exec finally for from global if import in is '+'lambda not or pass print raise return try yield while';var special='None True False self cls class_'
10
+ this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:'comment'},{regex:new RegExp("^\\s*@\\w+",'gm'),css:'decorator'},{regex:new RegExp("(['\"]{3})([^\\1])*?\\1",'gm'),css:'comment'},{regex:new RegExp('"(?!")(?:\\.|\\\\\\"|[^\\""\\n\\r])*"','gm'),css:'string'},{regex:new RegExp("'(?!')*(?:\\.|(\\\\\\')|[^\\''\\n\\r])*'",'gm'),css:'string'},{regex:new RegExp("\\b\\d+\\.?\\w*",'g'),css:'number'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'},{regex:new RegExp(this.GetKeywords(special),'gm'),css:'special'}];this.CssClass='dp-py';this.Style='.dp-py .builtins { color: #ff1493; }'+'.dp-py .magicmethods { color: #808080; }'+'.dp-py .exceptions { color: brown; }'+'.dp-py .types { color: brown; font-style: italic; }'+'.dp-py .commonlibs { color: #8A2BE2; font-style: italic; }';}
11
+ dp.sh.Brushes.Python.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Python.Aliases=['py','python'];
files/shBrushRuby.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Ruby=function()
9
+ {var keywords='alias and BEGIN begin break case class def define_method defined do each else elsif '+'END end ensure false for if in module new next nil not or raise redo rescue retry return '+'self super then throw true undef unless until when while yield';var builtins='Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload '+'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol '+'ThreadGroup Thread Time TrueClass'
10
+ this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp(':[a-z][A-Za-z0-9_]*','g'),css:'symbol'},{regex:new RegExp('(\\$|@@|@)\\w+','g'),css:'variable'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'},{regex:new RegExp(this.GetKeywords(builtins),'gm'),css:'builtin'}];this.CssClass='dp-rb';this.Style='.dp-rb .symbol { color: #a70; }'+'.dp-rb .variable { color: #a70; font-weight: bold; }';}
11
+ dp.sh.Brushes.Ruby.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Ruby.Aliases=['ruby','rails','ror'];
files/shBrushSql.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Sql=function()
9
+ {var funcs='abs avg case cast coalesce convert count current_timestamp '+'current_user day isnull left lower month nullif replace right '+'session_user space substring sum system_user upper user year';var keywords='absolute action add after alter as asc at authorization begin bigint '+'binary bit by cascade char character check checkpoint close collate '+'column commit committed connect connection constraint contains continue '+'create cube current current_date current_time cursor database date '+'deallocate dec decimal declare default delete desc distinct double drop '+'dynamic else end end-exec escape except exec execute false fetch first '+'float for force foreign forward free from full function global goto grant '+'group grouping having hour ignore index inner insensitive insert instead '+'int integer intersect into is isolation key last level load local max min '+'minute modify move name national nchar next no numeric of off on only '+'open option order out output partial password precision prepare primary '+'prior privileges procedure public read real references relative repeatable '+'restrict return returns revoke rollback rollup rows rule schema scroll '+'second section select sequence serializable set size smallint static '+'statistics table temp temporary then time timestamp to top transaction '+'translation trigger true truncate uncommitted union unique update values '+'varchar varying view when where with work';var operators='all and any between cross in join like not null or outer some';this.regexList=[{regex:new RegExp('--(.*)$','gm'),css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:dp.sh.RegexLib.SingleQuotedString,css:'string'},{regex:new RegExp(this.GetKeywords(funcs),'gmi'),css:'func'},{regex:new RegExp(this.GetKeywords(operators),'gmi'),css:'op'},{regex:new RegExp(this.GetKeywords(keywords),'gmi'),css:'keyword'}];this.CssClass='dp-sql';this.Style='.dp-sql .func { color: #ff1493; }'+'.dp-sql .op { color: #808080; }';}
10
+ dp.sh.Brushes.Sql.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Sql.Aliases=['sql'];
files/shBrushVb.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Vb=function()
9
+ {var keywords='AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto '+'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate '+'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType '+'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each '+'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend '+'Function Get GetType GoSub GoTo Handles If Implements Imports In '+'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module '+'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing '+'NotInheritable NotOverridable Object On Option Optional Or OrElse '+'Overloads Overridable Overrides ParamArray Preserve Private Property '+'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume '+'Return Select Set Shadows Shared Short Single Static Step Stop String '+'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until '+'Variant When While With WithEvents WriteOnly Xor';this.regexList=[{regex:new RegExp('\'.*$','gm'),css:'comment'},{regex:dp.sh.RegexLib.DoubleQuotedString,css:'string'},{regex:new RegExp('^\\s*#.*','gm'),css:'preprocessor'},{regex:new RegExp(this.GetKeywords(keywords),'gm'),css:'keyword'}];this.CssClass='dp-vb';}
10
+ dp.sh.Brushes.Vb.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Vb.Aliases=['vb','vb.net'];
files/shBrushXml.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ dp.sh.Brushes.Xml=function()
9
+ {this.CssClass='dp-xml';this.Style='.dp-xml .cdata { color: #ff1493; }'+'.dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }'+'.dp-xml .attribute { color: red; }'+'.dp-xml .attribute-value { color: blue; }';}
10
+ dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=['xml','xhtml','xslt','html','xhtml'];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function()
11
+ {function push(array,value)
12
+ {array[array.length]=value;}
13
+ var index=0;var match=null;var regex=null;this.GetMatches(new RegExp('(\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\&gt;|>)','gm'),'cdata');this.GetMatches(new RegExp('(\&lt;|<)!--\\s*.*?\\s*--(\&gt;|>)','gm'),'comments');regex=new RegExp('([:\\w-\.]+)\\s*=\\s*(".*?"|\'.*?\'|\\w+)*|(\\w+)','gm');while((match=regex.exec(this.code))!=null)
14
+ {if(match[1]==null)
15
+ {continue;}
16
+ push(this.matches,new dp.sh.Match(match[1],match.index,'attribute'));if(match[2]!=undefined)
17
+ {push(this.matches,new dp.sh.Match(match[2],match.index+match[0].indexOf(match[2]),'attribute-value'));}}
18
+ this.GetMatches(new RegExp('(\&lt;|<)/*\\?*(?!\\!)|/*\\?*(\&gt;|>)','gm'),'tag');regex=new RegExp('(?:\&lt;|<)/*\\?*\\s*([:\\w-\.]+)','gm');while((match=regex.exec(this.code))!=null)
19
+ {push(this.matches,new dp.sh.Match(match[1],match.index+match[0].indexOf(match[1]),'tag-name'));}}
files/shCore.js ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * JsMin
3
+ * Javascript Compressor
4
+ * http://www.crockford.com/
5
+ * http://www.smallsharptools.com/
6
+ */
7
+
8
+ var dp={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:'<html><head><title>About...</title></head><body class="dp-about"><table cellspacing="0"><tr><td class="copy"><p class="title">dp.SyntaxHighlighter</div><div class="para">Version: {V}</p><p><a href="http://www.dreamprojections.com/syntaxhighlighter/?ref=about" target="_blank">http://www.dreamprojections.com/syntaxhighlighter</a></p>&copy;2004-2007 Alex Gorbatchev.</td></tr><tr><td class="footer"><input type="button" class="close" value="OK" onClick="window.close()"/></td></tr></table></body></html>'},ClipboardSwf:null,Version:'1.5.1'}};dp.SyntaxHighlighter=dp.sh;dp.sh.Toolbar.Commands={ExpandSource:{label:'+ expand source',check:function(highlighter){return highlighter.collapse;},func:function(sender,highlighter)
9
+ {sender.parentNode.removeChild(sender);highlighter.div.className=highlighter.div.className.replace('collapsed','');}},ViewSource:{label:'view plain',func:function(sender,highlighter)
10
+ {var code=dp.sh.Utils.FixForBlogger(highlighter.originalCode).replace(/</g,'&lt;');var wnd=window.open('','_blank','width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=0');wnd.document.write('<textarea style="width:99%;height:99%">'+code+'</textarea>');wnd.document.close();}},CopyToClipboard:{label:'copy to clipboard',check:function(){return window.clipboardData!=null||dp.sh.ClipboardSwf!=null;},func:function(sender,highlighter)
11
+ {var code=dp.sh.Utils.FixForBlogger(highlighter.originalCode).replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');if(window.clipboardData)
12
+ {window.clipboardData.setData('text',code);}
13
+ else if(dp.sh.ClipboardSwf!=null)
14
+ {var flashcopier=highlighter.flashCopier;if(flashcopier==null)
15
+ {flashcopier=document.createElement('div');highlighter.flashCopier=flashcopier;highlighter.div.appendChild(flashcopier);}
16
+ flashcopier.innerHTML='<embed src="'+dp.sh.ClipboardSwf+'" FlashVars="clipboard='+encodeURIComponent(code)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';}
17
+ alert('The code is in your clipboard now');}},PrintSource:{label:'print',func:function(sender,highlighter)
18
+ {var iframe=document.createElement('IFRAME');var doc=null;iframe.style.cssText='position:absolute;width:0px;height:0px;left:-500px;top:-500px;';document.body.appendChild(iframe);doc=iframe.contentWindow.document;dp.sh.Utils.CopyStyles(doc,window.document);doc.write('<div class="'+highlighter.div.className.replace('collapsed','')+' printing">'+highlighter.div.innerHTML+'</div>');doc.close();iframe.contentWindow.focus();iframe.contentWindow.print();alert('Printing...');document.body.removeChild(iframe);}},About:{label:'?',func:function(highlighter)
19
+ {var wnd=window.open('','_blank','dialog,width=300,height=150,scrollbars=0');var doc=wnd.document;dp.sh.Utils.CopyStyles(doc,window.document);doc.write(dp.sh.Strings.AboutDialog.replace('{V}',dp.sh.Version));doc.close();wnd.focus();}}};dp.sh.Toolbar.Create=function(highlighter)
20
+ {var div=document.createElement('DIV');div.className='tools';for(var name in dp.sh.Toolbar.Commands)
21
+ {var cmd=dp.sh.Toolbar.Commands[name];if(cmd.check!=null&&!cmd.check(highlighter))
22
+ continue;div.innerHTML+='<a href="#" onclick="dp.sh.Toolbar.Command(\''+name+'\',this);return false;">'+cmd.label+'</a>';}
23
+ return div;}
24
+ dp.sh.Toolbar.Command=function(name,sender)
25
+ {var n=sender;while(n!=null&&n.className.indexOf('dp-highlighter')==-1)
26
+ n=n.parentNode;if(n!=null)
27
+ dp.sh.Toolbar.Commands[name].func(sender,n.highlighter);}
28
+ dp.sh.Utils.CopyStyles=function(destDoc,sourceDoc)
29
+ {var links=sourceDoc.getElementsByTagName('link');for(var i=0;i<links.length;i++)
30
+ if(links[i].rel.toLowerCase()=='stylesheet')
31
+ destDoc.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');}
32
+ dp.sh.Utils.FixForBlogger=function(str)
33
+ {return(dp.sh.isBloggerMode==true)?str.replace(/<br\s*\/?>|&lt;br\s*\/?&gt;/gi,'\n'):str;}
34
+ dp.sh.RegexLib={MultiLineCComments:new RegExp('/\\*[\\s\\S]*?\\*/','gm'),SingleLineCComments:new RegExp('//.*$','gm'),SingleLinePerlComments:new RegExp('#.*$','gm'),DoubleQuotedString:new RegExp('"(?:\\.|(\\\\\\")|[^\\""\\n])*"','g'),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'",'g')};dp.sh.Match=function(value,index,css)
35
+ {this.value=value;this.index=index;this.length=value.length;this.css=css;}
36
+ dp.sh.Highlighter=function()
37
+ {this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true;}
38
+ dp.sh.Highlighter.SortCallback=function(m1,m2)
39
+ {if(m1.index<m2.index)
40
+ return-1;else if(m1.index>m2.index)
41
+ return 1;else
42
+ {if(m1.length<m2.length)
43
+ return-1;else if(m1.length>m2.length)
44
+ return 1;}
45
+ return 0;}
46
+ dp.sh.Highlighter.prototype.CreateElement=function(name)
47
+ {var result=document.createElement(name);result.highlighter=this;return result;}
48
+ dp.sh.Highlighter.prototype.GetMatches=function(regex,css)
49
+ {var index=0;var match=null;while((match=regex.exec(this.code))!=null)
50
+ this.matches[this.matches.length]=new dp.sh.Match(match[0],match.index,css);}
51
+ dp.sh.Highlighter.prototype.AddBit=function(str,css)
52
+ {if(str==null||str.length==0)
53
+ return;var span=this.CreateElement('SPAN');str=str.replace(/ /g,'&nbsp;');str=str.replace(/</g,'&lt;');str=str.replace(/\n/gm,'&nbsp;<br>');if(css!=null)
54
+ {if((/br/gi).test(str))
55
+ {var lines=str.split('&nbsp;<br>');for(var i=0;i<lines.length;i++)
56
+ {span=this.CreateElement('SPAN');span.className=css;span.innerHTML=lines[i];this.div.appendChild(span);if(i+1<lines.length)
57
+ this.div.appendChild(this.CreateElement('BR'));}}
58
+ else
59
+ {span.className=css;span.innerHTML=str;this.div.appendChild(span);}}
60
+ else
61
+ {span.innerHTML=str;this.div.appendChild(span);}}
62
+ dp.sh.Highlighter.prototype.IsInside=function(match)
63
+ {if(match==null||match.length==0)
64
+ return false;for(var i=0;i<this.matches.length;i++)
65
+ {var c=this.matches[i];if(c==null)
66
+ continue;if((match.index>c.index)&&(match.index<c.index+c.length))
67
+ return true;}
68
+ return false;}
69
+ dp.sh.Highlighter.prototype.ProcessRegexList=function()
70
+ {for(var i=0;i<this.regexList.length;i++)
71
+ this.GetMatches(this.regexList[i].regex,this.regexList[i].css);}
72
+ dp.sh.Highlighter.prototype.ProcessSmartTabs=function(code)
73
+ {var lines=code.split('\n');var result='';var tabSize=4;var tab='\t';function InsertSpaces(line,pos,count)
74
+ {var left=line.substr(0,pos);var right=line.substr(pos+1,line.length);var spaces='';for(var i=0;i<count;i++)
75
+ spaces+=' ';return left+spaces+right;}
76
+ function ProcessLine(line,tabSize)
77
+ {if(line.indexOf(tab)==-1)
78
+ return line;var pos=0;while((pos=line.indexOf(tab))!=-1)
79
+ {var spaces=tabSize-pos%tabSize;line=InsertSpaces(line,pos,spaces);}
80
+ return line;}
81
+ for(var i=0;i<lines.length;i++)
82
+ result+=ProcessLine(lines[i],tabSize)+'\n';return result;}
83
+ dp.sh.Highlighter.prototype.SwitchToList=function()
84
+ {var html=this.div.innerHTML.replace(/<(br)\/?>/gi,'\n');var lines=html.split('\n');if(this.addControls==true)
85
+ this.bar.appendChild(dp.sh.Toolbar.Create(this));if(this.showColumns)
86
+ {var div=this.CreateElement('div');var columns=this.CreateElement('div');var showEvery=10;var i=1;while(i<=150)
87
+ {if(i%showEvery==0)
88
+ {div.innerHTML+=i;i+=(i+'').length;}
89
+ else
90
+ {div.innerHTML+='&middot;';i++;}}
91
+ columns.className='columns';columns.appendChild(div);this.bar.appendChild(columns);}
92
+ for(var i=0,lineIndex=this.firstLine;i<lines.length-1;i++,lineIndex++)
93
+ {var li=this.CreateElement('LI');var span=this.CreateElement('SPAN');li.className=(i%2==0)?'alt':'';span.innerHTML=lines[i]+'&nbsp;';li.appendChild(span);this.ol.appendChild(li);}
94
+ this.div.innerHTML='';}
95
+ dp.sh.Highlighter.prototype.Highlight=function(code)
96
+ {function Trim(str)
97
+ {return str.replace(/^\s*(.*?)[\s\n]*$/g,'$1');}
98
+ function Chop(str)
99
+ {return str.replace(/\n*$/,'').replace(/^\n*/,'');}
100
+ function Unindent(str)
101
+ {var lines=dp.sh.Utils.FixForBlogger(str).split('\n');var indents=new Array();var regex=new RegExp('^\\s*','g');var min=1000;for(var i=0;i<lines.length&&min>0;i++)
102
+ {if(Trim(lines[i]).length==0)
103
+ continue;var matches=regex.exec(lines[i]);if(matches!=null&&matches.length>0)
104
+ min=Math.min(matches[0].length,min);}
105
+ if(min>0)
106
+ for(var i=0;i<lines.length;i++)
107
+ lines[i]=lines[i].substr(min);return lines.join('\n');}
108
+ function Copy(string,pos1,pos2)
109
+ {return string.substr(pos1,pos2-pos1);}
110
+ var pos=0;if(code==null)
111
+ code='';this.originalCode=code;this.code=Chop(Unindent(code));this.div=this.CreateElement('DIV');this.bar=this.CreateElement('DIV');this.ol=this.CreateElement('OL');this.matches=new Array();this.div.className='dp-highlighter';this.div.highlighter=this;this.bar.className='bar';this.ol.start=this.firstLine;if(this.CssClass!=null)
112
+ this.ol.className=this.CssClass;if(this.collapse)
113
+ this.div.className+=' collapsed';if(this.noGutter)
114
+ this.div.className+=' nogutter';if(this.tabsToSpaces==true)
115
+ this.code=this.ProcessSmartTabs(this.code);this.ProcessRegexList();if(this.matches.length==0)
116
+ {this.AddBit(this.code,null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol);return;}
117
+ this.matches=this.matches.sort(dp.sh.Highlighter.SortCallback);for(var i=0;i<this.matches.length;i++)
118
+ if(this.IsInside(this.matches[i]))
119
+ this.matches[i]=null;for(var i=0;i<this.matches.length;i++)
120
+ {var match=this.matches[i];if(match==null||match.length==0)
121
+ continue;this.AddBit(Copy(this.code,pos,match.index),null);this.AddBit(match.value,match.css);pos=match.index+match.length;}
122
+ this.AddBit(this.code.substr(pos),null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol);}
123
+ dp.sh.Highlighter.prototype.GetKeywords=function(str)
124
+ {return'\\b'+str.replace(/ /g,'\\b|\\b')+'\\b';}
125
+ dp.sh.BloggerMode=function()
126
+ {dp.sh.isBloggerMode=true;}
127
+ dp.sh.HighlightAll=function(name,showGutter,showControls,collapseAll,firstLine,showColumns)
128
+ {function FindValue()
129
+ {var a=arguments;for(var i=0;i<a.length;i++)
130
+ {if(a[i]==null)
131
+ continue;if(typeof(a[i])=='string'&&a[i]!='')
132
+ return a[i]+'';if(typeof(a[i])=='object'&&a[i].value!='')
133
+ return a[i].value+'';}
134
+ return null;}
135
+ function IsOptionSet(value,list)
136
+ {for(var i=0;i<list.length;i++)
137
+ if(list[i]==value)
138
+ return true;return false;}
139
+ function GetOptionValue(name,list,defaultValue)
140
+ {var regex=new RegExp('^'+name+'\\[(\\w+)\\]$','gi');var matches=null;for(var i=0;i<list.length;i++)
141
+ if((matches=regex.exec(list[i]))!=null)
142
+ return matches[1];return defaultValue;}
143
+ function FindTagsByName(list,name,tagName)
144
+ {var tags=document.getElementsByTagName(tagName);for(var i=0;i<tags.length;i++)
145
+ if(tags[i].getAttribute('name')==name)
146
+ list.push(tags[i]);}
147
+ var elements=[];var highlighter=null;var registered={};var propertyName='innerHTML';FindTagsByName(elements,name,'pre');FindTagsByName(elements,name,'textarea');if(elements.length==0)
148
+ return;for(var brush in dp.sh.Brushes)
149
+ {var aliases=dp.sh.Brushes[brush].Aliases;if(aliases==null)
150
+ continue;for(var i=0;i<aliases.length;i++)
151
+ registered[aliases[i]]=brush;}
152
+ for(var i=0;i<elements.length;i++)
153
+ {var element=elements[i];var options=FindValue(element.attributes['class'],element.className,element.attributes['language'],element.language);var language='';if(options==null)
154
+ continue;options=options.split(':');language=options[0].toLowerCase();if(registered[language]==null)
155
+ continue;highlighter=new dp.sh.Brushes[registered[language]]();element.style.display='none';highlighter.noGutter=(showGutter==null)?IsOptionSet('nogutter',options):!showGutter;highlighter.addControls=(showControls==null)?!IsOptionSet('nocontrols',options):showControls;highlighter.collapse=(collapseAll==null)?IsOptionSet('collapse',options):collapseAll;highlighter.showColumns=(showColumns==null)?IsOptionSet('showcolumns',options):showColumns;var headNode=document.getElementsByTagName('head')[0];if(highlighter.Style&&headNode)
156
+ {var styleNode=document.createElement('style');styleNode.setAttribute('type','text/css');if(styleNode.styleSheet)
157
+ {styleNode.styleSheet.cssText=highlighter.Style;}
158
+ else
159
+ {var textNode=document.createTextNode(highlighter.Style);styleNode.appendChild(textNode);}
160
+ headNode.appendChild(styleNode);}
161
+ highlighter.firstLine=(firstLine==null)?parseInt(GetOptionValue('firstline',options,1)):firstLine;highlighter.Highlight(element[propertyName]);highlighter.source=element;element.parentNode.insertBefore(highlighter.div,element);}}
readme.txt ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === SyntaxHighlighter ===
2
+ Contributors: matt, Viper007Bond, mdawaffe
3
+ Tags: code, sourcecode, php, xhtml, html, css
4
+ Requires at least: 2.0
5
+ Stable tag: trunk
6
+
7
+ Easily post source code such as PHP or HTML and display it in a styled box.
8
+
9
+ == Description ==
10
+
11
+ SyntaxHighlighter allows you to easily post syntax highlighted code all without loosing it's formatting or making an manual changes.
12
+
13
+ It supports the following languages (the alias for use in the post is listed next to the name):
14
+
15
+ * C++ -- `cpp`, `c`, `c++`
16
+ * C# -- `c#`, `c-sharp`, `csharp`
17
+ * CSS -- `css`
18
+ * Delphi -- `delphi`, `pascal`
19
+ * Java -- `java`
20
+ * JavaScript -- `js`, `jscript`, `javascript`
21
+ * PHP -- `php`
22
+ * Python -- `py`, `python`
23
+ * Ruby -- `rb`, `ruby`, `rails`, `ror`
24
+ * SQL -- `sql`
25
+ * VB -- `vb`, `vb.net`
26
+ * XML/HTML -- `xml`, `html`, `xhtml`, `xslt`
27
+
28
+ This plugin uses the [SyntaxHighlighter JavaScript package by Alex Gorbatchev](http://code.google.com/p/syntaxhighlighter/).
29
+
30
+ == Installation ==
31
+
32
+ ###Updgrading From A Previous Version###
33
+
34
+ To upgrade from a previous version of this plugin, delete the entire folder and files from the previous version of the plugin and then follow the installation instructions below.
35
+
36
+ ###Uploading The Plugin###
37
+
38
+ Extract all files from the ZIP file, making sure to keep the file structure intact, and then upload it to `/wp-content/plugins/`.
39
+
40
+ This should result in the following file structure:
41
+
42
+ `- wp-content
43
+ - plugins
44
+ - syntaxhighlighter
45
+ | readme.txt
46
+ | screenshot-1.png
47
+ | syntaxhighlighter.php
48
+ - files
49
+ | clipboard.swf
50
+ | shBrushCpp.js
51
+ | shBrushCSharp.js
52
+ | [...]
53
+ | shCore.js
54
+ | SyntaxHighlighter.css`
55
+
56
+ **See Also:** ["Installing Plugins" article on the WP Codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins)
57
+
58
+ ###Plugin Activation###
59
+
60
+ Go to the admin area of your WordPress install and click on the "Plugins" menu. Click on "Activate" for the "SyntaxHighlighter" plugin.
61
+
62
+ ###Plugin Usage###
63
+
64
+ Just wrap your code in `[sourcecode language='css']code here[/sourcecode]`. The language attribute is **required**! See the [plugin's description](http://wordpress.org/extend/plugins/syntaxhighlighter/) for a list of valid language attributes.
65
+
66
+ == Frequently Asked Questions ==
67
+
68
+ = The BBCode in my post is being replaced with &lt;pre&gt;'s just fine, but I don't see the syntax highlighting! =
69
+
70
+ Make sure your theme's footer has `<?php wp_footer(); ?>` somewhere in it, otherwise the JavaScript highlighting files won't be loaded.
71
+
72
+ = I still see the BBCode in my post. What gives? =
73
+
74
+ Make sure you correctly use the BBCode with a valid language attribute. A malformed usage of it won't result in replacement.
75
+
76
+ == Screenshots ==
77
+
78
+ 1. Example code display. In this particular example, the default `wp-config.php` file contents are shown.
79
+
80
+ == Other BBCode Methods ==
81
+
82
+ Find `[sourcecode language='css']code here[/sourcecode]` too long to type? Here's some alternative examples:
83
+
84
+ * `[source language='css']code here[/source]`
85
+ * `[code language='css']code here[/code]`
86
+
87
+
88
+ * `[sourcecode lang='css']code here[/sourcecode]`
89
+ * `[source lang='css']code here[/source]`
90
+ * `[code lang='css']code here[/code]`
91
+
92
+
93
+ * `[sourcecode='css']code here[/sourcecode]`
94
+ * `[source='css']code here[/source]`
95
+ * `[code='css']code here[/code]`
96
+
97
+ == ChangeLog ==
98
+
99
+ **Version 1.1.1**
100
+
101
+ * Encode single quotes so `wptexturize()` doesn't transform them into fancy quotes and screw up code.
102
+
103
+ **Version 1.1.0**
104
+
105
+ * mdawaffe [fixed](http://dev.wp-plugins.org/ticket/703) an encoding issue relating to kses and users without the `unfiltered_html` capability. Mad props to mdawaffe.
106
+
107
+ **Version 1.0.1**
108
+
109
+ * Minor CSS fixes.
110
+ * Filter text widgets to allow posting of code.
111
+
112
+ **Version 1.0.0**
113
+
114
+ * Initial release!
screenshot-1.png ADDED
Binary file
syntaxhighlighter.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /*
2
+
3
+ **************************************************************************
4
+
5
+ Plugin Name: SyntaxHighlighter
6
+ Plugin URI: http://wordpress.org/extend/plugins/syntaxhighlighter/
7
+ Version: 1.1.2
8
+ Description: An advanced upload-and-activate WordPress implementation of Alex Gorbatchev's <a href="http://code.google.com/p/syntaxhighlighter/">SyntaxHighlighter</a> JavaScript code highlighting package. See WordPress.com's "<a href="http://faq.wordpress.com/2007/09/03/how-do-i-post-source-code/">How do I post source code?</a>" for details.
9
+ Author: <a href="http://photomatt.net/">Matt</a>, <a href="http://www.viper007bond.com/">Viper007Bond</a>, and <a href="http://blogwaffe.com/">mdawaffe</a>
10
+
11
+ **************************************************************************
12
+
13
+ Credits:
14
+
15
+ * Matt ( ma.tt ) -- original concept and code on WP.com
16
+ * Viper007Bond ( viper007bond.com ) -- current plugin version
17
+
18
+ Simply put, Matt deserves the majority of the credit for this plugin.
19
+ I (Viper007Bond) just took the plugin I had already written (it looked a
20
+ lot like this current one) after seeing his code operate on WP.com and
21
+ incorporated his ingenius TinyMCE handling and some other misc. code.
22
+
23
+ **************************************************************************/
24
+
25
+ class AGSyntaxHighlighter {
26
+ var $languages = array();
27
+ var $languagesregex;
28
+ var $jsfiles2load = array();
29
+ var $pluginurl;
30
+ var $kses_active = array();
31
+ var $kses_filters = array();
32
+ var $widget_format_to_edit = false;
33
+
34
+ // WordPress hooks
35
+ function AGSyntaxHighlighter() {
36
+ add_action( 'init', array(&$this, 'SetVariables'), 1000 );
37
+ add_action( 'wp_head', array(&$this, 'AddStylesheet'), 1000 );
38
+ add_action( 'admin_head', array(&$this, 'AddStylesheet'), 1000 );
39
+ add_action( 'wp_footer', array(&$this, 'FileLoader'), 1000 );
40
+ add_action( 'admin_footer', array(&$this, 'FileLoader'), 1000 ); // For viewing comments in admin area
41
+
42
+ // Find and replace the BBCode
43
+ add_filter( 'the_content', array(&$this, 'BBCodeToHTML'), 8 );
44
+ add_filter( 'widget_text', array(&$this, 'BBCodeToHTML'), 8 );
45
+
46
+ // Account for kses
47
+ add_filter( 'content_save_pre', array(&$this, 'before_kses_normalization'), 1 );
48
+ add_filter( 'content_save_pre', array(&$this, 'after_kses_normalization'), 11 );
49
+ add_action( 'admin_head', array(&$this, 'before_kses_normalization_widget'), 1 );
50
+ add_action( 'update_option_widget_text', array(&$this, 'after_kses_normalization_widget'), 1, 2 );
51
+ add_filter( 'format_to_edit', array(&$this, 'after_kses_normalization_widget_format_to_edit'), 1 );
52
+
53
+ // Account for TinyMCE
54
+ add_filter( 'content_save_pre', array(&$this, 'TinyMCEDecode'), 8 );
55
+ add_filter( 'the_editor_content', array(&$this, 'TinyMCEEncode'), 8 );
56
+
57
+ // Uncomment these next lines to allow commenters to post code
58
+ //add_filter( 'comment_text', array(&$this, 'BBCodeToHTML'), 8 );
59
+ //add_filter( 'pre_comment_content', array(&$this, 'before_kses_normalization_comment'), 1 );
60
+ //add_filter( 'pre_comment_content', array(&$this, 'after_kses_normalization_comment'), 11 );
61
+ }
62
+
63
+
64
+ // Set some variables now that we've given all other plugins a chance to load
65
+ function SetVariables() {
66
+ $this->pluginurl = apply_filters( 'agsyntaxhighlighter_url', get_bloginfo( 'wpurl' ) . '/wp-content/plugins/syntaxhighlighter/files/' );
67
+ if ( defined( 'WP_CONTENT_URL' ) )
68
+ $this->pluginurl = apply_filters( 'agsyntaxhighlighter_url', WP_CONTENT_URL . '/plugins/syntaxhighlighter/files/' );
69
+ // Define all allowed languages and allow plugins to modify this
70
+ $this->languages = apply_filters( 'agsyntaxhighlighter_languages', array(
71
+ 'cpp' => 'shBrushCpp.js',
72
+ 'c' => 'shBrushCpp.js',
73
+ 'c++' => 'shBrushCpp.js',
74
+ 'c#' => 'shBrushCSharp.js',
75
+ 'c-sharp' => 'shBrushCSharp.js',
76
+ 'csharp' => 'shBrushCSharp.js',
77
+ 'css' => 'shBrushCss.js',
78
+ 'delphi' => 'shBrushDelphi.js',
79
+ 'pascal' => 'shBrushDelphi.js',
80
+ 'java' => 'shBrushJava.js',
81
+ 'js' => 'shBrushJScript.js',
82
+ 'jscript' => 'shBrushJScript.js',
83
+ 'javascript' => 'shBrushJScript.js',
84
+ 'php' => 'shBrushPhp.js',
85
+ 'py' => 'shBrushPython.js',
86
+ 'python' => 'shBrushPython.js',
87
+ 'rb' => 'shBrushRuby.js',
88
+ 'ruby' => 'shBrushRuby.js',
89
+ 'rails' => 'shBrushRuby.js',
90
+ 'ror' => 'shBrushRuby.js',
91
+ 'sql' => 'shBrushSql.js',
92
+ 'vb' => 'shBrushVb.js',
93
+ 'vb.net' => 'shBrushVb.js',
94
+ 'xml' => 'shBrushXml.js',
95
+ 'html' => 'shBrushXml.js',
96
+ 'xhtml' => 'shBrushXml.js',
97
+ 'xslt' => 'shBrushXml.js',
98
+ ) );
99
+
100
+ // Quote them to make them regex safe
101
+ $languages = array();
102
+ foreach ( $this->languages as $language => $filename ) $languages[] = preg_quote( $language );
103
+
104
+ // Generate the regex for them
105
+ $this->languagesregex = '(' . implode( '|', $languages ) . ')';
106
+
107
+ $this->kses_filters = apply_filters( 'agsyntaxhighlighter_kses_filters', array(
108
+ 'wp_filter_kses',
109
+ 'wp_filter_post_kses',
110
+ 'wp_filter_nohtml_kses'
111
+ ) );
112
+ }
113
+
114
+
115
+ // We need to stick the stylesheet in the header for best results
116
+ function AddStylesheet() {
117
+ echo ' <link type="text/css" rel="stylesheet" href="' . $this->pluginurl . 'SyntaxHighlighter.css"></link>' . "\n";
118
+ }
119
+
120
+
121
+ // This function checks for the BBCode cheaply so we don't waste CPU cycles on regex if it's not needed
122
+ // It's in a seperate function since it's used in mulitple places (makes it easier to edit)
123
+ function CheckForBBCode( $content ) {
124
+ if ( stristr( $content, '[sourcecode' ) && stristr( $content, '[/sourcecode]' ) ) return TRUE;
125
+ if ( stristr( $content, '[source' ) && stristr( $content, '[/source]' ) ) return TRUE;
126
+ if ( stristr( $content, '[code' ) && stristr( $content, '[/code]' ) ) return TRUE;
127
+
128
+ return FALSE;
129
+ }
130
+
131
+
132
+ // This function is a wrapper for preg_match_all() that grabs all BBCode calls
133
+ // It's in a seperate function since it's used in mulitple places (makes it easier to edit)
134
+ function GetBBCode( $content, $addslashes = FALSE ) {
135
+ $regex = '/\[(sourcecod|sourc|cod)(e language=|e lang=|e=)';
136
+ if ( $addslashes ) $regex .= '\\\\';
137
+ $regex .= '([\'"])' . $this->languagesregex;
138
+ if ( $addslashes ) $regex .= '\\\\';
139
+ $regex .= '\3\](.*?)\[\/\1e\]/si';
140
+
141
+ preg_match_all( $regex, $content, $matches, PREG_SET_ORDER );
142
+
143
+ return $matches;
144
+ }
145
+
146
+
147
+ /* If KSES is going to hit this text, we double encode stuff within the [sourcecode] tags to keep
148
+ * wp_kses_normalize_entities from breaking them.
149
+ * $content = text to parse
150
+ * $which_filter = which filter to check to see if kses will be applied
151
+ * $addslashes = used by AGSyntaxHighlighter::GetBBCode
152
+ */
153
+ function before_kses_normalization( $content, $which_filter = 'content_save_pre', $addslashes = true ) {
154
+ global $wp_filter;
155
+ if ( is_string($which_filter) && !isset($this->kses_active[$which_filter]) ) {
156
+ $this->kses_active[$which_filter] = false;
157
+ $filters = $wp_filter[$which_filter];
158
+ foreach ( (array) $filters as $priority => $filter ) {
159
+ foreach ( $filter as $k => $v ) {
160
+ if ( in_array( $filter[$k]['function'], $this->kses_filters ) ) {
161
+ $this->kses_active[$which_filter] = true;
162
+ break 2;
163
+ }
164
+ }
165
+ }
166
+ }
167
+
168
+ if ( ( true === $which_filter || $this->kses_active[$which_filter] ) && $this->CheckForBBCode( $content ) ) {
169
+ $matches = $this->GetBBCode( $content, $addslashes );
170
+ foreach( (array) $matches as $match )
171
+ $content = str_replace( $match[5], htmlspecialchars( $match[5], ENT_QUOTES ), $content );
172
+ }
173
+ return $content;
174
+ }
175
+
176
+
177
+ /* We undouble encode the stuff within [sourcecode] tags to fix the output of
178
+ * AGSyntaxHighlighter::before_kses_normalization.
179
+ */
180
+ function after_kses_normalization( $content, $which_filter = 'content_save_pre', $addslashes = true ) {
181
+ if ( ( true === $which_filter || $this->kses_active[$which_filter] ) && $this->CheckForBBCode( $content ) ) {
182
+ $matches = $this->GetBBCode( $content, $addslashes );
183
+ foreach( (array) $matches as $match )
184
+ $content = str_replace( $match[5], htmlspecialchars_decode( $match[5], ENT_QUOTES ), $content );
185
+ }
186
+ return $content;
187
+ }
188
+
189
+
190
+ // Wrapper for comment text
191
+ function before_kses_normalization_comment( $content ) {
192
+ return $this->before_kses_normalization( $content, 'pre_comment_content' );
193
+ }
194
+
195
+
196
+ function after_kses_normalization_comment( $content ) {
197
+ return $this->after_kses_normalization( $content, 'pre_comment_content' );
198
+ }
199
+
200
+
201
+ /* "Wrapper" for widget text. Since we lack the necessary filters, we directly alter the
202
+ * submitted $_POST variables before the widgets are updated.
203
+ */
204
+ function before_kses_normalization_widget() {
205
+ global $pagenow;
206
+ if ( 'widgets.php' != $pagenow || current_user_can( 'unfiltered_html' ) )
207
+ return;
208
+
209
+ $i = 1;
210
+ while ( isset($_POST["text-submit-$i"]) ) {
211
+ $_POST["text-text-$i"] = $this->before_kses_normalization( $_POST["text-text-$i"], true );
212
+ $i++;
213
+ }
214
+ }
215
+
216
+ // Again, since we lack the needed filters, we have to check the freshly updated option and re-update it.
217
+ function after_kses_normalization_widget( $old, $new ) {
218
+ static $do_update = true;
219
+
220
+ if ( !$do_update || current_user_can( 'unfiltered_html' ) )
221
+ return;
222
+
223
+ foreach ( array_keys($new) as $i => $widget )
224
+ $new[$i]['text'] = $this->after_kses_normalization( $new[$i]['text'], true, false );
225
+
226
+ $do_update = false;
227
+
228
+ update_option( 'widget_text', $new );
229
+ $this->widget_format_to_edit = true;
230
+
231
+ $do_update = true;
232
+ }
233
+
234
+ // Totally lame. The output of the widget form in the admin screen is cached from before our re-update.
235
+ function after_kses_normalization_widget_format_to_edit( $content ) {
236
+ if ( !$this->widget_format_to_edit )
237
+ return $content;
238
+
239
+ $content = $this->after_kses_normalization( $content, true, false );
240
+
241
+ $this->widget_format_to_edit = false;
242
+
243
+ return $content;
244
+ }
245
+
246
+ // Reverse changes TinyMCE made to the entered code
247
+ function TinyMCEDecode( $content ) {
248
+ if ( !user_can_richedit() || !$this->CheckForBBCode( $content ) ) return $content;
249
+
250
+ // Find all BBCode (remember, it's all slash escaped!)
251
+ $matches = $this->GetBBCode( $content, TRUE );
252
+
253
+ if ( empty($matches) ) return $content; // No BBCode found, we can stop here
254
+
255
+ // Loop through each match and decode the code
256
+ foreach ( (array) $matches as $match ) {
257
+ $content = str_replace( $match[5], htmlspecialchars_decode( $match[5] ), $content );
258
+ }
259
+
260
+ return $content;
261
+ }
262
+
263
+
264
+ // (Re)Encode the code so TinyMCE will display it correctly
265
+ function TinyMCEEncode( $content ) {
266
+ if ( !user_can_richedit() || !$this->CheckForBBCode( $content ) ) return $content;
267
+
268
+ $matches = $this->GetBBCode( $content );
269
+
270
+ if ( empty($matches) ) return $content; // No BBCode found, we can stop here
271
+
272
+ // Loop through each match and encode the code
273
+ foreach ( (array) $matches as $match ) {
274
+ $code = htmlspecialchars( $match[5] );
275
+ $code = str_replace( '&amp;', '&amp;amp;', $code );
276
+ $code = str_replace( '&amp;lt;', '&amp;amp;lt;', $code );
277
+ $code = str_replace( '&amp;gt;', '&amp;amp;gt;', $code );
278
+
279
+ $content = str_replace( $match[5], $code, $content );
280
+ }
281
+
282
+ return $content;
283
+ }
284
+
285
+
286
+ // The meat of the plugin. Find all valid BBCode calls and replace them with HTML for the Javascript to handle.
287
+ function BBCodeToHTML( $content ) {
288
+ if ( !$this->CheckForBBCode( $content ) ) return $content;
289
+
290
+ $matches = $this->GetBBCode( $content );
291
+
292
+ if ( empty($matches) ) return $content; // No BBCode found, we can stop here
293
+
294
+ // Loop through each match and replace the BBCode with HTML
295
+ foreach ( (array) $matches as $match ) {
296
+ $language = strtolower( $match[4] );
297
+ $content = str_replace( $match[0], '<pre name="code" class="' . $language . "\">\n" . htmlspecialchars( $match[5], ENT_QUOTES ) . "\n</pre>", $content );
298
+ $this->jsfiles2load[$this->languages[$language]] = TRUE;
299
+ }
300
+
301
+ return $content;
302
+ }
303
+
304
+
305
+ // Output the HTML to load all of SyntaxHighlighter's Javascript, CSS, and SWF files
306
+ function FileLoader() {
307
+ ?>
308
+
309
+ <!-- SyntaxHighlighter Stuff -->
310
+ <script type="text/javascript" src="<?php echo $this->pluginurl; ?>shCore.js"></script>
311
+ <?php foreach ( $this->jsfiles2load as $filename => $foobar ) : ?>
312
+ <script type="text/javascript" src="<?php echo $this->pluginurl . $filename; ?>"></script>
313
+ <?php endforeach; ?>
314
+ <script type="text/javascript">
315
+ dp.SyntaxHighlighter.ClipboardSwf = '<?php echo $this->pluginurl; ?>clipboard.swf';
316
+ dp.SyntaxHighlighter.HighlightAll('code');
317
+ </script>
318
+
319
+ <?php
320
+ }
321
+ }
322
+
323
+ // Initiate the plugin class
324
+ $AGSyntaxHighlighter = new AGSyntaxHighlighter();
325
+
326
+ // For those poor souls stuck on PHP4
327
+ if ( !function_exists( 'htmlspecialchars_decode' ) ) {
328
+ function htmlspecialchars_decode( $string, $quote_style = ENT_COMPAT ) {
329
+ return strtr( $string, array_flip( get_html_translation_table( HTML_SPECIALCHARS, $quote_style) ) );
330
+ }
331
+ }
332
+
333
+ ?>