aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinweiClarkChao <[email protected]>2014-02-20 12:50:15 +0800
committerJinweiClarkChao <[email protected]>2014-02-20 12:52:51 +0800
commit31fb10f393fbfd4d7adf528ec70624d2b8d247a8 (patch)
tree1009bb2a4f5fe89b8bc822b68104018ea8df5261 /Blocks/syntax
parentbe404e3e01ca839e730c884309c25abef10863c9 (diff)
downloadjinwei.me-31fb10f393fbfd4d7adf528ec70624d2b8d247a8.tar.gz
Six Blocks Version
Diffstat (limited to 'Blocks/syntax')
-rw-r--r--Blocks/syntax/LGPL-LICENSE165
-rw-r--r--Blocks/syntax/MIT-LICENSE20
-rw-r--r--Blocks/syntax/compass/_theme_template.scss120
-rw-r--r--Blocks/syntax/compass/config.rb14
-rw-r--r--Blocks/syntax/compass/shCore.scss216
-rw-r--r--Blocks/syntax/compass/shCoreDefault.scss2
-rw-r--r--Blocks/syntax/compass/shCoreDjango.scss2
-rw-r--r--Blocks/syntax/compass/shCoreEclipse.scss2
-rw-r--r--Blocks/syntax/compass/shCoreEmacs.scss2
-rw-r--r--Blocks/syntax/compass/shCoreFadeToGrey.scss2
-rw-r--r--Blocks/syntax/compass/shCoreMDUltra.scss2
-rw-r--r--Blocks/syntax/compass/shCoreMidnight.scss2
-rw-r--r--Blocks/syntax/compass/shCoreRDark.scss2
-rw-r--r--Blocks/syntax/compass/shThemeDefault.scss7
-rw-r--r--Blocks/syntax/compass/shThemeDjango.scss36
-rw-r--r--Blocks/syntax/compass/shThemeEclipse.scss48
-rw-r--r--Blocks/syntax/compass/shThemeEmacs.scss32
-rw-r--r--Blocks/syntax/compass/shThemeFadeToGrey.scss36
-rw-r--r--Blocks/syntax/compass/shThemeMDUltra.scss32
-rw-r--r--Blocks/syntax/compass/shThemeMidnight.scss32
-rw-r--r--Blocks/syntax/compass/shThemeRDark.scss32
-rw-r--r--Blocks/syntax/index.html24
-rw-r--r--Blocks/syntax/scripts/shAutoloader.js17
-rw-r--r--Blocks/syntax/scripts/shBrushAS3.js59
-rw-r--r--Blocks/syntax/scripts/shBrushAppleScript.js75
-rw-r--r--Blocks/syntax/scripts/shBrushBash.js59
-rw-r--r--Blocks/syntax/scripts/shBrushCSharp.js65
-rw-r--r--Blocks/syntax/scripts/shBrushColdFusion.js100
-rw-r--r--Blocks/syntax/scripts/shBrushCpp.js97
-rw-r--r--Blocks/syntax/scripts/shBrushCss.js91
-rw-r--r--Blocks/syntax/scripts/shBrushDelphi.js55
-rw-r--r--Blocks/syntax/scripts/shBrushDiff.js41
-rw-r--r--Blocks/syntax/scripts/shBrushErlang.js52
-rw-r--r--Blocks/syntax/scripts/shBrushGroovy.js67
-rw-r--r--Blocks/syntax/scripts/shBrushJScript.js52
-rw-r--r--Blocks/syntax/scripts/shBrushJava.js57
-rw-r--r--Blocks/syntax/scripts/shBrushJavaFX.js58
-rw-r--r--Blocks/syntax/scripts/shBrushPerl.js72
-rw-r--r--Blocks/syntax/scripts/shBrushPhp.js88
-rw-r--r--Blocks/syntax/scripts/shBrushPlain.js33
-rw-r--r--Blocks/syntax/scripts/shBrushPowerShell.js74
-rw-r--r--Blocks/syntax/scripts/shBrushPython.js64
-rw-r--r--Blocks/syntax/scripts/shBrushRuby.js55
-rw-r--r--Blocks/syntax/scripts/shBrushSass.js94
-rw-r--r--Blocks/syntax/scripts/shBrushScala.js51
-rw-r--r--Blocks/syntax/scripts/shBrushSql.js66
-rw-r--r--Blocks/syntax/scripts/shBrushVb.js56
-rw-r--r--Blocks/syntax/scripts/shBrushXml.js69
-rw-r--r--Blocks/syntax/scripts/shCore.js17
-rw-r--r--Blocks/syntax/scripts/shLegacy.js17
-rw-r--r--Blocks/syntax/src/shAutoloader.js130
-rw-r--r--Blocks/syntax/src/shCore.js1721
-rw-r--r--Blocks/syntax/src/shLegacy.js157
-rw-r--r--Blocks/syntax/styles/shCore.css226
-rw-r--r--Blocks/syntax/styles/shCoreDefault.css328
-rw-r--r--Blocks/syntax/styles/shCoreDjango.css331
-rw-r--r--Blocks/syntax/styles/shCoreEclipse.css339
-rw-r--r--Blocks/syntax/styles/shCoreEmacs.css324
-rw-r--r--Blocks/syntax/styles/shCoreFadeToGrey.css328
-rw-r--r--Blocks/syntax/styles/shCoreMDUltra.css324
-rw-r--r--Blocks/syntax/styles/shCoreMidnight.css324
-rw-r--r--Blocks/syntax/styles/shCoreRDark.css324
-rw-r--r--Blocks/syntax/styles/shThemeDefault.css117
-rw-r--r--Blocks/syntax/styles/shThemeDjango.css120
-rw-r--r--Blocks/syntax/styles/shThemeEclipse.css128
-rw-r--r--Blocks/syntax/styles/shThemeEmacs.css113
-rw-r--r--Blocks/syntax/styles/shThemeFadeToGrey.css117
-rw-r--r--Blocks/syntax/styles/shThemeMDUltra.css113
-rw-r--r--Blocks/syntax/styles/shThemeMidnight.css113
-rw-r--r--Blocks/syntax/styles/shThemeRDark.css113
-rw-r--r--Blocks/syntax/tests/.rvmrc1
-rw-r--r--Blocks/syntax/tests/brushes/sass.html204
-rw-r--r--Blocks/syntax/tests/brushes_tests.html143
-rw-r--r--Blocks/syntax/tests/cases/001_basic.html42
-rw-r--r--Blocks/syntax/tests/cases/002_brushes.html50
-rw-r--r--Blocks/syntax/tests/cases/003_script_tag.html42
-rw-r--r--Blocks/syntax/tests/cases/004_url_parsing.html43
-rw-r--r--Blocks/syntax/tests/cases/005_no_gutter.html33
-rw-r--r--Blocks/syntax/tests/cases/006_pad_line_numbers.html39
-rw-r--r--Blocks/syntax/tests/cases/007_collapse.html60
-rw-r--r--Blocks/syntax/tests/cases/007_collapse_interaction.html44
-rw-r--r--Blocks/syntax/tests/cases/008_first_line.html29
-rw-r--r--Blocks/syntax/tests/cases/009_class_name.html32
-rw-r--r--Blocks/syntax/tests/cases/010_highlight.html70
-rw-r--r--Blocks/syntax/tests/cases/011_smart_tabs.html98
-rw-r--r--Blocks/syntax/tests/cases/012_server_side.html35
-rw-r--r--Blocks/syntax/tests/cases/013_html_script.html34
-rw-r--r--Blocks/syntax/tests/cases/014_legacy.html70
-rw-r--r--Blocks/syntax/tests/commonjs_tests.js52
-rw-r--r--Blocks/syntax/tests/js/jquery-1.4.2.js6240
-rw-r--r--Blocks/syntax/tests/js/qunit.css135
-rw-r--r--Blocks/syntax/tests/js/qunit.js1069
-rw-r--r--Blocks/syntax/tests/syntaxhighlighter_tests.html249
-rw-r--r--Blocks/syntax/tests/theme_tests.html141
-rw-r--r--Blocks/syntax/tests/webrick.rb11
-rw-r--r--Blocks/syntax/tests/webrick.sh2
96 files changed, 17289 insertions, 0 deletions
diff --git a/Blocks/syntax/LGPL-LICENSE b/Blocks/syntax/LGPL-LICENSE
new file mode 100644
index 0000000..3f9959f
--- /dev/null
+++ b/Blocks/syntax/LGPL-LICENSE
@@ -0,0 +1,165 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8
9 This version of the GNU Lesser General Public License incorporates
10the terms and conditions of version 3 of the GNU General Public
11License, supplemented by the additional permissions listed below.
12
13 0. Additional Definitions.
14
15 As used herein, "this License" refers to version 3 of the GNU Lesser
16General Public License, and the "GNU GPL" refers to version 3 of the GNU
17General Public License.
18
19 "The Library" refers to a covered work governed by this License,
20other than an Application or a Combined Work as defined below.
21
22 An "Application" is any work that makes use of an interface provided
23by the Library, but which is not otherwise based on the Library.
24Defining a subclass of a class defined by the Library is deemed a mode
25of using an interface provided by the Library.
26
27 A "Combined Work" is a work produced by combining or linking an
28Application with the Library. The particular version of the Library
29with which the Combined Work was made is also called the "Linked
30Version".
31
32 The "Minimal Corresponding Source" for a Combined Work means the
33Corresponding Source for the Combined Work, excluding any source code
34for portions of the Combined Work that, considered in isolation, are
35based on the Application, and not on the Linked Version.
36
37 The "Corresponding Application Code" for a Combined Work means the
38object code and/or source code for the Application, including any data
39and utility programs needed for reproducing the Combined Work from the
40Application, but excluding the System Libraries of the Combined Work.
41
42 1. Exception to Section 3 of the GNU GPL.
43
44 You may convey a covered work under sections 3 and 4 of this License
45without being bound by section 3 of the GNU GPL.
46
47 2. Conveying Modified Versions.
48
49 If you modify a copy of the Library, and, in your modifications, a
50facility refers to a function or data to be supplied by an Application
51that uses the facility (other than as an argument passed when the
52facility is invoked), then you may convey a copy of the modified
53version:
54
55 a) under this License, provided that you make a good faith effort to
56 ensure that, in the event an Application does not supply the
57 function or data, the facility still operates, and performs
58 whatever part of its purpose remains meaningful, or
59
60 b) under the GNU GPL, with none of the additional permissions of
61 this License applicable to that copy.
62
63 3. Object Code Incorporating Material from Library Header Files.
64
65 The object code form of an Application may incorporate material from
66a header file that is part of the Library. You may convey such object
67code under terms of your choice, provided that, if the incorporated
68material is not limited to numerical parameters, data structure
69layouts and accessors, or small macros, inline functions and templates
70(ten or fewer lines in length), you do both of the following:
71
72 a) Give prominent notice with each copy of the object code that the
73 Library is used in it and that the Library and its use are
74 covered by this License.
75
76 b) Accompany the object code with a copy of the GNU GPL and this license
77 document.
78
79 4. Combined Works.
80
81 You may convey a Combined Work under terms of your choice that,
82taken together, effectively do not restrict modification of the
83portions of the Library contained in the Combined Work and reverse
84engineering for debugging such modifications, if you also do each of
85the following:
86
87 a) Give prominent notice with each copy of the Combined Work that
88 the Library is used in it and that the Library and its use are
89 covered by this License.
90
91 b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 document.
93
94 c) For a Combined Work that displays copyright notices during
95 execution, include the copyright notice for the Library among
96 these notices, as well as a reference directing the user to the
97 copies of the GNU GPL and this license document.
98
99 d) Do one of the following:
100
101 0) Convey the Minimal Corresponding Source under the terms of this
102 License, and the Corresponding Application Code in a form
103 suitable for, and under terms that permit, the user to
104 recombine or relink the Application with a modified version of
105 the Linked Version to produce a modified Combined Work, in the
106 manner specified by section 6 of the GNU GPL for conveying
107 Corresponding Source.
108
109 1) Use a suitable shared library mechanism for linking with the
110 Library. A suitable mechanism is one that (a) uses at run time
111 a copy of the Library already present on the user's computer
112 system, and (b) will operate properly with a modified version
113 of the Library that is interface-compatible with the Linked
114 Version.
115
116 e) Provide Installation Information, but only if you would otherwise
117 be required to provide such information under section 6 of the
118 GNU GPL, and only to the extent that such information is
119 necessary to install and execute a modified version of the
120 Combined Work produced by recombining or relinking the
121 Application with a modified version of the Linked Version. (If
122 you use option 4d0, the Installation Information must accompany
123 the Minimal Corresponding Source and Corresponding Application
124 Code. If you use option 4d1, you must provide the Installation
125 Information in the manner specified by section 6 of the GNU GPL
126 for conveying Corresponding Source.)
127
128 5. Combined Libraries.
129
130 You may place library facilities that are a work based on the
131Library side by side in a single library together with other library
132facilities that are not Applications and are not covered by this
133License, and convey such a combined library under terms of your
134choice, if you do both of the following:
135
136 a) Accompany the combined library with a copy of the same work based
137 on the Library, uncombined with any other library facilities,
138 conveyed under the terms of this License.
139
140 b) Give prominent notice with the combined library that part of it
141 is a work based on the Library, and explaining where to find the
142 accompanying uncombined form of the same work.
143
144 6. Revised Versions of the GNU Lesser General Public License.
145
146 The Free Software Foundation may publish revised and/or new versions
147of the GNU Lesser General Public License from time to time. Such new
148versions will be similar in spirit to the present version, but may
149differ in detail to address new problems or concerns.
150
151 Each version is given a distinguishing version number. If the
152Library as you received it specifies that a certain numbered version
153of the GNU Lesser General Public License "or any later version"
154applies to it, you have the option of following the terms and
155conditions either of that published version or of any later version
156published by the Free Software Foundation. If the Library as you
157received it does not specify a version number of the GNU Lesser
158General Public License, you may choose any version of the GNU Lesser
159General Public License ever published by the Free Software Foundation.
160
161 If the Library as you received it specifies that a proxy can decide
162whether future versions of the GNU Lesser General Public License shall
163apply, that proxy's public statement of acceptance of any version is
164permanent authorization for you to choose that version for the
165Library. \ No newline at end of file
diff --git a/Blocks/syntax/MIT-LICENSE b/Blocks/syntax/MIT-LICENSE
new file mode 100644
index 0000000..e7c70ba
--- /dev/null
+++ b/Blocks/syntax/MIT-LICENSE
@@ -0,0 +1,20 @@
1Copyright (c) 2003, 2004 Jim Weirich
2
3Permission is hereby granted, free of charge, to any person obtaining
4a copy of this software and associated documentation files (the
5"Software"), to deal in the Software without restriction, including
6without limitation the rights to use, copy, modify, merge, publish,
7distribute, sublicense, and/or sell copies of the Software, and to
8permit persons to whom the Software is furnished to do so, subject to
9the following conditions:
10
11The above copyright notice and this permission notice shall be
12included in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Blocks/syntax/compass/_theme_template.scss b/Blocks/syntax/compass/_theme_template.scss
new file mode 100644
index 0000000..53f4df5
--- /dev/null
+++ b/Blocks/syntax/compass/_theme_template.scss
@@ -0,0 +1,120 @@
1$background: white !default;
2
3$line_alt1_background: $background !default;
4$line_alt2_background: $background !default;
5
6$line_highlighted_background: #e0e0e0 !default;
7$line_highlighted_number: black !default;
8
9$gutter_text: #afafaf !default;
10$gutter_border_color: #6ce26c !default;
11$gutter_border: 3px solid $gutter_border_color !default;
12
13$toolbar_collapsed_a: #00f !default;
14$toolbar_collapsed_a_hover: #f00 !default;
15$toolbar_collapsed_background: #fff !default;
16$toolbar_collapsed_border: 1px solid $gutter_border_color !default;
17
18$toolbar_a: #fff !default;
19$toolbar_a_hover: #000 !default;
20$toolbar_background: $gutter_border_color !default;
21$toolbar_border: none !default;
22
23$code_plain: black !default;
24$code_comments: #008200 !default;
25$code_string: blue !default;
26$code_keyword: #006699 !default;
27$code_preprocessor: gray !default;
28$code_variable: #aa7700 !default;
29$code_value: #009900 !default;
30$code_functions: #ff1493 !default;
31$code_constants: #0066cc !default;
32$code_script: $code_keyword !default;
33$code_script_background: none !default;
34$code_color1: gray !default;
35$code_color2: #ff1493 !default;
36$code_color3: red !default;
37
38$caption_color: $code_plain !default;
39
40// Interface elements.
41.syntaxhighlighter {
42 background-color: $background !important;
43
44 // Highlighed line number
45 .line {
46 &.alt1 { background-color: $line_alt1_background !important; }
47 &.alt2 { background-color: $line_alt2_background !important; }
48
49 // Highlighed line
50 &.highlighted {
51 &.alt1, &.alt2 { background-color: $line_highlighted_background !important; }
52 &.number { color: $line_highlighted_number !important; }
53 }
54 }
55
56 table {
57 caption {
58 color: $caption_color !important;
59 }
60 }
61
62 // Add border to the lines
63 .gutter {
64 color: $gutter_text !important;
65 .line {
66 border-right: $gutter_border !important;
67
68 &.highlighted {
69 background-color: $gutter_border_color !important;
70 color: $background !important;
71 }
72 }
73 }
74
75 &.printing .line .content { border: none !important; }
76
77 &.collapsed {
78 overflow: visible !important;
79
80 .toolbar {
81 color: $toolbar_collapsed_a !important;
82 background: $toolbar_collapsed_background !important;
83 border: $toolbar_collapsed_border !important;
84
85 a {
86 color: $toolbar_collapsed_a !important;
87 &:hover { color: $toolbar_collapsed_a_hover !important; }
88 }
89 }
90 }
91
92 .toolbar {
93 color: $toolbar_a !important;
94 background: $toolbar_background !important;
95 border: $toolbar_border !important;
96 a {
97 color: $toolbar_a !important;
98 &:hover { color: $toolbar_a_hover !important; }
99 }
100 }
101
102 // Actual syntax highlighter colors.
103 .plain, .plain a { color: $code_plain !important; }
104 .comments, .comments a { color: $code_comments !important; }
105 .string, .string a { color: $code_string !important; }
106 .keyword { color: $code_keyword !important; }
107 .preprocessor { color: $code_preprocessor !important; }
108 .variable { color: $code_variable !important; }
109 .value { color: $code_value !important; }
110 .functions { color: $code_functions !important; }
111 .constants { color: $code_constants !important; }
112 .script {
113 font-weight: bold !important;
114 color: $code_script !important;
115 background-color: $code_script_background !important;
116 }
117 .color1, .color1 a { color: $code_color1 !important; }
118 .color2, .color2 a { color: $code_color2 !important; }
119 .color3, .color3 a { color: $code_color3 !important; }
120}
diff --git a/Blocks/syntax/compass/config.rb b/Blocks/syntax/compass/config.rb
new file mode 100644
index 0000000..6f82de1
--- /dev/null
+++ b/Blocks/syntax/compass/config.rb
@@ -0,0 +1,14 @@
1environment = :production
2project_type = :stand_alone
3http_path = "/"
4css_dir = "../styles"
5sass_dir = "."
6images_dir = "images"
7sass_options = {
8 :line_numbers => false,
9 :debug_info => false
10}
11
12# output_style = :compressed
13# output_style = :compact
14output_style = :expanded
diff --git a/Blocks/syntax/compass/shCore.scss b/Blocks/syntax/compass/shCore.scss
new file mode 100644
index 0000000..a67e4f9
--- /dev/null
+++ b/Blocks/syntax/compass/shCore.scss
@@ -0,0 +1,216 @@
1@mixin round_corners_custom($top, $right, $bottom, $left) {
2 -moz-border-radius: $top $right $bottom $left !important;
3 -webkit-border-radius: $top $right $bottom $left !important;
4}
5
6@mixin round_corners($radius) {
7 @include round_corners_custom($radius, $radius, $radius, $radius);
8}
9
10.syntaxhighlighter {
11 a,
12 div,
13 code,
14 table,
15 table td,
16 table tr,
17 table tbody,
18 table thead,
19 table caption,
20 textarea {
21 @include round_corners(0);
22
23 background: none !important;
24 border: 0 !important;
25 bottom: auto !important;
26 float: none !important;
27 height: auto !important;
28 left: auto !important;
29 line-height: 1.1em !important;
30 margin: 0 !important;
31 outline: 0 !important;
32 overflow: visible !important;
33 padding: 0 !important;
34 position: static !important;
35 right: auto !important;
36 text-align: left !important;
37 top: auto !important;
38 vertical-align: baseline !important;
39 width: auto !important;
40 box-sizing: content-box !important;
41 font: {
42 family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
43 weight: normal !important;
44 style: normal !important;
45 size: 1em !important;
46 }
47 min: {
48 // For IE8, FF & WebKit
49 height: inherit !important;
50 // For IE7
51 height: auto !important;
52 }
53 }
54}
55
56.syntaxhighlighter {
57 width: 100% !important;
58 margin: 1em 0 1em 0 !important;
59
60 position: relative !important;
61 overflow: auto !important;
62 font-size: 1em !important;
63
64 &.source { overflow: hidden !important; }
65
66 // set up bold and italic
67 .bold { font-weight: bold !important; }
68 .italic { font-style: italic !important; }
69
70 .line { white-space: pre !important; }
71
72 // main table and columns
73 table {
74 width: 100% !important;
75 caption {
76 text-align: left !important;
77 padding: .5em 0 0.5em 1em !important;
78 }
79
80 td.code {
81 width: 100% !important;
82
83 .container {
84 position: relative !important;
85
86 textarea {
87 box-sizing: border-box !important;
88 position: absolute !important;
89 left: 0 !important;
90 top: 0 !important;
91 width: 100% !important;
92 height: 100% !important;
93 border: none !important;
94 background: white !important;
95 padding-left: 1em !important;
96 overflow: hidden !important;
97 white-space: pre !important;
98 }
99 }
100 }
101
102 // middle spacing between line numbers and lines
103 td.gutter .line {
104 text-align: right !important;
105 padding: 0 0.5em 0 1em !important;
106 }
107
108 td.code .line {
109 padding: 0 1em !important;
110 }
111 }
112
113 &.nogutter {
114 td.code {
115 .container textarea, .line { padding-left: 0em !important; }
116 }
117 }
118
119 &.show { display: block !important; }
120
121 // Adjust some properties when collapsed
122 &.collapsed {
123 table { display: none !important; }
124
125 .toolbar {
126 padding: 0.1em 0.8em 0em 0.8em !important;
127 font-size: 1em !important;
128 position: static !important;
129 width: auto !important;
130 height: auto !important;
131
132 span {
133 display: inline !important;
134 margin-right: 1em !important;
135
136 a {
137 padding: 0 !important;
138 display: none !important;
139 &.expandSource { display: inline !important; }
140 }
141 }
142 }
143 }
144
145 // Styles for the toolbar
146 .toolbar {
147 position: absolute !important;
148 right: 1px !important;
149 top: 1px !important;
150 width: 11px !important;
151 height: 11px !important;
152 font-size: 10px !important;
153 z-index: 10 !important;
154
155 span.title { display: inline !important; }
156
157 a {
158 display: block !important;
159 text-align: center !important;
160 text-decoration: none !important;
161 padding-top: 1px !important;
162
163 &.expandSource { display: none !important; }
164 }
165 }
166
167 &.ie {
168 font-size: .9em !important;
169 padding: 1px 0 1px 0 !important;
170
171 .toolbar {
172 line-height: 8px !important;
173 a {
174 padding-top: 0px !important;
175 }
176 }
177 }
178
179 // Print view.
180 // Colors are based on the default theme without background.
181 &.printing {
182 .line.alt1 .content,
183 .line.alt2 .content,
184 .line.highlighted .number,
185 .line.highlighted.alt1 .content,
186 .line.highlighted.alt2 .content { background: none !important; }
187
188 // Gutter line numbers
189 .line {
190 .number { color: #bbbbbb !important; }
191 // Add border to the lines
192 .content { color: black !important; }
193 }
194
195 // Toolbar when visible
196 .toolbar { display: none !important; }
197 a { text-decoration: none !important; }
198 .plain, .plain a { color: black !important; }
199 .comments, .comments a { color: #008200 !important; }
200 .string, .string a { color: blue !important; }
201 .keyword {
202 color: #006699 !important;
203 font-weight: bold !important;
204 }
205 .preprocessor { color: gray !important; }
206 .variable { color: #aa7700 !important; }
207 .value { color: #009900 !important; }
208 .functions { color: #ff1493 !important; }
209 .constants { color: #0066cc !important; }
210 .script { font-weight: bold !important; }
211 .color1, .color1 a { color: gray !important; }
212 .color2, .color2 a { color: #ff1493 !important; }
213 .color3, .color3 a { color: red !important; }
214 .break, .break a { color: black !important; }
215 }
216} \ No newline at end of file
diff --git a/Blocks/syntax/compass/shCoreDefault.scss b/Blocks/syntax/compass/shCoreDefault.scss
new file mode 100644
index 0000000..ff80c7f
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreDefault.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeDefault.scss";
diff --git a/Blocks/syntax/compass/shCoreDjango.scss b/Blocks/syntax/compass/shCoreDjango.scss
new file mode 100644
index 0000000..ef572e9
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreDjango.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeDjango.scss";
diff --git a/Blocks/syntax/compass/shCoreEclipse.scss b/Blocks/syntax/compass/shCoreEclipse.scss
new file mode 100644
index 0000000..9767f53
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreEclipse.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeEclipse.scss";
diff --git a/Blocks/syntax/compass/shCoreEmacs.scss b/Blocks/syntax/compass/shCoreEmacs.scss
new file mode 100644
index 0000000..5e466f3
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreEmacs.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeEmacs.scss";
diff --git a/Blocks/syntax/compass/shCoreFadeToGrey.scss b/Blocks/syntax/compass/shCoreFadeToGrey.scss
new file mode 100644
index 0000000..4628595
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreFadeToGrey.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeFadeToGrey.scss";
diff --git a/Blocks/syntax/compass/shCoreMDUltra.scss b/Blocks/syntax/compass/shCoreMDUltra.scss
new file mode 100644
index 0000000..10ad4c5
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreMDUltra.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeMDUltra.scss";
diff --git a/Blocks/syntax/compass/shCoreMidnight.scss b/Blocks/syntax/compass/shCoreMidnight.scss
new file mode 100644
index 0000000..e357eb2
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreMidnight.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeMidnight.scss";
diff --git a/Blocks/syntax/compass/shCoreRDark.scss b/Blocks/syntax/compass/shCoreRDark.scss
new file mode 100644
index 0000000..5c26da3
--- /dev/null
+++ b/Blocks/syntax/compass/shCoreRDark.scss
@@ -0,0 +1,2 @@
1@import "shCore.scss";
2@import "shThemeRDark.scss";
diff --git a/Blocks/syntax/compass/shThemeDefault.scss b/Blocks/syntax/compass/shThemeDefault.scss
new file mode 100644
index 0000000..1574dae
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeDefault.scss
@@ -0,0 +1,7 @@
1// Default Syntax Highlighter theme.
2
3@import "_theme_template.scss";
4
5.syntaxhighlighter {
6 .keyword { font-weight: bold !important; }
7}
diff --git a/Blocks/syntax/compass/shThemeDjango.scss b/Blocks/syntax/compass/shThemeDjango.scss
new file mode 100644
index 0000000..8e95c56
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeDjango.scss
@@ -0,0 +1,36 @@
1// Django SyntaxHighlighter theme
2
3$background: #0a2b1d !default;
4
5$line_highlighted_background: #233729 !default;
6$line_highlighted_number: white !default;
7
8$gutter_text: #497958 !default;
9$gutter_border_color: #41a83e !default;
10
11$toolbar_collapsed_a: #96dd3b !default;
12$toolbar_collapsed_a_hover: #fff !default;
13$toolbar_collapsed_background: #000 !default;
14
15$toolbar_a: #fff !default;
16$toolbar_a_hover: #ffe862 !default;
17
18$code_plain: #f8f8f8 !default;
19$code_comments: #336442 !default;
20$code_string: #9df39f !default;
21$code_keyword: #96dd3b !default;
22$code_preprocessor: #91bb9e !default;
23$code_variable: #ffaa3e !default;
24$code_value: #f7e741 !default;
25$code_functions: #ffaa3e !default;
26$code_constants: #e0e8ff !default;
27$code_color1: #eb939a !default;
28$code_color2: #91bb9e !default;
29$code_color3: #edef7d !default;
30
31@import "_theme_template.scss";
32
33.syntaxhighlighter {
34 .comments { font-style: italic !important; }
35 .keyword { font-weight: bold !important; }
36}
diff --git a/Blocks/syntax/compass/shThemeEclipse.scss b/Blocks/syntax/compass/shThemeEclipse.scss
new file mode 100644
index 0000000..193fb1d
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeEclipse.scss
@@ -0,0 +1,48 @@
1// Eclipse IDE SyntaxHighlighter color theme
2// (C) Code-House
3// :http//blog.code-house.org/2009/10/xml-i-adnotacje-kod-ogolnego-przeznaczenia-i-jpa/
4
5$background: #fff !default;
6
7$line_highlighted_background: #c3defe !default;
8$line_highlighted_number: #fff !default;
9
10$gutter_text: #787878 !default;
11$gutter_border_color: #d4d0c8 !default;
12
13$toolbar_collapsed_a: #3f5fbf !default;
14$toolbar_collapsed_a_hover: #aa7700 !default;
15$toolbar_collapsed_background: #fff !default;
16
17$toolbar_a: #a0a0a0 !default;
18$toolbar_a_hover: red !default;
19
20$code_plain: black !default;
21$code_comments: #3f5fbf !default;
22$code_string: #2a00ff !default;
23$code_keyword: #7f0055 !default;
24$code_preprocessor: #646464 !default;
25$code_variable: #aa7700 !default;
26$code_value: #009900 !default;
27$code_functions: #ff1493 !default;
28$code_constants: #0066cc !default;
29$code_color1: gray !default;
30$code_color2: #ff1493 !default;
31$code_color3: red !default;
32
33@import "_theme_template.scss";
34
35.syntaxhighlighter {
36 .keyword { font-weight: bold !important; }
37
38 .xml {
39 .keyword {
40 color: #3f7f7f !important;
41 font-weight: normal !important; }
42 .color1, .color1 a { color: #7f007f !important; }
43 .string {
44 font-style: italic !important;
45 color: #2a00ff !important;
46 }
47 }
48}
diff --git a/Blocks/syntax/compass/shThemeEmacs.scss b/Blocks/syntax/compass/shThemeEmacs.scss
new file mode 100644
index 0000000..11c9deb
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeEmacs.scss
@@ -0,0 +1,32 @@
1// Emacs SyntaxHighlighter theme based on theme by Joshua Emmons
2// http://www.skia.net/
3
4$background: black !default;
5
6$line_highlighted_background: #2A3133 !default;
7$line_highlighted_number: white !default;
8
9$gutter_text: #d3d3d3 !default;
10$gutter_border_color: #990000 !default;
11
12$toolbar_collapsed_a: #ebdb8d !default;
13$toolbar_collapsed_a_hover: #ff7d27 !default;
14$toolbar_collapsed_background: black !default;
15
16$toolbar_a: #fff !default;
17$toolbar_a_hover: #9ccff4 !default;
18
19$code_plain: #d3d3d3 !default;
20$code_comments: #ff7d27 !default;
21$code_string: #ff9e7b !default;
22$code_keyword: aqua !default;
23$code_preprocessor: #aec4de !default;
24$code_variable: #ffaa3e !default;
25$code_value: #009900 !default;
26$code_functions: #81cef9 !default;
27$code_constants: #ff9e7b !default;
28$code_color1: #ebdb8d !default;
29$code_color2: #ff7d27 !default;
30$code_color3: #aec4de !default;
31
32@import "_theme_template.scss";
diff --git a/Blocks/syntax/compass/shThemeFadeToGrey.scss b/Blocks/syntax/compass/shThemeFadeToGrey.scss
new file mode 100644
index 0000000..7963814
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeFadeToGrey.scss
@@ -0,0 +1,36 @@
1// Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager
2// :http//www.ibrasten.com/
3
4$background: #121212 !default;
5
6$line_highlighted_background: #2C2C29 !default;
7$line_highlighted_number: white !default;
8
9$gutter_text: #afafaf !default;
10$gutter_border_color: #3185b9 !default;
11
12$toolbar_collapsed_a: #3185b9 !default;
13$toolbar_collapsed_a_hover: #d01d33 !default;
14$toolbar_collapsed_background: black !default;
15
16$toolbar_a: #fff !default;
17$toolbar_a_hover: #96daff !default;
18
19$code_plain: white !default;
20$code_comments: #696854 !default;
21$code_string: #e3e658 !default;
22$code_keyword: #d01d33 !default;
23$code_preprocessor: #435a5f !default;
24$code_variable: #898989 !default;
25$code_value: #009900 !default;
26$code_functions: #aaaaaa !default;
27$code_constants: #96daff !default;
28$code_color1: #ffc074 !default;
29$code_color2: #4a8cdb !default;
30$code_color3: #96daff !default;
31
32@import "_theme_template.scss";
33
34.syntaxhighlighter {
35 .functions { font-weight: bold !important; }
36}
diff --git a/Blocks/syntax/compass/shThemeMDUltra.scss b/Blocks/syntax/compass/shThemeMDUltra.scss
new file mode 100644
index 0000000..0356fa6
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeMDUltra.scss
@@ -0,0 +1,32 @@
1// MDUltra SyntaxHighlighter theme based on Midnight Theme
2// http://www.mddev.co.uk/
3
4$background: #222222 !default;
5
6$line_highlighted_background: #253e5a !default;
7$line_highlighted_number: white !default;
8
9$gutter_text: #38566f !default;
10$gutter_border_color: #435a5f !default;
11
12$toolbar_collapsed_a: #428bdd !default;
13$toolbar_collapsed_a_hover: lime !default;
14$toolbar_collapsed_background: black !default;
15
16$toolbar_a: #aaaaff !default;
17$toolbar_a_hover: #9ccff4 !default;
18
19$code_plain: lime !default;
20$code_comments: #428bdd !default;
21$code_string: lime !default;
22$code_keyword: #aaaaff !default;
23$code_preprocessor: #8aa6c1 !default;
24$code_variable: aqua !default;
25$code_value: #f7e741 !default;
26$code_functions: #ff8000 !default;
27$code_constants: yellow !default;
28$code_color1: red !default;
29$code_color2: yellow !default;
30$code_color3: #ffaa3e !default;
31
32@import "_theme_template.scss";
diff --git a/Blocks/syntax/compass/shThemeMidnight.scss b/Blocks/syntax/compass/shThemeMidnight.scss
new file mode 100644
index 0000000..a4dae02
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeMidnight.scss
@@ -0,0 +1,32 @@
1// Midnight SyntaxHighlighter theme based on theme by J.D. Myers
2// http://webdesign.lsnjd.com/
3
4$background: #0f192a !default;
5
6$line_highlighted_background: #253e5a !default;
7$line_highlighted_number: #38566f !default;
8
9$gutter_text: #afafaf !default;
10$gutter_border_color: #435a5f !default;
11
12$toolbar_collapsed_a: #428bdd !default;
13$toolbar_collapsed_a_hover: #1dc116 !default;
14$toolbar_collapsed_background: #000 !default;
15
16$toolbar_a: #D1EDFF !default;
17$toolbar_a_hover: #8aa6c1 !default;
18
19$code_plain: #d1edff !default;
20$code_comments: #428bdd !default;
21$code_string: #1dc116 !default;
22$code_keyword: #b43d3d !default;
23$code_preprocessor: #8aa6c1 !default;
24$code_variable: #ffaa3e !default;
25$code_value: #f7e741 !default;
26$code_functions: #ffaa3e !default;
27$code_constants: #e0e8ff !default;
28$code_color1: #f8bb00 !default;
29$code_color2: white !default;
30$code_color3: #ffaa3e !default;
31
32@import "_theme_template.scss";
diff --git a/Blocks/syntax/compass/shThemeRDark.scss b/Blocks/syntax/compass/shThemeRDark.scss
new file mode 100644
index 0000000..3b67b15
--- /dev/null
+++ b/Blocks/syntax/compass/shThemeRDark.scss
@@ -0,0 +1,32 @@
1// RDark SyntaxHighlighter theme based on theme by Radu Dineiu
2// http://www.vim.org/scripts/script.php?script_id=1732
3
4$background: #1b2426 !default;
5
6$line_highlighted_background: #323E41 !default;
7$line_highlighted_number: #b9bdb6 !default;
8
9$gutter_text: #afafaf !default;
10$gutter_border_color: #435a5f !default;
11
12$toolbar_collapsed_a: #5ba1cf !default;
13$toolbar_collapsed_a_hover: #5ce638 !default;
14$toolbar_collapsed_background: #000 !default;
15
16$toolbar_a: #fff !default;
17$toolbar_a_hover: #e0e8ff !default;
18
19$code_plain: #b9bdb6 !default;
20$code_comments: #878a85 !default;
21$code_string: #5ce638 !default;
22$code_keyword: #5ba1cf !default;
23$code_preprocessor: #435a5f !default;
24$code_variable: #ffaa3e !default;
25$code_value: #009900 !default;
26$code_functions: #ffaa3e !default;
27$code_constants: #e0e8ff !default;
28$code_color1: #e0e8ff !default;
29$code_color2: white !default;
30$code_color3: #ffaa3e !default;
31
32@import "_theme_template.scss";
diff --git a/Blocks/syntax/index.html b/Blocks/syntax/index.html
new file mode 100644
index 0000000..5d8d56d
--- /dev/null
+++ b/Blocks/syntax/index.html
@@ -0,0 +1,24 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>Hello SyntaxHighlighter</title>
6 <script type="text/javascript" src="scripts/shCore.js"></script>
7 <script type="text/javascript" src="scripts/shBrushCpp.js"></script>
8 <link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
9 <script type="text/javascript">SyntaxHighlighter.all();</script>
10</head>
11
12<body style="background: white; font-family: Helvetica">
13
14<h1>Hello SyntaxHighlighter</h1>
15<pre class="brush: cpp;">
16#include "stdio.h"
17int main()
18{
19 printf("Hello\n");
20 return 0;
21}
22</pre>
23
24</html>
diff --git a/Blocks/syntax/scripts/shAutoloader.js b/Blocks/syntax/scripts/shAutoloader.js
new file mode 100644
index 0000000..4e29bdd
--- /dev/null
+++ b/Blocks/syntax/scripts/shAutoloader.js
@@ -0,0 +1,17 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17eval(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}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d<c.9;d++)i[c[d]]=a}2 o(c){1 a=r.H("J"),d=3;a.K=c;a.M="L/t";a.G="t";a.u=a.v=2(){6(!d&&(!8.7||8.7=="F"||8.7=="z")){d=q;e[c]=q;a:{4(1 p y e)6(e[p]==3)B a;j&&5.C(k)}a.u=a.v=x;a.D.O(a)}};r.N.R(a)}1 f=Q,l=h.P(),i={},e={},j=3,k=x,b;5.T=2(c){k=c;j=q};4(b=0;b<f.9;b++){1 m=f[b].w?f[b]:f[b].S(/\\s+/),g=m.w();n(m,g)}4(b=0;b<l.9;b++)6(g=i[l[b].E.A]){e[g]=3;o(g)}}})();',56,56,'|var|function|false|for|SyntaxHighlighter|if|readyState|this|length|||||||||||||||||true|document||javascript|onload|onreadystatechange|pop|null|in|complete|brush|break|highlight|parentNode|params|loaded|language|createElement|autoloader|script|src|text|type|body|removeChild|findElements|arguments|appendChild|split|all'.split('|'),0,{}))
diff --git a/Blocks/syntax/scripts/shBrushAS3.js b/Blocks/syntax/scripts/shBrushAS3.js
new file mode 100644
index 0000000..8aa3ed2
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushAS3.js
@@ -0,0 +1,59 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Created by Peter Atoria @ http://iAtoria.com
25
26 var inits = 'class interface function package';
27
28 var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
29 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
30 'extends false final finally flash_proxy for get if implements import in include Infinity ' +
31 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
32 'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
33 'return set static String super switch this throw true try typeof uint undefined unescape ' +
34 'use void while with'
35 ;
36
37 this.regexList = [
38 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
39 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
40 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
41 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
42 { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
43 { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
44 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
45 { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
46 { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
47 ];
48
49 this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
50 };
51
52 Brush.prototype = new SyntaxHighlighter.Highlighter();
53 Brush.aliases = ['actionscript3', 'as3'];
54
55 SyntaxHighlighter.brushes.AS3 = Brush;
56
57 // CommonJS
58 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
59})();
diff --git a/Blocks/syntax/scripts/shBrushAppleScript.js b/Blocks/syntax/scripts/shBrushAppleScript.js
new file mode 100644
index 0000000..d40bbd7
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushAppleScript.js
@@ -0,0 +1,75 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // AppleScript brush by David Chambers
25 // http://davidchambersdesign.com/
26 var keywords = 'after before beginning continue copy each end every from return get global in local named of set some that the then times to where whose with without';
27 var ordinals = 'first second third fourth fifth sixth seventh eighth ninth tenth last front back middle';
28 var specials = 'activate add alias AppleScript ask attachment boolean class constant delete duplicate empty exists false id integer list make message modal modified new no paragraph pi properties quit real record remove rest result reveal reverse run running save string true word yes';
29
30 this.regexList = [
31
32 { regex: /(--|#).*$/gm,
33 css: 'comments' },
34
35 { regex: /\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm, // support nested comments
36 css: 'comments' },
37
38 { regex: /"[\s\S]*?"/gm,
39 css: 'string' },
40
41 { regex: /(?:,|:|¬|'s\b|\(|\)|\{|\}|«|\b\w*»)/g,
42 css: 'color1' },
43
44 { regex: /(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g, // numbers
45 css: 'color1' },
46
47 { regex: /(?:&(amp;|gt;|lt;)?|=|� |>|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g,
48 css: 'color2' },
49
50 { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g,
51 css: 'keyword' },
52
53 { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals
54 css: 'keyword' },
55
56 { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,
57 css: 'color3' },
58
59 { regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
60 css: 'color3' },
61
62 { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
63 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
64 { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
65 ];
66 };
67
68 Brush.prototype = new SyntaxHighlighter.Highlighter();
69 Brush.aliases = ['applescript'];
70
71 SyntaxHighlighter.brushes.AppleScript = Brush;
72
73 // CommonJS
74 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
75})();
diff --git a/Blocks/syntax/scripts/shBrushBash.js b/Blocks/syntax/scripts/shBrushBash.js
new file mode 100644
index 0000000..8c29696
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushBash.js
@@ -0,0 +1,59 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le';
25 var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
26 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
27 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
28 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
29 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
30 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
31 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
32 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
33 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
34 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
35 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
36 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
37 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
38 'vi watch wc whereis which who whoami Wget xargs yes'
39 ;
40
41 this.regexList = [
42 { regex: /^#!.*$/gm, css: 'preprocessor bold' },
43 { regex: /\/[\w-\/]+/gm, css: 'plain' },
44 { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
45 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
46 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
47 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
48 { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
49 ];
50 }
51
52 Brush.prototype = new SyntaxHighlighter.Highlighter();
53 Brush.aliases = ['bash', 'shell'];
54
55 SyntaxHighlighter.brushes.Bash = Brush;
56
57 // CommonJS
58 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
59})();
diff --git a/Blocks/syntax/scripts/shBrushCSharp.js b/Blocks/syntax/scripts/shBrushCSharp.js
new file mode 100644
index 0000000..079214e
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushCSharp.js
@@ -0,0 +1,65 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var keywords = 'abstract as base bool break byte case catch char checked class const ' +
25 'continue decimal default delegate do double else enum event explicit ' +
26 'extern false finally fixed float for foreach get goto if implicit in int ' +
27 'interface internal is lock long namespace new null object operator out ' +
28 'override params private protected public readonly ref return sbyte sealed set ' +
29 'short sizeof stackalloc static string struct switch this throw true try ' +
30 'typeof uint ulong unchecked unsafe ushort using virtual void while';
31
32 function fixComments(match, regexInfo)
33 {
34 var css = (match[0].indexOf("///") == 0)
35 ? 'color1'
36 : 'comments'
37 ;
38
39 return [new SyntaxHighlighter.Match(match[0], match.index, css)];
40 }
41
42 this.regexList = [
43 { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
44 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
45 { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
46 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
47 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
48 { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
49 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
50 { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
51 { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
52 ];
53
54 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
55 };
56
57 Brush.prototype = new SyntaxHighlighter.Highlighter();
58 Brush.aliases = ['c#', 'c-sharp', 'csharp'];
59
60 SyntaxHighlighter.brushes.CSharp = Brush;
61
62 // CommonJS
63 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
64})();
65
diff --git a/Blocks/syntax/scripts/shBrushColdFusion.js b/Blocks/syntax/scripts/shBrushColdFusion.js
new file mode 100644
index 0000000..627dbb9
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushColdFusion.js
@@ -0,0 +1,100 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Jen
25 // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
26
27 var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' +
28 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' +
29 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' +
30 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' +
31 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' +
32 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' +
33 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' +
34 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' +
35 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' +
36 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' +
37 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' +
38 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' +
39 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' +
40 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' +
41 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' +
42 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' +
43 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' +
44 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' +
45 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' +
46 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' +
47 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' +
48 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' +
49 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' +
50 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' +
51 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' +
52 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' +
53 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' +
54 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' +
55 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' +
56 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' +
57 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' +
58 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' +
59 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' +
60 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' +
61 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' +
62 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' +
63 'XmlValidate Year YesNoFormat';
64
65 var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' +
66 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' +
67 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' +
68 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' +
69 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' +
70 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' +
71 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' +
72 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' +
73 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' +
74 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' +
75 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' +
76 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' +
77 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' +
78 'cfwindow cfxml cfzip cfzipparam';
79
80 var operators = 'all and any between cross in join like not null or outer some';
81
82 this.regexList = [
83 { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments
84 { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings
85 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
86 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
87 { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions
88 { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
89 { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
90 ];
91 }
92
93 Brush.prototype = new SyntaxHighlighter.Highlighter();
94 Brush.aliases = ['coldfusion','cf'];
95
96 SyntaxHighlighter.brushes.ColdFusion = Brush;
97
98 // CommonJS
99 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
100})();
diff --git a/Blocks/syntax/scripts/shBrushCpp.js b/Blocks/syntax/scripts/shBrushCpp.js
new file mode 100644
index 0000000..9f70d3a
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushCpp.js
@@ -0,0 +1,97 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Copyright 2006 Shin, YoungJin
25
26 var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
27 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
28 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
29 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
30 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
31 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
32 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
33 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
34 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
35 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
36 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
37 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
38 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
39 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
40 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
41 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
42 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
43 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
44 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
45 '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
46 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
47 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
48 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
49 'va_list wchar_t wctrans_t wctype_t wint_t signed';
50
51 var keywords = 'break case catch class const __finally __exception __try ' +
52 'const_cast continue private public protected __declspec ' +
53 'default delete deprecated dllexport dllimport do dynamic_cast ' +
54 'else enum explicit extern if for friend goto inline ' +
55 'mutable naked namespace new noinline noreturn nothrow ' +
56 'register reinterpret_cast return selectany ' +
57 'sizeof static static_cast struct switch template this ' +
58 'thread throw true false try typedef typeid typename union ' +
59 'using uuid virtual void volatile whcar_t while';
60
61 var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
62 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
63 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
64 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
65 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
66 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
67 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
68 'fwrite getc getchar gets perror printf putc putchar puts remove ' +
69 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
70 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
71 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
72 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
73 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
74 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
75 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
76 'clock ctime difftime gmtime localtime mktime strftime time';
77
78 this.regexList = [
79 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
80 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
81 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
82 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
83 { regex: /^ *#.*/gm, css: 'preprocessor' },
84 { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
85 { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
86 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
87 ];
88 };
89
90 Brush.prototype = new SyntaxHighlighter.Highlighter();
91 Brush.aliases = ['cpp', 'c'];
92
93 SyntaxHighlighter.brushes.Cpp = Brush;
94
95 // CommonJS
96 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
97})();
diff --git a/Blocks/syntax/scripts/shBrushCss.js b/Blocks/syntax/scripts/shBrushCss.js
new file mode 100644
index 0000000..4297a9a
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushCss.js
@@ -0,0 +1,91 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 function getKeywordsCSS(str)
25 {
26 return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
27 };
28
29 function getValuesCSS(str)
30 {
31 return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
32 };
33
34 var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
35 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
36 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
37 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
38 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
39 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
40 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
41 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
42 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
43 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
44 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
45 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
46 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
47 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
48
49 var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
50 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
51 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
52 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
53 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
54 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
55 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
56 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
57 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
58 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
59 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
60 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
61 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
62 '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';
63
64 var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
65
66 this.regexList = [
67 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
68 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
69 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
70 { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
71 { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
72 { regex: /!important/g, css: 'color3' }, // !important
73 { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
74 { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
75 { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
76 ];
77
78 this.forHtmlScript({
79 left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
80 right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
81 });
82 };
83
84 Brush.prototype = new SyntaxHighlighter.Highlighter();
85 Brush.aliases = ['css'];
86
87 SyntaxHighlighter.brushes.CSS = Brush;
88
89 // CommonJS
90 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
91})();
diff --git a/Blocks/syntax/scripts/shBrushDelphi.js b/Blocks/syntax/scripts/shBrushDelphi.js
new file mode 100644
index 0000000..e1060d4
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushDelphi.js
@@ -0,0 +1,55 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
25 'case char class comp const constructor currency destructor div do double ' +
26 'downto else end except exports extended false file finalization finally ' +
27 'for function goto if implementation in inherited int64 initialization ' +
28 'integer interface is label library longint longword mod nil not object ' +
29 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
30 'pint64 pointer private procedure program property pshortstring pstring ' +
31 'pvariant pwidechar pwidestring protected public published raise real real48 ' +
32 'record repeat set shl shortint shortstring shr single smallint string then ' +
33 'threadvar to true try type unit until uses val var varirnt while widechar ' +
34 'widestring with word write writeln xor';
35
36 this.regexList = [
37 { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
38 { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
39 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
40 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
41 { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
42 { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
43 { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
44 { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
45 ];
46 };
47
48 Brush.prototype = new SyntaxHighlighter.Highlighter();
49 Brush.aliases = ['delphi', 'pascal', 'pas'];
50
51 SyntaxHighlighter.brushes.Delphi = Brush;
52
53 // CommonJS
54 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
55})();
diff --git a/Blocks/syntax/scripts/shBrushDiff.js b/Blocks/syntax/scripts/shBrushDiff.js
new file mode 100644
index 0000000..e9b14fc
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushDiff.js
@@ -0,0 +1,41 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 this.regexList = [
25 { regex: /^\+\+\+.*$/gm, css: 'color2' },
26 { regex: /^\-\-\-.*$/gm, css: 'color2' },
27 { regex: /^\s.*$/gm, css: 'color1' },
28 { regex: /^@@.*@@$/gm, css: 'variable' },
29 { regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
30 { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
31 ];
32 };
33
34 Brush.prototype = new SyntaxHighlighter.Highlighter();
35 Brush.aliases = ['diff', 'patch'];
36
37 SyntaxHighlighter.brushes.Diff = Brush;
38
39 // CommonJS
40 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
41})();
diff --git a/Blocks/syntax/scripts/shBrushErlang.js b/Blocks/syntax/scripts/shBrushErlang.js
new file mode 100644
index 0000000..6ba7d9d
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushErlang.js
@@ -0,0 +1,52 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Jean-Lou Dupont
25 // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
26
27 // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
28 var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
29 'case catch cond div end fun if let not of or orelse '+
30 'query receive rem try when xor'+
31 // additional
32 ' module export import define';
33
34 this.regexList = [
35 { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
36 { regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
37 { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
38 { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
39 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
40 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
41 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
42 ];
43 };
44
45 Brush.prototype = new SyntaxHighlighter.Highlighter();
46 Brush.aliases = ['erl', 'erlang'];
47
48 SyntaxHighlighter.brushes.Erland = Brush;
49
50 // CommonJS
51 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
52})();
diff --git a/Blocks/syntax/scripts/shBrushGroovy.js b/Blocks/syntax/scripts/shBrushGroovy.js
new file mode 100644
index 0000000..6ec5c18
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushGroovy.js
@@ -0,0 +1,67 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Andres Almiray
25 // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
26
27 var keywords = 'as assert break case catch class continue def default do else extends finally ' +
28 'if in implements import instanceof interface new package property return switch ' +
29 'throw throws try while public protected private static';
30 var types = 'void boolean byte char short int long float double';
31 var constants = 'null';
32 var methods = 'allProperties count get size '+
33 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
34 'findIndexOf grep inject max min reverseEach sort ' +
35 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
36 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
37 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
38 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
39 'transformChar transformLine withOutputStream withPrintWriter withStream ' +
40 'withStreams withWriter withWriterAppend write writeLine '+
41 'dump inspect invokeMethod print println step times upto use waitForOrKill '+
42 'getText';
43
44 this.regexList = [
45 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
46 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
47 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
48 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
49 { regex: /""".*"""/g, css: 'string' }, // GStrings
50 { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
51 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
52 { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
53 { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
54 { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
55 ];
56
57 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
58 }
59
60 Brush.prototype = new SyntaxHighlighter.Highlighter();
61 Brush.aliases = ['groovy'];
62
63 SyntaxHighlighter.brushes.Groovy = Brush;
64
65 // CommonJS
66 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
67})();
diff --git a/Blocks/syntax/scripts/shBrushJScript.js b/Blocks/syntax/scripts/shBrushJScript.js
new file mode 100644
index 0000000..ff98dab
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushJScript.js
@@ -0,0 +1,52 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var keywords = 'break case catch continue ' +
25 'default delete do else false ' +
26 'for function if in instanceof ' +
27 'new null return super switch ' +
28 'this throw true try typeof var while with'
29 ;
30
31 var r = SyntaxHighlighter.regexLib;
32
33 this.regexList = [
34 { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
35 { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
36 { regex: r.singleLineCComments, css: 'comments' }, // one line comments
37 { regex: r.multiLineCComments, css: 'comments' }, // multiline comments
38 { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
39 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
40 ];
41
42 this.forHtmlScript(r.scriptScriptTags);
43 };
44
45 Brush.prototype = new SyntaxHighlighter.Highlighter();
46 Brush.aliases = ['js', 'jscript', 'javascript'];
47
48 SyntaxHighlighter.brushes.JScript = Brush;
49
50 // CommonJS
51 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
52})();
diff --git a/Blocks/syntax/scripts/shBrushJava.js b/Blocks/syntax/scripts/shBrushJava.js
new file mode 100644
index 0000000..d692fd6
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushJava.js
@@ -0,0 +1,57 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 'continue default do double else enum extends ' +
26 'false final finally float for goto if implements import ' +
27 'instanceof int interface long native new null ' +
28 'package private protected public return ' +
29 'short static strictfp super switch synchronized this throw throws true ' +
30 'transient try void volatile while';
31
32 this.regexList = [
33 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 ];
43
44 this.forHtmlScript({
45 left : /(&lt;|<)%[@!=]?/g,
46 right : /%(&gt;|>)/g
47 });
48 };
49
50 Brush.prototype = new SyntaxHighlighter.Highlighter();
51 Brush.aliases = ['java'];
52
53 SyntaxHighlighter.brushes.Java = Brush;
54
55 // CommonJS
56 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57})();
diff --git a/Blocks/syntax/scripts/shBrushJavaFX.js b/Blocks/syntax/scripts/shBrushJavaFX.js
new file mode 100644
index 0000000..1a150a6
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushJavaFX.js
@@ -0,0 +1,58 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Patrick Webster
25 // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
26 var datatypes = 'Boolean Byte Character Double Duration '
27 + 'Float Integer Long Number Short String Void'
28 ;
29
30 var keywords = 'abstract after and as assert at before bind bound break catch class '
31 + 'continue def delete else exclusive extends false finally first for from '
32 + 'function if import in indexof init insert instanceof into inverse last '
33 + 'lazy mixin mod nativearray new not null on or override package postinit '
34 + 'protected public public-init public-read replace return reverse sizeof '
35 + 'step super then this throw true try tween typeof var where while with '
36 + 'attribute let private readonly static trigger'
37 ;
38
39 this.regexList = [
40 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
41 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
42 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
43 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
44 { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
45 { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
46 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
47 ];
48 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
49 };
50
51 Brush.prototype = new SyntaxHighlighter.Highlighter();
52 Brush.aliases = ['jfx', 'javafx'];
53
54 SyntaxHighlighter.brushes.JavaFX = Brush;
55
56 // CommonJS
57 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
58})();
diff --git a/Blocks/syntax/scripts/shBrushPerl.js b/Blocks/syntax/scripts/shBrushPerl.js
new file mode 100644
index 0000000..d94a2e0
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushPerl.js
@@ -0,0 +1,72 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by David Simmons-Duffin and Marty Kube
25
26 var funcs =
27 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
28 'chroot close closedir connect cos crypt defined delete each endgrent ' +
29 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
30 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
31 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
32 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
33 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
34 'getservbyname getservbyport getservent getsockname getsockopt glob ' +
35 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
36 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
37 'oct open opendir ord pack pipe pop pos print printf prototype push ' +
38 'quotemeta rand read readdir readline readlink readpipe recv rename ' +
39 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
40 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
41 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
42 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
43 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
44 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
45 'undef unlink unpack unshift utime values vec wait waitpid warn write';
46
47 var keywords =
48 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
49 'for foreach goto if import last local my next no our package redo ref ' +
50 'require return sub tie tied unless untie until use wantarray while';
51
52 this.regexList = [
53 { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
54 { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
55 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
56 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
57 { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
58 { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
59 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
60 ];
61
62 this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
63 }
64
65 Brush.prototype = new SyntaxHighlighter.Highlighter();
66 Brush.aliases = ['perl', 'Perl', 'pl'];
67
68 SyntaxHighlighter.brushes.Perl = Brush;
69
70 // CommonJS
71 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
72})();
diff --git a/Blocks/syntax/scripts/shBrushPhp.js b/Blocks/syntax/scripts/shBrushPhp.js
new file mode 100644
index 0000000..95e6e43
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushPhp.js
@@ -0,0 +1,88 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var funcs = 'abs acos acosh addcslashes addslashes ' +
25 'array_change_key_case array_chunk array_combine array_count_values array_diff '+
26 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
27 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
28 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
29 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
30 'array_push array_rand array_reduce array_reverse array_search array_shift '+
31 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
32 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
33 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
34 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
35 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
36 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
37 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
38 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
39 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
40 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
41 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
42 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
43 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
44 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
45 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
46 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
47 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
48 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
49 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
50 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
51 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
52 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
53 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
54 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
55 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
56 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
57 'strtoupper strtr strval substr substr_compare';
58
59 var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
60 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
61 'function include include_once global goto if implements interface instanceof namespace new ' +
62 'old_function or private protected public return require require_once static switch ' +
63 'throw try use var while xor ';
64
65 var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
66
67 this.regexList = [
68 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
69 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
70 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
71 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
72 { regex: /\$\w+/g, css: 'variable' }, // variables
73 { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
74 { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
75 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
76 ];
77
78 this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
79 };
80
81 Brush.prototype = new SyntaxHighlighter.Highlighter();
82 Brush.aliases = ['php'];
83
84 SyntaxHighlighter.brushes.Php = Brush;
85
86 // CommonJS
87 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
88})();
diff --git a/Blocks/syntax/scripts/shBrushPlain.js b/Blocks/syntax/scripts/shBrushPlain.js
new file mode 100644
index 0000000..9f7d9e9
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushPlain.js
@@ -0,0 +1,33 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 };
25
26 Brush.prototype = new SyntaxHighlighter.Highlighter();
27 Brush.aliases = ['text', 'plain'];
28
29 SyntaxHighlighter.brushes.Plain = Brush;
30
31 // CommonJS
32 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
33})();
diff --git a/Blocks/syntax/scripts/shBrushPowerShell.js b/Blocks/syntax/scripts/shBrushPowerShell.js
new file mode 100644
index 0000000..0be1752
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushPowerShell.js
@@ -0,0 +1,74 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributes by B.v.Zanten, Getronics
25 // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
26
27 var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
28 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
29 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
30 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
31 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
32 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
33 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
34 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
35 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
36 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
37 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
38 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
39 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
40 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
41 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
42 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
43 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
44 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
45 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
46 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
47 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
48 var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
49 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
50 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
51 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
52 'spps spsv sv tee cat cd cp h history kill lp ls ' +
53 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
54 'erase rd ren type % \\?';
55
56 this.regexList = [
57 { regex: /#.*$/gm, css: 'comments' }, // one line comments
58 { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
59 { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
60 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
61 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
62 { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
63 { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
64 ];
65 };
66
67 Brush.prototype = new SyntaxHighlighter.Highlighter();
68 Brush.aliases = ['powershell', 'ps'];
69
70 SyntaxHighlighter.brushes.PowerShell = Brush;
71
72 // CommonJS
73 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
74})();
diff --git a/Blocks/syntax/scripts/shBrushPython.js b/Blocks/syntax/scripts/shBrushPython.js
new file mode 100644
index 0000000..ce77462
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushPython.js
@@ -0,0 +1,64 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Gheorghe Milas and Ahmad Sherif
25
26 var keywords = 'and assert break class continue def del elif else ' +
27 'except exec finally for from global if import in is ' +
28 'lambda not or pass print raise return try yield while';
29
30 var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
31 'chr classmethod cmp coerce compile complex delattr dict dir ' +
32 'divmod enumerate eval execfile file filter float format frozenset ' +
33 'getattr globals hasattr hash help hex id input int intern ' +
34 'isinstance issubclass iter len list locals long map max min next ' +
35 'object oct open ord pow print property range raw_input reduce ' +
36 'reload repr reversed round set setattr slice sorted staticmethod ' +
37 'str sum super tuple type type unichr unicode vars xrange zip';
38
39 var special = 'None True False self cls class_';
40
41 this.regexList = [
42 { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
43 { regex: /^\s*@\w+/gm, css: 'decorator' },
44 { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
45 { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
46 { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
47 { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
48 { regex: /\b\d+\.?\w*/g, css: 'value' },
49 { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
50 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
51 { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
52 ];
53
54 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
55 };
56
57 Brush.prototype = new SyntaxHighlighter.Highlighter();
58 Brush.aliases = ['py', 'python'];
59
60 SyntaxHighlighter.brushes.Python = Brush;
61
62 // CommonJS
63 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
64})();
diff --git a/Blocks/syntax/scripts/shBrushRuby.js b/Blocks/syntax/scripts/shBrushRuby.js
new file mode 100644
index 0000000..ff82130
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushRuby.js
@@ -0,0 +1,55 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Erik Peterson.
25
26 var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
27 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
28 'self super then throw true undef unless until when while yield';
29
30 var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
31 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
32 'ThreadGroup Thread Time TrueClass';
33
34 this.regexList = [
35 { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
36 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
37 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
38 { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
39 { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
40 { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables
41 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
42 { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
43 ];
44
45 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
46 };
47
48 Brush.prototype = new SyntaxHighlighter.Highlighter();
49 Brush.aliases = ['ruby', 'rails', 'ror', 'rb'];
50
51 SyntaxHighlighter.brushes.Ruby = Brush;
52
53 // CommonJS
54 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
55})();
diff --git a/Blocks/syntax/scripts/shBrushSass.js b/Blocks/syntax/scripts/shBrushSass.js
new file mode 100644
index 0000000..aa04da0
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushSass.js
@@ -0,0 +1,94 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 function getKeywordsCSS(str)
25 {
26 return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
27 };
28
29 function getValuesCSS(str)
30 {
31 return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
32 };
33
34 var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
35 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
36 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
37 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
38 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
39 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
40 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
41 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
42 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
43 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
44 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
45 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
46 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
47 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
48
49 var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
50 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
51 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+
52 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
53 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
54 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
55 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
56 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
57 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
58 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
59 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
60 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
61 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
62 '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';
63
64 var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
65
66 var statements = '!important !default';
67 var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include';
68
69 var r = SyntaxHighlighter.regexLib;
70
71 this.regexList = [
72 { regex: r.multiLineCComments, css: 'comments' }, // multiline comments
73 { regex: r.singleLineCComments, css: 'comments' }, // singleline comments
74 { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings
75 { regex: r.singleQuotedString, css: 'string' }, // single quoted strings
76 { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
77 { regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes
78 { regex: /\$\w+/g, css: 'variable' }, // variables
79 { regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements
80 { regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor
81 { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
82 { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
83 { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
84 ];
85 };
86
87 Brush.prototype = new SyntaxHighlighter.Highlighter();
88 Brush.aliases = ['sass', 'scss'];
89
90 SyntaxHighlighter.brushes.Sass = Brush;
91
92 // CommonJS
93 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
94})();
diff --git a/Blocks/syntax/scripts/shBrushScala.js b/Blocks/syntax/scripts/shBrushScala.js
new file mode 100644
index 0000000..4b0b6f0
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushScala.js
@@ -0,0 +1,51 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 // Contributed by Yegor Jbanov and David Bernard.
25
26 var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' +
27 'override try lazy for var catch throw type extends class while with new final yield abstract ' +
28 'else do if return protected private this package false';
29
30 var keyops = '[_:=><%#@]+';
31
32 this.regexList = [
33 { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
35 { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings
36 { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string
37 { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers
39 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
40 { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword
41 ];
42 }
43
44 Brush.prototype = new SyntaxHighlighter.Highlighter();
45 Brush.aliases = ['scala'];
46
47 SyntaxHighlighter.brushes.Scala = Brush;
48
49 // CommonJS
50 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
51})();
diff --git a/Blocks/syntax/scripts/shBrushSql.js b/Blocks/syntax/scripts/shBrushSql.js
new file mode 100644
index 0000000..5c2cd88
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushSql.js
@@ -0,0 +1,66 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
25 'current_user day isnull left lower month nullif replace right ' +
26 'session_user space substring sum system_user upper user year';
27
28 var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
29 'binary bit by cascade char character check checkpoint close collate ' +
30 'column commit committed connect connection constraint contains continue ' +
31 'create cube current current_date current_time cursor database date ' +
32 'deallocate dec decimal declare default delete desc distinct double drop ' +
33 'dynamic else end end-exec escape except exec execute false fetch first ' +
34 'float for force foreign forward free from full function global goto grant ' +
35 'group grouping having hour ignore index inner insensitive insert instead ' +
36 'int integer intersect into is isolation key last level load local max min ' +
37 'minute modify move name national nchar next no numeric of off on only ' +
38 'open option order out output partial password precision prepare primary ' +
39 'prior privileges procedure public read real references relative repeatable ' +
40 'restrict return returns revoke rollback rollup rows rule schema scroll ' +
41 'second section select sequence serializable set size smallint static ' +
42 'statistics table temp temporary then time timestamp to top transaction ' +
43 'translation trigger true truncate uncommitted union unique update values ' +
44 'varchar varying view when where with work';
45
46 var operators = 'all and any between cross in join like not null or outer some';
47
48 this.regexList = [
49 { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
50 { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
51 { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
52 { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
53 { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
54 { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
55 ];
56 };
57
58 Brush.prototype = new SyntaxHighlighter.Highlighter();
59 Brush.aliases = ['sql'];
60
61 SyntaxHighlighter.brushes.Sql = Brush;
62
63 // CommonJS
64 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
65})();
66
diff --git a/Blocks/syntax/scripts/shBrushVb.js b/Blocks/syntax/scripts/shBrushVb.js
new file mode 100644
index 0000000..be845dc
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushVb.js
@@ -0,0 +1,56 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
25 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
26 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
27 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
28 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
29 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
30 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
31 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
32 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
33 'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
34 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
35 'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
36 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
37 'Variant When While With WithEvents WriteOnly Xor';
38
39 this.regexList = [
40 { regex: /'.*$/gm, css: 'comments' }, // one line comments
41 { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
42 { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
43 { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword
44 ];
45
46 this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
47 };
48
49 Brush.prototype = new SyntaxHighlighter.Highlighter();
50 Brush.aliases = ['vb', 'vbnet'];
51
52 SyntaxHighlighter.brushes.Vb = Brush;
53
54 // CommonJS
55 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
56})();
diff --git a/Blocks/syntax/scripts/shBrushXml.js b/Blocks/syntax/scripts/shBrushXml.js
new file mode 100644
index 0000000..69d9fd0
--- /dev/null
+++ b/Blocks/syntax/scripts/shBrushXml.js
@@ -0,0 +1,69 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17;(function()
18{
19 // CommonJS
20 typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21
22 function Brush()
23 {
24 function process(match, regexInfo)
25 {
26 var constructor = SyntaxHighlighter.Match,
27 code = match[0],
28 tag = new XRegExp('(&lt;|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
29 result = []
30 ;
31
32 if (match.attributes != null)
33 {
34 var attributes,
35 regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
36 '\\s*=\\s*' +
37 '(?<value> ".*?"|\'.*?\'|\\w+)',
38 'xg');
39
40 while ((attributes = regex.exec(code)) != null)
41 {
42 result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
43 result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
44 }
45 }
46
47 if (tag != null)
48 result.push(
49 new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
50 );
51
52 return result;
53 }
54
55 this.regexList = [
56 { regex: new XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
57 { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
58 { regex: new XRegExp('(&lt;|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
59 ];
60 };
61
62 Brush.prototype = new SyntaxHighlighter.Highlighter();
63 Brush.aliases = ['xml', 'xhtml', 'xslt', 'html'];
64
65 SyntaxHighlighter.brushes.Xml = Brush;
66
67 // CommonJS
68 typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
69})();
diff --git a/Blocks/syntax/scripts/shCore.js b/Blocks/syntax/scripts/shCore.js
new file mode 100644
index 0000000..b47b645
--- /dev/null
+++ b/Blocks/syntax/scripts/shCore.js
@@ -0,0 +1,17 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17eval(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}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a<f.L;a++)I(f[a]===e)H a;H-1}M=6(f,e){K a=[],b=M.1B,c=0,d,h;I(M.1R(f)){I(e!==1d)1S 3m("2a\'t 5r 5I 5F 5B 5C 15 5E 5p");H r(f)}I(v)1S 2U("2a\'t W 3l M 59 5m 5g 5x 5i");e=e||"";O(d={2N:11,19:[],2K:6(g){H e.1i(g)>-1},3d:6(g){e+=g}};c<f.L;)I(h=B(f,c,b,d)){a.U(h.3k);c+=h.1C[0].L||1}Y I(h=n.X.W(z[b],f.1a(c))){a.U(h[0]);c+=h[0].L}Y{h=f.3a(c);I(h==="[")b=M.2I;Y I(h==="]")b=M.1B;a.U(h);c++}a=15(a.1K(""),n.Q.W(e,w,""));a.1w={1m:f,19:d.2N?d.19:N};H a};M.3v="1.5.0";M.2I=1;M.1B=2;K C=/\\$(?:(\\d\\d?|[$&`\'])|{([$\\w]+)})/g,w=/[^5h]+|([\\s\\S])(?=[\\s\\S]*\\1)/g,A=/^(?:[?*+]|{\\d+(?:,\\d*)?})\\??/,v=11,u=[],n={X:15.Z.X,1A:15.Z.1A,1C:1r.Z.1C,Q:1r.Z.Q,1e:1r.Z.1e},x=n.X.W(/()??/,"")[1]===1d,D=6(){K f=/^/g;n.1A.W(f,"");H!f.12}(),y=6(){K f=/x/g;n.Q.W("x",f,"");H!f.12}(),E=15.Z.3n!==1d,z={};z[M.2I]=/^(?:\\\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S]))/;z[M.1B]=/^(?:\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\\d*|x[\\29-26-f]{2}|u[\\29-26-f]{4}|c[A-3o-z]|[\\s\\S])|\\(\\?[:=!]|[?*+]\\?|{\\d+(?:,\\d*)?}\\??)/;M.1h=6(f,e,a,b){u.U({2q:r(f,"g"+(E?"y":"")),2b:e,3r:a||M.1B,2p:b||N})};M.2n=6(f,e){K a=f+"/"+(e||"");H M.2n[a]||(M.2n[a]=M(f,e))};M.3c=6(f){H r(f,"g")};M.5l=6(f){H f.Q(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g,"\\\\$&")};M.5e=6(f,e,a,b){e=r(e,"g"+(b&&E?"y":""));e.12=a=a||0;f=e.X(f);H b?f&&f.P===a?f:N:f};M.3q=6(){M.1h=6(){1S 2U("2a\'t 55 1h 54 3q")}};M.1R=6(f){H 53.Z.1q.W(f)==="[2m 15]"};M.3p=6(f,e,a,b){O(K c=r(e,"g"),d=-1,h;h=c.X(f);){a.W(b,h,++d,f,c);c.12===h.P&&c.12++}I(e.1J)e.12=0};M.57=6(f,e){H 6 a(b,c){K d=e[c].1I?e[c]:{1I:e[c]},h=r(d.1I,"g"),g=[],i;O(i=0;i<b.L;i++)M.3p(b[i],h,6(k){g.U(d.3j?k[d.3j]||"":k[0])});H c===e.L-1||!g.L?g:a(g,c+1)}([f],0)};15.Z.1p=6(f,e){H J.X(e[0])};15.Z.W=6(f,e){H J.X(e)};15.Z.X=6(f){K e=n.X.1p(J,14),a;I(e){I(!x&&e.L>1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;b<e.L;b++)I(a=J.1w.19[b-1])e[a]=e[b];!D&&J.1J&&!e[0].L&&J.12>e.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;d<b.L;d++)I(b[d])14[0][b[d]]=14[d+1]}I(a&&f.1J)f.12=14[14.L-2]+14[0].L;H e.1p(N,14)});Y{c=J+"";c=n.Q.W(c,f,6(){K d=14;H n.Q.W(e,C,6(h,g,i){I(g)5b(g){24"$":H"$";24"&":H d[0];24"`":H d[d.L-1].1a(0,d[d.L-2]);24"\'":H d[d.L-1].1a(d[d.L-2]+d[0].L);5a:i="";g=+g;I(!g)H h;O(;g>d.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P<a.L&&3b.Z.U.1p(b,d.1a(1));h=d[0].L;c=f.12;I(b.L>=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a<d.L&&i==N;a++)i=p(d[a],b,c);H i}6 C(a,b){K c={},d;O(d 2g a)c[d]=a[d];O(d 2g b)c[d]=b[d];H c}6 w(a,b,c,d){6 h(g){g=g||1P.5y;I(!g.1F){g.1F=g.52;g.3N=6(){J.5w=11}}c.W(d||1P,g)}a.3g?a.3g("4U"+b,h):a.4y(b,h,11)}6 A(a,b){K c=e.1Y.2j,d=N;I(c==N){c={};O(K h 2g e.1U){K g=e.1U[h];d=g.4x;I(d!=N){g.1V=h.4w();O(g=0;g<d.L;g++)c[d[g]]=h}}e.1Y.2j=c}d=e.1U[c[a]];d==N&&b!=11&&1P.1X(e.13.1x.1X+(e.13.1x.3E+a));H d}6 v(a,b){O(K c=a.1e("\\n"),d=0;d<c.L;d++)c[d]=b(c[d],d);H c.1K("\\n")}6 u(a,b){I(a==N||a.L==0||a=="\\n")H a;a=a.Q(/</g,"&1y;");a=a.Q(/ {2,}/g,6(c){O(K d="",h=0;h<c.L-1;h++)d+=e.13.1W;H d+" "});I(b!=N)a=v(a,6(c){I(c.L==0)H"";K d="";c=c.Q(/^(&2s;| )+/,6(h){d=h;H""});I(c.L==0)H d;H d+\'<17 1g="\'+b+\'">\'+c+"</17>"});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.P<b.P)H-1;Y I(a.P>b.P)H 1;Y I(a.L<b.L)H-1;Y I(a.L>b.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'<a 2h="\'+c+\'">\'+c+"</a>"+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<a.L;c++)a[c].3s=="20"&&b.U(a[c]);H b}6 f(a){a=a.1F;K b=p(a,".20",R);a=p(a,".3O",R);K c=1E.4i("3t");I(!(!a||!b||p(a,"3t"))){B(b.1c);r(b,"1m");O(K d=a.3G,h=[],g=0;g<d.L;g++)h.U(d[g].4z||d[g].4A);h=h.1K("\\r");c.39(1E.4D(h));a.39(c);c.2C();c.4C();w(c,"4u",6(){c.2G.4E(c);b.1l=b.1l.Q("1m","")})}}I(1j 3F!="1d"&&1j M=="1d")M=3F("M").M;K e={2v:{"1g-27":"","2i-1s":1,"2z-1s-2t":11,1M:N,1t:N,"42-45":R,"43-22":4,1u:R,16:R,"3V-17":R,2l:11,"41-40":R,2k:11,"1z-1k":11},13:{1W:"&2s;",2M:R,46:11,44:11,34:"4n",1x:{21:"4o 1m",2P:"?",1X:"1v\\n\\n",3E:"4r\'t 4t 1D O: ",4g:"4m 4B\'t 51 O 1z-1k 4F: ",37:\'<!4T 1z 4S "-//4V//3H 4W 1.0 4Z//4Y" "1Z://2y.3L.3K/4X/3I/3H/3I-4P.4J"><1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v</1t></3J><3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;"><T 1L="2O-3D:3C;3w-32:1.6z;"><T 1L="25-22:6A-6E;">1v</T><T 1L="25-22:.6C;3w-6B:6R;"><T>3v 3.0.76 (72 73 3x)</T><T><a 2h="1Z://3u.2w/1v" 1F="38" 1L="2f:#3y">1Z://3u.2w/1v</a></T><T>70 17 6U 71.</T><T>6T 6X-3x 6Y 6D.</T></T><T>6t 61 60 J 1k, 5Z <a 2h="6u://2y.62.2w/63-66/65?64=5X-5W&5P=5O" 1L="2f:#3y">5R</a> 5V <2R/>5U 5T 5S!</T></T></3B></1z>\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'<T 1g="16">\',d=e.16.2x,h=d.2X,g=0;g<h.L;g++)c+=(d[h[g]].1H||b)(a,h[g]);c+="</T>";H c},2o:6(a,b,c){H\'<2W><a 2h="#" 1g="6e 6h\'+b+" "+b+\'">\'+c+"</a></2W>"},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h<c.L;h++)d.U(c[h]);c=d}c=c;d=[];I(e.13.2M)c=c.1O(z());I(c.L===0)H d;O(h=0;h<c.L;h++){O(K g=c[h],i=a,k=c[h].1l,j=3W 0,l={},m=1f M("^\\\\[(?<2V>(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g<c.L;g++){b=c[g];K i=b.1F,k=b.1n,j=k.1D,l;I(j!=N){I(k["1z-1k"]=="R"||e.2v["1z-1k"]==R){d=1f e.4l(j);j="4O"}Y I(d=A(j))d=1f d;Y 6H;l=i.3X;I(h.2M){l=l;K m=x(l),s=11;I(m.1i("<![6G[")==0){m=m.4h(9);s=R}K o=m.L;I(m.1i("]]\\>")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;m<j.L;m++)j[m].P+=l}K c=A(a),d,h=1f e.1U.5Y,g=J,i="2F 1H 2Q".1e(" ");I(c!=N){d=1f c;O(K k=0;k<i.L;k++)(6(){K j=i[k];g[j]=6(){H h[j].1p(h,14)}})();d.28==N?1P.1X(e.13.1x.1X+(e.13.1x.4g+a)):h.2J.U({1I:d.28.17,2D:6(j){O(K l=j.17,m=[],s=d.2J,o=j.P+j.18.L,F=d.28,q,G=0;G<s.L;G++){q=y(l,s[G]);b(q,o);m=m.1O(q)}I(F.18!=N&&j.18!=N){q=y(j.18,F.18);b(q,j.P);m=m.1O(q)}I(F.1b!=N&&j.1b!=N){q=y(j.1b,F.1b);b(q,j.P+j[0].5Q(j.1b));m=m.1O(q)}O(j=0;j<m.L;j++)m[j].1V=c.1V;H m}})}};e.4j=6(){};e.4j.Z={V:6(a,b){K c=J.1n[a];c=c==N?b:c;K d={"R":R,"11":11}[c];H d==N?c:d},3Y:6(a){H 1E.4i(a)},4c:6(a,b){K c=[];I(a!=N)O(K d=0;d<a.L;d++)I(1j a[d]=="2m")c=c.1O(y(b,a[d]));H J.4e(c.6b(D))},4e:6(a){O(K b=0;b<a.L;b++)I(a[b]!==N)O(K c=a[b],d=c.P+c.L,h=b+1;h<a.L&&a[b]!==N;h++){K g=a[h];I(g!==N)I(g.P>d)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P<d)a[h]=N}H a},4d:6(a){K b=[],c=2u(J.V("2i-1s"));v(a,6(d,h){b.U(h+c)});H b},3U:6(a){K b=J.V("1M",[]);I(1j b!="2m"&&b.U==N)b=[b];a:{a=a.1q();K c=3W 0;O(c=c=1Q.6c(c||0,0);c<b.L;c++)I(b[c]==a){b=c;1N a}b=-1}H b!=-1},2r:6(a,b,c){a=["1s","6i"+b,"P"+a,"6r"+(b%2==0?1:2).1q()];J.3U(b)&&a.U("67");b==0&&a.U("1N");H\'<T 1g="\'+a.1K(" ")+\'">\'+c+"</T>"},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i<d;i++){K k=b?b[i]:h+i,j;I(k==0)j=e.13.1W;Y{j=g;O(K l=k.1q();l.L<j;)l="0"+l;j=l}a=j;c+=J.2r(i,k,a)}H c},49:6(a,b){a=x(a);K c=a.1e("\\n");J.V("2z-1s-2t");K d=2u(J.V("2i-1s"));a="";O(K h=J.V("1D"),g=0;g<c.L;g++){K i=c[g],k=/^(&2s;|\\s)+/.X(i),j=N,l=b?b[g]:d+g;I(k!=N){j=k[0].1q();i=i.1o(j.L);j=j.Q(" ",e.13.1W)}i=x(i);I(i.L==0)i=e.13.1W;a+=J.2r(g,l,(j!=N?\'<17 1g="\'+h+\' 5N">\'+j+"</17>":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"</4a>":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i<b.L;i++){K k=b[i],j;I(!(k===N||k.L===0)){j=c(k);h+=u(a.1o(d,k.P-d),j+"48")+u(k.1T,j+k.23);d=k.P+k.L+(k.75||0)}}h+=u(a.1o(d),c()+"48");H h},1H:6(a){K b="",c=["20"],d;I(J.V("2k")==R)J.1n.16=J.1n.1u=11;1l="20";J.V("2l")==R&&c.U("47");I((1u=J.V("1u"))==11)c.U("6S");c.U(J.V("1g-27"));c.U(J.V("1D"));a=a.Q(/^[ ]*[\\n]+|[\\n]*[ ]*$/g,"").Q(/\\r/g," ");b=J.V("43-22");I(J.V("42-45")==R)a=n(a,b);Y{O(K h="",g=0;g<b;g++)h+=" ";a=a.Q(/\\t/g,h)}a=a;a:{b=a=a;h=/<2R\\s*\\/?>|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i<b.L&&g>0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i<b.L;i++)b[i]=b[i].1o(g);a=b.1K("\\n")}I(1u)d=J.4d(a);b=J.4c(J.2J,a);b=J.4b(a,b);b=J.49(b,d);I(J.V("41-40"))b=E(b);1j 2H!="1d"&&2H.3S&&2H.3S.1C(/5s/)&&c.U("5t");H b=\'<T 1c="\'+t(J.1c)+\'" 1g="\'+c.1K(" ")+\'">\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"</2d>":"")+\'<2d 1g="17"><T 1g="3O">\'+b+"</T></2d></3P></3T></3Z></T>"},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))
diff --git a/Blocks/syntax/scripts/shLegacy.js b/Blocks/syntax/scripts/shLegacy.js
new file mode 100644
index 0000000..6d9fd4d
--- /dev/null
+++ b/Blocks/syntax/scripts/shLegacy.js
@@ -0,0 +1,17 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17eval(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}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?<q>\\\\w+)\\\\]$","U"),i=1,p=0;p<a.7;p++)6((i=h.J(a[p]))!=1)2 i.q;2 1}(c,"G"),n)}},F:4(c,k,l,m,n,o){4 d(){9(3 a=H,b=0;b<a.7;b++)6(a[b]!==1){6(z a[b]=="L"&&a[b]!="")2 a[b]+"";6(z a[b]=="X"&&a[b].q!="")2 a[b].q+""}2 1}4 f(a,b,h){h=12.13(h);9(3 i=0;i<h.7;i++)h[i].V("15")==b&&a.Y(h[i])}3 g=[];f(g,c,"Z");f(g,c,"W");6(g.7!==0)9(c=0;c<g.7;c++){3 e=g[c],j=d(e.B["14"],e.10,e.B.v,e.v);6(j!==1){j=u.8.A(j,k,l,m,n,o);8.11(j,e)}}}};',62,68,'|null|return|var|function|defaults|if|length|SyntaxHighlighter|for|||||||||||||||||value|true|collapse|reverse|dp|language||first|line|typeof|parseParams|attributes|gutter|toolbar|toString|HighlightAll|firstline|arguments|split|exec|false|string|result|nocontrols|nogutter|brush|ruler|in|XRegExp|new|gi|getAttribute|textarea|object|push|pre|className|highlight|document|getElementsByTagName|class|name'.split('|'),0,{}))
diff --git a/Blocks/syntax/src/shAutoloader.js b/Blocks/syntax/src/shAutoloader.js
new file mode 100644
index 0000000..3a95449
--- /dev/null
+++ b/Blocks/syntax/src/shAutoloader.js
@@ -0,0 +1,130 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17(function() {
18
19var sh = SyntaxHighlighter;
20
21/**
22 * Provides functionality to dynamically load only the brushes that a needed to render the current page.
23 *
24 * There are two syntaxes that autoload understands. For example:
25 *
26 * SyntaxHighlighter.autoloader(
27 * [ 'applescript', 'Scripts/shBrushAppleScript.js' ],
28 * [ 'actionscript3', 'as3', 'Scripts/shBrushAS3.js' ]
29 * );
30 *
31 * or a more easily comprehendable one:
32 *
33 * SyntaxHighlighter.autoloader(
34 * 'applescript Scripts/shBrushAppleScript.js',
35 * 'actionscript3 as3 Scripts/shBrushAS3.js'
36 * );
37 */
38sh.autoloader = function()
39{
40 var list = arguments,
41 elements = sh.findElements(),
42 brushes = {},
43 scripts = {},
44 all = SyntaxHighlighter.all,
45 allCalled = false,
46 allParams = null,
47 i
48 ;
49
50 SyntaxHighlighter.all = function(params)
51 {
52 allParams = params;
53 allCalled = true;
54 };
55
56 function addBrush(aliases, url)
57 {
58 for (var i = 0; i < aliases.length; i++)
59 brushes[aliases[i]] = url;
60 };
61
62 function getAliases(item)
63 {
64 return item.pop
65 ? item
66 : item.split(/\s+/)
67 ;
68 }
69
70 // create table of aliases and script urls
71 for (i = 0; i < list.length; i++)
72 {
73 var aliases = getAliases(list[i]),
74 url = aliases.pop()
75 ;
76
77 addBrush(aliases, url);
78 }
79
80 // dynamically add <script /> tags to the document body
81 for (i = 0; i < elements.length; i++)
82 {
83 var url = brushes[elements[i].params.brush];
84
85 if (!url)
86 continue;
87
88 scripts[url] = false;
89 loadScript(url);
90 }
91
92 function loadScript(url)
93 {
94 var script = document.createElement('script'),
95 done = false
96 ;
97
98 script.src = url;
99 script.type = 'text/javascript';
100 script.language = 'javascript';
101 script.onload = script.onreadystatechange = function()
102 {
103 if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
104 {
105 done = true;
106 scripts[url] = true;
107 checkAll();
108
109 // Handle memory leak in IE
110 script.onload = script.onreadystatechange = null;
111 script.parentNode.removeChild(script);
112 }
113 };
114
115 // sync way of adding script tags to the page
116 document.body.appendChild(script);
117 };
118
119 function checkAll()
120 {
121 for(var url in scripts)
122 if (scripts[url] == false)
123 return;
124
125 if (allCalled)
126 SyntaxHighlighter.highlight(allParams);
127 };
128};
129
130})();
diff --git a/Blocks/syntax/src/shCore.js b/Blocks/syntax/src/shCore.js
new file mode 100644
index 0000000..4214763
--- /dev/null
+++ b/Blocks/syntax/src/shCore.js
@@ -0,0 +1,1721 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17//
18// Begin anonymous function. This is used to contain local scope variables without polutting global scope.
19//
20var SyntaxHighlighter = function() {
21
22// CommonJS
23if (typeof(require) != 'undefined' && typeof(XRegExp) == 'undefined')
24{
25 XRegExp = require('XRegExp').XRegExp;
26}
27
28// Shortcut object which will be assigned to the SyntaxHighlighter variable.
29// This is a shorthand for local reference in order to avoid long namespace
30// references to SyntaxHighlighter.whatever...
31var sh = {
32 defaults : {
33 /** Additional CSS class names to be added to highlighter elements. */
34 'class-name' : '',
35
36 /** First line number. */
37 'first-line' : 1,
38
39 /**
40 * Pads line numbers. Possible values are:
41 *
42 * false - don't pad line numbers.
43 * true - automaticaly pad numbers with minimum required number of leading zeroes.
44 * [int] - length up to which pad line numbers.
45 */
46 'pad-line-numbers' : false,
47
48 /** Lines to highlight. */
49 'highlight' : null,
50
51 /** Title to be displayed above the code block. */
52 'title' : null,
53
54 /** Enables or disables smart tabs. */
55 'smart-tabs' : true,
56
57 /** Gets or sets tab size. */
58 'tab-size' : 4,
59
60 /** Enables or disables gutter. */
61 'gutter' : true,
62
63 /** Enables or disables toolbar. */
64 'toolbar' : true,
65
66 /** Enables quick code copy and paste from double click. */
67 'quick-code' : true,
68
69 /** Forces code view to be collapsed. */
70 'collapse' : false,
71
72 /** Enables or disables automatic links. */
73 'auto-links' : true,
74
75 /** Gets or sets light mode. Equavalent to turning off gutter and toolbar. */
76 'light' : false,
77
78 'html-script' : false
79 },
80
81 config : {
82 space : '&nbsp;',
83
84 /** Enables use of <SCRIPT type="syntaxhighlighter" /> tags. */
85 useScriptTags : true,
86
87 /** Blogger mode flag. */
88 bloggerMode : false,
89
90 stripBrs : false,
91
92 /** Name of the tag that SyntaxHighlighter will automatically look for. */
93 tagName : 'pre',
94
95 strings : {
96 expandSource : 'expand source',
97 help : '?',
98 alert: 'SyntaxHighlighter\n\n',
99 noBrush : 'Can\'t find brush for: ',
100 brushNotHtmlScript : 'Brush wasn\'t configured for html-script option: ',
101
102 // this is populated by the build script
103 aboutDialog : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>About SyntaxHighlighter</title></head><body style="font-family:Geneva,Arial,Helvetica,sans-serif;background-color:#fff;color:#000;font-size:1em;text-align:center;"><div style="text-align:center;margin-top:1.5em;"><div style="font-size:xx-large;">SyntaxHighlighter</div><div style="font-size:.75em;margin-bottom:3em;"><div>version 3.0.83 (July 02 2010)</div><div><a href="http://alexgorbatchev.com/SyntaxHighlighter" target="_blank" style="color:#005896">http://alexgorbatchev.com/SyntaxHighlighter</a></div><div>JavaScript code syntax highlighter.</div><div>Copyright 2004-2010 Alex Gorbatchev.</div></div><div>If you like this script, please <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2930402" style="color:#005896">donate</a> to <br/>keep development active!</div></div></body></html>'
104 }
105 },
106
107 /** Internal 'global' variables. */
108 vars : {
109 discoveredBrushes : null,
110 highlighters : {}
111 },
112
113 /** This object is populated by user included external brush files. */
114 brushes : {},
115
116 /** Common regular expressions. */
117 regexLib : {
118 multiLineCComments : /\/\*[\s\S]*?\*\//gm,
119 singleLineCComments : /\/\/.*$/gm,
120 singleLinePerlComments : /#.*$/gm,
121 doubleQuotedString : /"([^\\"\n]|\\.)*"/g,
122 singleQuotedString : /'([^\\'\n]|\\.)*'/g,
123 multiLineDoubleQuotedString : new XRegExp('"([^\\\\"]|\\\\.)*"', 'gs'),
124 multiLineSingleQuotedString : new XRegExp("'([^\\\\']|\\\\.)*'", 'gs'),
125 xmlComments : /(&lt;|<)!--[\s\S]*?--(&gt;|>)/gm,
126 url : /\w+:\/\/[\w-.\/?%&=:@;]*/g,
127
128 /** <?= ?> tags. */
129 phpScriptTags : { left: /(&lt;|<)\?=?/g, right: /\?(&gt;|>)/g },
130
131 /** <%= %> tags. */
132 aspScriptTags : { left: /(&lt;|<)%=?/g, right: /%(&gt;|>)/g },
133
134 /** <script></script> tags. */
135 scriptScriptTags : { left: /(&lt;|<)\s*script.*?(&gt;|>)/gi, right: /(&lt;|<)\/\s*script\s*(&gt;|>)/gi }
136 },
137
138 toolbar: {
139 /**
140 * Generates HTML markup for the toolbar.
141 * @param {Highlighter} highlighter Highlighter instance.
142 * @return {String} Returns HTML markup.
143 */
144 getHtml: function(highlighter)
145 {
146 var html = '<div class="toolbar">',
147 items = sh.toolbar.items,
148 list = items.list
149 ;
150
151 function defaultGetHtml(highlighter, name)
152 {
153 return sh.toolbar.getButtonHtml(highlighter, name, sh.config.strings[name]);
154 };
155
156 for (var i = 0; i < list.length; i++)
157 html += (items[list[i]].getHtml || defaultGetHtml)(highlighter, list[i]);
158
159 html += '</div>';
160
161 return html;
162 },
163
164 /**
165 * Generates HTML markup for a regular button in the toolbar.
166 * @param {Highlighter} highlighter Highlighter instance.
167 * @param {String} commandName Command name that would be executed.
168 * @param {String} label Label text to display.
169 * @return {String} Returns HTML markup.
170 */
171 getButtonHtml: function(highlighter, commandName, label)
172 {
173 return '<span><a href="#" class="toolbar_item'
174 + ' command_' + commandName
175 + ' ' + commandName
176 + '">' + label + '</a></span>'
177 ;
178 },
179
180 /**
181 * Event handler for a toolbar anchor.
182 */
183 handler: function(e)
184 {
185 var target = e.target,
186 className = target.className || ''
187 ;
188
189 function getValue(name)
190 {
191 var r = new RegExp(name + '_(\\w+)'),
192 match = r.exec(className)
193 ;
194
195 return match ? match[1] : null;
196 };
197
198 var highlighter = getHighlighterById(findParentElement(target, '.syntaxhighlighter').id),
199 commandName = getValue('command')
200 ;
201
202 // execute the toolbar command
203 if (highlighter && commandName)
204 sh.toolbar.items[commandName].execute(highlighter);
205
206 // disable default A click behaviour
207 e.preventDefault();
208 },
209
210 /** Collection of toolbar items. */
211 items : {
212 // Ordered lis of items in the toolbar. Can't expect `for (var n in items)` to be consistent.
213 list: ['expandSource', 'help'],
214
215 expandSource: {
216 getHtml: function(highlighter)
217 {
218 if (highlighter.getParam('collapse') != true)
219 return '';
220
221 var title = highlighter.getParam('title');
222 return sh.toolbar.getButtonHtml(highlighter, 'expandSource', title ? title : sh.config.strings.expandSource);
223 },
224
225 execute: function(highlighter)
226 {
227 var div = getHighlighterDivById(highlighter.id);
228 removeClass(div, 'collapsed');
229 }
230 },
231
232 /** Command to display the about dialog window. */
233 help: {
234 execute: function(highlighter)
235 {
236 var wnd = popup('', '_blank', 500, 250, 'scrollbars=0'),
237 doc = wnd.document
238 ;
239
240 doc.write(sh.config.strings.aboutDialog);
241 doc.close();
242 wnd.focus();
243 }
244 }
245 }
246 },
247
248 /**
249 * Finds all elements on the page which should be processes by SyntaxHighlighter.
250 *
251 * @param {Object} globalParams Optional parameters which override element's
252 * parameters. Only used if element is specified.
253 *
254 * @param {Object} element Optional element to highlight. If none is
255 * provided, all elements in the current document
256 * are returned which qualify.
257 *
258 * @return {Array} Returns list of <code>{ target: DOMElement, params: Object }</code> objects.
259 */
260 findElements: function(globalParams, element)
261 {
262 var elements = element ? [element] : toArray(document.getElementsByTagName(sh.config.tagName)),
263 conf = sh.config,
264 result = []
265 ;
266
267 // support for <SCRIPT TYPE="syntaxhighlighter" /> feature
268 if (conf.useScriptTags)
269 elements = elements.concat(getSyntaxHighlighterScriptTags());
270
271 if (elements.length === 0)
272 return result;
273
274 for (var i = 0; i < elements.length; i++)
275 {
276 var item = {
277 target: elements[i],
278 // local params take precedence over globals
279 params: merge(globalParams, parseParams(elements[i].className))
280 };
281
282 if (item.params['brush'] == null)
283 continue;
284
285 result.push(item);
286 }
287
288 return result;
289 },
290
291 /**
292 * Shorthand to highlight all elements on the page that are marked as
293 * SyntaxHighlighter source code.
294 *
295 * @param {Object} globalParams Optional parameters which override element's
296 * parameters. Only used if element is specified.
297 *
298 * @param {Object} element Optional element to highlight. If none is
299 * provided, all elements in the current document
300 * are highlighted.
301 */
302 highlight: function(globalParams, element)
303 {
304 var elements = this.findElements(globalParams, element),
305 propertyName = 'innerHTML',
306 highlighter = null,
307 conf = sh.config
308 ;
309
310 if (elements.length === 0)
311 return;
312
313 for (var i = 0; i < elements.length; i++)
314 {
315 var element = elements[i],
316 target = element.target,
317 params = element.params,
318 brushName = params.brush,
319 code
320 ;
321
322 if (brushName == null)
323 continue;
324
325 // Instantiate a brush
326 if (params['html-script'] == 'true' || sh.defaults['html-script'] == true)
327 {
328 highlighter = new sh.HtmlScript(brushName);
329 brushName = 'htmlscript';
330 }
331 else
332 {
333 var brush = findBrush(brushName);
334
335 if (brush)
336 highlighter = new brush();
337 else
338 continue;
339 }
340
341 code = target[propertyName];
342
343 // remove CDATA from <SCRIPT/> tags if it's present
344 if (conf.useScriptTags)
345 code = stripCData(code);
346
347 // Inject title if the attribute is present
348 if ((target.title || '') != '')
349 params.title = target.title;
350
351 params['brush'] = brushName;
352 highlighter.init(params);
353 element = highlighter.getDiv(code);
354
355 // carry over ID
356 if ((target.id || '') != '')
357 element.id = target.id;
358
359 target.parentNode.replaceChild(element, target);
360 }
361 },
362
363 /**
364 * Main entry point for the SyntaxHighlighter.
365 * @param {Object} params Optional params to apply to all highlighted elements.
366 */
367 all: function(params)
368 {
369 attachEvent(
370 window,
371 'load',
372 function() { sh.highlight(params); }
373 );
374 }
375}; // end of sh
376
377sh['all'] = sh.all;
378sh['highlight'] = sh.highlight;
379
380/**
381 * Checks if target DOM elements has specified CSS class.
382 * @param {DOMElement} target Target DOM element to check.
383 * @param {String} className Name of the CSS class to check for.
384 * @return {Boolean} Returns true if class name is present, false otherwise.
385 */
386function hasClass(target, className)
387{
388 return target.className.indexOf(className) != -1;
389};
390
391/**
392 * Adds CSS class name to the target DOM element.
393 * @param {DOMElement} target Target DOM element.
394 * @param {String} className New CSS class to add.
395 */
396function addClass(target, className)
397{
398 if (!hasClass(target, className))
399 target.className += ' ' + className;
400};
401
402/**
403 * Removes CSS class name from the target DOM element.
404 * @param {DOMElement} target Target DOM element.
405 * @param {String} className CSS class to remove.
406 */
407function removeClass(target, className)
408{
409 target.className = target.className.replace(className, '');
410};
411
412/**
413 * Converts the source to array object. Mostly used for function arguments and
414 * lists returned by getElementsByTagName() which aren't Array objects.
415 * @param {List} source Source list.
416 * @return {Array} Returns array.
417 */
418function toArray(source)
419{
420 var result = [];
421
422 for (var i = 0; i < source.length; i++)
423 result.push(source[i]);
424
425 return result;
426};
427
428/**
429 * Splits block of text into lines.
430 * @param {String} block Block of text.
431 * @return {Array} Returns array of lines.
432 */
433function splitLines(block)
434{
435 return block.split('\n');
436}
437
438/**
439 * Generates HTML ID for the highlighter.
440 * @param {String} highlighterId Highlighter ID.
441 * @return {String} Returns HTML ID.
442 */
443function getHighlighterId(id)
444{
445 var prefix = 'highlighter_';
446 return id.indexOf(prefix) == 0 ? id : prefix + id;
447};
448
449/**
450 * Finds Highlighter instance by ID.
451 * @param {String} highlighterId Highlighter ID.
452 * @return {Highlighter} Returns instance of the highlighter.
453 */
454function getHighlighterById(id)
455{
456 return sh.vars.highlighters[getHighlighterId(id)];
457};
458
459/**
460 * Finds highlighter's DIV container.
461 * @param {String} highlighterId Highlighter ID.
462 * @return {Element} Returns highlighter's DIV element.
463 */
464function getHighlighterDivById(id)
465{
466 return document.getElementById(getHighlighterId(id));
467};
468
469/**
470 * Stores highlighter so that getHighlighterById() can do its thing. Each
471 * highlighter must call this method to preserve itself.
472 * @param {Highilghter} highlighter Highlighter instance.
473 */
474function storeHighlighter(highlighter)
475{
476 sh.vars.highlighters[getHighlighterId(highlighter.id)] = highlighter;
477};
478
479/**
480 * Looks for a child or parent node which has specified classname.
481 * Equivalent to jQuery's $(container).find(".className")
482 * @param {Element} target Target element.
483 * @param {String} search Class name or node name to look for.
484 * @param {Boolean} reverse If set to true, will go up the node tree instead of down.
485 * @return {Element} Returns found child or parent element on null.
486 */
487function findElement(target, search, reverse /* optional */)
488{
489 if (target == null)
490 return null;
491
492 var nodes = reverse != true ? target.childNodes : [ target.parentNode ],
493 propertyToFind = { '#' : 'id', '.' : 'className' }[search.substr(0, 1)] || 'nodeName',
494 expectedValue,
495 found
496 ;
497
498 expectedValue = propertyToFind != 'nodeName'
499 ? search.substr(1)
500 : search.toUpperCase()
501 ;
502
503 // main return of the found node
504 if ((target[propertyToFind] || '').indexOf(expectedValue) != -1)
505 return target;
506
507 for (var i = 0; nodes && i < nodes.length && found == null; i++)
508 found = findElement(nodes[i], search, reverse);
509
510 return found;
511};
512
513/**
514 * Looks for a parent node which has specified classname.
515 * This is an alias to <code>findElement(container, className, true)</code>.
516 * @param {Element} target Target element.
517 * @param {String} className Class name to look for.
518 * @return {Element} Returns found parent element on null.
519 */
520function findParentElement(target, className)
521{
522 return findElement(target, className, true);
523};
524
525/**
526 * Finds an index of element in the array.
527 * @ignore
528 * @param {Object} searchElement
529 * @param {Number} fromIndex
530 * @return {Number} Returns index of element if found; -1 otherwise.
531 */
532function indexOf(array, searchElement, fromIndex)
533{
534 fromIndex = Math.max(fromIndex || 0, 0);
535
536 for (var i = fromIndex; i < array.length; i++)
537 if(array[i] == searchElement)
538 return i;
539
540 return -1;
541};
542
543/**
544 * Generates a unique element ID.
545 */
546function guid(prefix)
547{
548 return (prefix || '') + Math.round(Math.random() * 1000000).toString();
549};
550
551/**
552 * Merges two objects. Values from obj2 override values in obj1.
553 * Function is NOT recursive and works only for one dimensional objects.
554 * @param {Object} obj1 First object.
555 * @param {Object} obj2 Second object.
556 * @return {Object} Returns combination of both objects.
557 */
558function merge(obj1, obj2)
559{
560 var result = {}, name;
561
562 for (name in obj1)
563 result[name] = obj1[name];
564
565 for (name in obj2)
566 result[name] = obj2[name];
567
568 return result;
569};
570
571/**
572 * Attempts to convert string to boolean.
573 * @param {String} value Input string.
574 * @return {Boolean} Returns true if input was "true", false if input was "false" and value otherwise.
575 */
576function toBoolean(value)
577{
578 var result = { "true" : true, "false" : false }[value];
579 return result == null ? value : result;
580};
581
582/**
583 * Opens up a centered popup window.
584 * @param {String} url URL to open in the window.
585 * @param {String} name Popup name.
586 * @param {int} width Popup width.
587 * @param {int} height Popup height.
588 * @param {String} options window.open() options.
589 * @return {Window} Returns window instance.
590 */
591function popup(url, name, width, height, options)
592{
593 var x = (screen.width - width) / 2,
594 y = (screen.height - height) / 2
595 ;
596
597 options += ', left=' + x +
598 ', top=' + y +
599 ', width=' + width +
600 ', height=' + height
601 ;
602 options = options.replace(/^,/, '');
603
604 var win = window.open(url, name, options);
605 win.focus();
606 return win;
607};
608
609/**
610 * Adds event handler to the target object.
611 * @param {Object} obj Target object.
612 * @param {String} type Name of the event.
613 * @param {Function} func Handling function.
614 */
615function attachEvent(obj, type, func, scope)
616{
617 function handler(e)
618 {
619 e = e || window.event;
620
621 if (!e.target)
622 {
623 e.target = e.srcElement;
624 e.preventDefault = function()
625 {
626 this.returnValue = false;
627 };
628 }
629
630 func.call(scope || window, e);
631 };
632
633 if (obj.attachEvent)
634 {
635 obj.attachEvent('on' + type, handler);
636 }
637 else
638 {
639 obj.addEventListener(type, handler, false);
640 }
641};
642
643/**
644 * Displays an alert.
645 * @param {String} str String to display.
646 */
647function alert(str)
648{
649 window.alert(sh.config.strings.alert + str);
650};
651
652/**
653 * Finds a brush by its alias.
654 *
655 * @param {String} alias Brush alias.
656 * @param {Boolean} showAlert Suppresses the alert if false.
657 * @return {Brush} Returns bursh constructor if found, null otherwise.
658 */
659function findBrush(alias, showAlert)
660{
661 var brushes = sh.vars.discoveredBrushes,
662 result = null
663 ;
664
665 if (brushes == null)
666 {
667 brushes = {};
668
669 // Find all brushes
670 for (var brush in sh.brushes)
671 {
672 var info = sh.brushes[brush],
673 aliases = info.aliases
674 ;
675
676 if (aliases == null)
677 continue;
678
679 // keep the brush name
680 info.brushName = brush.toLowerCase();
681
682 for (var i = 0; i < aliases.length; i++)
683 brushes[aliases[i]] = brush;
684 }
685
686 sh.vars.discoveredBrushes = brushes;
687 }
688
689 result = sh.brushes[brushes[alias]];
690
691 if (result == null && showAlert != false)
692 alert(sh.config.strings.noBrush + alias);
693
694 return result;
695};
696
697/**
698 * Executes a callback on each line and replaces each line with result from the callback.
699 * @param {Object} str Input string.
700 * @param {Object} callback Callback function taking one string argument and returning a string.
701 */
702function eachLine(str, callback)
703{
704 var lines = splitLines(str);
705
706 for (var i = 0; i < lines.length; i++)
707 lines[i] = callback(lines[i], i);
708
709 return lines.join('\n');
710};
711
712/**
713 * This is a special trim which only removes first and last empty lines
714 * and doesn't affect valid leading space on the first line.
715 *
716 * @param {String} str Input string
717 * @return {String} Returns string without empty first and last lines.
718 */
719function trimFirstAndLastLines(str)
720{
721 return str.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g, '');
722};
723
724/**
725 * Parses key/value pairs into hash object.
726 *
727 * Understands the following formats:
728 * - name: word;
729 * - name: [word, word];
730 * - name: "string";
731 * - name: 'string';
732 *
733 * For example:
734 * name1: value; name2: [value, value]; name3: 'value'
735 *
736 * @param {String} str Input string.
737 * @return {Object} Returns deserialized object.
738 */
739function parseParams(str)
740{
741 var match,
742 result = {},
743 arrayRegex = new XRegExp("^\\[(?<values>(.*?))\\]$"),
744 regex = new XRegExp(
745 "(?<name>[\\w-]+)" +
746 "\\s*:\\s*" +
747 "(?<value>" +
748 "[\\w-%#]+|" + // word
749 "\\[.*?\\]|" + // [] array
750 '".*?"|' + // "" string
751 "'.*?'" + // '' string
752 ")\\s*;?",
753 "g"
754 )
755 ;
756
757 while ((match = regex.exec(str)) != null)
758 {
759 var value = match.value
760 .replace(/^['"]|['"]$/g, '') // strip quotes from end of strings
761 ;
762
763 // try to parse array value
764 if (value != null && arrayRegex.test(value))
765 {
766 var m = arrayRegex.exec(value);
767 value = m.values.length > 0 ? m.values.split(/\s*,\s*/) : [];
768 }
769
770 result[match.name] = value;
771 }
772
773 return result;
774};
775
776/**
777 * Wraps each line of the string into <code/> tag with given style applied to it.
778 *
779 * @param {String} str Input string.
780 * @param {String} css Style name to apply to the string.
781 * @return {String} Returns input string with each line surrounded by <span/> tag.
782 */
783function wrapLinesWithCode(str, css)
784{
785 if (str == null || str.length == 0 || str == '\n')
786 return str;
787
788 str = str.replace(/</g, '&lt;');
789
790 // Replace two or more sequential spaces with &nbsp; leaving last space untouched.
791 str = str.replace(/ {2,}/g, function(m)
792 {
793 var spaces = '';
794
795 for (var i = 0; i < m.length - 1; i++)
796 spaces += sh.config.space;
797
798 return spaces + ' ';
799 });
800
801 // Split each line and apply <span class="...">...</span> to them so that
802 // leading spaces aren't included.
803 if (css != null)
804 str = eachLine(str, function(line)
805 {
806 if (line.length == 0)
807 return '';
808
809 var spaces = '';
810
811 line = line.replace(/^(&nbsp;| )+/, function(s)
812 {
813 spaces = s;
814 return '';
815 });
816
817 if (line.length == 0)
818 return spaces;
819
820 return spaces + '<code class="' + css + '">' + line + '</code>';
821 });
822
823 return str;
824};
825
826/**
827 * Pads number with zeros until it's length is the same as given length.
828 *
829 * @param {Number} number Number to pad.
830 * @param {Number} length Max string length with.
831 * @return {String} Returns a string padded with proper amount of '0'.
832 */
833function padNumber(number, length)
834{
835 var result = number.toString();
836
837 while (result.length < length)
838 result = '0' + result;
839
840 return result;
841};
842
843/**
844 * Replaces tabs with spaces.
845 *
846 * @param {String} code Source code.
847 * @param {Number} tabSize Size of the tab.
848 * @return {String} Returns code with all tabs replaces by spaces.
849 */
850function processTabs(code, tabSize)
851{
852 var tab = '';
853
854 for (var i = 0; i < tabSize; i++)
855 tab += ' ';
856
857 return code.replace(/\t/g, tab);
858};
859
860/**
861 * Replaces tabs with smart spaces.
862 *
863 * @param {String} code Code to fix the tabs in.
864 * @param {Number} tabSize Number of spaces in a column.
865 * @return {String} Returns code with all tabs replaces with roper amount of spaces.
866 */
867function processSmartTabs(code, tabSize)
868{
869 var lines = splitLines(code),
870 tab = '\t',
871 spaces = ''
872 ;
873
874 // Create a string with 1000 spaces to copy spaces from...
875 // It's assumed that there would be no indentation longer than that.
876 for (var i = 0; i < 50; i++)
877 spaces += ' '; // 20 spaces * 50
878
879 // This function inserts specified amount of spaces in the string
880 // where a tab is while removing that given tab.
881 function insertSpaces(line, pos, count)
882 {
883 return line.substr(0, pos)
884 + spaces.substr(0, count)
885 + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab
886 ;
887 };
888
889 // Go through all the lines and do the 'smart tabs' magic.
890 code = eachLine(code, function(line)
891 {
892 if (line.indexOf(tab) == -1)
893 return line;
894
895 var pos = 0;
896
897 while ((pos = line.indexOf(tab)) != -1)
898 {
899 // This is pretty much all there is to the 'smart tabs' logic.
900 // Based on the position within the line and size of a tab,
901 // calculate the amount of spaces we need to insert.
902 var spaces = tabSize - pos % tabSize;
903 line = insertSpaces(line, pos, spaces);
904 }
905
906 return line;
907 });
908
909 return code;
910};
911
912/**
913 * Performs various string fixes based on configuration.
914 */
915function fixInputString(str)
916{
917 var br = /<br\s*\/?>|&lt;br\s*\/?&gt;/gi;
918
919 if (sh.config.bloggerMode == true)
920 str = str.replace(br, '\n');
921
922 if (sh.config.stripBrs == true)
923 str = str.replace(br, '');
924
925 return str;
926};
927
928/**
929 * Removes all white space at the begining and end of a string.
930 *
931 * @param {String} str String to trim.
932 * @return {String} Returns string without leading and following white space characters.
933 */
934function trim(str)
935{
936 return str.replace(/^\s+|\s+$/g, '');
937};
938
939/**
940 * Unindents a block of text by the lowest common indent amount.
941 * @param {String} str Text to unindent.
942 * @return {String} Returns unindented text block.
943 */
944function unindent(str)
945{
946 var lines = splitLines(fixInputString(str)),
947 indents = new Array(),
948 regex = /^\s*/,
949 min = 1000
950 ;
951
952 // go through every line and check for common number of indents
953 for (var i = 0; i < lines.length && min > 0; i++)
954 {
955 var line = lines[i];
956
957 if (trim(line).length == 0)
958 continue;
959
960 var matches = regex.exec(line);
961
962 // In the event that just one line doesn't have leading white space
963 // we can't unindent anything, so bail completely.
964 if (matches == null)
965 return str;
966
967 min = Math.min(matches[0].length, min);
968 }
969
970 // trim minimum common number of white space from the begining of every line
971 if (min > 0)
972 for (var i = 0; i < lines.length; i++)
973 lines[i] = lines[i].substr(min);
974
975 return lines.join('\n');
976};
977
978/**
979 * Callback method for Array.sort() which sorts matches by
980 * index position and then by length.
981 *
982 * @param {Match} m1 Left object.
983 * @param {Match} m2 Right object.
984 * @return {Number} Returns -1, 0 or -1 as a comparison result.
985 */
986function matchesSortCallback(m1, m2)
987{
988 // sort matches by index first
989 if(m1.index < m2.index)
990 return -1;
991 else if(m1.index > m2.index)
992 return 1;
993 else
994 {
995 // if index is the same, sort by length
996 if(m1.length < m2.length)
997 return -1;
998 else if(m1.length > m2.length)
999 return 1;
1000 }
1001
1002 return 0;
1003};
1004
1005/**
1006 * Executes given regular expression on provided code and returns all
1007 * matches that are found.
1008 *
1009 * @param {String} code Code to execute regular expression on.
1010 * @param {Object} regex Regular expression item info from <code>regexList</code> collection.
1011 * @return {Array} Returns a list of Match objects.
1012 */
1013function getMatches(code, regexInfo)
1014{
1015 function defaultAdd(match, regexInfo)
1016 {
1017 return match[0];
1018 };
1019
1020 var index = 0,
1021 match = null,
1022 matches = [],
1023 func = regexInfo.func ? regexInfo.func : defaultAdd
1024 ;
1025
1026 while((match = regexInfo.regex.exec(code)) != null)
1027 {
1028 var resultMatch = func(match, regexInfo);
1029
1030 if (typeof(resultMatch) == 'string')
1031 resultMatch = [new sh.Match(resultMatch, match.index, regexInfo.css)];
1032
1033 matches = matches.concat(resultMatch);
1034 }
1035
1036 return matches;
1037};
1038
1039/**
1040 * Turns all URLs in the code into <a/> tags.
1041 * @param {String} code Input code.
1042 * @return {String} Returns code with </a> tags.
1043 */
1044function processUrls(code)
1045{
1046 var gt = /(.*)((&gt;|&lt;).*)/;
1047
1048 return code.replace(sh.regexLib.url, function(m)
1049 {
1050 var suffix = '',
1051 match = null
1052 ;
1053
1054 // We include &lt; and &gt; in the URL for the common cases like <http://google.com>
1055 // The problem is that they get transformed into &lt;http://google.com&gt;
1056 // Where as &gt; easily looks like part of the URL string.
1057
1058 if (match = gt.exec(m))
1059 {
1060 m = match[1];
1061 suffix = match[2];
1062 }
1063
1064 return '<a href="' + m + '">' + m + '</a>' + suffix;
1065 });
1066};
1067
1068/**
1069 * Finds all <SCRIPT TYPE="syntaxhighlighter" /> elementss.
1070 * @return {Array} Returns array of all found SyntaxHighlighter tags.
1071 */
1072function getSyntaxHighlighterScriptTags()
1073{
1074 var tags = document.getElementsByTagName('script'),
1075 result = []
1076 ;
1077
1078 for (var i = 0; i < tags.length; i++)
1079 if (tags[i].type == 'syntaxhighlighter')
1080 result.push(tags[i]);
1081
1082 return result;
1083};
1084
1085/**
1086 * Strips <![CDATA[]]> from <SCRIPT /> content because it should be used
1087 * there in most cases for XHTML compliance.
1088 * @param {String} original Input code.
1089 * @return {String} Returns code without leading <![CDATA[]]> tags.
1090 */
1091function stripCData(original)
1092{
1093 var left = '<![CDATA[',
1094 right = ']]>',
1095 // for some reason IE inserts some leading blanks here
1096 copy = trim(original),
1097 changed = false,
1098 leftLength = left.length,
1099 rightLength = right.length
1100 ;
1101
1102 if (copy.indexOf(left) == 0)
1103 {
1104 copy = copy.substring(leftLength);
1105 changed = true;
1106 }
1107
1108 var copyLength = copy.length;
1109
1110 if (copy.indexOf(right) == copyLength - rightLength)
1111 {
1112 copy = copy.substring(0, copyLength - rightLength);
1113 changed = true;
1114 }
1115
1116 return changed ? copy : original;
1117};
1118
1119
1120/**
1121 * Quick code mouse double click handler.
1122 */
1123function quickCodeHandler(e)
1124{
1125 var target = e.target,
1126 highlighterDiv = findParentElement(target, '.syntaxhighlighter'),
1127 container = findParentElement(target, '.container'),
1128 textarea = document.createElement('textarea'),
1129 highlighter
1130 ;
1131
1132 if (!container || !highlighterDiv || findElement(container, 'textarea'))
1133 return;
1134
1135 highlighter = getHighlighterById(highlighterDiv.id);
1136
1137 // add source class name
1138 addClass(highlighterDiv, 'source');
1139
1140 // Have to go over each line and grab it's text, can't just do it on the
1141 // container because Firefox loses all \n where as Webkit doesn't.
1142 var lines = container.childNodes,
1143 code = []
1144 ;
1145
1146 for (var i = 0; i < lines.length; i++)
1147 code.push(lines[i].innerText || lines[i].textContent);
1148
1149 // using \r instead of \r or \r\n makes this work equally well on IE, FF and Webkit
1150 code = code.join('\r');
1151
1152 // inject <textarea/> tag
1153 textarea.appendChild(document.createTextNode(code));
1154 container.appendChild(textarea);
1155
1156 // preselect all text
1157 textarea.focus();
1158 textarea.select();
1159
1160 // set up handler for lost focus
1161 attachEvent(textarea, 'blur', function(e)
1162 {
1163 textarea.parentNode.removeChild(textarea);
1164 removeClass(highlighterDiv, 'source');
1165 });
1166};
1167
1168/**
1169 * Match object.
1170 */
1171sh.Match = function(value, index, css)
1172{
1173 this.value = value;
1174 this.index = index;
1175 this.length = value.length;
1176 this.css = css;
1177 this.brushName = null;
1178};
1179
1180sh.Match.prototype.toString = function()
1181{
1182 return this.value;
1183};
1184
1185/**
1186 * Simulates HTML code with a scripting language embedded.
1187 *
1188 * @param {String} scriptBrushName Brush name of the scripting language.
1189 */
1190sh.HtmlScript = function(scriptBrushName)
1191{
1192 var brushClass = findBrush(scriptBrushName),
1193 scriptBrush,
1194 xmlBrush = new sh.brushes.Xml(),
1195 bracketsRegex = null,
1196 ref = this,
1197 methodsToExpose = 'getDiv getHtml init'.split(' ')
1198 ;
1199
1200 if (brushClass == null)
1201 return;
1202
1203 scriptBrush = new brushClass();
1204
1205 for(var i = 0; i < methodsToExpose.length; i++)
1206 // make a closure so we don't lose the name after i changes
1207 (function() {
1208 var name = methodsToExpose[i];
1209
1210 ref[name] = function()
1211 {
1212 return xmlBrush[name].apply(xmlBrush, arguments);
1213 };
1214 })();
1215
1216 if (scriptBrush.htmlScript == null)
1217 {
1218 alert(sh.config.strings.brushNotHtmlScript + scriptBrushName);
1219 return;
1220 }
1221
1222 xmlBrush.regexList.push(
1223 { regex: scriptBrush.htmlScript.code, func: process }
1224 );
1225
1226 function offsetMatches(matches, offset)
1227 {
1228 for (var j = 0; j < matches.length; j++)
1229 matches[j].index += offset;
1230 }
1231
1232 function process(match, info)
1233 {
1234 var code = match.code,
1235 matches = [],
1236 regexList = scriptBrush.regexList,
1237 offset = match.index + match.left.length,
1238 htmlScript = scriptBrush.htmlScript,
1239 result
1240 ;
1241
1242 // add all matches from the code
1243 for (var i = 0; i < regexList.length; i++)
1244 {
1245 result = getMatches(code, regexList[i]);
1246 offsetMatches(result, offset);
1247 matches = matches.concat(result);
1248 }
1249
1250 // add left script bracket
1251 if (htmlScript.left != null && match.left != null)
1252 {
1253 result = getMatches(match.left, htmlScript.left);
1254 offsetMatches(result, match.index);
1255 matches = matches.concat(result);
1256 }
1257
1258 // add right script bracket
1259 if (htmlScript.right != null && match.right != null)
1260 {
1261 result = getMatches(match.right, htmlScript.right);
1262 offsetMatches(result, match.index + match[0].lastIndexOf(match.right));
1263 matches = matches.concat(result);
1264 }
1265
1266 for (var j = 0; j < matches.length; j++)
1267 matches[j].brushName = brushClass.brushName;
1268
1269 return matches;
1270 }
1271};
1272
1273/**
1274 * Main Highlither class.
1275 * @constructor
1276 */
1277sh.Highlighter = function()
1278{
1279 // not putting any code in here because of the prototype inheritance
1280};
1281
1282sh.Highlighter.prototype = {
1283 /**
1284 * Returns value of the parameter passed to the highlighter.
1285 * @param {String} name Name of the parameter.
1286 * @param {Object} defaultValue Default value.
1287 * @return {Object} Returns found value or default value otherwise.
1288 */
1289 getParam: function(name, defaultValue)
1290 {
1291 var result = this.params[name];
1292 return toBoolean(result == null ? defaultValue : result);
1293 },
1294
1295 /**
1296 * Shortcut to document.createElement().
1297 * @param {String} name Name of the element to create (DIV, A, etc).
1298 * @return {HTMLElement} Returns new HTML element.
1299 */
1300 create: function(name)
1301 {
1302 return document.createElement(name);
1303 },
1304
1305 /**
1306 * Applies all regular expression to the code and stores all found
1307 * matches in the `this.matches` array.
1308 * @param {Array} regexList List of regular expressions.
1309 * @param {String} code Source code.
1310 * @return {Array} Returns list of matches.
1311 */
1312 findMatches: function(regexList, code)
1313 {
1314 var result = [];
1315
1316 if (regexList != null)
1317 for (var i = 0; i < regexList.length; i++)
1318 // BUG: length returns len+1 for array if methods added to prototype chain ([email protected])
1319 if (typeof (regexList[i]) == "object")
1320 result = result.concat(getMatches(code, regexList[i]));
1321
1322 // sort and remove nested the matches
1323 return this.removeNestedMatches(result.sort(matchesSortCallback));
1324 },
1325
1326 /**
1327 * Checks to see if any of the matches are inside of other matches.
1328 * This process would get rid of highligted strings inside comments,
1329 * keywords inside strings and so on.
1330 */
1331 removeNestedMatches: function(matches)
1332 {
1333 // Optimized by Jose Prado (http://joseprado.com)
1334 for (var i = 0; i < matches.length; i++)
1335 {
1336 if (matches[i] === null)
1337 continue;
1338
1339 var itemI = matches[i],
1340 itemIEndPos = itemI.index + itemI.length
1341 ;
1342
1343 for (var j = i + 1; j < matches.length && matches[i] !== null; j++)
1344 {
1345 var itemJ = matches[j];
1346
1347 if (itemJ === null)
1348 continue;
1349 else if (itemJ.index > itemIEndPos)
1350 break;
1351 else if (itemJ.index == itemI.index && itemJ.length > itemI.length)
1352 matches[i] = null;
1353 else if (itemJ.index >= itemI.index && itemJ.index < itemIEndPos)
1354 matches[j] = null;
1355 }
1356 }
1357
1358 return matches;
1359 },
1360
1361 /**
1362 * Creates an array containing integer line numbers starting from the 'first-line' param.
1363 * @return {Array} Returns array of integers.
1364 */
1365 figureOutLineNumbers: function(code)
1366 {
1367 var lines = [],
1368 firstLine = parseInt(this.getParam('first-line'))
1369 ;
1370
1371 eachLine(code, function(line, index)
1372 {
1373 lines.push(index + firstLine);
1374 });
1375
1376 return lines;
1377 },
1378
1379 /**
1380 * Determines if specified line number is in the highlighted list.
1381 */
1382 isLineHighlighted: function(lineNumber)
1383 {
1384 var list = this.getParam('highlight', []);
1385
1386 if (typeof(list) != 'object' && list.push == null)
1387 list = [ list ];
1388
1389 return indexOf(list, lineNumber.toString()) != -1;
1390 },
1391
1392 /**
1393 * Generates HTML markup for a single line of code while determining alternating line style.
1394 * @param {Integer} lineNumber Line number.
1395 * @param {String} code Line HTML markup.
1396 * @return {String} Returns HTML markup.
1397 */
1398 getLineHtml: function(lineIndex, lineNumber, code)
1399 {
1400 var classes = [
1401 'line',
1402 'number' + lineNumber,
1403 'index' + lineIndex,
1404 'alt' + (lineNumber % 2 == 0 ? 1 : 2).toString()
1405 ];
1406
1407 if (this.isLineHighlighted(lineNumber))
1408 classes.push('highlighted');
1409
1410 if (lineNumber == 0)
1411 classes.push('break');
1412
1413 return '<div class="' + classes.join(' ') + '">' + code + '</div>';
1414 },
1415
1416 /**
1417 * Generates HTML markup for line number column.
1418 * @param {String} code Complete code HTML markup.
1419 * @param {Array} lineNumbers Calculated line numbers.
1420 * @return {String} Returns HTML markup.
1421 */
1422 getLineNumbersHtml: function(code, lineNumbers)
1423 {
1424 var html = '',
1425 count = splitLines(code).length,
1426 firstLine = parseInt(this.getParam('first-line')),
1427 pad = this.getParam('pad-line-numbers')
1428 ;
1429
1430 if (pad == true)
1431 pad = (firstLine + count - 1).toString().length;
1432 else if (isNaN(pad) == true)
1433 pad = 0;
1434
1435 for (var i = 0; i < count; i++)
1436 {
1437 var lineNumber = lineNumbers ? lineNumbers[i] : firstLine + i,
1438 code = lineNumber == 0 ? sh.config.space : padNumber(lineNumber, pad)
1439 ;
1440
1441 html += this.getLineHtml(i, lineNumber, code);
1442 }
1443
1444 return html;
1445 },
1446
1447 /**
1448 * Splits block of text into individual DIV lines.
1449 * @param {String} code Code to highlight.
1450 * @param {Array} lineNumbers Calculated line numbers.
1451 * @return {String} Returns highlighted code in HTML form.
1452 */
1453 getCodeLinesHtml: function(html, lineNumbers)
1454 {
1455 html = trim(html);
1456
1457 var lines = splitLines(html),
1458 padLength = this.getParam('pad-line-numbers'),
1459 firstLine = parseInt(this.getParam('first-line')),
1460 html = '',
1461 brushName = this.getParam('brush')
1462 ;
1463
1464 for (var i = 0; i < lines.length; i++)
1465 {
1466 var line = lines[i],
1467 indent = /^(&nbsp;|\s)+/.exec(line),
1468 spaces = null,
1469 lineNumber = lineNumbers ? lineNumbers[i] : firstLine + i;
1470 ;
1471
1472 if (indent != null)
1473 {
1474 spaces = indent[0].toString();
1475 line = line.substr(spaces.length);
1476 spaces = spaces.replace(' ', sh.config.space);
1477 }
1478
1479 line = trim(line);
1480
1481 if (line.length == 0)
1482 line = sh.config.space;
1483
1484 html += this.getLineHtml(
1485 i,
1486 lineNumber,
1487 (spaces != null ? '<code class="' + brushName + ' spaces">' + spaces + '</code>' : '') + line
1488 );
1489 }
1490
1491 return html;
1492 },
1493
1494 /**
1495 * Returns HTML for the table title or empty string if title is null.
1496 */
1497 getTitleHtml: function(title)
1498 {
1499 return title ? '<caption>' + title + '</caption>' : '';
1500 },
1501
1502 /**
1503 * Finds all matches in the source code.
1504 * @param {String} code Source code to process matches in.
1505 * @param {Array} matches Discovered regex matches.
1506 * @return {String} Returns formatted HTML with processed mathes.
1507 */
1508 getMatchesHtml: function(code, matches)
1509 {
1510 var pos = 0,
1511 result = '',
1512 brushName = this.getParam('brush', '')
1513 ;
1514
1515 function getBrushNameCss(match)
1516 {
1517 var result = match ? (match.brushName || brushName) : brushName;
1518 return result ? result + ' ' : '';
1519 };
1520
1521 // Finally, go through the final list of matches and pull the all
1522 // together adding everything in between that isn't a match.
1523 for (var i = 0; i < matches.length; i++)
1524 {
1525 var match = matches[i],
1526 matchBrushName
1527 ;
1528
1529 if (match === null || match.length === 0)
1530 continue;
1531
1532 matchBrushName = getBrushNameCss(match);
1533
1534 result += wrapLinesWithCode(code.substr(pos, match.index - pos), matchBrushName + 'plain')
1535 + wrapLinesWithCode(match.value, matchBrushName + match.css)
1536 ;
1537
1538 pos = match.index + match.length + (match.offset || 0);
1539 }
1540
1541 // don't forget to add whatever's remaining in the string
1542 result += wrapLinesWithCode(code.substr(pos), getBrushNameCss() + 'plain');
1543
1544 return result;
1545 },
1546
1547 /**
1548 * Generates HTML markup for the whole syntax highlighter.
1549 * @param {String} code Source code.
1550 * @return {String} Returns HTML markup.
1551 */
1552 getHtml: function(code)
1553 {
1554 var html = '',
1555 classes = [ 'syntaxhighlighter' ],
1556 tabSize,
1557 matches,
1558 lineNumbers
1559 ;
1560
1561 // process light mode
1562 if (this.getParam('light') == true)
1563 this.params.toolbar = this.params.gutter = false;
1564
1565 className = 'syntaxhighlighter';
1566
1567 if (this.getParam('collapse') == true)
1568 classes.push('collapsed');
1569
1570 if ((gutter = this.getParam('gutter')) == false)
1571 classes.push('nogutter');
1572
1573 // add custom user style name
1574 classes.push(this.getParam('class-name'));
1575
1576 // add brush alias to the class name for custom CSS
1577 classes.push(this.getParam('brush'));
1578
1579 code = trimFirstAndLastLines(code)
1580 .replace(/\r/g, ' ') // IE lets these buggers through
1581 ;
1582
1583 tabSize = this.getParam('tab-size');
1584
1585 // replace tabs with spaces
1586 code = this.getParam('smart-tabs') == true
1587 ? processSmartTabs(code, tabSize)
1588 : processTabs(code, tabSize)
1589 ;
1590
1591 // unindent code by the common indentation
1592 code = unindent(code);
1593
1594 if (gutter)
1595 lineNumbers = this.figureOutLineNumbers(code);
1596
1597 // find matches in the code using brushes regex list
1598 matches = this.findMatches(this.regexList, code);
1599 // processes found matches into the html
1600 html = this.getMatchesHtml(code, matches);
1601 // finally, split all lines so that they wrap well
1602 html = this.getCodeLinesHtml(html, lineNumbers);
1603
1604 // finally, process the links
1605 if (this.getParam('auto-links'))
1606 html = processUrls(html);
1607
1608 if (typeof(navigator) != 'undefined' && navigator.userAgent && navigator.userAgent.match(/MSIE/))
1609 classes.push('ie');
1610
1611 html =
1612 '<div id="' + getHighlighterId(this.id) + '" class="' + classes.join(' ') + '">'
1613 + (this.getParam('toolbar') ? sh.toolbar.getHtml(this) : '')
1614 + '<table border="0" cellpadding="0" cellspacing="0">'
1615 + this.getTitleHtml(this.getParam('title'))
1616 + '<tbody>'
1617 + '<tr>'
1618 + (gutter ? '<td class="gutter">' + this.getLineNumbersHtml(code) + '</td>' : '')
1619 + '<td class="code">'
1620 + '<div class="container">'
1621 + html
1622 + '</div>'
1623 + '</td>'
1624 + '</tr>'
1625 + '</tbody>'
1626 + '</table>'
1627 + '</div>'
1628 ;
1629
1630 return html;
1631 },
1632
1633 /**
1634 * Highlights the code and returns complete HTML.
1635 * @param {String} code Code to highlight.
1636 * @return {Element} Returns container DIV element with all markup.
1637 */
1638 getDiv: function(code)
1639 {
1640 if (code === null)
1641 code = '';
1642
1643 this.code = code;
1644
1645 var div = this.create('div');
1646
1647 // create main HTML
1648 div.innerHTML = this.getHtml(code);
1649
1650 // set up click handlers
1651 if (this.getParam('toolbar'))
1652 attachEvent(findElement(div, '.toolbar'), 'click', sh.toolbar.handler);
1653
1654 if (this.getParam('quick-code'))
1655 attachEvent(findElement(div, '.code'), 'dblclick', quickCodeHandler);
1656
1657 return div;
1658 },
1659
1660 /**
1661 * Initializes the highlighter/brush.
1662 *
1663 * Constructor isn't used for initialization so that nothing executes during necessary
1664 * `new SyntaxHighlighter.Highlighter()` call when setting up brush inheritence.
1665 *
1666 * @param {Hash} params Highlighter parameters.
1667 */
1668 init: function(params)
1669 {
1670 this.id = guid();
1671
1672 // register this instance in the highlighters list
1673 storeHighlighter(this);
1674
1675 // local params take precedence over defaults
1676 this.params = merge(sh.defaults, params || {})
1677
1678 // process light mode
1679 if (this.getParam('light') == true)
1680 this.params.toolbar = this.params.gutter = false;
1681 },
1682
1683 /**
1684 * Converts space separated list of keywords into a regular expression string.
1685 * @param {String} str Space separated keywords.
1686 * @return {String} Returns regular expression string.
1687 */
1688 getKeywords: function(str)
1689 {
1690 str = str
1691 .replace(/^\s+|\s+$/g, '')
1692 .replace(/\s+/g, '|')
1693 ;
1694
1695 return '\\b(?:' + str + ')\\b';
1696 },
1697
1698 /**
1699 * Makes a brush compatible with the `html-script` functionality.
1700 * @param {Object} regexGroup Object containing `left` and `right` regular expressions.
1701 */
1702 forHtmlScript: function(regexGroup)
1703 {
1704 this.htmlScript = {
1705 left : { regex: regexGroup.left, css: 'script' },
1706 right : { regex: regexGroup.right, css: 'script' },
1707 code : new XRegExp(
1708 "(?<left>" + regexGroup.left.source + ")" +
1709 "(?<code>.*?)" +
1710 "(?<right>" + regexGroup.right.source + ")",
1711 "sgi"
1712 )
1713 };
1714 }
1715}; // end of Highlighter
1716
1717return sh;
1718}(); // end of anonymous function
1719
1720// CommonJS
1721typeof(exports) != 'undefined' ? exports['SyntaxHighlighter'] = SyntaxHighlighter : null;
diff --git a/Blocks/syntax/src/shLegacy.js b/Blocks/syntax/src/shLegacy.js
new file mode 100644
index 0000000..36951c9
--- /dev/null
+++ b/Blocks/syntax/src/shLegacy.js
@@ -0,0 +1,157 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17var dp = {
18 SyntaxHighlighter : {}
19};
20
21dp.SyntaxHighlighter = {
22 parseParams: function(
23 input,
24 showGutter,
25 showControls,
26 collapseAll,
27 firstLine,
28 showColumns
29 )
30 {
31 function getValue(list, name)
32 {
33 var regex = new XRegExp('^' + name + '\\[(?<value>\\w+)\\]$', 'gi'),
34 match = null
35 ;
36
37 for (var i = 0; i < list.length; i++)
38 if ((match = regex.exec(list[i])) != null)
39 return match.value;
40
41 return null;
42 };
43
44 function defaultValue(value, def)
45 {
46 return value != null ? value : def;
47 };
48
49 function asString(value)
50 {
51 return value != null ? value.toString() : null;
52 };
53
54 var parts = input.split(':'),
55 brushName = parts[0],
56 options = {},
57 straight = { 'true' : true }
58 reverse = { 'true' : false },
59 result = null,
60 defaults = SyntaxHighlighter.defaults
61 ;
62
63 for (var i in parts)
64 options[parts[i]] = 'true';
65
66 showGutter = asString(defaultValue(showGutter, defaults.gutter));
67 showControls = asString(defaultValue(showControls, defaults.toolbar));
68 collapseAll = asString(defaultValue(collapseAll, defaults.collapse));
69 showColumns = asString(defaultValue(showColumns, defaults.ruler));
70 firstLine = asString(defaultValue(firstLine, defaults['first-line']));
71
72 return {
73 brush : brushName,
74 gutter : defaultValue(reverse[options.nogutter], showGutter),
75 toolbar : defaultValue(reverse[options.nocontrols], showControls),
76 collapse : defaultValue(straight[options.collapse], collapseAll),
77 // ruler : defaultValue(straight[options.showcolumns], showColumns),
78 'first-line' : defaultValue(getValue(parts, 'firstline'), firstLine)
79 };
80 },
81
82 HighlightAll: function(
83 name,
84 showGutter /* optional */,
85 showControls /* optional */,
86 collapseAll /* optional */,
87 firstLine /* optional */,
88 showColumns /* optional */
89 )
90 {
91 function findValue()
92 {
93 var a = arguments;
94
95 for (var i = 0; i < a.length; i++)
96 {
97 if (a[i] === null)
98 continue;
99
100 if (typeof(a[i]) == 'string' && a[i] != '')
101 return a[i] + '';
102
103 if (typeof(a[i]) == 'object' && a[i].value != '')
104 return a[i].value + '';
105 }
106
107 return null;
108 };
109
110 function findTagsByName(list, name, tagName)
111 {
112 var tags = document.getElementsByTagName(tagName);
113
114 for (var i = 0; i < tags.length; i++)
115 if (tags[i].getAttribute('name') == name)
116 list.push(tags[i]);
117 }
118
119 var elements = [],
120 highlighter = null,
121 registered = {},
122 propertyName = 'innerHTML'
123 ;
124
125 // for some reason IE doesn't find <pre/> by name, however it does see them just fine by tag name...
126 findTagsByName(elements, name, 'pre');
127 findTagsByName(elements, name, 'textarea');
128
129 if (elements.length === 0)
130 return;
131
132 for (var i = 0; i < elements.length; i++)
133 {
134 var element = elements[i],
135 params = findValue(
136 element.attributes['class'], element.className,
137 element.attributes['language'], element.language
138 ),
139 language = ''
140 ;
141
142 if (params === null)
143 continue;
144
145 params = dp.SyntaxHighlighter.parseParams(
146 params,
147 showGutter,
148 showControls,
149 collapseAll,
150 firstLine,
151 showColumns
152 );
153
154 SyntaxHighlighter.highlight(params, element);
155 }
156 }
157};
diff --git a/Blocks/syntax/styles/shCore.css b/Blocks/syntax/styles/shCore.css
new file mode 100644
index 0000000..34f6864
--- /dev/null
+++ b/Blocks/syntax/styles/shCore.css
@@ -0,0 +1,226 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
diff --git a/Blocks/syntax/styles/shCoreDefault.css b/Blocks/syntax/styles/shCoreDefault.css
new file mode 100644
index 0000000..08f9e10
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreDefault.css
@@ -0,0 +1,328 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: white !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: white !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: white !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #e0e0e0 !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: black !important;
242}
243.syntaxhighlighter table caption {
244 color: black !important;
245}
246.syntaxhighlighter .gutter {
247 color: #afafaf !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #6ce26c !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #6ce26c !important;
254 color: white !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: blue !important;
264 background: white !important;
265 border: 1px solid #6ce26c !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: blue !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: red !important;
272}
273.syntaxhighlighter .toolbar {
274 color: white !important;
275 background: #6ce26c !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: white !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: black !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: black !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #008200 !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: blue !important;
292}
293.syntaxhighlighter .keyword {
294 color: #006699 !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: gray !important;
298}
299.syntaxhighlighter .variable {
300 color: #aa7700 !important;
301}
302.syntaxhighlighter .value {
303 color: #009900 !important;
304}
305.syntaxhighlighter .functions {
306 color: #ff1493 !important;
307}
308.syntaxhighlighter .constants {
309 color: #0066cc !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #006699 !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: gray !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: #ff1493 !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: red !important;
324}
325
326.syntaxhighlighter .keyword {
327 font-weight: bold !important;
328}
diff --git a/Blocks/syntax/styles/shCoreDjango.css b/Blocks/syntax/styles/shCoreDjango.css
new file mode 100644
index 0000000..1db1f70
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreDjango.css
@@ -0,0 +1,331 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: #0a2b1d !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: #0a2b1d !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: #0a2b1d !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #233729 !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: white !important;
242}
243.syntaxhighlighter table caption {
244 color: #f8f8f8 !important;
245}
246.syntaxhighlighter .gutter {
247 color: #497958 !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #41a83e !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #41a83e !important;
254 color: #0a2b1d !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #96dd3b !important;
264 background: black !important;
265 border: 1px solid #41a83e !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #96dd3b !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: white !important;
272}
273.syntaxhighlighter .toolbar {
274 color: white !important;
275 background: #41a83e !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: white !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: #ffe862 !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: #f8f8f8 !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #336442 !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: #9df39f !important;
292}
293.syntaxhighlighter .keyword {
294 color: #96dd3b !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #91bb9e !important;
298}
299.syntaxhighlighter .variable {
300 color: #ffaa3e !important;
301}
302.syntaxhighlighter .value {
303 color: #f7e741 !important;
304}
305.syntaxhighlighter .functions {
306 color: #ffaa3e !important;
307}
308.syntaxhighlighter .constants {
309 color: #e0e8ff !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #96dd3b !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: #eb939a !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: #91bb9e !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: #edef7d !important;
324}
325
326.syntaxhighlighter .comments {
327 font-style: italic !important;
328}
329.syntaxhighlighter .keyword {
330 font-weight: bold !important;
331}
diff --git a/Blocks/syntax/styles/shCoreEclipse.css b/Blocks/syntax/styles/shCoreEclipse.css
new file mode 100644
index 0000000..a45de9f
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreEclipse.css
@@ -0,0 +1,339 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: white !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: white !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: white !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #c3defe !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: white !important;
242}
243.syntaxhighlighter table caption {
244 color: black !important;
245}
246.syntaxhighlighter .gutter {
247 color: #787878 !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #d4d0c8 !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #d4d0c8 !important;
254 color: white !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #3f5fbf !important;
264 background: white !important;
265 border: 1px solid #d4d0c8 !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #3f5fbf !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: #aa7700 !important;
272}
273.syntaxhighlighter .toolbar {
274 color: #a0a0a0 !important;
275 background: #d4d0c8 !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: #a0a0a0 !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: red !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: black !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #3f5fbf !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: #2a00ff !important;
292}
293.syntaxhighlighter .keyword {
294 color: #7f0055 !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #646464 !important;
298}
299.syntaxhighlighter .variable {
300 color: #aa7700 !important;
301}
302.syntaxhighlighter .value {
303 color: #009900 !important;
304}
305.syntaxhighlighter .functions {
306 color: #ff1493 !important;
307}
308.syntaxhighlighter .constants {
309 color: #0066cc !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #7f0055 !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: gray !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: #ff1493 !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: red !important;
324}
325
326.syntaxhighlighter .keyword {
327 font-weight: bold !important;
328}
329.syntaxhighlighter .xml .keyword {
330 color: #3f7f7f !important;
331 font-weight: normal !important;
332}
333.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
334 color: #7f007f !important;
335}
336.syntaxhighlighter .xml .string {
337 font-style: italic !important;
338 color: #2a00ff !important;
339}
diff --git a/Blocks/syntax/styles/shCoreEmacs.css b/Blocks/syntax/styles/shCoreEmacs.css
new file mode 100644
index 0000000..706c77a
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreEmacs.css
@@ -0,0 +1,324 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: black !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: black !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: black !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #2a3133 !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: white !important;
242}
243.syntaxhighlighter table caption {
244 color: #d3d3d3 !important;
245}
246.syntaxhighlighter .gutter {
247 color: #d3d3d3 !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #990000 !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #990000 !important;
254 color: black !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #ebdb8d !important;
264 background: black !important;
265 border: 1px solid #990000 !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #ebdb8d !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: #ff7d27 !important;
272}
273.syntaxhighlighter .toolbar {
274 color: white !important;
275 background: #990000 !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: white !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: #9ccff4 !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: #d3d3d3 !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #ff7d27 !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: #ff9e7b !important;
292}
293.syntaxhighlighter .keyword {
294 color: aqua !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #aec4de !important;
298}
299.syntaxhighlighter .variable {
300 color: #ffaa3e !important;
301}
302.syntaxhighlighter .value {
303 color: #009900 !important;
304}
305.syntaxhighlighter .functions {
306 color: #81cef9 !important;
307}
308.syntaxhighlighter .constants {
309 color: #ff9e7b !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: aqua !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: #ebdb8d !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: #ff7d27 !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: #aec4de !important;
324}
diff --git a/Blocks/syntax/styles/shCoreFadeToGrey.css b/Blocks/syntax/styles/shCoreFadeToGrey.css
new file mode 100644
index 0000000..6101eba
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreFadeToGrey.css
@@ -0,0 +1,328 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: #121212 !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: #121212 !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: #121212 !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #2c2c29 !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: white !important;
242}
243.syntaxhighlighter table caption {
244 color: white !important;
245}
246.syntaxhighlighter .gutter {
247 color: #afafaf !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #3185b9 !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #3185b9 !important;
254 color: #121212 !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #3185b9 !important;
264 background: black !important;
265 border: 1px solid #3185b9 !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #3185b9 !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: #d01d33 !important;
272}
273.syntaxhighlighter .toolbar {
274 color: white !important;
275 background: #3185b9 !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: white !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: #96daff !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: white !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #696854 !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: #e3e658 !important;
292}
293.syntaxhighlighter .keyword {
294 color: #d01d33 !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #435a5f !important;
298}
299.syntaxhighlighter .variable {
300 color: #898989 !important;
301}
302.syntaxhighlighter .value {
303 color: #009900 !important;
304}
305.syntaxhighlighter .functions {
306 color: #aaaaaa !important;
307}
308.syntaxhighlighter .constants {
309 color: #96daff !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #d01d33 !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: #ffc074 !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: #4a8cdb !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: #96daff !important;
324}
325
326.syntaxhighlighter .functions {
327 font-weight: bold !important;
328}
diff --git a/Blocks/syntax/styles/shCoreMDUltra.css b/Blocks/syntax/styles/shCoreMDUltra.css
new file mode 100644
index 0000000..2923ce7
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreMDUltra.css
@@ -0,0 +1,324 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: #222222 !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: #222222 !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: #222222 !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #253e5a !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: white !important;
242}
243.syntaxhighlighter table caption {
244 color: lime !important;
245}
246.syntaxhighlighter .gutter {
247 color: #38566f !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #435a5f !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #435a5f !important;
254 color: #222222 !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #428bdd !important;
264 background: black !important;
265 border: 1px solid #435a5f !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #428bdd !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: lime !important;
272}
273.syntaxhighlighter .toolbar {
274 color: #aaaaff !important;
275 background: #435a5f !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: #aaaaff !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: #9ccff4 !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: lime !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #428bdd !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: lime !important;
292}
293.syntaxhighlighter .keyword {
294 color: #aaaaff !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #8aa6c1 !important;
298}
299.syntaxhighlighter .variable {
300 color: aqua !important;
301}
302.syntaxhighlighter .value {
303 color: #f7e741 !important;
304}
305.syntaxhighlighter .functions {
306 color: #ff8000 !important;
307}
308.syntaxhighlighter .constants {
309 color: yellow !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #aaaaff !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: red !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: yellow !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: #ffaa3e !important;
324}
diff --git a/Blocks/syntax/styles/shCoreMidnight.css b/Blocks/syntax/styles/shCoreMidnight.css
new file mode 100644
index 0000000..e3733ee
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreMidnight.css
@@ -0,0 +1,324 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: #0f192a !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: #0f192a !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: #0f192a !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #253e5a !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: #38566f !important;
242}
243.syntaxhighlighter table caption {
244 color: #d1edff !important;
245}
246.syntaxhighlighter .gutter {
247 color: #afafaf !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #435a5f !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #435a5f !important;
254 color: #0f192a !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #428bdd !important;
264 background: black !important;
265 border: 1px solid #435a5f !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #428bdd !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: #1dc116 !important;
272}
273.syntaxhighlighter .toolbar {
274 color: #d1edff !important;
275 background: #435a5f !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: #d1edff !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: #8aa6c1 !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: #d1edff !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #428bdd !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: #1dc116 !important;
292}
293.syntaxhighlighter .keyword {
294 color: #b43d3d !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #8aa6c1 !important;
298}
299.syntaxhighlighter .variable {
300 color: #ffaa3e !important;
301}
302.syntaxhighlighter .value {
303 color: #f7e741 !important;
304}
305.syntaxhighlighter .functions {
306 color: #ffaa3e !important;
307}
308.syntaxhighlighter .constants {
309 color: #e0e8ff !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #b43d3d !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: #f8bb00 !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: white !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: #ffaa3e !important;
324}
diff --git a/Blocks/syntax/styles/shCoreRDark.css b/Blocks/syntax/styles/shCoreRDark.css
new file mode 100644
index 0000000..d093683
--- /dev/null
+++ b/Blocks/syntax/styles/shCoreRDark.css
@@ -0,0 +1,324 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter a,
18.syntaxhighlighter div,
19.syntaxhighlighter code,
20.syntaxhighlighter table,
21.syntaxhighlighter table td,
22.syntaxhighlighter table tr,
23.syntaxhighlighter table tbody,
24.syntaxhighlighter table thead,
25.syntaxhighlighter table caption,
26.syntaxhighlighter textarea {
27 -moz-border-radius: 0 0 0 0 !important;
28 -webkit-border-radius: 0 0 0 0 !important;
29 background: none !important;
30 border: 0 !important;
31 bottom: auto !important;
32 float: none !important;
33 height: auto !important;
34 left: auto !important;
35 line-height: 1.1em !important;
36 margin: 0 !important;
37 outline: 0 !important;
38 overflow: visible !important;
39 padding: 0 !important;
40 position: static !important;
41 right: auto !important;
42 text-align: left !important;
43 top: auto !important;
44 vertical-align: baseline !important;
45 width: auto !important;
46 box-sizing: content-box !important;
47 font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
48 font-weight: normal !important;
49 font-style: normal !important;
50 font-size: 1em !important;
51 min-height: inherit !important;
52 min-height: auto !important;
53}
54
55.syntaxhighlighter {
56 width: 100% !important;
57 margin: 1em 0 1em 0 !important;
58 position: relative !important;
59 overflow: auto !important;
60 font-size: 1em !important;
61}
62.syntaxhighlighter.source {
63 overflow: hidden !important;
64}
65.syntaxhighlighter .bold {
66 font-weight: bold !important;
67}
68.syntaxhighlighter .italic {
69 font-style: italic !important;
70}
71.syntaxhighlighter .line {
72 white-space: pre !important;
73}
74.syntaxhighlighter table {
75 width: 100% !important;
76}
77.syntaxhighlighter table caption {
78 text-align: left !important;
79 padding: .5em 0 0.5em 1em !important;
80}
81.syntaxhighlighter table td.code {
82 width: 100% !important;
83}
84.syntaxhighlighter table td.code .container {
85 position: relative !important;
86}
87.syntaxhighlighter table td.code .container textarea {
88 box-sizing: border-box !important;
89 position: absolute !important;
90 left: 0 !important;
91 top: 0 !important;
92 width: 100% !important;
93 height: 100% !important;
94 border: none !important;
95 background: white !important;
96 padding-left: 1em !important;
97 overflow: hidden !important;
98 white-space: pre !important;
99}
100.syntaxhighlighter table td.gutter .line {
101 text-align: right !important;
102 padding: 0 0.5em 0 1em !important;
103}
104.syntaxhighlighter table td.code .line {
105 padding: 0 1em !important;
106}
107.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
108 padding-left: 0em !important;
109}
110.syntaxhighlighter.show {
111 display: block !important;
112}
113.syntaxhighlighter.collapsed table {
114 display: none !important;
115}
116.syntaxhighlighter.collapsed .toolbar {
117 padding: 0.1em 0.8em 0em 0.8em !important;
118 font-size: 1em !important;
119 position: static !important;
120 width: auto !important;
121 height: auto !important;
122}
123.syntaxhighlighter.collapsed .toolbar span {
124 display: inline !important;
125 margin-right: 1em !important;
126}
127.syntaxhighlighter.collapsed .toolbar span a {
128 padding: 0 !important;
129 display: none !important;
130}
131.syntaxhighlighter.collapsed .toolbar span a.expandSource {
132 display: inline !important;
133}
134.syntaxhighlighter .toolbar {
135 position: absolute !important;
136 right: 1px !important;
137 top: 1px !important;
138 width: 11px !important;
139 height: 11px !important;
140 font-size: 10px !important;
141 z-index: 10 !important;
142}
143.syntaxhighlighter .toolbar span.title {
144 display: inline !important;
145}
146.syntaxhighlighter .toolbar a {
147 display: block !important;
148 text-align: center !important;
149 text-decoration: none !important;
150 padding-top: 1px !important;
151}
152.syntaxhighlighter .toolbar a.expandSource {
153 display: none !important;
154}
155.syntaxhighlighter.ie {
156 font-size: .9em !important;
157 padding: 1px 0 1px 0 !important;
158}
159.syntaxhighlighter.ie .toolbar {
160 line-height: 8px !important;
161}
162.syntaxhighlighter.ie .toolbar a {
163 padding-top: 0px !important;
164}
165.syntaxhighlighter.printing .line.alt1 .content,
166.syntaxhighlighter.printing .line.alt2 .content,
167.syntaxhighlighter.printing .line.highlighted .number,
168.syntaxhighlighter.printing .line.highlighted.alt1 .content,
169.syntaxhighlighter.printing .line.highlighted.alt2 .content {
170 background: none !important;
171}
172.syntaxhighlighter.printing .line .number {
173 color: #bbbbbb !important;
174}
175.syntaxhighlighter.printing .line .content {
176 color: black !important;
177}
178.syntaxhighlighter.printing .toolbar {
179 display: none !important;
180}
181.syntaxhighlighter.printing a {
182 text-decoration: none !important;
183}
184.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
185 color: black !important;
186}
187.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
188 color: #008200 !important;
189}
190.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
191 color: blue !important;
192}
193.syntaxhighlighter.printing .keyword {
194 color: #006699 !important;
195 font-weight: bold !important;
196}
197.syntaxhighlighter.printing .preprocessor {
198 color: gray !important;
199}
200.syntaxhighlighter.printing .variable {
201 color: #aa7700 !important;
202}
203.syntaxhighlighter.printing .value {
204 color: #009900 !important;
205}
206.syntaxhighlighter.printing .functions {
207 color: #ff1493 !important;
208}
209.syntaxhighlighter.printing .constants {
210 color: #0066cc !important;
211}
212.syntaxhighlighter.printing .script {
213 font-weight: bold !important;
214}
215.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
216 color: gray !important;
217}
218.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
219 color: #ff1493 !important;
220}
221.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
222 color: red !important;
223}
224.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
225 color: black !important;
226}
227
228.syntaxhighlighter {
229 background-color: #1b2426 !important;
230}
231.syntaxhighlighter .line.alt1 {
232 background-color: #1b2426 !important;
233}
234.syntaxhighlighter .line.alt2 {
235 background-color: #1b2426 !important;
236}
237.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
238 background-color: #323e41 !important;
239}
240.syntaxhighlighter .line.highlighted.number {
241 color: #b9bdb6 !important;
242}
243.syntaxhighlighter table caption {
244 color: #b9bdb6 !important;
245}
246.syntaxhighlighter .gutter {
247 color: #afafaf !important;
248}
249.syntaxhighlighter .gutter .line {
250 border-right: 3px solid #435a5f !important;
251}
252.syntaxhighlighter .gutter .line.highlighted {
253 background-color: #435a5f !important;
254 color: #1b2426 !important;
255}
256.syntaxhighlighter.printing .line .content {
257 border: none !important;
258}
259.syntaxhighlighter.collapsed {
260 overflow: visible !important;
261}
262.syntaxhighlighter.collapsed .toolbar {
263 color: #5ba1cf !important;
264 background: black !important;
265 border: 1px solid #435a5f !important;
266}
267.syntaxhighlighter.collapsed .toolbar a {
268 color: #5ba1cf !important;
269}
270.syntaxhighlighter.collapsed .toolbar a:hover {
271 color: #5ce638 !important;
272}
273.syntaxhighlighter .toolbar {
274 color: white !important;
275 background: #435a5f !important;
276 border: none !important;
277}
278.syntaxhighlighter .toolbar a {
279 color: white !important;
280}
281.syntaxhighlighter .toolbar a:hover {
282 color: #e0e8ff !important;
283}
284.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
285 color: #b9bdb6 !important;
286}
287.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
288 color: #878a85 !important;
289}
290.syntaxhighlighter .string, .syntaxhighlighter .string a {
291 color: #5ce638 !important;
292}
293.syntaxhighlighter .keyword {
294 color: #5ba1cf !important;
295}
296.syntaxhighlighter .preprocessor {
297 color: #435a5f !important;
298}
299.syntaxhighlighter .variable {
300 color: #ffaa3e !important;
301}
302.syntaxhighlighter .value {
303 color: #009900 !important;
304}
305.syntaxhighlighter .functions {
306 color: #ffaa3e !important;
307}
308.syntaxhighlighter .constants {
309 color: #e0e8ff !important;
310}
311.syntaxhighlighter .script {
312 font-weight: bold !important;
313 color: #5ba1cf !important;
314 background-color: none !important;
315}
316.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
317 color: #e0e8ff !important;
318}
319.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
320 color: white !important;
321}
322.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
323 color: #ffaa3e !important;
324}
diff --git a/Blocks/syntax/styles/shThemeDefault.css b/Blocks/syntax/styles/shThemeDefault.css
new file mode 100644
index 0000000..1365411
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeDefault.css
@@ -0,0 +1,117 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: white !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: white !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: white !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #e0e0e0 !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: black !important;
31}
32.syntaxhighlighter table caption {
33 color: black !important;
34}
35.syntaxhighlighter .gutter {
36 color: #afafaf !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #6ce26c !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #6ce26c !important;
43 color: white !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: blue !important;
53 background: white !important;
54 border: 1px solid #6ce26c !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: blue !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: red !important;
61}
62.syntaxhighlighter .toolbar {
63 color: white !important;
64 background: #6ce26c !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: white !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: black !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: black !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #008200 !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: blue !important;
81}
82.syntaxhighlighter .keyword {
83 color: #006699 !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: gray !important;
87}
88.syntaxhighlighter .variable {
89 color: #aa7700 !important;
90}
91.syntaxhighlighter .value {
92 color: #009900 !important;
93}
94.syntaxhighlighter .functions {
95 color: #ff1493 !important;
96}
97.syntaxhighlighter .constants {
98 color: #0066cc !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #006699 !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: gray !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: #ff1493 !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: red !important;
113}
114
115.syntaxhighlighter .keyword {
116 font-weight: bold !important;
117}
diff --git a/Blocks/syntax/styles/shThemeDjango.css b/Blocks/syntax/styles/shThemeDjango.css
new file mode 100644
index 0000000..d8b4313
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeDjango.css
@@ -0,0 +1,120 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: #0a2b1d !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: #0a2b1d !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: #0a2b1d !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #233729 !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: white !important;
31}
32.syntaxhighlighter table caption {
33 color: #f8f8f8 !important;
34}
35.syntaxhighlighter .gutter {
36 color: #497958 !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #41a83e !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #41a83e !important;
43 color: #0a2b1d !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #96dd3b !important;
53 background: black !important;
54 border: 1px solid #41a83e !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #96dd3b !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: white !important;
61}
62.syntaxhighlighter .toolbar {
63 color: white !important;
64 background: #41a83e !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: white !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: #ffe862 !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: #f8f8f8 !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #336442 !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: #9df39f !important;
81}
82.syntaxhighlighter .keyword {
83 color: #96dd3b !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #91bb9e !important;
87}
88.syntaxhighlighter .variable {
89 color: #ffaa3e !important;
90}
91.syntaxhighlighter .value {
92 color: #f7e741 !important;
93}
94.syntaxhighlighter .functions {
95 color: #ffaa3e !important;
96}
97.syntaxhighlighter .constants {
98 color: #e0e8ff !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #96dd3b !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: #eb939a !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: #91bb9e !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: #edef7d !important;
113}
114
115.syntaxhighlighter .comments {
116 font-style: italic !important;
117}
118.syntaxhighlighter .keyword {
119 font-weight: bold !important;
120}
diff --git a/Blocks/syntax/styles/shThemeEclipse.css b/Blocks/syntax/styles/shThemeEclipse.css
new file mode 100644
index 0000000..77377d9
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeEclipse.css
@@ -0,0 +1,128 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: white !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: white !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: white !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #c3defe !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: white !important;
31}
32.syntaxhighlighter table caption {
33 color: black !important;
34}
35.syntaxhighlighter .gutter {
36 color: #787878 !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #d4d0c8 !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #d4d0c8 !important;
43 color: white !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #3f5fbf !important;
53 background: white !important;
54 border: 1px solid #d4d0c8 !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #3f5fbf !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: #aa7700 !important;
61}
62.syntaxhighlighter .toolbar {
63 color: #a0a0a0 !important;
64 background: #d4d0c8 !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: #a0a0a0 !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: red !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: black !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #3f5fbf !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: #2a00ff !important;
81}
82.syntaxhighlighter .keyword {
83 color: #7f0055 !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #646464 !important;
87}
88.syntaxhighlighter .variable {
89 color: #aa7700 !important;
90}
91.syntaxhighlighter .value {
92 color: #009900 !important;
93}
94.syntaxhighlighter .functions {
95 color: #ff1493 !important;
96}
97.syntaxhighlighter .constants {
98 color: #0066cc !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #7f0055 !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: gray !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: #ff1493 !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: red !important;
113}
114
115.syntaxhighlighter .keyword {
116 font-weight: bold !important;
117}
118.syntaxhighlighter .xml .keyword {
119 color: #3f7f7f !important;
120 font-weight: normal !important;
121}
122.syntaxhighlighter .xml .color1, .syntaxhighlighter .xml .color1 a {
123 color: #7f007f !important;
124}
125.syntaxhighlighter .xml .string {
126 font-style: italic !important;
127 color: #2a00ff !important;
128}
diff --git a/Blocks/syntax/styles/shThemeEmacs.css b/Blocks/syntax/styles/shThemeEmacs.css
new file mode 100644
index 0000000..dae5053
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeEmacs.css
@@ -0,0 +1,113 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: black !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: black !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: black !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #2a3133 !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: white !important;
31}
32.syntaxhighlighter table caption {
33 color: #d3d3d3 !important;
34}
35.syntaxhighlighter .gutter {
36 color: #d3d3d3 !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #990000 !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #990000 !important;
43 color: black !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #ebdb8d !important;
53 background: black !important;
54 border: 1px solid #990000 !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #ebdb8d !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: #ff7d27 !important;
61}
62.syntaxhighlighter .toolbar {
63 color: white !important;
64 background: #990000 !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: white !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: #9ccff4 !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: #d3d3d3 !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #ff7d27 !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: #ff9e7b !important;
81}
82.syntaxhighlighter .keyword {
83 color: aqua !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #aec4de !important;
87}
88.syntaxhighlighter .variable {
89 color: #ffaa3e !important;
90}
91.syntaxhighlighter .value {
92 color: #009900 !important;
93}
94.syntaxhighlighter .functions {
95 color: #81cef9 !important;
96}
97.syntaxhighlighter .constants {
98 color: #ff9e7b !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: aqua !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: #ebdb8d !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: #ff7d27 !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: #aec4de !important;
113}
diff --git a/Blocks/syntax/styles/shThemeFadeToGrey.css b/Blocks/syntax/styles/shThemeFadeToGrey.css
new file mode 100644
index 0000000..8fbd871
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeFadeToGrey.css
@@ -0,0 +1,117 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: #121212 !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: #121212 !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: #121212 !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #2c2c29 !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: white !important;
31}
32.syntaxhighlighter table caption {
33 color: white !important;
34}
35.syntaxhighlighter .gutter {
36 color: #afafaf !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #3185b9 !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #3185b9 !important;
43 color: #121212 !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #3185b9 !important;
53 background: black !important;
54 border: 1px solid #3185b9 !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #3185b9 !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: #d01d33 !important;
61}
62.syntaxhighlighter .toolbar {
63 color: white !important;
64 background: #3185b9 !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: white !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: #96daff !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: white !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #696854 !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: #e3e658 !important;
81}
82.syntaxhighlighter .keyword {
83 color: #d01d33 !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #435a5f !important;
87}
88.syntaxhighlighter .variable {
89 color: #898989 !important;
90}
91.syntaxhighlighter .value {
92 color: #009900 !important;
93}
94.syntaxhighlighter .functions {
95 color: #aaaaaa !important;
96}
97.syntaxhighlighter .constants {
98 color: #96daff !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #d01d33 !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: #ffc074 !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: #4a8cdb !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: #96daff !important;
113}
114
115.syntaxhighlighter .functions {
116 font-weight: bold !important;
117}
diff --git a/Blocks/syntax/styles/shThemeMDUltra.css b/Blocks/syntax/styles/shThemeMDUltra.css
new file mode 100644
index 0000000..f4db39c
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeMDUltra.css
@@ -0,0 +1,113 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: #222222 !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: #222222 !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: #222222 !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #253e5a !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: white !important;
31}
32.syntaxhighlighter table caption {
33 color: lime !important;
34}
35.syntaxhighlighter .gutter {
36 color: #38566f !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #435a5f !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #435a5f !important;
43 color: #222222 !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #428bdd !important;
53 background: black !important;
54 border: 1px solid #435a5f !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #428bdd !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: lime !important;
61}
62.syntaxhighlighter .toolbar {
63 color: #aaaaff !important;
64 background: #435a5f !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: #aaaaff !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: #9ccff4 !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: lime !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #428bdd !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: lime !important;
81}
82.syntaxhighlighter .keyword {
83 color: #aaaaff !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #8aa6c1 !important;
87}
88.syntaxhighlighter .variable {
89 color: aqua !important;
90}
91.syntaxhighlighter .value {
92 color: #f7e741 !important;
93}
94.syntaxhighlighter .functions {
95 color: #ff8000 !important;
96}
97.syntaxhighlighter .constants {
98 color: yellow !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #aaaaff !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: red !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: yellow !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: #ffaa3e !important;
113}
diff --git a/Blocks/syntax/styles/shThemeMidnight.css b/Blocks/syntax/styles/shThemeMidnight.css
new file mode 100644
index 0000000..c49563c
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeMidnight.css
@@ -0,0 +1,113 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: #0f192a !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: #0f192a !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: #0f192a !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #253e5a !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: #38566f !important;
31}
32.syntaxhighlighter table caption {
33 color: #d1edff !important;
34}
35.syntaxhighlighter .gutter {
36 color: #afafaf !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #435a5f !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #435a5f !important;
43 color: #0f192a !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #428bdd !important;
53 background: black !important;
54 border: 1px solid #435a5f !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #428bdd !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: #1dc116 !important;
61}
62.syntaxhighlighter .toolbar {
63 color: #d1edff !important;
64 background: #435a5f !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: #d1edff !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: #8aa6c1 !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: #d1edff !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #428bdd !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: #1dc116 !important;
81}
82.syntaxhighlighter .keyword {
83 color: #b43d3d !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #8aa6c1 !important;
87}
88.syntaxhighlighter .variable {
89 color: #ffaa3e !important;
90}
91.syntaxhighlighter .value {
92 color: #f7e741 !important;
93}
94.syntaxhighlighter .functions {
95 color: #ffaa3e !important;
96}
97.syntaxhighlighter .constants {
98 color: #e0e8ff !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #b43d3d !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: #f8bb00 !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: white !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: #ffaa3e !important;
113}
diff --git a/Blocks/syntax/styles/shThemeRDark.css b/Blocks/syntax/styles/shThemeRDark.css
new file mode 100644
index 0000000..6305a10
--- /dev/null
+++ b/Blocks/syntax/styles/shThemeRDark.css
@@ -0,0 +1,113 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17.syntaxhighlighter {
18 background-color: #1b2426 !important;
19}
20.syntaxhighlighter .line.alt1 {
21 background-color: #1b2426 !important;
22}
23.syntaxhighlighter .line.alt2 {
24 background-color: #1b2426 !important;
25}
26.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
27 background-color: #323e41 !important;
28}
29.syntaxhighlighter .line.highlighted.number {
30 color: #b9bdb6 !important;
31}
32.syntaxhighlighter table caption {
33 color: #b9bdb6 !important;
34}
35.syntaxhighlighter .gutter {
36 color: #afafaf !important;
37}
38.syntaxhighlighter .gutter .line {
39 border-right: 3px solid #435a5f !important;
40}
41.syntaxhighlighter .gutter .line.highlighted {
42 background-color: #435a5f !important;
43 color: #1b2426 !important;
44}
45.syntaxhighlighter.printing .line .content {
46 border: none !important;
47}
48.syntaxhighlighter.collapsed {
49 overflow: visible !important;
50}
51.syntaxhighlighter.collapsed .toolbar {
52 color: #5ba1cf !important;
53 background: black !important;
54 border: 1px solid #435a5f !important;
55}
56.syntaxhighlighter.collapsed .toolbar a {
57 color: #5ba1cf !important;
58}
59.syntaxhighlighter.collapsed .toolbar a:hover {
60 color: #5ce638 !important;
61}
62.syntaxhighlighter .toolbar {
63 color: white !important;
64 background: #435a5f !important;
65 border: none !important;
66}
67.syntaxhighlighter .toolbar a {
68 color: white !important;
69}
70.syntaxhighlighter .toolbar a:hover {
71 color: #e0e8ff !important;
72}
73.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
74 color: #b9bdb6 !important;
75}
76.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
77 color: #878a85 !important;
78}
79.syntaxhighlighter .string, .syntaxhighlighter .string a {
80 color: #5ce638 !important;
81}
82.syntaxhighlighter .keyword {
83 color: #5ba1cf !important;
84}
85.syntaxhighlighter .preprocessor {
86 color: #435a5f !important;
87}
88.syntaxhighlighter .variable {
89 color: #ffaa3e !important;
90}
91.syntaxhighlighter .value {
92 color: #009900 !important;
93}
94.syntaxhighlighter .functions {
95 color: #ffaa3e !important;
96}
97.syntaxhighlighter .constants {
98 color: #e0e8ff !important;
99}
100.syntaxhighlighter .script {
101 font-weight: bold !important;
102 color: #5ba1cf !important;
103 background-color: none !important;
104}
105.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
106 color: #e0e8ff !important;
107}
108.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
109 color: white !important;
110}
111.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
112 color: #ffaa3e !important;
113}
diff --git a/Blocks/syntax/tests/.rvmrc b/Blocks/syntax/tests/.rvmrc
new file mode 100644
index 0000000..8cb2ee3
--- /dev/null
+++ b/Blocks/syntax/tests/.rvmrc
@@ -0,0 +1 @@
rvm 1.8.7-p249@copydeca \ No newline at end of file
diff --git a/Blocks/syntax/tests/brushes/sass.html b/Blocks/syntax/tests/brushes/sass.html
new file mode 100644
index 0000000..f415684
--- /dev/null
+++ b/Blocks/syntax/tests/brushes/sass.html
@@ -0,0 +1,204 @@
1<script class="brush: sass;" type="syntaxhighlighter">
2@mixin round_corners_custom($top, $right, $bottom, $left) {
3 -moz-border-radius: $top $right $bottom $left !important;
4 -webkit-border-radius: $top $right $bottom $left !important;
5}
6
7@mixin round_corners($radius) {
8 @include round_corners_custom($radius, $radius, $radius, $radius);
9}
10
11.syntaxhighlighter {
12 a,
13 div,
14 code,
15 table,
16 table td,
17 table tr,
18 table tbody,
19 table thead,
20 table caption,
21 textarea {
22 @include round_corners(0);
23
24 background: none !important;
25 border: 0 !important;
26 bottom: auto !important;
27 float: none !important;
28 height: auto !important;
29 left: auto !important;
30 line-height: 1.1em !important;
31 margin: 0 !important;
32 outline: 0 !important;
33 overflow: visible !important;
34 padding: 0 !important;
35 position: static !important;
36 right: auto !important;
37 text-align: left !important;
38 top: auto !important;
39 vertical-align: baseline !important;
40 width: auto !important;
41 font: {
42 family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
43 weight: normal !important;
44 style: normal !important;
45 size: 1em !important;
46 }
47 min: {
48 // For IE8, FF & WebKit
49 height: inherit !important;
50 // For IE7
51 height: auto !important;
52 }
53 }
54}
55
56.syntaxhighlighter {
57 width: 100% !important;
58 margin: 1em 0 1em 0 !important;
59
60 position: relative !important;
61 overflow: auto !important;
62 font-size: 1em !important;
63
64 &.source { overflow: hidden !important; }
65
66 // set up bold and italic
67 .bold { font-weight: bold !important; }
68 .italic { font-style: italic !important; }
69
70 .line { white-space: pre !important; }
71
72 // main table and columns
73 table {
74 width: 100% !important;
75 caption {
76 text-align: left !important;
77 padding: .5em 0 0.5em 1em !important;
78 }
79
80 td.code {
81 width: 100% !important;
82
83 .container {
84 position: relative !important;
85
86 textarea {
87 position: absolute !important;
88 left: 0 !important;
89 top: 0 !important;
90 width: 100% !important;
91 height: 120% !important;
92 border: none !important;
93 background: white !important;
94 padding-left: 1em !important;
95 overflow: hidden !important;
96 white-space: pre !important;
97 }
98 }
99 }
100
101 // middle spacing between line numbers and lines
102 td.gutter .line {
103 text-align: right !important;
104 padding: 0 0.5em 0 1em !important;
105 }
106
107 td.code .line {
108 padding: 0 1em !important;
109 }
110 }
111
112 &.nogutter {
113 td.code {
114 .container textarea, .line { padding-left: 0em !important; }
115 }
116 }
117
118 &.show { display: block !important; }
119
120 // Adjust some properties when collapsed
121 &.collapsed {
122 table { display: none !important; }
123
124 .toolbar {
125 padding: 0.1em 0.8em 0em 0.8em !important;
126 font-size: 1em !important;
127 position: static !important;
128 width: auto !important;
129 height: auto !important;
130
131 span {
132 display: inline !important;
133 margin-right: 1em !important;
134
135 a {
136 padding: 0 !important;
137 display: none !important;
138 &.expandSource, &.help { display: inline !important; }
139 }
140 }
141 }
142 }
143
144 // Styles for the toolbar
145 .toolbar {
146 position: absolute !important;
147 right: 1px !important;
148 top: 1px !important;
149 width: 11px !important;
150 height: 11px !important;
151 font-size: 10px !important;
152 z-index: 10 !important;
153
154 span.title { display: inline !important; }
155
156 a {
157 display: block !important;
158 text-align: center !important;
159 text-decoration: none !important;
160 padding-top: 1px !important;
161
162 &.expandSource { display: none !important; }
163 }
164 }
165
166 // Print view.
167 // Colors are based on the default theme without background.
168 &.printing {
169 .line.alt1 .content,
170 .line.alt2 .content,
171 .line.highlighted .number,
172 .line.highlighted.alt1 .content,
173 .line.highlighted.alt2 .content { background: none !important; }
174
175 // Gutter line numbers
176 .line {
177 .number { color: #bbbbbb !important; }
178 // Add border to the lines
179 .content { color: black !important; }
180 }
181
182 // Toolbar when visible
183 .toolbar { display: none !important; }
184 a { text-decoration: none !important; }
185 .plain, .plain a { color: black !important; }
186 .comments, .comments a { color: #008200 !important; }
187 .string, .string a { color: blue !important; }
188 .keyword {
189 color: #006699 !important;
190 font-weight: bold !important;
191 }
192 .preprocessor { color: gray !important; }
193 .variable { color: #aa7700 !important; }
194 .value { color: #009900 !important; }
195 .functions { color: #ff1493 !important; }
196 .constants { color: #0066cc !important; }
197 .script { font-weight: bold !important; }
198 .color1, .color1 a { color: gray !important; }
199 .color2, .color2 a { color: #ff1493 !important; }
200 .color3, .color3 a { color: red !important; }
201 .break, .break a { color: black !important; }
202 }
203}
204</script> \ No newline at end of file
diff --git a/Blocks/syntax/tests/brushes_tests.html b/Blocks/syntax/tests/brushes_tests.html
new file mode 100644
index 0000000..cf60a98
--- /dev/null
+++ b/Blocks/syntax/tests/brushes_tests.html
@@ -0,0 +1,143 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>SyntaxHighlighter Brushes Tests</title>
6 <script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
7
8 <!-- SyntaxHighlighter -->
9 <script type="text/javascript" src="/sh/scripts/XRegExp.js"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
10 <script type="text/javascript" src="/sh/scripts/shCore.js"></script>
11 <script type="text/javascript" src="/sh/scripts/shAutoloader.js"></script>
12 <script type="text/javascript" src="/sh/scripts/shBrushAppleScript.js"></script>
13 <script type="text/javascript" src="/sh/scripts/shBrushAS3.js"></script>
14 <script type="text/javascript" src="/sh/scripts/shBrushBash.js"></script>
15 <script type="text/javascript" src="/sh/scripts/shBrushColdFusion.js"></script>
16 <script type="text/javascript" src="/sh/scripts/shBrushCpp.js"></script>
17 <script type="text/javascript" src="/sh/scripts/shBrushCSharp.js"></script>
18 <script type="text/javascript" src="/sh/scripts/shBrushCss.js"></script>
19 <script type="text/javascript" src="/sh/scripts/shBrushDelphi.js"></script>
20 <script type="text/javascript" src="/sh/scripts/shBrushDiff.js"></script>
21 <script type="text/javascript" src="/sh/scripts/shBrushErlang.js"></script>
22 <script type="text/javascript" src="/sh/scripts/shBrushGroovy.js"></script>
23 <script type="text/javascript" src="/sh/scripts/shBrushJava.js"></script>
24 <script type="text/javascript" src="/sh/scripts/shBrushJavaFx.js"></script>
25 <script type="text/javascript" src="/sh/scripts/shBrushJScript.js"></script>
26 <script type="text/javascript" src="/sh/scripts/shBrushPerl.js"></script>
27 <script type="text/javascript" src="/sh/scripts/shBrushPhp.js"></script>
28 <script type="text/javascript" src="/sh/scripts/shBrushPlain.js"></script>
29 <script type="text/javascript" src="/sh/scripts/shBrushPowerShell.js"></script>
30 <script type="text/javascript" src="/sh/scripts/shBrushPython.js"></script>
31 <script type="text/javascript" src="/sh/scripts/shBrushRuby.js"></script>
32 <script type="text/javascript" src="/sh/scripts/shBrushSass.js"></script>
33 <script type="text/javascript" src="/sh/scripts/shBrushScala.js"></script>
34 <script type="text/javascript" src="/sh/scripts/shBrushSql.js"></script>
35 <script type="text/javascript" src="/sh/scripts/shBrushVb.js"></script>
36 <script type="text/javascript" src="/sh/scripts/shBrushXml.js"></script>
37
38 <link type="text/css" rel="stylesheet" href="/sh/styles/shCoreDefault.css"/>
39</head>
40
41<body>
42
43<div id="output"></div>
44
45<style>
46body {
47 background: white;
48 font-family: Helvetica;
49}
50
51.test-wrap {
52 width: 100%;
53 height: 800px;
54 overflow: auto;
55 border: none;
56}
57</style>
58
59<script type="text/javascript">
60var brushes = [
61 'AS3',
62 'AppleScript',
63 'Bash',
64 'CSharp',
65 'ColdFusion',
66 'Cpp',
67 'Css',
68 'Delphi',
69 'Diff',
70 'Erlang',
71 'Groovy',
72 'JScript',
73 'Java',
74 'JavaFX',
75 'Perl',
76 'Php',
77 'Plain',
78 'PowerShell',
79 'Python',
80 'Ruby',
81 'Sass',
82 'Scala',
83 'Sql',
84 'Vb',
85 'Xml'
86 ];
87
88$(document).ready(function()
89{
90 var html = '';
91
92 $.each(brushes, function(index)
93 {
94 var name = this;
95
96 html += ''
97 + '<div class="test-wrap">'
98 + '<h1>'
99 + '<a href="#theme' + (index + 1) + '">next</a> '
100 + '<a name="theme' + index + '">'
101 + name
102 + '</a>'
103 + '</h1>'
104 ;
105
106 $.ajax({
107 url: 'brushes/' + name.toLowerCase() + '.html',
108 type: 'GET',
109 dataType: 'text',
110 async: false,
111 success: function(data)
112 {
113 html += data;
114 },
115 error: function()
116 {
117 html += '<p>Not found...</p>';
118 }
119 });
120
121 html += '</div>\n';
122
123 if (index % 2 != 0)
124 html += '<div style="clear:both"></div>\n';
125 });
126
127 $('#output')[0].innerHTML = html;
128 $('#output a[name]:first').attr('name', 'top');
129 $('#output a[href]:last').attr('href', '#top').html('top');
130
131 SyntaxHighlighter.highlight();
132});
133</script>
134
135
136<!-- jinwei.me Baidu tongji analytics -->
137<script type="text/javascript">
138var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
139document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F91918ac6d6854623883a2b546ebc00ac' type='text/javascript'%3E%3C/script%3E"));
140</script>
141
142</body>
143</html>
diff --git a/Blocks/syntax/tests/cases/001_basic.html b/Blocks/syntax/tests/cases/001_basic.html
new file mode 100644
index 0000000..1d57334
--- /dev/null
+++ b/Blocks/syntax/tests/cases/001_basic.html
@@ -0,0 +1,42 @@
1<pre id="sh_001_basic" class="brush: js;" title="Title/caption should render">
2 /**
3 * multiline comment
4 */
5
6 text
7
8 // single line comment
9
10 text
11
12 "string" text 'string' text "string"
13 "string with \" escape" text 'string with \' escape' text "string with \" escape"
14
15 var code = '\
16 function helloWorld()\
17 {\
18 // this is great!\
19 for(var i = 0; i &lt;= 1; i++)\
20 alert("yay");\
21 }\
22 ';
23</pre>
24
25<script type="text/javascript">
26queue(function()
27{
28 var $sh;
29
30 module('001_basic');
31
32 test('basic html check of default elements', function()
33 {
34 $sh = $('#sh_001_basic');
35 ok_sh($sh);
36 ok_toolbar($sh);
37 ok_caption($sh, 'Title/caption should render');
38 ok_gutter($sh);
39 ok_code($sh);
40 });
41});
42</script>
diff --git a/Blocks/syntax/tests/cases/002_brushes.html b/Blocks/syntax/tests/cases/002_brushes.html
new file mode 100644
index 0000000..e9c64e2
--- /dev/null
+++ b/Blocks/syntax/tests/cases/002_brushes.html
@@ -0,0 +1,50 @@
1<div id="sh_002_brushes">
2 <pre class="brush: applescript;">test</pre>
3 <pre class="brush: as3;">test</pre>
4 <pre class="brush: bash;">test</pre>
5 <pre class="brush: cf;">test</pre>
6 <pre class="brush: cpp;">test</pre>
7 <pre class="brush: csharp;">test</pre>
8 <pre class="brush: css;">test</pre>
9 <pre class="brush: delphi;">test</pre>
10 <pre class="brush: diff;">test</pre>
11 <pre class="brush: erlang;">test</pre>
12 <pre class="brush: groovy;">test</pre>
13 <pre class="brush: java;">test</pre>
14 <pre class="brush: javafx;">test</pre>
15 <pre class="brush: jscript;">test</pre>
16 <pre class="brush: perl;">test</pre>
17 <pre class="brush: php;">test</pre>
18 <pre class="brush: plain;">test</pre>
19 <pre class="brush: powershell;">test</pre>
20 <pre class="brush: python;">test</pre>
21 <pre class="brush: ruby;">test</pre>
22 <pre class="brush: sass;">test</pre>
23 <pre class="brush: scala;">test</pre>
24 <pre class="brush: sql;">test</pre>
25 <pre class="brush: vb;">test</pre>
26 <pre class="brush: xml;">test</pre>
27</div>
28
29<script type="text/javascript">
30queue(function()
31{
32 var $sh;
33
34 module('002_brushes');
35
36 test('check that all brushes loaded and rendered', function()
37 {
38 $sh = $('#sh_002_brushes');
39
40 $sh.find('> div > .syntaxhighlighter').each(function()
41 {
42 var $sh = $(this).parent();
43 ok_sh($sh);
44 ok_sh($sh);
45 ok_toolbar($sh);
46 ok_code($sh);
47 });
48 });
49});
50</script>
diff --git a/Blocks/syntax/tests/cases/003_script_tag.html b/Blocks/syntax/tests/cases/003_script_tag.html
new file mode 100644
index 0000000..9b44292
--- /dev/null
+++ b/Blocks/syntax/tests/cases/003_script_tag.html
@@ -0,0 +1,42 @@
1<div>
2<script id="sh_003_script_tag" type="syntaxhighlighter" class="brush: csharp" title="Title/caption should render"><![CDATA[
3 partial class Foo
4 {
5 function test()
6 {
7 yield return;
8 yield break;
9 }
10 }
11
12 function foo()
13 {
14 var vector:Vector.<Vector.<String>> = new Vector<Vector.String>>();
15
16 for (var i = 0; i < 10; i++)
17 {
18 /* comments */
19 }
20 }
21]]></script>
22</div>
23
24<script type="text/javascript">
25queue(function()
26{
27 var $sh;
28
29 module('003_script_tag');
30
31 test('basic html check of default elements', function()
32 {
33 $sh = $('#sh_003_script_tag');
34
35 ok_sh($sh);
36 ok_toolbar($sh);
37 ok_caption($sh, 'Title/caption should render');
38 ok_gutter($sh);
39 ok_code($sh);
40 });
41});
42</script>
diff --git a/Blocks/syntax/tests/cases/004_url_parsing.html b/Blocks/syntax/tests/cases/004_url_parsing.html
new file mode 100644
index 0000000..d489a66
--- /dev/null
+++ b/Blocks/syntax/tests/cases/004_url_parsing.html
@@ -0,0 +1,43 @@
1<pre id="sh_004_url_parsing" class="brush: as3;">
2/**
3 * Please see &lt;http://www.alexgorbatchev.come/?test=1&y=2&gt;
4 */
5var home = "http://www.alexgorbatchev.come/?test=1&y=2;test/1/2/3;";
6// &lt; http://www.gnu.org/licenses/?test=1&y=2 &gt;.
7
8// Test embedded URLs that terminate at a left angle bracket.
9// See bug #28: http://bitbucket.org/alexg/syntaxhighlighter/issue/28/
10"<location>http://www.example.com/song2.mp3</location>";
11</pre>
12
13<script type="text/javascript">
14queue(function()
15{
16 var $sh;
17
18 module('004_url_parsing');
19
20 test('check that urls are present', function()
21 {
22 $sh = $('#sh_004_url_parsing');
23
24 ok_sh($sh);
25 ok_toolbar($sh);
26 ok_code($sh);
27
28 var expected = [
29 'http://www.alexgorbatchev.come/?test=1&y=2',
30 'http://www.alexgorbatchev.come/?test=1&y=2;test/1/2/3;',
31 'http://www.gnu.org/licenses/?test=1&y=2',
32 'http://bitbucket.org/alexg/syntaxhighlighter/issue/28/',
33 'http://www.example.com/song2.mp3'
34 ];
35
36 $sh.find('td.code a').each(function(index)
37 {
38 equal($(this).attr('href'), expected[index], 'href');
39 equal($(this).text(), expected[index], 'text');
40 })
41 });
42});
43</script> \ No newline at end of file
diff --git a/Blocks/syntax/tests/cases/005_no_gutter.html b/Blocks/syntax/tests/cases/005_no_gutter.html
new file mode 100644
index 0000000..6e6b1be
--- /dev/null
+++ b/Blocks/syntax/tests/cases/005_no_gutter.html
@@ -0,0 +1,33 @@
1<pre id="sh_005_no_gutter" class="brush: java; gutter: false;">
2 public Image getImage(URL url, String name) {
3 try {
4 /*
5 Regular multiline comment.
6 */
7 return getImage(new URL(url, name));
8 } catch (MalformedURLException e) {
9 return null;
10 }
11 }
12</pre>
13
14<script type="text/javascript">
15queue(function()
16{
17 var $sh;
18
19 module('005_no_gutter');
20
21 test('check that there is no gutter', function()
22 {
23 $sh = $('#sh_005_no_gutter');
24
25 ok_sh($sh);
26 ok_toolbar($sh);
27 ok_code($sh);
28
29 ok($sh.find('> .syntaxhighlighter.nogutter').length == 1, '.nogutter present');
30 ok($sh.find('> .syntaxhighlighter > table > tbody > tr > .gutter').length == 0, 'Gutter not present');
31 });
32});
33</script>
diff --git a/Blocks/syntax/tests/cases/006_pad_line_numbers.html b/Blocks/syntax/tests/cases/006_pad_line_numbers.html
new file mode 100644
index 0000000..8ebdd55
--- /dev/null
+++ b/Blocks/syntax/tests/cases/006_pad_line_numbers.html
@@ -0,0 +1,39 @@
1<pre id="sh_006_pad_line_numbers" class="brush: java; pad-line-numbers: true">
2/**
3 * Returns an Image object that can then be painted on the screen.
4 * The url argument must specify an absolute {@link URL}. The name
5 * argument is a specifier that is relative to the url argument.
6 *
7 * @param url an absolute URL giving the base location of the image
8 * @param name the location of the image, relative to the url argument
9 * @return the image at the specified URL
10 * @see Image
11 */
12</pre>
13
14<script type="text/javascript">
15queue(function()
16{
17 var $sh;
18
19 module('006_pad_line_numbers');
20
21 test('check that line numbers are padded with zeroes', function()
22 {
23 $sh = $('#sh_006_pad_line_numbers');
24
25 ok_sh($sh);
26 ok_toolbar($sh);
27 ok_gutter($sh);
28 ok_code($sh);
29
30 $sh.find('.gutter > .line').each(function(index)
31 {
32 var text = $(this).text();
33
34 if (parseInt(text) < 10)
35 ok(text.charAt(0) == '0', 'Line ' + index + ' has leading zero: ' + text);
36 });
37 });
38});
39</script>
diff --git a/Blocks/syntax/tests/cases/007_collapse.html b/Blocks/syntax/tests/cases/007_collapse.html
new file mode 100644
index 0000000..2643bb5
--- /dev/null
+++ b/Blocks/syntax/tests/cases/007_collapse.html
@@ -0,0 +1,60 @@
1<pre id="sh_007_collapse_a" class="brush: groovy; collapse: true" title="This is a title for collapsed block">
2 /**
3 * Returns an Image object that can then be painted on the screen.
4 * The url argument must specify an absolute {@link URL}. The name
5 * argument is a specifier that is relative to the url argument.
6 *
7 * @param url an absolute URL giving the base location of the image
8 * @param name the location of the image, relative to the url argument
9 * @return the image at the specified URL
10 * @see Image
11 */
12</pre>
13
14<pre id="sh_007_collapse_b" class="brush: groovy; collapse: true">
15 /**
16 * Returns an Image object that can then be painted on the screen.
17 * The url argument must specify an absolute {@link URL}. The name
18 * argument is a specifier that is relative to the url argument.
19 *
20 * @param url an absolute URL giving the base location of the image
21 * @param name the location of the image, relative to the url argument
22 * @return the image at the specified URL
23 * @see Image
24 */
25</pre>
26
27<script type="text/javascript">
28queue(function()
29{
30 var $sh;
31
32 module('007_collapse');
33
34 test('collapsed block with title', function()
35 {
36 $sh = $('#sh_007_collapse_a');
37
38 ok_sh($sh);
39 ok_toolbar($sh);
40 ok_collapsed($sh);
41
42 var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
43 ok($title.length == 1, 'Expand present');
44 equal($title.text(), 'This is a title for collapsed block', 'Expand text');
45 });
46
47 test('collapsed block without title', function()
48 {
49 $sh = $('#sh_007_collapse_b');
50
51 ok_sh($sh);
52 ok_toolbar($sh);
53 ok_collapsed($sh);
54
55 var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
56 ok($title.length == 1, 'Expand present');
57 equal($title.text(), SyntaxHighlighter.config.strings.expandSource, 'Expand text');
58 });
59});
60</script>
diff --git a/Blocks/syntax/tests/cases/007_collapse_interaction.html b/Blocks/syntax/tests/cases/007_collapse_interaction.html
new file mode 100644
index 0000000..ea72046
--- /dev/null
+++ b/Blocks/syntax/tests/cases/007_collapse_interaction.html
@@ -0,0 +1,44 @@
1<script type="text/javascript">
2queue(function()
3{
4 var $sh;
5
6 module('007_collapse_interaction');
7
8 function clickA($a)
9 {
10 SyntaxHighlighter.toolbar.handler({
11 target: $a[0],
12 preventDefault: function() {}
13 });
14 };
15
16 test('expand collapsed block with title', function()
17 {
18 $sh = $('#sh_007_collapse_a');
19
20 ok_sh($sh);
21 ok_toolbar($sh);
22 ok_collapsed($sh);
23
24 var $a = $sh.find('.toolbar a.toolbar_item.command_expandSource');
25 clickA($a);
26 ok($a.not(':visible'), 'Expand not visible');
27 ok_code($sh);
28 });
29
30 test('expand collapsed block without title', function()
31 {
32 $sh = $('#sh_007_collapse_b');
33
34 ok_sh($sh);
35 ok_toolbar($sh);
36 ok_collapsed($sh);
37
38 var $a = $sh.find('.toolbar a.toolbar_item.command_expandSource');
39 clickA($a);
40 ok($a.not(':visible'), 'Expand not visible');
41 ok_code($sh);
42 });
43});
44</script>
diff --git a/Blocks/syntax/tests/cases/008_first_line.html b/Blocks/syntax/tests/cases/008_first_line.html
new file mode 100644
index 0000000..169dc38
--- /dev/null
+++ b/Blocks/syntax/tests/cases/008_first_line.html
@@ -0,0 +1,29 @@
1<pre id="sh_008_first_line" class="brush: java; first-line: 10">
2 partial class Foo
3 {
4 function test()
5 {
6 yield return;
7 }
8 }
9</pre>
10
11<script type="text/javascript">
12queue(function()
13{
14 var $sh;
15
16 module('008_first_line');
17
18 test('check the first line', function()
19 {
20 $sh = $('#sh_008_first_line');
21
22 ok_sh($sh);
23 ok_toolbar($sh);
24 ok_gutter($sh);
25 ok_code($sh);
26 equals($sh.find('.gutter .index0').text(), '10', 'First line');
27 });
28});
29</script>
diff --git a/Blocks/syntax/tests/cases/009_class_name.html b/Blocks/syntax/tests/cases/009_class_name.html
new file mode 100644
index 0000000..f2437d5
--- /dev/null
+++ b/Blocks/syntax/tests/cases/009_class_name.html
@@ -0,0 +1,32 @@
1<pre id="sh_009_class_name" class="brush: java; class-name: 'custom class here'">
2 public Image getImage(URL url, String name) {
3 try {
4 /*
5 Regular multiline comment.
6 */
7 return getImage(new URL(url, name));
8 } catch (MalformedURLException e) {
9 return null;
10 }
11 }
12</pre>
13
14<script type="text/javascript">
15queue(function()
16{
17 var $sh;
18
19 module('009_class_name');
20
21 test('check custom classes', function()
22 {
23 $sh = $('#sh_009_class_name');
24
25 ok_sh($sh);
26 ok_toolbar($sh);
27 ok_gutter($sh);
28 ok_code($sh);
29 ok($sh.find('.syntaxhighlighter').is('.custom.class.here'), 'Check custom classes');
30 });
31});
32</script>
diff --git a/Blocks/syntax/tests/cases/010_highlight.html b/Blocks/syntax/tests/cases/010_highlight.html
new file mode 100644
index 0000000..64b6613
--- /dev/null
+++ b/Blocks/syntax/tests/cases/010_highlight.html
@@ -0,0 +1,70 @@
1<pre id="sh_010_highlight_a" class="brush: groovy; highlight: 2">
2 public function validateStrongPassword(password:String):Boolean
3 {
4 if (password == null || password.length <= 0)
5 {
6 return false;
7 }
8
9 return STRONG_PASSWORD_PATTERN.test(password);
10 }
11</pre>
12<script id="sh_010_highlight_b" type="syntaxhighlighter" class="brush: as3; highlight: [2, 4, 12]"><![CDATA[
13 /**
14 * Checks a password and returns a value indicating whether the password is a "strong"
15 * password. The criteria for a strong password are:
16 *
17 * <ul>
18 * <li>Minimum 8 characters</li>
19 * <li>Maxmium 32 characters</li>
20 * <li>Contains at least one lowercase letter</li>
21 * <li>Contains at least one uppercase letter</li>
22 * <li>Contains at least one number or symbol character</li>
23 * </ul>
24 *
25 * @param password The password to check
26 *
27 * @return A value indicating whether the password is a strong password (<code>true</code>)
28 * or not (<code>false</code>).
29 */
30 public function validateStrongPassword(password:String):Boolean
31 {
32 if (password == null || password.length <= 0)
33 {
34 return false;
35 }
36
37 return STRONG_PASSWORD_PATTERN.test(password);
38 }
39]]></script>
40
41<script type="text/javascript">
42queue(function()
43{
44 var $sh;
45
46 module('010_highlight');
47
48 test('one highlighted line', function()
49 {
50 $sh = $('#sh_010_highlight_a');
51
52 ok_sh($sh);
53 ok_toolbar($sh);
54 ok_code($sh);
55 ok($sh.find('.gutter .number2').is('.highlighted'), 'Line 2 is highlighted');
56 });
57
58 test('multiple highlighted lines', function()
59 {
60 $sh = $('#sh_010_highlight_b');
61
62 ok_sh($sh);
63 ok_toolbar($sh);
64 ok_code($sh);
65 ok($sh.find('.gutter .number2').is('.highlighted'), 'Line 2 is highlighted');
66 ok($sh.find('.gutter .number4').is('.highlighted'), 'Line 4 is highlighted');
67 ok($sh.find('.gutter .number12').is('.highlighted'), 'Line 12 is highlighted');
68 });
69});
70</script>
diff --git a/Blocks/syntax/tests/cases/011_smart_tabs.html b/Blocks/syntax/tests/cases/011_smart_tabs.html
new file mode 100644
index 0000000..d6d62fc
--- /dev/null
+++ b/Blocks/syntax/tests/cases/011_smart_tabs.html
@@ -0,0 +1,98 @@
1<pre id="sh_011_smart_tabs_a" class="brush: plain;">
2 the words in this paragraph
3 should look like they are
4 evenly spaced between columns
5</pre>
6
7<pre id="sh_011_smart_tabs_b" class="brush: plain; tab-size: 8;">
8 the words in this paragraph
9 should look like they are
10 evenly spaced between columns
11</pre>
12
13<pre id="sh_011_smart_tabs_c" class="brush: plain; smart-tabs: false">
14 the words in this paragraph
15 should look out of whack
16 because smart tabs are disabled
17</pre>
18
19<script type="text/javascript">
20queue(function()
21{
22 var $sh;
23
24 module('011_smart_tabs');
25
26 var evenLines = [
27 'the words in this paragraph',
28 'should look like they are',
29 'evenly spaced between columns'
30 ],
31 unevenLines = [
32 'the words in this paragraph',
33 'should look out of whack',
34 'because smart tabs are disabled'
35 ]
36 ;
37
38 function fixSpaces(s)
39 {
40 s = encodeURIComponent(s).replace(/%C2%A0/g, '%20');
41 return unescape(s).replace(/\s+$/g, '');
42 };
43
44 test('default tab size is 4', function()
45 {
46 $sh = $('#sh_011_smart_tabs_a');
47
48 ok_sh($sh);
49 ok_toolbar($sh);
50 ok_code($sh);
51
52 $sh.find('.code .line').each(function(index)
53 {
54 var s1 = fixSpaces($(this).text()),
55 s2 = fixSpaces(evenLines[index])
56 ;
57
58 equal(s1, s2, 'Line ' + index);
59 });
60 });
61
62 test('tab size changed to 8', function()
63 {
64 $sh = $('#sh_011_smart_tabs_b');
65
66 ok_sh($sh);
67 ok_toolbar($sh);
68 ok_code($sh);
69
70 $sh.find('.code .line').each(function(index)
71 {
72 var s1 = fixSpaces($(this).text()),
73 s2 = fixSpaces(evenLines[index])
74 ;
75
76 equal(s1, s2, 'Line ' + index);
77 });
78 });
79
80 test('smart tabs are off', function()
81 {
82 $sh = $('#sh_011_smart_tabs_c');
83
84 ok_sh($sh);
85 ok_toolbar($sh);
86 ok_code($sh);
87
88 $sh.find('.code .line').each(function(index)
89 {
90 var s1 = fixSpaces($(this).text()),
91 s2 = fixSpaces(unevenLines[index])
92 ;
93
94 equal(s1, s2, 'Line ' + index);
95 });
96 });
97});
98</script>
diff --git a/Blocks/syntax/tests/cases/012_server_side.html b/Blocks/syntax/tests/cases/012_server_side.html
new file mode 100644
index 0000000..1bb4217
--- /dev/null
+++ b/Blocks/syntax/tests/cases/012_server_side.html
@@ -0,0 +1,35 @@
1<script id="sh_012_server_side_input" type="text/plain">
2function helloWorld()
3{
4 // this is great!
5 for(var i = 0; i <= 1; i++)
6 alert("yay");
7}
8</script>
9
10<div id="sh_012_server_side_output">
11</div>
12
13<script type="text/javascript">
14queue(function()
15{
16 var $sh;
17
18 module('012_server_side');
19
20 test('generate markup', function()
21 {
22 var brush = new SyntaxHighlighter.brushes.JScript(),
23 code = $('#sh_012_server_side_input').html()
24 ;
25
26 brush.init({ toolbar: false });
27 $sh = $('#sh_012_server_side_output');
28 $sh.html(brush.getHtml(code));
29
30 ok_sh($sh);
31 ok_gutter($sh);
32 ok_code($sh);
33 });
34});
35</script> \ No newline at end of file
diff --git a/Blocks/syntax/tests/cases/013_html_script.html b/Blocks/syntax/tests/cases/013_html_script.html
new file mode 100644
index 0000000..c0a1201
--- /dev/null
+++ b/Blocks/syntax/tests/cases/013_html_script.html
@@ -0,0 +1,34 @@
1<pre id="sh_013_html_script" class="brush: groovy; html-script: true">
2&lt;hello>
3 &lt;%
4 package free.cafekiwi.gotapi;
5 %>
6&lt;/hello>
7
8<!--
9 Comments here
10-->
11&lt;%= print(); %>
12</pre>
13
14<script type="text/javascript">
15queue(function()
16{
17 var $sh;
18
19 module('013_html_script');
20
21 test('check markup', function()
22 {
23 $sh = $('#sh_013_html_script');
24
25 ok_sh($sh);
26 ok_gutter($sh);
27 ok_code($sh);
28
29 ok($sh.find('.code .number1 > .htmlscript').length > 0, 'Has .htmlscript on line 1');
30 ok($sh.find('.code .number3 > .groovy').length > 0, 'Has .groovy on line 3');
31 ok($sh.find('.code .number10 > .groovy').length > 0, 'Has .groovy on line 10');
32 });
33});
34</script> \ No newline at end of file
diff --git a/Blocks/syntax/tests/cases/014_legacy.html b/Blocks/syntax/tests/cases/014_legacy.html
new file mode 100644
index 0000000..eb4343e
--- /dev/null
+++ b/Blocks/syntax/tests/cases/014_legacy.html
@@ -0,0 +1,70 @@
1<pre id="sh_014_legacy_a" name="code" class="plain">basic check</pre>
2<pre id="sh_014_legacy_b" name="code" class="plain:nocontrols">no toolbar</pre>
3<pre id="sh_014_legacy_c" name="code" class="plain:nogutter">no gutter</pre>
4<pre id="sh_014_legacy_d" name="code" class="plain:collapse">collapsed</pre>
5<pre id="sh_014_legacy_e" name="code" class="plain:firstline[10]">first line</pre>
6
7<script type="text/javascript">
8queue(function()
9{
10 var $sh;
11
12 dp.SyntaxHighlighter.HighlightAll('code');
13
14 module('014_legacy');
15
16 test('basic check', function()
17 {
18 $sh = $('#sh_014_legacy_a');
19
20 ok_sh($sh);
21 ok_toolbar($sh);
22 ok_code($sh);
23 });
24
25 test('no toolbar', function()
26 {
27 $sh = $('#sh_014_legacy_b');
28
29 ok_sh($sh);
30 ok_code($sh);
31 ok($sh.find('> .syntaxhighlighter > .toolbar').length == 0, 'Toolbar not present');
32 });
33
34 test('no gutter', function()
35 {
36 $sh = $('#sh_014_legacy_c');
37
38 ok_sh($sh);
39 ok_toolbar($sh);
40 ok_code($sh);
41
42 ok($sh.find('> .syntaxhighlighter.nogutter').length == 1, '.nogutter present');
43 ok($sh.find('> .syntaxhighlighter > table > tbody > tr > .gutter').length == 0, 'Gutter not present');
44 });
45
46 test('collapsed check', function()
47 {
48 $sh = $('#sh_014_legacy_d');
49
50 ok_sh($sh);
51 ok_toolbar($sh);
52 ok_collapsed($sh);
53
54 var $title = $sh.find('.toolbar a.toolbar_item.command_expandSource');
55 ok($title.length == 1, 'Expand present');
56 equal($title.text(), SyntaxHighlighter.config.strings.expandSource, 'Expand text');
57 });
58
59 test('first line check', function()
60 {
61 $sh = $('#sh_014_legacy_e');
62
63 ok_sh($sh);
64 ok_toolbar($sh);
65 ok_gutter($sh);
66 ok_code($sh);
67 equals($sh.find('.gutter .index0').text(), '10', 'First line');
68 });
69});
70</script>
diff --git a/Blocks/syntax/tests/commonjs_tests.js b/Blocks/syntax/tests/commonjs_tests.js
new file mode 100644
index 0000000..cda8162
--- /dev/null
+++ b/Blocks/syntax/tests/commonjs_tests.js
@@ -0,0 +1,52 @@
1/**
2 * This is a CommonJS compatibility test. You can run this file with node.
3 */
4require.paths.unshift(__dirname + '/../scripts');
5
6var sys = require('sys'),
7 shSyntaxHighlighter = require('shCore').SyntaxHighlighter,
8 code = 'test',
9 brushes = [
10 'AS3',
11 'AppleScript',
12 'Bash',
13 'CSharp',
14 'ColdFusion',
15 'Cpp',
16 'Css',
17 'Delphi',
18 'Diff',
19 'Erlang',
20 'Groovy',
21 'JScript',
22 'Java',
23 'JavaFX',
24 'Perl',
25 'Php',
26 'Plain',
27 'PowerShell',
28 'Python',
29 'Ruby',
30 'Sass',
31 'Scala',
32 'Sql',
33 'Vb',
34 'Xml'
35 ]
36 ;
37
38brushes.sort();
39
40for (var i = 0; i < brushes.length; i++)
41{
42 var name = brushes[i],
43 brush = require('shBrush' + name).Brush
44 ;
45
46 brush = new brush();
47 brush.init({ toolbar: false });
48
49 var result = brush.getHtml(code);
50
51 sys.puts(name + (result != null ? ': ok' : ': NOT OK'));
52}
diff --git a/Blocks/syntax/tests/js/jquery-1.4.2.js b/Blocks/syntax/tests/js/jquery-1.4.2.js
new file mode 100644
index 0000000..e414a7e
--- /dev/null
+++ b/Blocks/syntax/tests/js/jquery-1.4.2.js
@@ -0,0 +1,6240 @@
1/*!
2 * jQuery JavaScript Library v1.4.2
3 * http://jquery.com/
4 *
5 * Copyright 2010, John Resig
6 * Dual licensed under the MIT or GPL Version 2 licenses.
7 * http://jquery.org/license
8 *
9 * Includes Sizzle.js
10 * http://sizzlejs.com/
11 * Copyright 2010, The Dojo Foundation
12 * Released under the MIT, BSD, and GPL Licenses.
13 *
14 * Date: Sat Feb 13 22:33:48 2010 -0500
15 */
16(function( window, undefined ) {
17
18// Define a local copy of jQuery
19var jQuery = function( selector, context ) {
20 // The jQuery object is actually just the init constructor 'enhanced'
21 return new jQuery.fn.init( selector, context );
22 },
23
24 // Map over jQuery in case of overwrite
25 _jQuery = window.jQuery,
26
27 // Map over the $ in case of overwrite
28 _$ = window.$,
29
30 // Use the correct document accordingly with window argument (sandbox)
31 document = window.document,
32
33 // A central reference to the root jQuery(document)
34 rootjQuery,
35
36 // A simple way to check for HTML strings or ID strings
37 // (both of which we optimize for)
38 quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
39
40 // Is it a simple selector
41 isSimple = /^.[^:#\[\.,]*$/,
42
43 // Check if a string has a non-whitespace character in it
44 rnotwhite = /\S/,
45
46 // Used for trimming whitespace
47 rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
48
49 // Match a standalone tag
50 rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
51
52 // Keep a UserAgent string for use with jQuery.browser
53 userAgent = navigator.userAgent,
54
55 // For matching the engine and version of the browser
56 browserMatch,
57
58 // Has the ready events already been bound?
59 readyBound = false,
60
61 // The functions to execute on DOM ready
62 readyList = [],
63
64 // The ready event handler
65 DOMContentLoaded,
66
67 // Save a reference to some core methods
68 toString = Object.prototype.toString,
69 hasOwnProperty = Object.prototype.hasOwnProperty,
70 push = Array.prototype.push,
71 slice = Array.prototype.slice,
72 indexOf = Array.prototype.indexOf;
73
74jQuery.fn = jQuery.prototype = {
75 init: function( selector, context ) {
76 var match, elem, ret, doc;
77
78 // Handle $(""), $(null), or $(undefined)
79 if ( !selector ) {
80 return this;
81 }
82
83 // Handle $(DOMElement)
84 if ( selector.nodeType ) {
85 this.context = this[0] = selector;
86 this.length = 1;
87 return this;
88 }
89
90 // The body element only exists once, optimize finding it
91 if ( selector === "body" && !context ) {
92 this.context = document;
93 this[0] = document.body;
94 this.selector = "body";
95 this.length = 1;
96 return this;
97 }
98
99 // Handle HTML strings
100 if ( typeof selector === "string" ) {
101 // Are we dealing with HTML string or an ID?
102 match = quickExpr.exec( selector );
103
104 // Verify a match, and that no context was specified for #id
105 if ( match && (match[1] || !context) ) {
106
107 // HANDLE: $(html) -> $(array)
108 if ( match[1] ) {
109 doc = (context ? context.ownerDocument || context : document);
110
111 // If a single string is passed in and it's a single tag
112 // just do a createElement and skip the rest
113 ret = rsingleTag.exec( selector );
114
115 if ( ret ) {
116 if ( jQuery.isPlainObject( context ) ) {
117 selector = [ document.createElement( ret[1] ) ];
118 jQuery.fn.attr.call( selector, context, true );
119
120 } else {
121 selector = [ doc.createElement( ret[1] ) ];
122 }
123
124 } else {
125 ret = buildFragment( [ match[1] ], [ doc ] );
126 selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
127 }
128
129 return jQuery.merge( this, selector );
130
131 // HANDLE: $("#id")
132 } else {
133 elem = document.getElementById( match[2] );
134
135 if ( elem ) {
136 // Handle the case where IE and Opera return items
137 // by name instead of ID
138 if ( elem.id !== match[2] ) {
139 return rootjQuery.find( selector );
140 }
141
142 // Otherwise, we inject the element directly into the jQuery object
143 this.length = 1;
144 this[0] = elem;
145 }
146
147 this.context = document;
148 this.selector = selector;
149 return this;
150 }
151
152 // HANDLE: $("TAG")
153 } else if ( !context && /^\w+$/.test( selector ) ) {
154 this.selector = selector;
155 this.context = document;
156 selector = document.getElementsByTagName( selector );
157 return jQuery.merge( this, selector );
158
159 // HANDLE: $(expr, $(...))
160 } else if ( !context || context.jquery ) {
161 return (context || rootjQuery).find( selector );
162
163 // HANDLE: $(expr, context)
164 // (which is just equivalent to: $(context).find(expr)
165 } else {
166 return jQuery( context ).find( selector );
167 }
168
169 // HANDLE: $(function)
170 // Shortcut for document ready
171 } else if ( jQuery.isFunction( selector ) ) {
172 return rootjQuery.ready( selector );
173 }
174
175 if (selector.selector !== undefined) {
176 this.selector = selector.selector;
177 this.context = selector.context;
178 }
179
180 return jQuery.makeArray( selector, this );
181 },
182
183 // Start with an empty selector
184 selector: "",
185
186 // The current version of jQuery being used
187 jquery: "1.4.2",
188
189 // The default length of a jQuery object is 0
190 length: 0,
191
192 // The number of elements contained in the matched element set
193 size: function() {
194 return this.length;
195 },
196
197 toArray: function() {
198 return slice.call( this, 0 );
199 },
200
201 // Get the Nth element in the matched element set OR
202 // Get the whole matched element set as a clean array
203 get: function( num ) {
204 return num == null ?
205
206 // Return a 'clean' array
207 this.toArray() :
208
209 // Return just the object
210 ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
211 },
212
213 // Take an array of elements and push it onto the stack
214 // (returning the new matched element set)
215 pushStack: function( elems, name, selector ) {
216 // Build a new jQuery matched element set
217 var ret = jQuery();
218
219 if ( jQuery.isArray( elems ) ) {
220 push.apply( ret, elems );
221
222 } else {
223 jQuery.merge( ret, elems );
224 }
225
226 // Add the old object onto the stack (as a reference)
227 ret.prevObject = this;
228
229 ret.context = this.context;
230
231 if ( name === "find" ) {
232 ret.selector = this.selector + (this.selector ? " " : "") + selector;
233 } else if ( name ) {
234 ret.selector = this.selector + "." + name + "(" + selector + ")";
235 }
236
237 // Return the newly-formed element set
238 return ret;
239 },
240
241 // Execute a callback for every element in the matched set.
242 // (You can seed the arguments with an array of args, but this is
243 // only used internally.)
244 each: function( callback, args ) {
245 return jQuery.each( this, callback, args );
246 },
247
248 ready: function( fn ) {
249 // Attach the listeners
250 jQuery.bindReady();
251
252 // If the DOM is already ready
253 if ( jQuery.isReady ) {
254 // Execute the function immediately
255 fn.call( document, jQuery );
256
257 // Otherwise, remember the function for later
258 } else if ( readyList ) {
259 // Add the function to the wait list
260 readyList.push( fn );
261 }
262
263 return this;
264 },
265
266 eq: function( i ) {
267 return i === -1 ?
268 this.slice( i ) :
269 this.slice( i, +i + 1 );
270 },
271
272 first: function() {
273 return this.eq( 0 );
274 },
275
276 last: function() {
277 return this.eq( -1 );
278 },
279
280 slice: function() {
281 return this.pushStack( slice.apply( this, arguments ),
282 "slice", slice.call(arguments).join(",") );
283 },
284
285 map: function( callback ) {
286 return this.pushStack( jQuery.map(this, function( elem, i ) {
287 return callback.call( elem, i, elem );
288 }));
289 },
290
291 end: function() {
292 return this.prevObject || jQuery(null);
293 },
294
295 // For internal use only.
296 // Behaves like an Array's method, not like a jQuery method.
297 push: push,
298 sort: [].sort,
299 splice: [].splice
300};
301
302// Give the init function the jQuery prototype for later instantiation
303jQuery.fn.init.prototype = jQuery.fn;
304
305jQuery.extend = jQuery.fn.extend = function() {
306 // copy reference to target object
307 var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
308
309 // Handle a deep copy situation
310 if ( typeof target === "boolean" ) {
311 deep = target;
312 target = arguments[1] || {};
313 // skip the boolean and the target
314 i = 2;
315 }
316
317 // Handle case when target is a string or something (possible in deep copy)
318 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
319 target = {};
320 }
321
322 // extend jQuery itself if only one argument is passed
323 if ( length === i ) {
324 target = this;
325 --i;
326 }
327
328 for ( ; i < length; i++ ) {
329 // Only deal with non-null/undefined values
330 if ( (options = arguments[ i ]) != null ) {
331 // Extend the base object
332 for ( name in options ) {
333 src = target[ name ];
334 copy = options[ name ];
335
336 // Prevent never-ending loop
337 if ( target === copy ) {
338 continue;
339 }
340
341 // Recurse if we're merging object literal values or arrays
342 if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
343 var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
344 : jQuery.isArray(copy) ? [] : {};
345
346 // Never move original objects, clone them
347 target[ name ] = jQuery.extend( deep, clone, copy );
348
349 // Don't bring in undefined values
350 } else if ( copy !== undefined ) {
351 target[ name ] = copy;
352 }
353 }
354 }
355 }
356
357 // Return the modified object
358 return target;
359};
360
361jQuery.extend({
362 noConflict: function( deep ) {
363 window.$ = _$;
364
365 if ( deep ) {
366 window.jQuery = _jQuery;
367 }
368
369 return jQuery;
370 },
371
372 // Is the DOM ready to be used? Set to true once it occurs.
373 isReady: false,
374
375 // Handle when the DOM is ready
376 ready: function() {
377 // Make sure that the DOM is not already loaded
378 if ( !jQuery.isReady ) {
379 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
380 if ( !document.body ) {
381 return setTimeout( jQuery.ready, 13 );
382 }
383
384 // Remember that the DOM is ready
385 jQuery.isReady = true;
386
387 // If there are functions bound, to execute
388 if ( readyList ) {
389 // Execute all of them
390 var fn, i = 0;
391 while ( (fn = readyList[ i++ ]) ) {
392 fn.call( document, jQuery );
393 }
394
395 // Reset the list of functions
396 readyList = null;
397 }
398
399 // Trigger any bound ready events
400 if ( jQuery.fn.triggerHandler ) {
401 jQuery( document ).triggerHandler( "ready" );
402 }
403 }
404 },
405
406 bindReady: function() {
407 if ( readyBound ) {
408 return;
409 }
410
411 readyBound = true;
412
413 // Catch cases where $(document).ready() is called after the
414 // browser event has already occurred.
415 if ( document.readyState === "complete" ) {
416 return jQuery.ready();
417 }
418
419 // Mozilla, Opera and webkit nightlies currently support this event
420 if ( document.addEventListener ) {
421 // Use the handy event callback
422 document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
423
424 // A fallback to window.onload, that will always work
425 window.addEventListener( "load", jQuery.ready, false );
426
427 // If IE event model is used
428 } else if ( document.attachEvent ) {
429 // ensure firing before onload,
430 // maybe late but safe also for iframes
431 document.attachEvent("onreadystatechange", DOMContentLoaded);
432
433 // A fallback to window.onload, that will always work
434 window.attachEvent( "onload", jQuery.ready );
435
436 // If IE and not a frame
437 // continually check to see if the document is ready
438 var toplevel = false;
439
440 try {
441 toplevel = window.frameElement == null;
442 } catch(e) {}
443
444 if ( document.documentElement.doScroll && toplevel ) {
445 doScrollCheck();
446 }
447 }
448 },
449
450 // See test/unit/core.js for details concerning isFunction.
451 // Since version 1.3, DOM methods and functions like alert
452 // aren't supported. They return false on IE (#2968).
453 isFunction: function( obj ) {
454 return toString.call(obj) === "[object Function]";
455 },
456
457 isArray: function( obj ) {
458 return toString.call(obj) === "[object Array]";
459 },
460
461 isPlainObject: function( obj ) {
462 // Must be an Object.
463 // Because of IE, we also have to check the presence of the constructor property.
464 // Make sure that DOM nodes and window objects don't pass through, as well
465 if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
466 return false;
467 }
468
469 // Not own constructor property must be Object
470 if ( obj.constructor
471 && !hasOwnProperty.call(obj, "constructor")
472 && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
473 return false;
474 }
475
476 // Own properties are enumerated firstly, so to speed up,
477 // if last one is own, then all properties are own.
478
479 var key;
480 for ( key in obj ) {}
481
482 return key === undefined || hasOwnProperty.call( obj, key );
483 },
484
485 isEmptyObject: function( obj ) {
486 for ( var name in obj ) {
487 return false;
488 }
489 return true;
490 },
491
492 error: function( msg ) {
493 throw msg;
494 },
495
496 parseJSON: function( data ) {
497 if ( typeof data !== "string" || !data ) {
498 return null;
499 }
500
501 // Make sure leading/trailing whitespace is removed (IE can't handle it)
502 data = jQuery.trim( data );
503
504 // Make sure the incoming data is actual JSON
505 // Logic borrowed from http://json.org/json2.js
506 if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
507 .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
508 .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
509
510 // Try to use the native JSON parser first
511 return window.JSON && window.JSON.parse ?
512 window.JSON.parse( data ) :
513 (new Function("return " + data))();
514
515 } else {
516 jQuery.error( "Invalid JSON: " + data );
517 }
518 },
519
520 noop: function() {},
521
522 // Evalulates a script in a global context
523 globalEval: function( data ) {
524 if ( data && rnotwhite.test(data) ) {
525 // Inspired by code by Andrea Giammarchi
526 // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
527 var head = document.getElementsByTagName("head")[0] || document.documentElement,
528 script = document.createElement("script");
529
530 script.type = "text/javascript";
531
532 if ( jQuery.support.scriptEval ) {
533 script.appendChild( document.createTextNode( data ) );
534 } else {
535 script.text = data;
536 }
537
538 // Use insertBefore instead of appendChild to circumvent an IE6 bug.
539 // This arises when a base node is used (#2709).
540 head.insertBefore( script, head.firstChild );
541 head.removeChild( script );
542 }
543 },
544
545 nodeName: function( elem, name ) {
546 return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
547 },
548
549 // args is for internal usage only
550 each: function( object, callback, args ) {
551 var name, i = 0,
552 length = object.length,
553 isObj = length === undefined || jQuery.isFunction(object);
554
555 if ( args ) {
556 if ( isObj ) {
557 for ( name in object ) {
558 if ( callback.apply( object[ name ], args ) === false ) {
559 break;
560 }
561 }
562 } else {
563 for ( ; i < length; ) {
564 if ( callback.apply( object[ i++ ], args ) === false ) {
565 break;
566 }
567 }
568 }
569
570 // A special, fast, case for the most common use of each
571 } else {
572 if ( isObj ) {
573 for ( name in object ) {
574 if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
575 break;
576 }
577 }
578 } else {
579 for ( var value = object[0];
580 i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
581 }
582 }
583
584 return object;
585 },
586
587 trim: function( text ) {
588 return (text || "").replace( rtrim, "" );
589 },
590
591 // results is for internal usage only
592 makeArray: function( array, results ) {
593 var ret = results || [];
594
595 if ( array != null ) {
596 // The window, strings (and functions) also have 'length'
597 // The extra typeof function check is to prevent crashes
598 // in Safari 2 (See: #3039)
599 if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
600 push.call( ret, array );
601 } else {
602 jQuery.merge( ret, array );
603 }
604 }
605
606 return ret;
607 },
608
609 inArray: function( elem, array ) {
610 if ( array.indexOf ) {
611 return array.indexOf( elem );
612 }
613
614 for ( var i = 0, length = array.length; i < length; i++ ) {
615 if ( array[ i ] === elem ) {
616 return i;
617 }
618 }
619
620 return -1;
621 },
622
623 merge: function( first, second ) {
624 var i = first.length, j = 0;
625
626 if ( typeof second.length === "number" ) {
627 for ( var l = second.length; j < l; j++ ) {
628 first[ i++ ] = second[ j ];
629 }
630
631 } else {
632 while ( second[j] !== undefined ) {
633 first[ i++ ] = second[ j++ ];
634 }
635 }
636
637 first.length = i;
638
639 return first;
640 },
641
642 grep: function( elems, callback, inv ) {
643 var ret = [];
644
645 // Go through the array, only saving the items
646 // that pass the validator function
647 for ( var i = 0, length = elems.length; i < length; i++ ) {
648 if ( !inv !== !callback( elems[ i ], i ) ) {
649 ret.push( elems[ i ] );
650 }
651 }
652
653 return ret;
654 },
655
656 // arg is for internal usage only
657 map: function( elems, callback, arg ) {
658 var ret = [], value;
659
660 // Go through the array, translating each of the items to their
661 // new value (or values).
662 for ( var i = 0, length = elems.length; i < length; i++ ) {
663 value = callback( elems[ i ], i, arg );
664
665 if ( value != null ) {
666 ret[ ret.length ] = value;
667 }
668 }
669
670 return ret.concat.apply( [], ret );
671 },
672
673 // A global GUID counter for objects
674 guid: 1,
675
676 proxy: function( fn, proxy, thisObject ) {
677 if ( arguments.length === 2 ) {
678 if ( typeof proxy === "string" ) {
679 thisObject = fn;
680 fn = thisObject[ proxy ];
681 proxy = undefined;
682
683 } else if ( proxy && !jQuery.isFunction( proxy ) ) {
684 thisObject = proxy;
685 proxy = undefined;
686 }
687 }
688
689 if ( !proxy && fn ) {
690 proxy = function() {
691 return fn.apply( thisObject || this, arguments );
692 };
693 }
694
695 // Set the guid of unique handler to the same of original handler, so it can be removed
696 if ( fn ) {
697 proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
698 }
699
700 // So proxy can be declared as an argument
701 return proxy;
702 },
703
704 // Use of jQuery.browser is frowned upon.
705 // More details: http://docs.jquery.com/Utilities/jQuery.browser
706 uaMatch: function( ua ) {
707 ua = ua.toLowerCase();
708
709 var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
710 /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
711 /(msie) ([\w.]+)/.exec( ua ) ||
712 !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
713 [];
714
715 return { browser: match[1] || "", version: match[2] || "0" };
716 },
717
718 browser: {}
719});
720
721browserMatch = jQuery.uaMatch( userAgent );
722if ( browserMatch.browser ) {
723 jQuery.browser[ browserMatch.browser ] = true;
724 jQuery.browser.version = browserMatch.version;
725}
726
727// Deprecated, use jQuery.browser.webkit instead
728if ( jQuery.browser.webkit ) {
729 jQuery.browser.safari = true;
730}
731
732if ( indexOf ) {
733 jQuery.inArray = function( elem, array ) {
734 return indexOf.call( array, elem );
735 };
736}
737
738// All jQuery objects should point back to these
739rootjQuery = jQuery(document);
740
741// Cleanup functions for the document ready method
742if ( document.addEventListener ) {
743 DOMContentLoaded = function() {
744 document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
745 jQuery.ready();
746 };
747
748} else if ( document.attachEvent ) {
749 DOMContentLoaded = function() {
750 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
751 if ( document.readyState === "complete" ) {
752 document.detachEvent( "onreadystatechange", DOMContentLoaded );
753 jQuery.ready();
754 }
755 };
756}
757
758// The DOM ready check for Internet Explorer
759function doScrollCheck() {
760 if ( jQuery.isReady ) {
761 return;
762 }
763
764 try {
765 // If IE is used, use the trick by Diego Perini
766 // http://javascript.nwbox.com/IEContentLoaded/
767 document.documentElement.doScroll("left");
768 } catch( error ) {
769 setTimeout( doScrollCheck, 1 );
770 return;
771 }
772
773 // and execute any waiting functions
774 jQuery.ready();
775}
776
777function evalScript( i, elem ) {
778 if ( elem.src ) {
779 jQuery.ajax({
780 url: elem.src,
781 async: false,
782 dataType: "script"
783 });
784 } else {
785 jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
786 }
787
788 if ( elem.parentNode ) {
789 elem.parentNode.removeChild( elem );
790 }
791}
792
793// Mutifunctional method to get and set values to a collection
794// The value/s can be optionally by executed if its a function
795function access( elems, key, value, exec, fn, pass ) {
796 var length = elems.length;
797
798 // Setting many attributes
799 if ( typeof key === "object" ) {
800 for ( var k in key ) {
801 access( elems, k, key[k], exec, fn, value );
802 }
803 return elems;
804 }
805
806 // Setting one attribute
807 if ( value !== undefined ) {
808 // Optionally, function values get executed if exec is true
809 exec = !pass && exec && jQuery.isFunction(value);
810
811 for ( var i = 0; i < length; i++ ) {
812 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
813 }
814
815 return elems;
816 }
817
818 // Getting an attribute
819 return length ? fn( elems[0], key ) : undefined;
820}
821
822function now() {
823 return (new Date).getTime();
824}
825(function() {
826
827 jQuery.support = {};
828
829 var root = document.documentElement,
830 script = document.createElement("script"),
831 div = document.createElement("div"),
832 id = "script" + now();
833
834 div.style.display = "none";
835 div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
836
837 var all = div.getElementsByTagName("*"),
838 a = div.getElementsByTagName("a")[0];
839
840 // Can't get basic test support
841 if ( !all || !all.length || !a ) {
842 return;
843 }
844
845 jQuery.support = {
846 // IE strips leading whitespace when .innerHTML is used
847 leadingWhitespace: div.firstChild.nodeType === 3,
848
849 // Make sure that tbody elements aren't automatically inserted
850 // IE will insert them into empty tables
851 tbody: !div.getElementsByTagName("tbody").length,
852
853 // Make sure that link elements get serialized correctly by innerHTML
854 // This requires a wrapper element in IE
855 htmlSerialize: !!div.getElementsByTagName("link").length,
856
857 // Get the style information from getAttribute
858 // (IE uses .cssText insted)
859 style: /red/.test( a.getAttribute("style") ),
860
861 // Make sure that URLs aren't manipulated
862 // (IE normalizes it by default)
863 hrefNormalized: a.getAttribute("href") === "/a",
864
865 // Make sure that element opacity exists
866 // (IE uses filter instead)
867 // Use a regex to work around a WebKit issue. See #5145
868 opacity: /^0.55$/.test( a.style.opacity ),
869
870 // Verify style float existence
871 // (IE uses styleFloat instead of cssFloat)
872 cssFloat: !!a.style.cssFloat,
873
874 // Make sure that if no value is specified for a checkbox
875 // that it defaults to "on".
876 // (WebKit defaults to "" instead)
877 checkOn: div.getElementsByTagName("input")[0].value === "on",
878
879 // Make sure that a selected-by-default option has a working selected property.
880 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
881 optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
882
883 parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
884
885 // Will be defined later
886 deleteExpando: true,
887 checkClone: false,
888 scriptEval: false,
889 noCloneEvent: true,
890 boxModel: null
891 };
892
893 script.type = "text/javascript";
894 try {
895 script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
896 } catch(e) {}
897
898 root.insertBefore( script, root.firstChild );
899
900 // Make sure that the execution of code works by injecting a script
901 // tag with appendChild/createTextNode
902 // (IE doesn't support this, fails, and uses .text instead)
903 if ( window[ id ] ) {
904 jQuery.support.scriptEval = true;
905 delete window[ id ];
906 }
907
908 // Test to see if it's possible to delete an expando from an element
909 // Fails in Internet Explorer
910 try {
911 delete script.test;
912
913 } catch(e) {
914 jQuery.support.deleteExpando = false;
915 }
916
917 root.removeChild( script );
918
919 if ( div.attachEvent && div.fireEvent ) {
920 div.attachEvent("onclick", function click() {
921 // Cloning a node shouldn't copy over any
922 // bound event handlers (IE does this)
923 jQuery.support.noCloneEvent = false;
924 div.detachEvent("onclick", click);
925 });
926 div.cloneNode(true).fireEvent("onclick");
927 }
928
929 div = document.createElement("div");
930 div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
931
932 var fragment = document.createDocumentFragment();
933 fragment.appendChild( div.firstChild );
934
935 // WebKit doesn't clone checked state correctly in fragments
936 jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
937
938 // Figure out if the W3C box model works as expected
939 // document.body must exist before we can do this
940 jQuery(function() {
941 var div = document.createElement("div");
942 div.style.width = div.style.paddingLeft = "1px";
943
944 document.body.appendChild( div );
945 jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
946 document.body.removeChild( div ).style.display = 'none';
947
948 div = null;
949 });
950
951 // Technique from Juriy Zaytsev
952 // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
953 var eventSupported = function( eventName ) {
954 var el = document.createElement("div");
955 eventName = "on" + eventName;
956
957 var isSupported = (eventName in el);
958 if ( !isSupported ) {
959 el.setAttribute(eventName, "return;");
960 isSupported = typeof el[eventName] === "function";
961 }
962 el = null;
963
964 return isSupported;
965 };
966
967 jQuery.support.submitBubbles = eventSupported("submit");
968 jQuery.support.changeBubbles = eventSupported("change");
969
970 // release memory in IE
971 root = script = div = all = a = null;
972})();
973
974jQuery.props = {
975 "for": "htmlFor",
976 "class": "className",
977 readonly: "readOnly",
978 maxlength: "maxLength",
979 cellspacing: "cellSpacing",
980 rowspan: "rowSpan",
981 colspan: "colSpan",
982 tabindex: "tabIndex",
983 usemap: "useMap",
984 frameborder: "frameBorder"
985};
986var expando = "jQuery" + now(), uuid = 0, windowData = {};
987
988jQuery.extend({
989 cache: {},
990
991 expando:expando,
992
993 // The following elements throw uncatchable exceptions if you
994 // attempt to add expando properties to them.
995 noData: {
996 "embed": true,
997 "object": true,
998 "applet": true
999 },
1000
1001 data: function( elem, name, data ) {
1002 if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
1003 return;
1004 }
1005
1006 elem = elem == window ?
1007 windowData :
1008 elem;
1009
1010 var id = elem[ expando ], cache = jQuery.cache, thisCache;
1011
1012 if ( !id && typeof name === "string" && data === undefined ) {
1013 return null;
1014 }
1015
1016 // Compute a unique ID for the element
1017 if ( !id ) {
1018 id = ++uuid;
1019 }
1020
1021 // Avoid generating a new cache unless none exists and we
1022 // want to manipulate it.
1023 if ( typeof name === "object" ) {
1024 elem[ expando ] = id;
1025 thisCache = cache[ id ] = jQuery.extend(true, {}, name);
1026
1027 } else if ( !cache[ id ] ) {
1028 elem[ expando ] = id;
1029 cache[ id ] = {};
1030 }
1031
1032 thisCache = cache[ id ];
1033
1034 // Prevent overriding the named cache with undefined values
1035 if ( data !== undefined ) {
1036 thisCache[ name ] = data;
1037 }
1038
1039 return typeof name === "string" ? thisCache[ name ] : thisCache;
1040 },
1041
1042 removeData: function( elem, name ) {
1043 if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
1044 return;
1045 }
1046
1047 elem = elem == window ?
1048 windowData :
1049 elem;
1050
1051 var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
1052
1053 // If we want to remove a specific section of the element's data
1054 if ( name ) {
1055 if ( thisCache ) {
1056 // Remove the section of cache data
1057 delete thisCache[ name ];
1058
1059 // If we've removed all the data, remove the element's cache
1060 if ( jQuery.isEmptyObject(thisCache) ) {
1061 jQuery.removeData( elem );
1062 }
1063 }
1064
1065 // Otherwise, we want to remove all of the element's data
1066 } else {
1067 if ( jQuery.support.deleteExpando ) {
1068 delete elem[ jQuery.expando ];
1069
1070 } else if ( elem.removeAttribute ) {
1071 elem.removeAttribute( jQuery.expando );
1072 }
1073
1074 // Completely remove the data cache
1075 delete cache[ id ];
1076 }
1077 }
1078});
1079
1080jQuery.fn.extend({
1081 data: function( key, value ) {
1082 if ( typeof key === "undefined" && this.length ) {
1083 return jQuery.data( this[0] );
1084
1085 } else if ( typeof key === "object" ) {
1086 return this.each(function() {
1087 jQuery.data( this, key );
1088 });
1089 }
1090
1091 var parts = key.split(".");
1092 parts[1] = parts[1] ? "." + parts[1] : "";
1093
1094 if ( value === undefined ) {
1095 var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1096
1097 if ( data === undefined && this.length ) {
1098 data = jQuery.data( this[0], key );
1099 }
1100 return data === undefined && parts[1] ?
1101 this.data( parts[0] ) :
1102 data;
1103 } else {
1104 return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
1105 jQuery.data( this, key, value );
1106 });
1107 }
1108 },
1109
1110 removeData: function( key ) {
1111 return this.each(function() {
1112 jQuery.removeData( this, key );
1113 });
1114 }
1115});
1116jQuery.extend({
1117 queue: function( elem, type, data ) {
1118 if ( !elem ) {
1119 return;
1120 }
1121
1122 type = (type || "fx") + "queue";
1123 var q = jQuery.data( elem, type );
1124
1125 // Speed up dequeue by getting out quickly if this is just a lookup
1126 if ( !data ) {
1127 return q || [];
1128 }
1129
1130 if ( !q || jQuery.isArray(data) ) {
1131 q = jQuery.data( elem, type, jQuery.makeArray(data) );
1132
1133 } else {
1134 q.push( data );
1135 }
1136
1137 return q;
1138 },
1139
1140 dequeue: function( elem, type ) {
1141 type = type || "fx";
1142
1143 var queue = jQuery.queue( elem, type ), fn = queue.shift();
1144
1145 // If the fx queue is dequeued, always remove the progress sentinel
1146 if ( fn === "inprogress" ) {
1147 fn = queue.shift();
1148 }
1149
1150 if ( fn ) {
1151 // Add a progress sentinel to prevent the fx queue from being
1152 // automatically dequeued
1153 if ( type === "fx" ) {
1154 queue.unshift("inprogress");
1155 }
1156
1157 fn.call(elem, function() {
1158 jQuery.dequeue(elem, type);
1159 });
1160 }
1161 }
1162});
1163
1164jQuery.fn.extend({
1165 queue: function( type, data ) {
1166 if ( typeof type !== "string" ) {
1167 data = type;
1168 type = "fx";
1169 }
1170
1171 if ( data === undefined ) {
1172 return jQuery.queue( this[0], type );
1173 }
1174 return this.each(function( i, elem ) {
1175 var queue = jQuery.queue( this, type, data );
1176
1177 if ( type === "fx" && queue[0] !== "inprogress" ) {
1178 jQuery.dequeue( this, type );
1179 }
1180 });
1181 },
1182 dequeue: function( type ) {
1183 return this.each(function() {
1184 jQuery.dequeue( this, type );
1185 });
1186 },
1187
1188 // Based off of the plugin by Clint Helfers, with permission.
1189 // http://blindsignals.com/index.php/2009/07/jquery-delay/
1190 delay: function( time, type ) {
1191 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
1192 type = type || "fx";
1193
1194 return this.queue( type, function() {
1195 var elem = this;
1196 setTimeout(function() {
1197 jQuery.dequeue( elem, type );
1198 }, time );
1199 });
1200 },
1201
1202 clearQueue: function( type ) {
1203 return this.queue( type || "fx", [] );
1204 }
1205});
1206var rclass = /[\n\t]/g,
1207 rspace = /\s+/,
1208 rreturn = /\r/g,
1209 rspecialurl = /href|src|style/,
1210 rtype = /(button|input)/i,
1211 rfocusable = /(button|input|object|select|textarea)/i,
1212 rclickable = /^(a|area)$/i,
1213 rradiocheck = /radio|checkbox/;
1214
1215jQuery.fn.extend({
1216 attr: function( name, value ) {
1217 return access( this, name, value, true, jQuery.attr );
1218 },
1219
1220 removeAttr: function( name, fn ) {
1221 return this.each(function(){
1222 jQuery.attr( this, name, "" );
1223 if ( this.nodeType === 1 ) {
1224 this.removeAttribute( name );
1225 }
1226 });
1227 },
1228
1229 addClass: function( value ) {
1230 if ( jQuery.isFunction(value) ) {
1231 return this.each(function(i) {
1232 var self = jQuery(this);
1233 self.addClass( value.call(this, i, self.attr("class")) );
1234 });
1235 }
1236
1237 if ( value && typeof value === "string" ) {
1238 var classNames = (value || "").split( rspace );
1239
1240 for ( var i = 0, l = this.length; i < l; i++ ) {
1241 var elem = this[i];
1242
1243 if ( elem.nodeType === 1 ) {
1244 if ( !elem.className ) {
1245 elem.className = value;
1246
1247 } else {
1248 var className = " " + elem.className + " ", setClass = elem.className;
1249 for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1250 if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1251 setClass += " " + classNames[c];
1252 }
1253 }
1254 elem.className = jQuery.trim( setClass );
1255 }
1256 }
1257 }
1258 }
1259
1260 return this;
1261 },
1262
1263 removeClass: function( value ) {
1264 if ( jQuery.isFunction(value) ) {
1265 return this.each(function(i) {
1266 var self = jQuery(this);
1267 self.removeClass( value.call(this, i, self.attr("class")) );
1268 });
1269 }
1270
1271 if ( (value && typeof value === "string") || value === undefined ) {
1272 var classNames = (value || "").split(rspace);
1273
1274 for ( var i = 0, l = this.length; i < l; i++ ) {
1275 var elem = this[i];
1276
1277 if ( elem.nodeType === 1 && elem.className ) {
1278 if ( value ) {
1279 var className = (" " + elem.className + " ").replace(rclass, " ");
1280 for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1281 className = className.replace(" " + classNames[c] + " ", " ");
1282 }
1283 elem.className = jQuery.trim( className );
1284
1285 } else {
1286 elem.className = "";
1287 }
1288 }
1289 }
1290 }
1291
1292 return this;
1293 },
1294
1295 toggleClass: function( value, stateVal ) {
1296 var type = typeof value, isBool = typeof stateVal === "boolean";
1297
1298 if ( jQuery.isFunction( value ) ) {
1299 return this.each(function(i) {
1300 var self = jQuery(this);
1301 self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
1302 });
1303 }
1304
1305 return this.each(function() {
1306 if ( type === "string" ) {
1307 // toggle individual class names
1308 var className, i = 0, self = jQuery(this),
1309 state = stateVal,
1310 classNames = value.split( rspace );
1311
1312 while ( (className = classNames[ i++ ]) ) {
1313 // check each className given, space seperated list
1314 state = isBool ? state : !self.hasClass( className );
1315 self[ state ? "addClass" : "removeClass" ]( className );
1316 }
1317
1318 } else if ( type === "undefined" || type === "boolean" ) {
1319 if ( this.className ) {
1320 // store className if set
1321 jQuery.data( this, "__className__", this.className );
1322 }
1323
1324 // toggle whole className
1325 this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
1326 }
1327 });
1328 },
1329
1330 hasClass: function( selector ) {
1331 var className = " " + selector + " ";
1332 for ( var i = 0, l = this.length; i < l; i++ ) {
1333 if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
1334 return true;
1335 }
1336 }
1337
1338 return false;
1339 },
1340
1341 val: function( value ) {
1342 if ( value === undefined ) {
1343 var elem = this[0];
1344
1345 if ( elem ) {
1346 if ( jQuery.nodeName( elem, "option" ) ) {
1347 return (elem.attributes.value || {}).specified ? elem.value : elem.text;
1348 }
1349
1350 // We need to handle select boxes special
1351 if ( jQuery.nodeName( elem, "select" ) ) {
1352 var index = elem.selectedIndex,
1353 values = [],
1354 options = elem.options,
1355 one = elem.type === "select-one";
1356
1357 // Nothing was selected
1358 if ( index < 0 ) {
1359 return null;
1360 }
1361
1362 // Loop through all the selected options
1363 for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1364 var option = options[ i ];
1365
1366 if ( option.selected ) {
1367 // Get the specifc value for the option
1368 value = jQuery(option).val();
1369
1370 // We don't need an array for one selects
1371 if ( one ) {
1372 return value;
1373 }
1374
1375 // Multi-Selects return an array
1376 values.push( value );
1377 }
1378 }
1379
1380 return values;
1381 }
1382
1383 // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1384 if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
1385 return elem.getAttribute("value") === null ? "on" : elem.value;
1386 }
1387
1388
1389 // Everything else, we just grab the value
1390 return (elem.value || "").replace(rreturn, "");
1391
1392 }
1393
1394 return undefined;
1395 }
1396
1397 var isFunction = jQuery.isFunction(value);
1398
1399 return this.each(function(i) {
1400 var self = jQuery(this), val = value;
1401
1402 if ( this.nodeType !== 1 ) {
1403 return;
1404 }
1405
1406 if ( isFunction ) {
1407 val = value.call(this, i, self.val());
1408 }
1409
1410 // Typecast each time if the value is a Function and the appended
1411 // value is therefore different each time.
1412 if ( typeof val === "number" ) {
1413 val += "";
1414 }
1415
1416 if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
1417 this.checked = jQuery.inArray( self.val(), val ) >= 0;
1418
1419 } else if ( jQuery.nodeName( this, "select" ) ) {
1420 var values = jQuery.makeArray(val);
1421
1422 jQuery( "option", this ).each(function() {
1423 this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
1424 });
1425
1426 if ( !values.length ) {
1427 this.selectedIndex = -1;
1428 }
1429
1430 } else {
1431 this.value = val;
1432 }
1433 });
1434 }
1435});
1436
1437jQuery.extend({
1438 attrFn: {
1439 val: true,
1440 css: true,
1441 html: true,
1442 text: true,
1443 data: true,
1444 width: true,
1445 height: true,
1446 offset: true
1447 },
1448
1449 attr: function( elem, name, value, pass ) {
1450 // don't set attributes on text and comment nodes
1451 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1452 return undefined;
1453 }
1454
1455 if ( pass && name in jQuery.attrFn ) {
1456 return jQuery(elem)[name](value);
1457 }
1458
1459 var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
1460 // Whether we are setting (or getting)
1461 set = value !== undefined;
1462
1463 // Try to normalize/fix the name
1464 name = notxml && jQuery.props[ name ] || name;
1465
1466 // Only do all the following if this is a node (faster for style)
1467 if ( elem.nodeType === 1 ) {
1468 // These attributes require special treatment
1469 var special = rspecialurl.test( name );
1470
1471 // Safari mis-reports the default selected property of an option
1472 // Accessing the parent's selectedIndex property fixes it
1473 if ( name === "selected" && !jQuery.support.optSelected ) {
1474 var parent = elem.parentNode;
1475 if ( parent ) {
1476 parent.selectedIndex;
1477
1478 // Make sure that it also works with optgroups, see #5701
1479 if ( parent.parentNode ) {
1480 parent.parentNode.selectedIndex;
1481 }
1482 }
1483 }
1484
1485 // If applicable, access the attribute via the DOM 0 way
1486 if ( name in elem && notxml && !special ) {
1487 if ( set ) {
1488 // We can't allow the type property to be changed (since it causes problems in IE)
1489 if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
1490 jQuery.error( "type property can't be changed" );
1491 }
1492
1493 elem[ name ] = value;
1494 }
1495
1496 // browsers index elements by id/name on forms, give priority to attributes.
1497 if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
1498 return elem.getAttributeNode( name ).nodeValue;
1499 }
1500
1501 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1502 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1503 if ( name === "tabIndex" ) {
1504 var attributeNode = elem.getAttributeNode( "tabIndex" );
1505
1506 return attributeNode && attributeNode.specified ?
1507 attributeNode.value :
1508 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
1509 0 :
1510 undefined;
1511 }
1512
1513 return elem[ name ];
1514 }
1515
1516 if ( !jQuery.support.style && notxml && name === "style" ) {
1517 if ( set ) {
1518 elem.style.cssText = "" + value;
1519 }
1520
1521 return elem.style.cssText;
1522 }
1523
1524 if ( set ) {
1525 // convert the value to a string (all browsers do this but IE) see #1070
1526 elem.setAttribute( name, "" + value );
1527 }
1528
1529 var attr = !jQuery.support.hrefNormalized && notxml && special ?
1530 // Some attributes require a special call on IE
1531 elem.getAttribute( name, 2 ) :
1532 elem.getAttribute( name );
1533
1534 // Non-existent attributes return null, we normalize to undefined
1535 return attr === null ? undefined : attr;
1536 }
1537
1538 // elem is actually elem.style ... set the style
1539 // Using attr for specific style information is now deprecated. Use style instead.
1540 return jQuery.style( elem, name, value );
1541 }
1542});
1543var rnamespaces = /\.(.*)$/,
1544 fcleanup = function( nm ) {
1545 return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
1546 return "\\" + ch;
1547 });
1548 };
1549
1550/*
1551 * A number of helper functions used for managing events.
1552 * Many of the ideas behind this code originated from
1553 * Dean Edwards' addEvent library.
1554 */
1555jQuery.event = {
1556
1557 // Bind an event to an element
1558 // Original by Dean Edwards
1559 add: function( elem, types, handler, data ) {
1560 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1561 return;
1562 }
1563
1564 // For whatever reason, IE has trouble passing the window object
1565 // around, causing it to be cloned in the process
1566 if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
1567 elem = window;
1568 }
1569
1570 var handleObjIn, handleObj;
1571
1572 if ( handler.handler ) {
1573 handleObjIn = handler;
1574 handler = handleObjIn.handler;
1575 }
1576
1577 // Make sure that the function being executed has a unique ID
1578 if ( !handler.guid ) {
1579 handler.guid = jQuery.guid++;
1580 }
1581
1582 // Init the element's event structure
1583 var elemData = jQuery.data( elem );
1584
1585 // If no elemData is found then we must be trying to bind to one of the
1586 // banned noData elements
1587 if ( !elemData ) {
1588 return;
1589 }
1590
1591 var events = elemData.events = elemData.events || {},
1592 eventHandle = elemData.handle, eventHandle;
1593
1594 if ( !eventHandle ) {
1595 elemData.handle = eventHandle = function() {
1596 // Handle the second event of a trigger and when
1597 // an event is called after a page has unloaded
1598 return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
1599 jQuery.event.handle.apply( eventHandle.elem, arguments ) :
1600 undefined;
1601 };
1602 }
1603
1604 // Add elem as a property of the handle function
1605 // This is to prevent a memory leak with non-native events in IE.
1606 eventHandle.elem = elem;
1607
1608 // Handle multiple events separated by a space
1609 // jQuery(...).bind("mouseover mouseout", fn);
1610 types = types.split(" ");
1611
1612 var type, i = 0, namespaces;
1613
1614 while ( (type = types[ i++ ]) ) {
1615 handleObj = handleObjIn ?
1616 jQuery.extend({}, handleObjIn) :
1617 { handler: handler, data: data };
1618
1619 // Namespaced event handlers
1620 if ( type.indexOf(".") > -1 ) {
1621 namespaces = type.split(".");
1622 type = namespaces.shift();
1623 handleObj.namespace = namespaces.slice(0).sort().join(".");
1624
1625 } else {
1626 namespaces = [];
1627 handleObj.namespace = "";
1628 }
1629
1630 handleObj.type = type;
1631 handleObj.guid = handler.guid;
1632
1633 // Get the current list of functions bound to this event
1634 var handlers = events[ type ],
1635 special = jQuery.event.special[ type ] || {};
1636
1637 // Init the event handler queue
1638 if ( !handlers ) {
1639 handlers = events[ type ] = [];
1640
1641 // Check for a special event handler
1642 // Only use addEventListener/attachEvent if the special
1643 // events handler returns false
1644 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
1645 // Bind the global event handler to the element
1646 if ( elem.addEventListener ) {
1647 elem.addEventListener( type, eventHandle, false );
1648
1649 } else if ( elem.attachEvent ) {
1650 elem.attachEvent( "on" + type, eventHandle );
1651 }
1652 }
1653 }
1654
1655 if ( special.add ) {
1656 special.add.call( elem, handleObj );
1657
1658 if ( !handleObj.handler.guid ) {
1659 handleObj.handler.guid = handler.guid;
1660 }
1661 }
1662
1663 // Add the function to the element's handler list
1664 handlers.push( handleObj );
1665
1666 // Keep track of which events have been used, for global triggering
1667 jQuery.event.global[ type ] = true;
1668 }
1669
1670 // Nullify elem to prevent memory leaks in IE
1671 elem = null;
1672 },
1673
1674 global: {},
1675
1676 // Detach an event or set of events from an element
1677 remove: function( elem, types, handler, pos ) {
1678 // don't do events on text and comment nodes
1679 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1680 return;
1681 }
1682
1683 var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
1684 elemData = jQuery.data( elem ),
1685 events = elemData && elemData.events;
1686
1687 if ( !elemData || !events ) {
1688 return;
1689 }
1690
1691 // types is actually an event object here
1692 if ( types && types.type ) {
1693 handler = types.handler;
1694 types = types.type;
1695 }
1696
1697 // Unbind all events for the element
1698 if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
1699 types = types || "";
1700
1701 for ( type in events ) {
1702 jQuery.event.remove( elem, type + types );
1703 }
1704
1705 return;
1706 }
1707
1708 // Handle multiple events separated by a space
1709 // jQuery(...).unbind("mouseover mouseout", fn);
1710 types = types.split(" ");
1711
1712 while ( (type = types[ i++ ]) ) {
1713 origType = type;
1714 handleObj = null;
1715 all = type.indexOf(".") < 0;
1716 namespaces = [];
1717
1718 if ( !all ) {
1719 // Namespaced event handlers
1720 namespaces = type.split(".");
1721 type = namespaces.shift();
1722
1723 namespace = new RegExp("(^|\\.)" +
1724 jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
1725 }
1726
1727 eventType = events[ type ];
1728
1729 if ( !eventType ) {
1730 continue;
1731 }
1732
1733 if ( !handler ) {
1734 for ( var j = 0; j < eventType.length; j++ ) {
1735 handleObj = eventType[ j ];
1736
1737 if ( all || namespace.test( handleObj.namespace ) ) {
1738 jQuery.event.remove( elem, origType, handleObj.handler, j );
1739 eventType.splice( j--, 1 );
1740 }
1741 }
1742
1743 continue;
1744 }
1745
1746 special = jQuery.event.special[ type ] || {};
1747
1748 for ( var j = pos || 0; j < eventType.length; j++ ) {
1749 handleObj = eventType[ j ];
1750
1751 if ( handler.guid === handleObj.guid ) {
1752 // remove the given handler for the given type
1753 if ( all || namespace.test( handleObj.namespace ) ) {
1754 if ( pos == null ) {
1755 eventType.splice( j--, 1 );
1756 }
1757
1758 if ( special.remove ) {
1759 special.remove.call( elem, handleObj );
1760 }
1761 }
1762
1763 if ( pos != null ) {
1764 break;
1765 }
1766 }
1767 }
1768
1769 // remove generic event handler if no more handlers exist
1770 if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
1771 if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
1772 removeEvent( elem, type, elemData.handle );
1773 }
1774
1775 ret = null;
1776 delete events[ type ];
1777 }
1778 }
1779
1780 // Remove the expando if it's no longer used
1781 if ( jQuery.isEmptyObject( events ) ) {
1782 var handle = elemData.handle;
1783 if ( handle ) {
1784 handle.elem = null;
1785 }
1786
1787 delete elemData.events;
1788 delete elemData.handle;
1789
1790 if ( jQuery.isEmptyObject( elemData ) ) {
1791 jQuery.removeData( elem );
1792 }
1793 }
1794 },
1795
1796 // bubbling is internal
1797 trigger: function( event, data, elem /*, bubbling */ ) {
1798 // Event object or event type
1799 var type = event.type || event,
1800 bubbling = arguments[3];
1801
1802 if ( !bubbling ) {
1803 event = typeof event === "object" ?
1804 // jQuery.Event object
1805 event[expando] ? event :
1806 // Object literal
1807 jQuery.extend( jQuery.Event(type), event ) :
1808 // Just the event type (string)
1809 jQuery.Event(type);
1810
1811 if ( type.indexOf("!") >= 0 ) {
1812 event.type = type = type.slice(0, -1);
1813 event.exclusive = true;
1814 }
1815
1816 // Handle a global trigger
1817 if ( !elem ) {
1818 // Don't bubble custom events when global (to avoid too much overhead)
1819 event.stopPropagation();
1820
1821 // Only trigger if we've ever bound an event for it
1822 if ( jQuery.event.global[ type ] ) {
1823 jQuery.each( jQuery.cache, function() {
1824 if ( this.events && this.events[type] ) {
1825 jQuery.event.trigger( event, data, this.handle.elem );
1826 }
1827 });
1828 }
1829 }
1830
1831 // Handle triggering a single element
1832
1833 // don't do events on text and comment nodes
1834 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
1835 return undefined;
1836 }
1837
1838 // Clean up in case it is reused
1839 event.result = undefined;
1840 event.target = elem;
1841
1842 // Clone the incoming data, if any
1843 data = jQuery.makeArray( data );
1844 data.unshift( event );
1845 }
1846
1847 event.currentTarget = elem;
1848
1849 // Trigger the event, it is assumed that "handle" is a function
1850 var handle = jQuery.data( elem, "handle" );
1851 if ( handle ) {
1852 handle.apply( elem, data );
1853 }
1854
1855 var parent = elem.parentNode || elem.ownerDocument;
1856
1857 // Trigger an inline bound script
1858 try {
1859 if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
1860 if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
1861 event.result = false;
1862 }
1863 }
1864
1865 // prevent IE from throwing an error for some elements with some event types, see #3533
1866 } catch (e) {}
1867
1868 if ( !event.isPropagationStopped() && parent ) {
1869 jQuery.event.trigger( event, data, parent, true );
1870
1871 } else if ( !event.isDefaultPrevented() ) {
1872 var target = event.target, old,
1873 isClick = jQuery.nodeName(target, "a") && type === "click",
1874 special = jQuery.event.special[ type ] || {};
1875
1876 if ( (!special._default || special._default.call( elem, event ) === false) &&
1877 !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
1878
1879 try {
1880 if ( target[ type ] ) {
1881 // Make sure that we don't accidentally re-trigger the onFOO events
1882 old = target[ "on" + type ];
1883
1884 if ( old ) {
1885 target[ "on" + type ] = null;
1886 }
1887
1888 jQuery.event.triggered = true;
1889 target[ type ]();
1890 }
1891
1892 // prevent IE from throwing an error for some elements with some event types, see #3533
1893 } catch (e) {}
1894
1895 if ( old ) {
1896 target[ "on" + type ] = old;
1897 }
1898
1899 jQuery.event.triggered = false;
1900 }
1901 }
1902 },
1903
1904 handle: function( event ) {
1905 var all, handlers, namespaces, namespace, events;
1906
1907 event = arguments[0] = jQuery.event.fix( event || window.event );
1908 event.currentTarget = this;
1909
1910 // Namespaced event handlers
1911 all = event.type.indexOf(".") < 0 && !event.exclusive;
1912
1913 if ( !all ) {
1914 namespaces = event.type.split(".");
1915 event.type = namespaces.shift();
1916 namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
1917 }
1918
1919 var events = jQuery.data(this, "events"), handlers = events[ event.type ];
1920
1921 if ( events && handlers ) {
1922 // Clone the handlers to prevent manipulation
1923 handlers = handlers.slice(0);
1924
1925 for ( var j = 0, l = handlers.length; j < l; j++ ) {
1926 var handleObj = handlers[ j ];
1927
1928 // Filter the functions by class
1929 if ( all || namespace.test( handleObj.namespace ) ) {
1930 // Pass in a reference to the handler function itself
1931 // So that we can later remove it
1932 event.handler = handleObj.handler;
1933 event.data = handleObj.data;
1934 event.handleObj = handleObj;
1935
1936 var ret = handleObj.handler.apply( this, arguments );
1937
1938 if ( ret !== undefined ) {
1939 event.result = ret;
1940 if ( ret === false ) {
1941 event.preventDefault();
1942 event.stopPropagation();
1943 }
1944 }
1945
1946 if ( event.isImmediatePropagationStopped() ) {
1947 break;
1948 }
1949 }
1950 }
1951 }
1952
1953 return event.result;
1954 },
1955
1956 props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
1957
1958 fix: function( event ) {
1959 if ( event[ expando ] ) {
1960 return event;
1961 }
1962
1963 // store a copy of the original event object
1964 // and "clone" to set read-only properties
1965 var originalEvent = event;
1966 event = jQuery.Event( originalEvent );
1967
1968 for ( var i = this.props.length, prop; i; ) {
1969 prop = this.props[ --i ];
1970 event[ prop ] = originalEvent[ prop ];
1971 }
1972
1973 // Fix target property, if necessary
1974 if ( !event.target ) {
1975 event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
1976 }
1977
1978 // check if target is a textnode (safari)
1979 if ( event.target.nodeType === 3 ) {
1980 event.target = event.target.parentNode;
1981 }
1982
1983 // Add relatedTarget, if necessary
1984 if ( !event.relatedTarget && event.fromElement ) {
1985 event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
1986 }
1987
1988 // Calculate pageX/Y if missing and clientX/Y available
1989 if ( event.pageX == null && event.clientX != null ) {
1990 var doc = document.documentElement, body = document.body;
1991 event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
1992 event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
1993 }
1994
1995 // Add which for key events
1996 if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
1997 event.which = event.charCode || event.keyCode;
1998 }
1999
2000 // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
2001 if ( !event.metaKey && event.ctrlKey ) {
2002 event.metaKey = event.ctrlKey;
2003 }
2004
2005 // Add which for click: 1 === left; 2 === middle; 3 === right
2006 // Note: button is not normalized, so don't use it
2007 if ( !event.which && event.button !== undefined ) {
2008 event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
2009 }
2010
2011 return event;
2012 },
2013
2014 // Deprecated, use jQuery.guid instead
2015 guid: 1E8,
2016
2017 // Deprecated, use jQuery.proxy instead
2018 proxy: jQuery.proxy,
2019
2020 special: {
2021 ready: {
2022 // Make sure the ready event is setup
2023 setup: jQuery.bindReady,
2024 teardown: jQuery.noop
2025 },
2026
2027 live: {
2028 add: function( handleObj ) {
2029 jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) );
2030 },
2031
2032 remove: function( handleObj ) {
2033 var remove = true,
2034 type = handleObj.origType.replace(rnamespaces, "");
2035
2036 jQuery.each( jQuery.data(this, "events").live || [], function() {
2037 if ( type === this.origType.replace(rnamespaces, "") ) {
2038 remove = false;
2039 return false;
2040 }
2041 });
2042
2043 if ( remove ) {
2044 jQuery.event.remove( this, handleObj.origType, liveHandler );
2045 }
2046 }
2047
2048 },
2049
2050 beforeunload: {
2051 setup: function( data, namespaces, eventHandle ) {
2052 // We only want to do this special case on windows
2053 if ( this.setInterval ) {
2054 this.onbeforeunload = eventHandle;
2055 }
2056
2057 return false;
2058 },
2059 teardown: function( namespaces, eventHandle ) {
2060 if ( this.onbeforeunload === eventHandle ) {
2061 this.onbeforeunload = null;
2062 }
2063 }
2064 }
2065 }
2066};
2067
2068var removeEvent = document.removeEventListener ?
2069 function( elem, type, handle ) {
2070 elem.removeEventListener( type, handle, false );
2071 } :
2072 function( elem, type, handle ) {
2073 elem.detachEvent( "on" + type, handle );
2074 };
2075
2076jQuery.Event = function( src ) {
2077 // Allow instantiation without the 'new' keyword
2078 if ( !this.preventDefault ) {
2079 return new jQuery.Event( src );
2080 }
2081
2082 // Event object
2083 if ( src && src.type ) {
2084 this.originalEvent = src;
2085 this.type = src.type;
2086 // Event type
2087 } else {
2088 this.type = src;
2089 }
2090
2091 // timeStamp is buggy for some events on Firefox(#3843)
2092 // So we won't rely on the native value
2093 this.timeStamp = now();
2094
2095 // Mark it as fixed
2096 this[ expando ] = true;
2097};
2098
2099function returnFalse() {
2100 return false;
2101}
2102function returnTrue() {
2103 return true;
2104}
2105
2106// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
2107// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
2108jQuery.Event.prototype = {
2109 preventDefault: function() {
2110 this.isDefaultPrevented = returnTrue;
2111
2112 var e = this.originalEvent;
2113 if ( !e ) {
2114 return;
2115 }
2116
2117 // if preventDefault exists run it on the original event
2118 if ( e.preventDefault ) {
2119 e.preventDefault();
2120 }
2121 // otherwise set the returnValue property of the original event to false (IE)
2122 e.returnValue = false;
2123 },
2124 stopPropagation: function() {
2125 this.isPropagationStopped = returnTrue;
2126
2127 var e = this.originalEvent;
2128 if ( !e ) {
2129 return;
2130 }
2131 // if stopPropagation exists run it on the original event
2132 if ( e.stopPropagation ) {
2133 e.stopPropagation();
2134 }
2135 // otherwise set the cancelBubble property of the original event to true (IE)
2136 e.cancelBubble = true;
2137 },
2138 stopImmediatePropagation: function() {
2139 this.isImmediatePropagationStopped = returnTrue;
2140 this.stopPropagation();
2141 },
2142 isDefaultPrevented: returnFalse,
2143 isPropagationStopped: returnFalse,
2144 isImmediatePropagationStopped: returnFalse
2145};
2146
2147// Checks if an event happened on an element within another element
2148// Used in jQuery.event.special.mouseenter and mouseleave handlers
2149var withinElement = function( event ) {
2150 // Check if mouse(over|out) are still within the same parent element
2151 var parent = event.relatedTarget;
2152
2153 // Firefox sometimes assigns relatedTarget a XUL element
2154 // which we cannot access the parentNode property of
2155 try {
2156 // Traverse up the tree
2157 while ( parent && parent !== this ) {
2158 parent = parent.parentNode;
2159 }
2160
2161 if ( parent !== this ) {
2162 // set the correct event type
2163 event.type = event.data;
2164
2165 // handle event if we actually just moused on to a non sub-element
2166 jQuery.event.handle.apply( this, arguments );
2167 }
2168
2169 // assuming we've left the element since we most likely mousedover a xul element
2170 } catch(e) { }
2171},
2172
2173// In case of event delegation, we only need to rename the event.type,
2174// liveHandler will take care of the rest.
2175delegate = function( event ) {
2176 event.type = event.data;
2177 jQuery.event.handle.apply( this, arguments );
2178};
2179
2180// Create mouseenter and mouseleave events
2181jQuery.each({
2182 mouseenter: "mouseover",
2183 mouseleave: "mouseout"
2184}, function( orig, fix ) {
2185 jQuery.event.special[ orig ] = {
2186 setup: function( data ) {
2187 jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
2188 },
2189 teardown: function( data ) {
2190 jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
2191 }
2192 };
2193});
2194
2195// submit delegation
2196if ( !jQuery.support.submitBubbles ) {
2197
2198 jQuery.event.special.submit = {
2199 setup: function( data, namespaces ) {
2200 if ( this.nodeName.toLowerCase() !== "form" ) {
2201 jQuery.event.add(this, "click.specialSubmit", function( e ) {
2202 var elem = e.target, type = elem.type;
2203
2204 if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
2205 return trigger( "submit", this, arguments );
2206 }
2207 });
2208
2209 jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
2210 var elem = e.target, type = elem.type;
2211
2212 if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
2213 return trigger( "submit", this, arguments );
2214 }
2215 });
2216
2217 } else {
2218 return false;
2219 }
2220 },
2221
2222 teardown: function( namespaces ) {
2223 jQuery.event.remove( this, ".specialSubmit" );
2224 }
2225 };
2226
2227}
2228
2229// change delegation, happens here so we have bind.
2230if ( !jQuery.support.changeBubbles ) {
2231
2232 var formElems = /textarea|input|select/i,
2233
2234 changeFilters,
2235
2236 getVal = function( elem ) {
2237 var type = elem.type, val = elem.value;
2238
2239 if ( type === "radio" || type === "checkbox" ) {
2240 val = elem.checked;
2241
2242 } else if ( type === "select-multiple" ) {
2243 val = elem.selectedIndex > -1 ?
2244 jQuery.map( elem.options, function( elem ) {
2245 return elem.selected;
2246 }).join("-") :
2247 "";
2248
2249 } else if ( elem.nodeName.toLowerCase() === "select" ) {
2250 val = elem.selectedIndex;
2251 }
2252
2253 return val;
2254 },
2255
2256 testChange = function testChange( e ) {
2257 var elem = e.target, data, val;
2258
2259 if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
2260 return;
2261 }
2262
2263 data = jQuery.data( elem, "_change_data" );
2264 val = getVal(elem);
2265
2266 // the current data will be also retrieved by beforeactivate
2267 if ( e.type !== "focusout" || elem.type !== "radio" ) {
2268 jQuery.data( elem, "_change_data", val );
2269 }
2270
2271 if ( data === undefined || val === data ) {
2272 return;
2273 }
2274
2275 if ( data != null || val ) {
2276 e.type = "change";
2277 return jQuery.event.trigger( e, arguments[1], elem );
2278 }
2279 };
2280
2281 jQuery.event.special.change = {
2282 filters: {
2283 focusout: testChange,
2284
2285 click: function( e ) {
2286 var elem = e.target, type = elem.type;
2287
2288 if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
2289 return testChange.call( this, e );
2290 }
2291 },
2292
2293 // Change has to be called before submit
2294 // Keydown will be called before keypress, which is used in submit-event delegation
2295 keydown: function( e ) {
2296 var elem = e.target, type = elem.type;
2297
2298 if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
2299 (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
2300 type === "select-multiple" ) {
2301 return testChange.call( this, e );
2302 }
2303 },
2304
2305 // Beforeactivate happens also before the previous element is blurred
2306 // with this event you can't trigger a change event, but you can store
2307 // information/focus[in] is not needed anymore
2308 beforeactivate: function( e ) {
2309 var elem = e.target;
2310 jQuery.data( elem, "_change_data", getVal(elem) );
2311 }
2312 },
2313
2314 setup: function( data, namespaces ) {
2315 if ( this.type === "file" ) {
2316 return false;
2317 }
2318
2319 for ( var type in changeFilters ) {
2320 jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
2321 }
2322
2323 return formElems.test( this.nodeName );
2324 },
2325
2326 teardown: function( namespaces ) {
2327 jQuery.event.remove( this, ".specialChange" );
2328
2329 return formElems.test( this.nodeName );
2330 }
2331 };
2332
2333 changeFilters = jQuery.event.special.change.filters;
2334}
2335
2336function trigger( type, elem, args ) {
2337 args[0].type = type;
2338 return jQuery.event.handle.apply( elem, args );
2339}
2340
2341// Create "bubbling" focus and blur events
2342if ( document.addEventListener ) {
2343 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
2344 jQuery.event.special[ fix ] = {
2345 setup: function() {
2346 this.addEventListener( orig, handler, true );
2347 },
2348 teardown: function() {
2349 this.removeEventListener( orig, handler, true );
2350 }
2351 };
2352
2353 function handler( e ) {
2354 e = jQuery.event.fix( e );
2355 e.type = fix;
2356 return jQuery.event.handle.call( this, e );
2357 }
2358 });
2359}
2360
2361jQuery.each(["bind", "one"], function( i, name ) {
2362 jQuery.fn[ name ] = function( type, data, fn ) {
2363 // Handle object literals
2364 if ( typeof type === "object" ) {
2365 for ( var key in type ) {
2366 this[ name ](key, data, type[key], fn);
2367 }
2368 return this;
2369 }
2370
2371 if ( jQuery.isFunction( data ) ) {
2372 fn = data;
2373 data = undefined;
2374 }
2375
2376 var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
2377 jQuery( this ).unbind( event, handler );
2378 return fn.apply( this, arguments );
2379 }) : fn;
2380
2381 if ( type === "unload" && name !== "one" ) {
2382 this.one( type, data, fn );
2383
2384 } else {
2385 for ( var i = 0, l = this.length; i < l; i++ ) {
2386 jQuery.event.add( this[i], type, handler, data );
2387 }
2388 }
2389
2390 return this;
2391 };
2392});
2393
2394jQuery.fn.extend({
2395 unbind: function( type, fn ) {
2396 // Handle object literals
2397 if ( typeof type === "object" && !type.preventDefault ) {
2398 for ( var key in type ) {
2399 this.unbind(key, type[key]);
2400 }
2401
2402 } else {
2403 for ( var i = 0, l = this.length; i < l; i++ ) {
2404 jQuery.event.remove( this[i], type, fn );
2405 }
2406 }
2407
2408 return this;
2409 },
2410
2411 delegate: function( selector, types, data, fn ) {
2412 return this.live( types, data, fn, selector );
2413 },
2414
2415 undelegate: function( selector, types, fn ) {
2416 if ( arguments.length === 0 ) {
2417 return this.unbind( "live" );
2418
2419 } else {
2420 return this.die( types, null, fn, selector );
2421 }
2422 },
2423
2424 trigger: function( type, data ) {
2425 return this.each(function() {
2426 jQuery.event.trigger( type, data, this );
2427 });
2428 },
2429
2430 triggerHandler: function( type, data ) {
2431 if ( this[0] ) {
2432 var event = jQuery.Event( type );
2433 event.preventDefault();
2434 event.stopPropagation();
2435 jQuery.event.trigger( event, data, this[0] );
2436 return event.result;
2437 }
2438 },
2439
2440 toggle: function( fn ) {
2441 // Save reference to arguments for access in closure
2442 var args = arguments, i = 1;
2443
2444 // link all the functions, so any of them can unbind this click handler
2445 while ( i < args.length ) {
2446 jQuery.proxy( fn, args[ i++ ] );
2447 }
2448
2449 return this.click( jQuery.proxy( fn, function( event ) {
2450 // Figure out which function to execute
2451 var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
2452 jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
2453
2454 // Make sure that clicks stop
2455 event.preventDefault();
2456
2457 // and execute the function
2458 return args[ lastToggle ].apply( this, arguments ) || false;
2459 }));
2460 },
2461
2462 hover: function( fnOver, fnOut ) {
2463 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
2464 }
2465});
2466
2467var liveMap = {
2468 focus: "focusin",
2469 blur: "focusout",
2470 mouseenter: "mouseover",
2471 mouseleave: "mouseout"
2472};
2473
2474jQuery.each(["live", "die"], function( i, name ) {
2475 jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
2476 var type, i = 0, match, namespaces, preType,
2477 selector = origSelector || this.selector,
2478 context = origSelector ? this : jQuery( this.context );
2479
2480 if ( jQuery.isFunction( data ) ) {
2481 fn = data;
2482 data = undefined;
2483 }
2484
2485 types = (types || "").split(" ");
2486
2487 while ( (type = types[ i++ ]) != null ) {
2488 match = rnamespaces.exec( type );
2489 namespaces = "";
2490
2491 if ( match ) {
2492 namespaces = match[0];
2493 type = type.replace( rnamespaces, "" );
2494 }
2495
2496 if ( type === "hover" ) {
2497 types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
2498 continue;
2499 }
2500
2501 preType = type;
2502
2503 if ( type === "focus" || type === "blur" ) {
2504 types.push( liveMap[ type ] + namespaces );
2505 type = type + namespaces;
2506
2507 } else {
2508 type = (liveMap[ type ] || type) + namespaces;
2509 }
2510
2511 if ( name === "live" ) {
2512 // bind live handler
2513 context.each(function(){
2514 jQuery.event.add( this, liveConvert( type, selector ),
2515 { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
2516 });
2517
2518 } else {
2519 // unbind live handler
2520 context.unbind( liveConvert( type, selector ), fn );
2521 }
2522 }
2523
2524 return this;
2525 }
2526});
2527
2528function liveHandler( event ) {
2529 var stop, elems = [], selectors = [], args = arguments,
2530 related, match, handleObj, elem, j, i, l, data,
2531 events = jQuery.data( this, "events" );
2532
2533 // Make sure we avoid non-left-click bubbling in Firefox (#3861)
2534 if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
2535 return;
2536 }
2537
2538 event.liveFired = this;
2539
2540 var live = events.live.slice(0);
2541
2542 for ( j = 0; j < live.length; j++ ) {
2543 handleObj = live[j];
2544
2545 if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
2546 selectors.push( handleObj.selector );
2547
2548 } else {
2549 live.splice( j--, 1 );
2550 }
2551 }
2552
2553 match = jQuery( event.target ).closest( selectors, event.currentTarget );
2554
2555 for ( i = 0, l = match.length; i < l; i++ ) {
2556 for ( j = 0; j < live.length; j++ ) {
2557 handleObj = live[j];
2558
2559 if ( match[i].selector === handleObj.selector ) {
2560 elem = match[i].elem;
2561 related = null;
2562
2563 // Those two events require additional checking
2564 if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
2565 related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
2566 }
2567
2568 if ( !related || related !== elem ) {
2569 elems.push({ elem: elem, handleObj: handleObj });
2570 }
2571 }
2572 }
2573 }
2574
2575 for ( i = 0, l = elems.length; i < l; i++ ) {
2576 match = elems[i];
2577 event.currentTarget = match.elem;
2578 event.data = match.handleObj.data;
2579 event.handleObj = match.handleObj;
2580
2581 if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
2582 stop = false;
2583 break;
2584 }
2585 }
2586
2587 return stop;
2588}
2589
2590function liveConvert( type, selector ) {
2591 return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
2592}
2593
2594jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
2595 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
2596 "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
2597
2598 // Handle event binding
2599 jQuery.fn[ name ] = function( fn ) {
2600 return fn ? this.bind( name, fn ) : this.trigger( name );
2601 };
2602
2603 if ( jQuery.attrFn ) {
2604 jQuery.attrFn[ name ] = true;
2605 }
2606});
2607
2608// Prevent memory leaks in IE
2609// Window isn't included so as not to unbind existing unload events
2610// More info:
2611// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
2612if ( window.attachEvent && !window.addEventListener ) {
2613 window.attachEvent("onunload", function() {
2614 for ( var id in jQuery.cache ) {
2615 if ( jQuery.cache[ id ].handle ) {
2616 // Try/Catch is to handle iframes being unloaded, see #4280
2617 try {
2618 jQuery.event.remove( jQuery.cache[ id ].handle.elem );
2619 } catch(e) {}
2620 }
2621 }
2622 });
2623}
2624/*!
2625 * Sizzle CSS Selector Engine - v1.0
2626 * Copyright 2009, The Dojo Foundation
2627 * Released under the MIT, BSD, and GPL Licenses.
2628 * More information: http://sizzlejs.com/
2629 */
2630(function(){
2631
2632var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
2633 done = 0,
2634 toString = Object.prototype.toString,
2635 hasDuplicate = false,
2636 baseHasDuplicate = true;
2637
2638// Here we check if the JavaScript engine is using some sort of
2639// optimization where it does not always call our comparision
2640// function. If that is the case, discard the hasDuplicate value.
2641// Thus far that includes Google Chrome.
2642[0, 0].sort(function(){
2643 baseHasDuplicate = false;
2644 return 0;
2645});
2646
2647var Sizzle = function(selector, context, results, seed) {
2648 results = results || [];
2649 var origContext = context = context || document;
2650
2651 if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
2652 return [];
2653 }
2654
2655 if ( !selector || typeof selector !== "string" ) {
2656 return results;
2657 }
2658
2659 var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
2660 soFar = selector;
2661
2662 // Reset the position of the chunker regexp (start from head)
2663 while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
2664 soFar = m[3];
2665
2666 parts.push( m[1] );
2667
2668 if ( m[2] ) {
2669 extra = m[3];
2670 break;
2671 }
2672 }
2673
2674 if ( parts.length > 1 && origPOS.exec( selector ) ) {
2675 if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
2676 set = posProcess( parts[0] + parts[1], context );
2677 } else {
2678 set = Expr.relative[ parts[0] ] ?
2679 [ context ] :
2680 Sizzle( parts.shift(), context );
2681
2682 while ( parts.length ) {
2683 selector = parts.shift();
2684
2685 if ( Expr.relative[ selector ] ) {
2686 selector += parts.shift();
2687 }
2688
2689 set = posProcess( selector, set );
2690 }
2691 }
2692 } else {
2693 // Take a shortcut and set the context if the root selector is an ID
2694 // (but not if it'll be faster if the inner selector is an ID)
2695 if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
2696 Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
2697 var ret = Sizzle.find( parts.shift(), context, contextXML );
2698 context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
2699 }
2700
2701 if ( context ) {
2702 var ret = seed ?
2703 { expr: parts.pop(), set: makeArray(seed) } :
2704 Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
2705 set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
2706
2707 if ( parts.length > 0 ) {
2708 checkSet = makeArray(set);
2709 } else {
2710 prune = false;
2711 }
2712
2713 while ( parts.length ) {
2714 var cur = parts.pop(), pop = cur;
2715
2716 if ( !Expr.relative[ cur ] ) {
2717 cur = "";
2718 } else {
2719 pop = parts.pop();
2720 }
2721
2722 if ( pop == null ) {
2723 pop = context;
2724 }
2725
2726 Expr.relative[ cur ]( checkSet, pop, contextXML );
2727 }
2728 } else {
2729 checkSet = parts = [];
2730 }
2731 }
2732
2733 if ( !checkSet ) {
2734 checkSet = set;
2735 }
2736
2737 if ( !checkSet ) {
2738 Sizzle.error( cur || selector );
2739 }
2740
2741 if ( toString.call(checkSet) === "[object Array]" ) {
2742 if ( !prune ) {
2743 results.push.apply( results, checkSet );
2744 } else if ( context && context.nodeType === 1 ) {
2745 for ( var i = 0; checkSet[i] != null; i++ ) {
2746 if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
2747 results.push( set[i] );
2748 }
2749 }
2750 } else {
2751 for ( var i = 0; checkSet[i] != null; i++ ) {
2752 if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
2753 results.push( set[i] );
2754 }
2755 }
2756 }
2757 } else {
2758 makeArray( checkSet, results );
2759 }
2760
2761 if ( extra ) {
2762 Sizzle( extra, origContext, results, seed );
2763 Sizzle.uniqueSort( results );
2764 }
2765
2766 return results;
2767};
2768
2769Sizzle.uniqueSort = function(results){
2770 if ( sortOrder ) {
2771 hasDuplicate = baseHasDuplicate;
2772 results.sort(sortOrder);
2773
2774 if ( hasDuplicate ) {
2775 for ( var i = 1; i < results.length; i++ ) {
2776 if ( results[i] === results[i-1] ) {
2777 results.splice(i--, 1);
2778 }
2779 }
2780 }
2781 }
2782
2783 return results;
2784};
2785
2786Sizzle.matches = function(expr, set){
2787 return Sizzle(expr, null, null, set);
2788};
2789
2790Sizzle.find = function(expr, context, isXML){
2791 var set, match;
2792
2793 if ( !expr ) {
2794 return [];
2795 }
2796
2797 for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
2798 var type = Expr.order[i], match;
2799
2800 if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
2801 var left = match[1];
2802 match.splice(1,1);
2803
2804 if ( left.substr( left.length - 1 ) !== "\\" ) {
2805 match[1] = (match[1] || "").replace(/\\/g, "");
2806 set = Expr.find[ type ]( match, context, isXML );
2807 if ( set != null ) {
2808 expr = expr.replace( Expr.match[ type ], "" );
2809 break;
2810 }
2811 }
2812 }
2813 }
2814
2815 if ( !set ) {
2816 set = context.getElementsByTagName("*");
2817 }
2818
2819 return {set: set, expr: expr};
2820};
2821
2822Sizzle.filter = function(expr, set, inplace, not){
2823 var old = expr, result = [], curLoop = set, match, anyFound,
2824 isXMLFilter = set && set[0] && isXML(set[0]);
2825
2826 while ( expr && set.length ) {
2827 for ( var type in Expr.filter ) {
2828 if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
2829 var filter = Expr.filter[ type ], found, item, left = match[1];
2830 anyFound = false;
2831
2832 match.splice(1,1);
2833
2834 if ( left.substr( left.length - 1 ) === "\\" ) {
2835 continue;
2836 }
2837
2838 if ( curLoop === result ) {
2839 result = [];
2840 }
2841
2842 if ( Expr.preFilter[ type ] ) {
2843 match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
2844
2845 if ( !match ) {
2846 anyFound = found = true;
2847 } else if ( match === true ) {
2848 continue;
2849 }
2850 }
2851
2852 if ( match ) {
2853 for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
2854 if ( item ) {
2855 found = filter( item, match, i, curLoop );
2856 var pass = not ^ !!found;
2857
2858 if ( inplace && found != null ) {
2859 if ( pass ) {
2860 anyFound = true;
2861 } else {
2862 curLoop[i] = false;
2863 }
2864 } else if ( pass ) {
2865 result.push( item );
2866 anyFound = true;
2867 }
2868 }
2869 }
2870 }
2871
2872 if ( found !== undefined ) {
2873 if ( !inplace ) {
2874 curLoop = result;
2875 }
2876
2877 expr = expr.replace( Expr.match[ type ], "" );
2878
2879 if ( !anyFound ) {
2880 return [];
2881 }
2882
2883 break;
2884 }
2885 }
2886 }
2887
2888 // Improper expression
2889 if ( expr === old ) {
2890 if ( anyFound == null ) {
2891 Sizzle.error( expr );
2892 } else {
2893 break;
2894 }
2895 }
2896
2897 old = expr;
2898 }
2899
2900 return curLoop;
2901};
2902
2903Sizzle.error = function( msg ) {
2904 throw "Syntax error, unrecognized expression: " + msg;
2905};
2906
2907var Expr = Sizzle.selectors = {
2908 order: [ "ID", "NAME", "TAG" ],
2909 match: {
2910 ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
2911 CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
2912 NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
2913 ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
2914 TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
2915 CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
2916 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
2917 PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
2918 },
2919 leftMatch: {},
2920 attrMap: {
2921 "class": "className",
2922 "for": "htmlFor"
2923 },
2924 attrHandle: {
2925 href: function(elem){
2926 return elem.getAttribute("href");
2927 }
2928 },
2929 relative: {
2930 "+": function(checkSet, part){
2931 var isPartStr = typeof part === "string",
2932 isTag = isPartStr && !/\W/.test(part),
2933 isPartStrNotTag = isPartStr && !isTag;
2934
2935 if ( isTag ) {
2936 part = part.toLowerCase();
2937 }
2938
2939 for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
2940 if ( (elem = checkSet[i]) ) {
2941 while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
2942
2943 checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
2944 elem || false :
2945 elem === part;
2946 }
2947 }
2948
2949 if ( isPartStrNotTag ) {
2950 Sizzle.filter( part, checkSet, true );
2951 }
2952 },
2953 ">": function(checkSet, part){
2954 var isPartStr = typeof part === "string";
2955
2956 if ( isPartStr && !/\W/.test(part) ) {
2957 part = part.toLowerCase();
2958
2959 for ( var i = 0, l = checkSet.length; i < l; i++ ) {
2960 var elem = checkSet[i];
2961 if ( elem ) {
2962 var parent = elem.parentNode;
2963 checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
2964 }
2965 }
2966 } else {
2967 for ( var i = 0, l = checkSet.length; i < l; i++ ) {
2968 var elem = checkSet[i];
2969 if ( elem ) {
2970 checkSet[i] = isPartStr ?
2971 elem.parentNode :
2972 elem.parentNode === part;
2973 }
2974 }
2975
2976 if ( isPartStr ) {
2977 Sizzle.filter( part, checkSet, true );
2978 }
2979 }
2980 },
2981 "": function(checkSet, part, isXML){
2982 var doneName = done++, checkFn = dirCheck;
2983
2984 if ( typeof part === "string" && !/\W/.test(part) ) {
2985 var nodeCheck = part = part.toLowerCase();
2986 checkFn = dirNodeCheck;
2987 }
2988
2989 checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
2990 },
2991 "~": function(checkSet, part, isXML){
2992 var doneName = done++, checkFn = dirCheck;
2993
2994 if ( typeof part === "string" && !/\W/.test(part) ) {
2995 var nodeCheck = part = part.toLowerCase();
2996 checkFn = dirNodeCheck;
2997 }
2998
2999 checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
3000 }
3001 },
3002 find: {
3003 ID: function(match, context, isXML){
3004 if ( typeof context.getElementById !== "undefined" && !isXML ) {
3005 var m = context.getElementById(match[1]);
3006 return m ? [m] : [];
3007 }
3008 },
3009 NAME: function(match, context){
3010 if ( typeof context.getElementsByName !== "undefined" ) {
3011 var ret = [], results = context.getElementsByName(match[1]);
3012
3013 for ( var i = 0, l = results.length; i < l; i++ ) {
3014 if ( results[i].getAttribute("name") === match[1] ) {
3015 ret.push( results[i] );
3016 }
3017 }
3018
3019 return ret.length === 0 ? null : ret;
3020 }
3021 },
3022 TAG: function(match, context){
3023 return context.getElementsByTagName(match[1]);
3024 }
3025 },
3026 preFilter: {
3027 CLASS: function(match, curLoop, inplace, result, not, isXML){
3028 match = " " + match[1].replace(/\\/g, "") + " ";
3029
3030 if ( isXML ) {
3031 return match;
3032 }
3033
3034 for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
3035 if ( elem ) {
3036 if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
3037 if ( !inplace ) {
3038 result.push( elem );
3039 }
3040 } else if ( inplace ) {
3041 curLoop[i] = false;
3042 }
3043 }
3044 }
3045
3046 return false;
3047 },
3048 ID: function(match){
3049 return match[1].replace(/\\/g, "");
3050 },
3051 TAG: function(match, curLoop){
3052 return match[1].toLowerCase();
3053 },
3054 CHILD: function(match){
3055 if ( match[1] === "nth" ) {
3056 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
3057 var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
3058 match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
3059 !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
3060
3061 // calculate the numbers (first)n+(last) including if they are negative
3062 match[2] = (test[1] + (test[2] || 1)) - 0;
3063 match[3] = test[3] - 0;
3064 }
3065
3066 // TODO: Move to normal caching system
3067 match[0] = done++;
3068
3069 return match;
3070 },
3071 ATTR: function(match, curLoop, inplace, result, not, isXML){
3072 var name = match[1].replace(/\\/g, "");
3073
3074 if ( !isXML && Expr.attrMap[name] ) {
3075 match[1] = Expr.attrMap[name];
3076 }
3077
3078 if ( match[2] === "~=" ) {
3079 match[4] = " " + match[4] + " ";
3080 }
3081
3082 return match;
3083 },
3084 PSEUDO: function(match, curLoop, inplace, result, not){
3085 if ( match[1] === "not" ) {
3086 // If we're dealing with a complex expression, or a simple one
3087 if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
3088 match[3] = Sizzle(match[3], null, null, curLoop);
3089 } else {
3090 var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
3091 if ( !inplace ) {
3092 result.push.apply( result, ret );
3093 }
3094 return false;
3095 }
3096 } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
3097 return true;
3098 }
3099
3100 return match;
3101 },
3102 POS: function(match){
3103 match.unshift( true );
3104 return match;
3105 }
3106 },
3107 filters: {
3108 enabled: function(elem){
3109 return elem.disabled === false && elem.type !== "hidden";
3110 },
3111 disabled: function(elem){
3112 return elem.disabled === true;
3113 },
3114 checked: function(elem){
3115 return elem.checked === true;
3116 },
3117 selected: function(elem){
3118 // Accessing this property makes selected-by-default
3119 // options in Safari work properly
3120 elem.parentNode.selectedIndex;
3121 return elem.selected === true;
3122 },
3123 parent: function(elem){
3124 return !!elem.firstChild;
3125 },
3126 empty: function(elem){
3127 return !elem.firstChild;
3128 },
3129 has: function(elem, i, match){
3130 return !!Sizzle( match[3], elem ).length;
3131 },
3132 header: function(elem){
3133 return /h\d/i.test( elem.nodeName );
3134 },
3135 text: function(elem){
3136 return "text" === elem.type;
3137 },
3138 radio: function(elem){
3139 return "radio" === elem.type;
3140 },
3141 checkbox: function(elem){
3142 return "checkbox" === elem.type;
3143 },
3144 file: function(elem){
3145 return "file" === elem.type;
3146 },
3147 password: function(elem){
3148 return "password" === elem.type;
3149 },
3150 submit: function(elem){
3151 return "submit" === elem.type;
3152 },
3153 image: function(elem){
3154 return "image" === elem.type;
3155 },
3156 reset: function(elem){
3157 return "reset" === elem.type;
3158 },
3159 button: function(elem){
3160 return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
3161 },
3162 input: function(elem){
3163 return /input|select|textarea|button/i.test(elem.nodeName);
3164 }
3165 },
3166 setFilters: {
3167 first: function(elem, i){
3168 return i === 0;
3169 },
3170 last: function(elem, i, match, array){
3171 return i === array.length - 1;
3172 },
3173 even: function(elem, i){
3174 return i % 2 === 0;
3175 },
3176 odd: function(elem, i){
3177 return i % 2 === 1;
3178 },
3179 lt: function(elem, i, match){
3180 return i < match[3] - 0;
3181 },
3182 gt: function(elem, i, match){
3183 return i > match[3] - 0;
3184 },
3185 nth: function(elem, i, match){
3186 return match[3] - 0 === i;
3187 },
3188 eq: function(elem, i, match){
3189 return match[3] - 0 === i;
3190 }
3191 },
3192 filter: {
3193 PSEUDO: function(elem, match, i, array){
3194 var name = match[1], filter = Expr.filters[ name ];
3195
3196 if ( filter ) {
3197 return filter( elem, i, match, array );
3198 } else if ( name === "contains" ) {
3199 return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
3200 } else if ( name === "not" ) {
3201 var not = match[3];
3202
3203 for ( var i = 0, l = not.length; i < l; i++ ) {
3204 if ( not[i] === elem ) {
3205 return false;
3206 }
3207 }
3208
3209 return true;
3210 } else {
3211 Sizzle.error( "Syntax error, unrecognized expression: " + name );
3212 }
3213 },
3214 CHILD: function(elem, match){
3215 var type = match[1], node = elem;
3216 switch (type) {
3217 case 'only':
3218 case 'first':
3219 while ( (node = node.previousSibling) ) {
3220 if ( node.nodeType === 1 ) {
3221 return false;
3222 }
3223 }
3224 if ( type === "first" ) {
3225 return true;
3226 }
3227 node = elem;
3228 case 'last':
3229 while ( (node = node.nextSibling) ) {
3230 if ( node.nodeType === 1 ) {
3231 return false;
3232 }
3233 }
3234 return true;
3235 case 'nth':
3236 var first = match[2], last = match[3];
3237
3238 if ( first === 1 && last === 0 ) {
3239 return true;
3240 }
3241
3242 var doneName = match[0],
3243 parent = elem.parentNode;
3244
3245 if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
3246 var count = 0;
3247 for ( node = parent.firstChild; node; node = node.nextSibling ) {
3248 if ( node.nodeType === 1 ) {
3249 node.nodeIndex = ++count;
3250 }
3251 }
3252 parent.sizcache = doneName;
3253 }
3254
3255 var diff = elem.nodeIndex - last;
3256 if ( first === 0 ) {
3257 return diff === 0;
3258 } else {
3259 return ( diff % first === 0 && diff / first >= 0 );
3260 }
3261 }
3262 },
3263 ID: function(elem, match){
3264 return elem.nodeType === 1 && elem.getAttribute("id") === match;
3265 },
3266 TAG: function(elem, match){
3267 return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
3268 },
3269 CLASS: function(elem, match){
3270 return (" " + (elem.className || elem.getAttribute("class")) + " ")
3271 .indexOf( match ) > -1;
3272 },
3273 ATTR: function(elem, match){
3274 var name = match[1],
3275 result = Expr.attrHandle[ name ] ?
3276 Expr.attrHandle[ name ]( elem ) :
3277 elem[ name ] != null ?
3278 elem[ name ] :
3279 elem.getAttribute( name ),
3280 value = result + "",
3281 type = match[2],
3282 check = match[4];
3283
3284 return result == null ?
3285 type === "!=" :
3286 type === "=" ?
3287 value === check :
3288 type === "*=" ?
3289 value.indexOf(check) >= 0 :
3290 type === "~=" ?
3291 (" " + value + " ").indexOf(check) >= 0 :
3292 !check ?
3293 value && result !== false :
3294 type === "!=" ?
3295 value !== check :
3296 type === "^=" ?
3297 value.indexOf(check) === 0 :
3298 type === "$=" ?
3299 value.substr(value.length - check.length) === check :
3300 type === "|=" ?
3301 value === check || value.substr(0, check.length + 1) === check + "-" :
3302 false;
3303 },
3304 POS: function(elem, match, i, array){
3305 var name = match[2], filter = Expr.setFilters[ name ];
3306
3307 if ( filter ) {
3308 return filter( elem, i, match, array );
3309 }
3310 }
3311 }
3312};
3313
3314var origPOS = Expr.match.POS;
3315
3316for ( var type in Expr.match ) {
3317 Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
3318 Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
3319 return "\\" + (num - 0 + 1);
3320 }));
3321}
3322
3323var makeArray = function(array, results) {
3324 array = Array.prototype.slice.call( array, 0 );
3325
3326 if ( results ) {
3327 results.push.apply( results, array );
3328 return results;
3329 }
3330
3331 return array;
3332};
3333
3334// Perform a simple check to determine if the browser is capable of
3335// converting a NodeList to an array using builtin methods.
3336// Also verifies that the returned array holds DOM nodes
3337// (which is not the case in the Blackberry browser)
3338try {
3339 Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
3340
3341// Provide a fallback method if it does not work
3342} catch(e){
3343 makeArray = function(array, results) {
3344 var ret = results || [];
3345
3346 if ( toString.call(array) === "[object Array]" ) {
3347 Array.prototype.push.apply( ret, array );
3348 } else {
3349 if ( typeof array.length === "number" ) {
3350 for ( var i = 0, l = array.length; i < l; i++ ) {
3351 ret.push( array[i] );
3352 }
3353 } else {
3354 for ( var i = 0; array[i]; i++ ) {
3355 ret.push( array[i] );
3356 }
3357 }
3358 }
3359
3360 return ret;
3361 };
3362}
3363
3364var sortOrder;
3365
3366if ( document.documentElement.compareDocumentPosition ) {
3367 sortOrder = function( a, b ) {
3368 if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
3369 if ( a == b ) {
3370 hasDuplicate = true;
3371 }
3372 return a.compareDocumentPosition ? -1 : 1;
3373 }
3374
3375 var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
3376 if ( ret === 0 ) {
3377 hasDuplicate = true;
3378 }
3379 return ret;
3380 };
3381} else if ( "sourceIndex" in document.documentElement ) {
3382 sortOrder = function( a, b ) {
3383 if ( !a.sourceIndex || !b.sourceIndex ) {
3384 if ( a == b ) {
3385 hasDuplicate = true;
3386 }
3387 return a.sourceIndex ? -1 : 1;
3388 }
3389
3390 var ret = a.sourceIndex - b.sourceIndex;
3391 if ( ret === 0 ) {
3392 hasDuplicate = true;
3393 }
3394 return ret;
3395 };
3396} else if ( document.createRange ) {
3397 sortOrder = function( a, b ) {
3398 if ( !a.ownerDocument || !b.ownerDocument ) {
3399 if ( a == b ) {
3400 hasDuplicate = true;
3401 }
3402 return a.ownerDocument ? -1 : 1;
3403 }
3404
3405 var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
3406 aRange.setStart(a, 0);
3407 aRange.setEnd(a, 0);
3408 bRange.setStart(b, 0);
3409 bRange.setEnd(b, 0);
3410 var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
3411 if ( ret === 0 ) {
3412 hasDuplicate = true;
3413 }
3414 return ret;
3415 };
3416}
3417
3418// Utility function for retreiving the text value of an array of DOM nodes
3419function getText( elems ) {
3420 var ret = "", elem;
3421
3422 for ( var i = 0; elems[i]; i++ ) {
3423 elem = elems[i];
3424
3425 // Get the text from text nodes and CDATA nodes
3426 if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
3427 ret += elem.nodeValue;
3428
3429 // Traverse everything else, except comment nodes
3430 } else if ( elem.nodeType !== 8 ) {
3431 ret += getText( elem.childNodes );
3432 }
3433 }
3434
3435 return ret;
3436}
3437
3438// Check to see if the browser returns elements by name when
3439// querying by getElementById (and provide a workaround)
3440(function(){
3441 // We're going to inject a fake input element with a specified name
3442 var form = document.createElement("div"),
3443 id = "script" + (new Date).getTime();
3444 form.innerHTML = "<a name='" + id + "'/>";
3445
3446 // Inject it into the root element, check its status, and remove it quickly
3447 var root = document.documentElement;
3448 root.insertBefore( form, root.firstChild );
3449
3450 // The workaround has to do additional checks after a getElementById
3451 // Which slows things down for other browsers (hence the branching)
3452 if ( document.getElementById( id ) ) {
3453 Expr.find.ID = function(match, context, isXML){
3454 if ( typeof context.getElementById !== "undefined" && !isXML ) {
3455 var m = context.getElementById(match[1]);
3456 return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
3457 }
3458 };
3459
3460 Expr.filter.ID = function(elem, match){
3461 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
3462 return elem.nodeType === 1 && node && node.nodeValue === match;
3463 };
3464 }
3465
3466 root.removeChild( form );
3467 root = form = null; // release memory in IE
3468})();
3469
3470(function(){
3471 // Check to see if the browser returns only elements
3472 // when doing getElementsByTagName("*")
3473
3474 // Create a fake element
3475 var div = document.createElement("div");
3476 div.appendChild( document.createComment("") );
3477
3478 // Make sure no comments are found
3479 if ( div.getElementsByTagName("*").length > 0 ) {
3480 Expr.find.TAG = function(match, context){
3481 var results = context.getElementsByTagName(match[1]);
3482
3483 // Filter out possible comments
3484 if ( match[1] === "*" ) {
3485 var tmp = [];
3486
3487 for ( var i = 0; results[i]; i++ ) {
3488 if ( results[i].nodeType === 1 ) {
3489 tmp.push( results[i] );
3490 }
3491 }
3492
3493 results = tmp;
3494 }
3495
3496 return results;
3497 };
3498 }
3499
3500 // Check to see if an attribute returns normalized href attributes
3501 div.innerHTML = "<a href='#'></a>";
3502 if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
3503 div.firstChild.getAttribute("href") !== "#" ) {
3504 Expr.attrHandle.href = function(elem){
3505 return elem.getAttribute("href", 2);
3506 };
3507 }
3508
3509 div = null; // release memory in IE
3510})();
3511
3512if ( document.querySelectorAll ) {
3513 (function(){
3514 var oldSizzle = Sizzle, div = document.createElement("div");
3515 div.innerHTML = "<p class='TEST'></p>";
3516
3517 // Safari can't handle uppercase or unicode characters when
3518 // in quirks mode.
3519 if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
3520 return;
3521 }
3522
3523 Sizzle = function(query, context, extra, seed){
3524 context = context || document;
3525
3526 // Only use querySelectorAll on non-XML documents
3527 // (ID selectors don't work in non-HTML documents)
3528 if ( !seed && context.nodeType === 9 && !isXML(context) ) {
3529 try {
3530 return makeArray( context.querySelectorAll(query), extra );
3531 } catch(e){}
3532 }
3533
3534 return oldSizzle(query, context, extra, seed);
3535 };
3536
3537 for ( var prop in oldSizzle ) {
3538 Sizzle[ prop ] = oldSizzle[ prop ];
3539 }
3540
3541 div = null; // release memory in IE
3542 })();
3543}
3544
3545(function(){
3546 var div = document.createElement("div");
3547
3548 div.innerHTML = "<div class='test e'></div><div class='test'></div>";
3549
3550 // Opera can't find a second classname (in 9.6)
3551 // Also, make sure that getElementsByClassName actually exists
3552 if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
3553 return;
3554 }
3555
3556 // Safari caches class attributes, doesn't catch changes (in 3.2)
3557 div.lastChild.className = "e";
3558
3559 if ( div.getElementsByClassName("e").length === 1 ) {
3560 return;
3561 }
3562
3563 Expr.order.splice(1, 0, "CLASS");
3564 Expr.find.CLASS = function(match, context, isXML) {
3565 if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
3566 return context.getElementsByClassName(match[1]);
3567 }
3568 };
3569
3570 div = null; // release memory in IE
3571})();
3572
3573function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
3574 for ( var i = 0, l = checkSet.length; i < l; i++ ) {
3575 var elem = checkSet[i];
3576 if ( elem ) {
3577 elem = elem[dir];
3578 var match = false;
3579
3580 while ( elem ) {
3581 if ( elem.sizcache === doneName ) {
3582 match = checkSet[elem.sizset];
3583 break;
3584 }
3585
3586 if ( elem.nodeType === 1 && !isXML ){
3587 elem.sizcache = doneName;
3588 elem.sizset = i;
3589 }
3590
3591 if ( elem.nodeName.toLowerCase() === cur ) {
3592 match = elem;
3593 break;
3594 }
3595
3596 elem = elem[dir];
3597 }
3598
3599 checkSet[i] = match;
3600 }
3601 }
3602}
3603
3604function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
3605 for ( var i = 0, l = checkSet.length; i < l; i++ ) {
3606 var elem = checkSet[i];
3607 if ( elem ) {
3608 elem = elem[dir];
3609 var match = false;
3610
3611 while ( elem ) {
3612 if ( elem.sizcache === doneName ) {
3613 match = checkSet[elem.sizset];
3614 break;
3615 }
3616
3617 if ( elem.nodeType === 1 ) {
3618 if ( !isXML ) {
3619 elem.sizcache = doneName;
3620 elem.sizset = i;
3621 }
3622 if ( typeof cur !== "string" ) {
3623 if ( elem === cur ) {
3624 match = true;
3625 break;
3626 }
3627
3628 } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
3629 match = elem;
3630 break;
3631 }
3632 }
3633
3634 elem = elem[dir];
3635 }
3636
3637 checkSet[i] = match;
3638 }
3639 }
3640}
3641
3642var contains = document.compareDocumentPosition ? function(a, b){
3643 return !!(a.compareDocumentPosition(b) & 16);
3644} : function(a, b){
3645 return a !== b && (a.contains ? a.contains(b) : true);
3646};
3647
3648var isXML = function(elem){
3649 // documentElement is verified for cases where it doesn't yet exist
3650 // (such as loading iframes in IE - #4833)
3651 var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
3652 return documentElement ? documentElement.nodeName !== "HTML" : false;
3653};
3654
3655var posProcess = function(selector, context){
3656 var tmpSet = [], later = "", match,
3657 root = context.nodeType ? [context] : context;
3658
3659 // Position selectors must be done after the filter
3660 // And so must :not(positional) so we move all PSEUDOs to the end
3661 while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
3662 later += match[0];
3663 selector = selector.replace( Expr.match.PSEUDO, "" );
3664 }
3665
3666 selector = Expr.relative[selector] ? selector + "*" : selector;
3667
3668 for ( var i = 0, l = root.length; i < l; i++ ) {
3669 Sizzle( selector, root[i], tmpSet );
3670 }
3671
3672 return Sizzle.filter( later, tmpSet );
3673};
3674
3675// EXPOSE
3676jQuery.find = Sizzle;
3677jQuery.expr = Sizzle.selectors;
3678jQuery.expr[":"] = jQuery.expr.filters;
3679jQuery.unique = Sizzle.uniqueSort;
3680jQuery.text = getText;
3681jQuery.isXMLDoc = isXML;
3682jQuery.contains = contains;
3683
3684return;
3685
3686window.Sizzle = Sizzle;
3687
3688})();
3689var runtil = /Until$/,
3690 rparentsprev = /^(?:parents|prevUntil|prevAll)/,
3691 // Note: This RegExp should be improved, or likely pulled from Sizzle
3692 rmultiselector = /,/,
3693 slice = Array.prototype.slice;
3694
3695// Implement the identical functionality for filter and not
3696var winnow = function( elements, qualifier, keep ) {
3697 if ( jQuery.isFunction( qualifier ) ) {
3698 return jQuery.grep(elements, function( elem, i ) {
3699 return !!qualifier.call( elem, i, elem ) === keep;
3700 });
3701
3702 } else if ( qualifier.nodeType ) {
3703 return jQuery.grep(elements, function( elem, i ) {
3704 return (elem === qualifier) === keep;
3705 });
3706
3707 } else if ( typeof qualifier === "string" ) {
3708 var filtered = jQuery.grep(elements, function( elem ) {
3709 return elem.nodeType === 1;
3710 });
3711
3712 if ( isSimple.test( qualifier ) ) {
3713 return jQuery.filter(qualifier, filtered, !keep);
3714 } else {
3715 qualifier = jQuery.filter( qualifier, filtered );
3716 }
3717 }
3718
3719 return jQuery.grep(elements, function( elem, i ) {
3720 return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
3721 });
3722};
3723
3724jQuery.fn.extend({
3725 find: function( selector ) {
3726 var ret = this.pushStack( "", "find", selector ), length = 0;
3727
3728 for ( var i = 0, l = this.length; i < l; i++ ) {
3729 length = ret.length;
3730 jQuery.find( selector, this[i], ret );
3731
3732 if ( i > 0 ) {
3733 // Make sure that the results are unique
3734 for ( var n = length; n < ret.length; n++ ) {
3735 for ( var r = 0; r < length; r++ ) {
3736 if ( ret[r] === ret[n] ) {
3737 ret.splice(n--, 1);
3738 break;
3739 }
3740 }
3741 }
3742 }
3743 }
3744
3745 return ret;
3746 },
3747
3748 has: function( target ) {
3749 var targets = jQuery( target );
3750 return this.filter(function() {
3751 for ( var i = 0, l = targets.length; i < l; i++ ) {
3752 if ( jQuery.contains( this, targets[i] ) ) {
3753 return true;
3754 }
3755 }
3756 });
3757 },
3758
3759 not: function( selector ) {
3760 return this.pushStack( winnow(this, selector, false), "not", selector);
3761 },
3762
3763 filter: function( selector ) {
3764 return this.pushStack( winnow(this, selector, true), "filter", selector );
3765 },
3766
3767 is: function( selector ) {
3768 return !!selector && jQuery.filter( selector, this ).length > 0;
3769 },
3770
3771 closest: function( selectors, context ) {
3772 if ( jQuery.isArray( selectors ) ) {
3773 var ret = [], cur = this[0], match, matches = {}, selector;
3774
3775 if ( cur && selectors.length ) {
3776 for ( var i = 0, l = selectors.length; i < l; i++ ) {
3777 selector = selectors[i];
3778
3779 if ( !matches[selector] ) {
3780 matches[selector] = jQuery.expr.match.POS.test( selector ) ?
3781 jQuery( selector, context || this.context ) :
3782 selector;
3783 }
3784 }
3785
3786 while ( cur && cur.ownerDocument && cur !== context ) {
3787 for ( selector in matches ) {
3788 match = matches[selector];
3789
3790 if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
3791 ret.push({ selector: selector, elem: cur });
3792 delete matches[selector];
3793 }
3794 }
3795 cur = cur.parentNode;
3796 }
3797 }
3798
3799 return ret;
3800 }
3801
3802 var pos = jQuery.expr.match.POS.test( selectors ) ?
3803 jQuery( selectors, context || this.context ) : null;
3804
3805 return this.map(function( i, cur ) {
3806 while ( cur && cur.ownerDocument && cur !== context ) {
3807 if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
3808 return cur;
3809 }
3810 cur = cur.parentNode;
3811 }
3812 return null;
3813 });
3814 },
3815
3816 // Determine the position of an element within
3817 // the matched set of elements
3818 index: function( elem ) {
3819 if ( !elem || typeof elem === "string" ) {
3820 return jQuery.inArray( this[0],
3821 // If it receives a string, the selector is used
3822 // If it receives nothing, the siblings are used
3823 elem ? jQuery( elem ) : this.parent().children() );
3824 }
3825 // Locate the position of the desired element
3826 return jQuery.inArray(
3827 // If it receives a jQuery object, the first element is used
3828 elem.jquery ? elem[0] : elem, this );
3829 },
3830
3831 add: function( selector, context ) {
3832 var set = typeof selector === "string" ?
3833 jQuery( selector, context || this.context ) :
3834 jQuery.makeArray( selector ),
3835 all = jQuery.merge( this.get(), set );
3836
3837 return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
3838 all :
3839 jQuery.unique( all ) );
3840 },
3841
3842 andSelf: function() {
3843 return this.add( this.prevObject );
3844 }
3845});
3846
3847// A painfully simple check to see if an element is disconnected
3848// from a document (should be improved, where feasible).
3849function isDisconnected( node ) {
3850 return !node || !node.parentNode || node.parentNode.nodeType === 11;
3851}
3852
3853jQuery.each({
3854 parent: function( elem ) {
3855 var parent = elem.parentNode;
3856 return parent && parent.nodeType !== 11 ? parent : null;
3857 },
3858 parents: function( elem ) {
3859 return jQuery.dir( elem, "parentNode" );
3860 },
3861 parentsUntil: function( elem, i, until ) {
3862 return jQuery.dir( elem, "parentNode", until );
3863 },
3864 next: function( elem ) {
3865 return jQuery.nth( elem, 2, "nextSibling" );
3866 },
3867 prev: function( elem ) {
3868 return jQuery.nth( elem, 2, "previousSibling" );
3869 },
3870 nextAll: function( elem ) {
3871 return jQuery.dir( elem, "nextSibling" );
3872 },
3873 prevAll: function( elem ) {
3874 return jQuery.dir( elem, "previousSibling" );
3875 },
3876 nextUntil: function( elem, i, until ) {
3877 return jQuery.dir( elem, "nextSibling", until );
3878 },
3879 prevUntil: function( elem, i, until ) {
3880 return jQuery.dir( elem, "previousSibling", until );
3881 },
3882 siblings: function( elem ) {
3883 return jQuery.sibling( elem.parentNode.firstChild, elem );
3884 },
3885 children: function( elem ) {
3886 return jQuery.sibling( elem.firstChild );
3887 },
3888 contents: function( elem ) {
3889 return jQuery.nodeName( elem, "iframe" ) ?
3890 elem.contentDocument || elem.contentWindow.document :
3891 jQuery.makeArray( elem.childNodes );
3892 }
3893}, function( name, fn ) {
3894 jQuery.fn[ name ] = function( until, selector ) {
3895 var ret = jQuery.map( this, fn, until );
3896
3897 if ( !runtil.test( name ) ) {
3898 selector = until;
3899 }
3900
3901 if ( selector && typeof selector === "string" ) {
3902 ret = jQuery.filter( selector, ret );
3903 }
3904
3905 ret = this.length > 1 ? jQuery.unique( ret ) : ret;
3906
3907 if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
3908 ret = ret.reverse();
3909 }
3910
3911 return this.pushStack( ret, name, slice.call(arguments).join(",") );
3912 };
3913});
3914
3915jQuery.extend({
3916 filter: function( expr, elems, not ) {
3917 if ( not ) {
3918 expr = ":not(" + expr + ")";
3919 }
3920
3921 return jQuery.find.matches(expr, elems);
3922 },
3923
3924 dir: function( elem, dir, until ) {
3925 var matched = [], cur = elem[dir];
3926 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
3927 if ( cur.nodeType === 1 ) {
3928 matched.push( cur );
3929 }
3930 cur = cur[dir];
3931 }
3932 return matched;
3933 },
3934
3935 nth: function( cur, result, dir, elem ) {
3936 result = result || 1;
3937 var num = 0;
3938
3939 for ( ; cur; cur = cur[dir] ) {
3940 if ( cur.nodeType === 1 && ++num === result ) {
3941 break;
3942 }
3943 }
3944
3945 return cur;
3946 },
3947
3948 sibling: function( n, elem ) {
3949 var r = [];
3950
3951 for ( ; n; n = n.nextSibling ) {
3952 if ( n.nodeType === 1 && n !== elem ) {
3953 r.push( n );
3954 }
3955 }
3956
3957 return r;
3958 }
3959});
3960var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
3961 rleadingWhitespace = /^\s+/,
3962 rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
3963 rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
3964 rtagName = /<([\w:]+)/,
3965 rtbody = /<tbody/i,
3966 rhtml = /<|&#?\w+;/,
3967 rnocache = /<script|<object|<embed|<option|<style/i,
3968 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5)
3969 fcloseTag = function( all, front, tag ) {
3970 return rselfClosing.test( tag ) ?
3971 all :
3972 front + "></" + tag + ">";
3973 },
3974 wrapMap = {
3975 option: [ 1, "<select multiple='multiple'>", "</select>" ],
3976 legend: [ 1, "<fieldset>", "</fieldset>" ],
3977 thead: [ 1, "<table>", "</table>" ],
3978 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
3979 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
3980 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
3981 area: [ 1, "<map>", "</map>" ],
3982 _default: [ 0, "", "" ]
3983 };
3984
3985wrapMap.optgroup = wrapMap.option;
3986wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
3987wrapMap.th = wrapMap.td;
3988
3989// IE can't serialize <link> and <script> tags normally
3990if ( !jQuery.support.htmlSerialize ) {
3991 wrapMap._default = [ 1, "div<div>", "</div>" ];
3992}
3993
3994jQuery.fn.extend({
3995 text: function( text ) {
3996 if ( jQuery.isFunction(text) ) {
3997 return this.each(function(i) {
3998 var self = jQuery(this);
3999 self.text( text.call(this, i, self.text()) );
4000 });
4001 }
4002
4003 if ( typeof text !== "object" && text !== undefined ) {
4004 return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
4005 }
4006
4007 return jQuery.text( this );
4008 },
4009
4010 wrapAll: function( html ) {
4011 if ( jQuery.isFunction( html ) ) {
4012 return this.each(function(i) {
4013 jQuery(this).wrapAll( html.call(this, i) );
4014 });
4015 }
4016
4017 if ( this[0] ) {
4018 // The elements to wrap the target around
4019 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
4020
4021 if ( this[0].parentNode ) {
4022 wrap.insertBefore( this[0] );
4023 }
4024
4025 wrap.map(function() {
4026 var elem = this;
4027
4028 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
4029 elem = elem.firstChild;
4030 }
4031
4032 return elem;
4033 }).append(this);
4034 }
4035
4036 return this;
4037 },
4038
4039 wrapInner: function( html ) {
4040 if ( jQuery.isFunction( html ) ) {
4041 return this.each(function(i) {
4042 jQuery(this).wrapInner( html.call(this, i) );
4043 });
4044 }
4045
4046 return this.each(function() {
4047 var self = jQuery( this ), contents = self.contents();
4048
4049 if ( contents.length ) {
4050 contents.wrapAll( html );
4051
4052 } else {
4053 self.append( html );
4054 }
4055 });
4056 },
4057
4058 wrap: function( html ) {
4059 return this.each(function() {
4060 jQuery( this ).wrapAll( html );
4061 });
4062 },
4063
4064 unwrap: function() {
4065 return this.parent().each(function() {
4066 if ( !jQuery.nodeName( this, "body" ) ) {
4067 jQuery( this ).replaceWith( this.childNodes );
4068 }
4069 }).end();
4070 },
4071
4072 append: function() {
4073 return this.domManip(arguments, true, function( elem ) {
4074 if ( this.nodeType === 1 ) {
4075 this.appendChild( elem );
4076 }
4077 });
4078 },
4079
4080 prepend: function() {
4081 return this.domManip(arguments, true, function( elem ) {
4082 if ( this.nodeType === 1 ) {
4083 this.insertBefore( elem, this.firstChild );
4084 }
4085 });
4086 },
4087
4088 before: function() {
4089 if ( this[0] && this[0].parentNode ) {
4090 return this.domManip(arguments, false, function( elem ) {
4091 this.parentNode.insertBefore( elem, this );
4092 });
4093 } else if ( arguments.length ) {
4094 var set = jQuery(arguments[0]);
4095 set.push.apply( set, this.toArray() );
4096 return this.pushStack( set, "before", arguments );
4097 }
4098 },
4099
4100 after: function() {
4101 if ( this[0] && this[0].parentNode ) {
4102 return this.domManip(arguments, false, function( elem ) {
4103 this.parentNode.insertBefore( elem, this.nextSibling );
4104 });
4105 } else if ( arguments.length ) {
4106 var set = this.pushStack( this, "after", arguments );
4107 set.push.apply( set, jQuery(arguments[0]).toArray() );
4108 return set;
4109 }
4110 },
4111
4112 // keepData is for internal use only--do not document
4113 remove: function( selector, keepData ) {
4114 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
4115 if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
4116 if ( !keepData && elem.nodeType === 1 ) {
4117 jQuery.cleanData( elem.getElementsByTagName("*") );
4118 jQuery.cleanData( [ elem ] );
4119 }
4120
4121 if ( elem.parentNode ) {
4122 elem.parentNode.removeChild( elem );
4123 }
4124 }
4125 }
4126
4127 return this;
4128 },
4129
4130 empty: function() {
4131 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
4132 // Remove element nodes and prevent memory leaks
4133 if ( elem.nodeType === 1 ) {
4134 jQuery.cleanData( elem.getElementsByTagName("*") );
4135 }
4136
4137 // Remove any remaining nodes
4138 while ( elem.firstChild ) {
4139 elem.removeChild( elem.firstChild );
4140 }
4141 }
4142
4143 return this;
4144 },
4145
4146 clone: function( events ) {
4147 // Do the clone
4148 var ret = this.map(function() {
4149 if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
4150 // IE copies events bound via attachEvent when
4151 // using cloneNode. Calling detachEvent on the
4152 // clone will also remove the events from the orignal
4153 // In order to get around this, we use innerHTML.
4154 // Unfortunately, this means some modifications to
4155 // attributes in IE that are actually only stored
4156 // as properties will not be copied (such as the
4157 // the name attribute on an input).
4158 var html = this.outerHTML, ownerDocument = this.ownerDocument;
4159 if ( !html ) {
4160 var div = ownerDocument.createElement("div");
4161 div.appendChild( this.cloneNode(true) );
4162 html = div.innerHTML;
4163 }
4164
4165 return jQuery.clean([html.replace(rinlinejQuery, "")
4166 // Handle the case in IE 8 where action=/test/> self-closes a tag
4167 .replace(/=([^="'>\s]+\/)>/g, '="$1">')
4168 .replace(rleadingWhitespace, "")], ownerDocument)[0];
4169 } else {
4170 return this.cloneNode(true);
4171 }
4172 });
4173
4174 // Copy the events from the original to the clone
4175 if ( events === true ) {
4176 cloneCopyEvent( this, ret );
4177 cloneCopyEvent( this.find("*"), ret.find("*") );
4178 }
4179
4180 // Return the cloned set
4181 return ret;
4182 },
4183
4184 html: function( value ) {
4185 if ( value === undefined ) {
4186 return this[0] && this[0].nodeType === 1 ?
4187 this[0].innerHTML.replace(rinlinejQuery, "") :
4188 null;
4189
4190 // See if we can take a shortcut and just use innerHTML
4191 } else if ( typeof value === "string" && !rnocache.test( value ) &&
4192 (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
4193 !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
4194
4195 value = value.replace(rxhtmlTag, fcloseTag);
4196
4197 try {
4198 for ( var i = 0, l = this.length; i < l; i++ ) {
4199 // Remove element nodes and prevent memory leaks
4200 if ( this[i].nodeType === 1 ) {
4201 jQuery.cleanData( this[i].getElementsByTagName("*") );
4202 this[i].innerHTML = value;
4203 }
4204 }
4205
4206 // If using innerHTML throws an exception, use the fallback method
4207 } catch(e) {
4208 this.empty().append( value );
4209 }
4210
4211 } else if ( jQuery.isFunction( value ) ) {
4212 this.each(function(i){
4213 var self = jQuery(this), old = self.html();
4214 self.empty().append(function(){
4215 return value.call( this, i, old );
4216 });
4217 });
4218
4219 } else {
4220 this.empty().append( value );
4221 }
4222
4223 return this;
4224 },
4225
4226 replaceWith: function( value ) {
4227 if ( this[0] && this[0].parentNode ) {
4228 // Make sure that the elements are removed from the DOM before they are inserted
4229 // this can help fix replacing a parent with child elements
4230 if ( jQuery.isFunction( value ) ) {
4231 return this.each(function(i) {
4232 var self = jQuery(this), old = self.html();
4233 self.replaceWith( value.call( this, i, old ) );
4234 });
4235 }
4236
4237 if ( typeof value !== "string" ) {
4238 value = jQuery(value).detach();
4239 }
4240
4241 return this.each(function() {
4242 var next = this.nextSibling, parent = this.parentNode;
4243
4244 jQuery(this).remove();
4245
4246 if ( next ) {
4247 jQuery(next).before( value );
4248 } else {
4249 jQuery(parent).append( value );
4250 }
4251 });
4252 } else {
4253 return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
4254 }
4255 },
4256
4257 detach: function( selector ) {
4258 return this.remove( selector, true );
4259 },
4260
4261 domManip: function( args, table, callback ) {
4262 var results, first, value = args[0], scripts = [], fragment, parent;
4263
4264 // We can't cloneNode fragments that contain checked, in WebKit
4265 if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
4266 return this.each(function() {
4267 jQuery(this).domManip( args, table, callback, true );
4268 });
4269 }
4270
4271 if ( jQuery.isFunction(value) ) {
4272 return this.each(function(i) {
4273 var self = jQuery(this);
4274 args[0] = value.call(this, i, table ? self.html() : undefined);
4275 self.domManip( args, table, callback );
4276 });
4277 }
4278
4279 if ( this[0] ) {
4280 parent = value && value.parentNode;
4281
4282 // If we're in a fragment, just use that instead of building a new one
4283 if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
4284 results = { fragment: parent };
4285
4286 } else {
4287 results = buildFragment( args, this, scripts );
4288 }
4289
4290 fragment = results.fragment;
4291
4292 if ( fragment.childNodes.length === 1 ) {
4293 first = fragment = fragment.firstChild;
4294 } else {
4295 first = fragment.firstChild;
4296 }
4297
4298 if ( first ) {
4299 table = table && jQuery.nodeName( first, "tr" );
4300
4301 for ( var i = 0, l = this.length; i < l; i++ ) {
4302 callback.call(
4303 table ?
4304 root(this[i], first) :
4305 this[i],
4306 i > 0 || results.cacheable || this.length > 1 ?
4307 fragment.cloneNode(true) :
4308 fragment
4309 );
4310 }
4311 }
4312
4313 if ( scripts.length ) {
4314 jQuery.each( scripts, evalScript );
4315 }
4316 }
4317
4318 return this;
4319
4320 function root( elem, cur ) {
4321 return jQuery.nodeName(elem, "table") ?
4322 (elem.getElementsByTagName("tbody")[0] ||
4323 elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
4324 elem;
4325 }
4326 }
4327});
4328
4329function cloneCopyEvent(orig, ret) {
4330 var i = 0;
4331
4332 ret.each(function() {
4333 if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
4334 return;
4335 }
4336
4337 var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
4338
4339 if ( events ) {
4340 delete curData.handle;
4341 curData.events = {};
4342
4343 for ( var type in events ) {
4344 for ( var handler in events[ type ] ) {
4345 jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
4346 }
4347 }
4348 }
4349 });
4350}
4351
4352function buildFragment( args, nodes, scripts ) {
4353 var fragment, cacheable, cacheresults,
4354 doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
4355
4356 // Only cache "small" (1/2 KB) strings that are associated with the main document
4357 // Cloning options loses the selected state, so don't cache them
4358 // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
4359 // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
4360 if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
4361 !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
4362
4363 cacheable = true;
4364 cacheresults = jQuery.fragments[ args[0] ];
4365 if ( cacheresults ) {
4366 if ( cacheresults !== 1 ) {
4367 fragment = cacheresults;
4368 }
4369 }
4370 }
4371
4372 if ( !fragment ) {
4373 fragment = doc.createDocumentFragment();
4374 jQuery.clean( args, doc, fragment, scripts );
4375 }
4376
4377 if ( cacheable ) {
4378 jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
4379 }
4380
4381 return { fragment: fragment, cacheable: cacheable };
4382}
4383
4384jQuery.fragments = {};
4385
4386jQuery.each({
4387 appendTo: "append",
4388 prependTo: "prepend",
4389 insertBefore: "before",
4390 insertAfter: "after",
4391 replaceAll: "replaceWith"
4392}, function( name, original ) {
4393 jQuery.fn[ name ] = function( selector ) {
4394 var ret = [], insert = jQuery( selector ),
4395 parent = this.length === 1 && this[0].parentNode;
4396
4397 if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
4398 insert[ original ]( this[0] );
4399 return this;
4400
4401 } else {
4402 for ( var i = 0, l = insert.length; i < l; i++ ) {
4403 var elems = (i > 0 ? this.clone(true) : this).get();
4404 jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
4405 ret = ret.concat( elems );
4406 }
4407
4408 return this.pushStack( ret, name, insert.selector );
4409 }
4410 };
4411});
4412
4413jQuery.extend({
4414 clean: function( elems, context, fragment, scripts ) {
4415 context = context || document;
4416
4417 // !context.createElement fails in IE with an error but returns typeof 'object'
4418 if ( typeof context.createElement === "undefined" ) {
4419 context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
4420 }
4421
4422 var ret = [];
4423
4424 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
4425 if ( typeof elem === "number" ) {
4426 elem += "";
4427 }
4428
4429 if ( !elem ) {
4430 continue;
4431 }
4432
4433 // Convert html string into DOM nodes
4434 if ( typeof elem === "string" && !rhtml.test( elem ) ) {
4435 elem = context.createTextNode( elem );
4436
4437 } else if ( typeof elem === "string" ) {
4438 // Fix "XHTML"-style tags in all browsers
4439 elem = elem.replace(rxhtmlTag, fcloseTag);
4440
4441 // Trim whitespace, otherwise indexOf won't work as expected
4442 var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
4443 wrap = wrapMap[ tag ] || wrapMap._default,
4444 depth = wrap[0],
4445 div = context.createElement("div");
4446
4447 // Go to html and back, then peel off extra wrappers
4448 div.innerHTML = wrap[1] + elem + wrap[2];
4449
4450 // Move to the right depth
4451 while ( depth-- ) {
4452 div = div.lastChild;
4453 }
4454
4455 // Remove IE's autoinserted <tbody> from table fragments
4456 if ( !jQuery.support.tbody ) {
4457
4458 // String was a <table>, *may* have spurious <tbody>
4459 var hasBody = rtbody.test(elem),
4460 tbody = tag === "table" && !hasBody ?
4461 div.firstChild && div.firstChild.childNodes :
4462
4463 // String was a bare <thead> or <tfoot>
4464 wrap[1] === "<table>" && !hasBody ?
4465 div.childNodes :
4466 [];
4467
4468 for ( var j = tbody.length - 1; j >= 0 ; --j ) {
4469 if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
4470 tbody[ j ].parentNode.removeChild( tbody[ j ] );
4471 }
4472 }
4473
4474 }
4475
4476 // IE completely kills leading whitespace when innerHTML is used
4477 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
4478 div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
4479 }
4480
4481 elem = div.childNodes;
4482 }
4483
4484 if ( elem.nodeType ) {
4485 ret.push( elem );
4486 } else {
4487 ret = jQuery.merge( ret, elem );
4488 }
4489 }
4490
4491 if ( fragment ) {
4492 for ( var i = 0; ret[i]; i++ ) {
4493 if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
4494 scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
4495
4496 } else {
4497 if ( ret[i].nodeType === 1 ) {
4498 ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
4499 }
4500 fragment.appendChild( ret[i] );
4501 }
4502 }
4503 }
4504
4505 return ret;
4506 },
4507
4508 cleanData: function( elems ) {
4509 var data, id, cache = jQuery.cache,
4510 special = jQuery.event.special,
4511 deleteExpando = jQuery.support.deleteExpando;
4512
4513 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
4514 id = elem[ jQuery.expando ];
4515
4516 if ( id ) {
4517 data = cache[ id ];
4518
4519 if ( data.events ) {
4520 for ( var type in data.events ) {
4521 if ( special[ type ] ) {
4522 jQuery.event.remove( elem, type );
4523
4524 } else {
4525 removeEvent( elem, type, data.handle );
4526 }
4527 }
4528 }
4529
4530 if ( deleteExpando ) {
4531 delete elem[ jQuery.expando ];
4532
4533 } else if ( elem.removeAttribute ) {
4534 elem.removeAttribute( jQuery.expando );
4535 }
4536
4537 delete cache[ id ];
4538 }
4539 }
4540 }
4541});
4542// exclude the following css properties to add px
4543var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
4544 ralpha = /alpha\([^)]*\)/,
4545 ropacity = /opacity=([^)]*)/,
4546 rfloat = /float/i,
4547 rdashAlpha = /-([a-z])/ig,
4548 rupper = /([A-Z])/g,
4549 rnumpx = /^-?\d+(?:px)?$/i,
4550 rnum = /^-?\d/,
4551
4552 cssShow = { position: "absolute", visibility: "hidden", display:"block" },
4553 cssWidth = [ "Left", "Right" ],
4554 cssHeight = [ "Top", "Bottom" ],
4555
4556 // cache check for defaultView.getComputedStyle
4557 getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
4558 // normalize float css property
4559 styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
4560 fcamelCase = function( all, letter ) {
4561 return letter.toUpperCase();
4562 };
4563
4564jQuery.fn.css = function( name, value ) {
4565 return access( this, name, value, true, function( elem, name, value ) {
4566 if ( value === undefined ) {
4567 return jQuery.curCSS( elem, name );
4568 }
4569
4570 if ( typeof value === "number" && !rexclude.test(name) ) {
4571 value += "px";
4572 }
4573
4574 jQuery.style( elem, name, value );
4575 });
4576};
4577
4578jQuery.extend({
4579 style: function( elem, name, value ) {
4580 // don't set styles on text and comment nodes
4581 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
4582 return undefined;
4583 }
4584
4585 // ignore negative width and height values #1599
4586 if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
4587 value = undefined;
4588 }
4589
4590 var style = elem.style || elem, set = value !== undefined;
4591
4592 // IE uses filters for opacity
4593 if ( !jQuery.support.opacity && name === "opacity" ) {
4594 if ( set ) {
4595 // IE has trouble with opacity if it does not have layout
4596 // Force it by setting the zoom level
4597 style.zoom = 1;
4598
4599 // Set the alpha filter to set the opacity
4600 var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
4601 var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
4602 style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
4603 }
4604
4605 return style.filter && style.filter.indexOf("opacity=") >= 0 ?
4606 (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
4607 "";
4608 }
4609
4610 // Make sure we're using the right name for getting the float value
4611 if ( rfloat.test( name ) ) {
4612 name = styleFloat;
4613 }
4614
4615 name = name.replace(rdashAlpha, fcamelCase);
4616
4617 if ( set ) {
4618 style[ name ] = value;
4619 }
4620
4621 return style[ name ];
4622 },
4623
4624 css: function( elem, name, force, extra ) {
4625 if ( name === "width" || name === "height" ) {
4626 var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
4627
4628 function getWH() {
4629 val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
4630
4631 if ( extra === "border" ) {
4632 return;
4633 }
4634
4635 jQuery.each( which, function() {
4636 if ( !extra ) {
4637 val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
4638 }
4639
4640 if ( extra === "margin" ) {
4641 val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
4642 } else {
4643 val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
4644 }
4645 });
4646 }
4647
4648 if ( elem.offsetWidth !== 0 ) {
4649 getWH();
4650 } else {
4651 jQuery.swap( elem, props, getWH );
4652 }
4653
4654 return Math.max(0, Math.round(val));
4655 }
4656
4657 return jQuery.curCSS( elem, name, force );
4658 },
4659
4660 curCSS: function( elem, name, force ) {
4661 var ret, style = elem.style, filter;
4662
4663 // IE uses filters for opacity
4664 if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
4665 ret = ropacity.test(elem.currentStyle.filter || "") ?
4666 (parseFloat(RegExp.$1) / 100) + "" :
4667 "";
4668
4669 return ret === "" ?
4670 "1" :
4671 ret;
4672 }
4673
4674 // Make sure we're using the right name for getting the float value
4675 if ( rfloat.test( name ) ) {
4676 name = styleFloat;
4677 }
4678
4679 if ( !force && style && style[ name ] ) {
4680 ret = style[ name ];
4681
4682 } else if ( getComputedStyle ) {
4683
4684 // Only "float" is needed here
4685 if ( rfloat.test( name ) ) {
4686 name = "float";
4687 }
4688
4689 name = name.replace( rupper, "-$1" ).toLowerCase();
4690
4691 var defaultView = elem.ownerDocument.defaultView;
4692
4693 if ( !defaultView ) {
4694 return null;
4695 }
4696
4697 var computedStyle = defaultView.getComputedStyle( elem, null );
4698
4699 if ( computedStyle ) {
4700 ret = computedStyle.getPropertyValue( name );
4701 }
4702
4703 // We should always get a number back from opacity
4704 if ( name === "opacity" && ret === "" ) {
4705 ret = "1";
4706 }
4707
4708 } else if ( elem.currentStyle ) {
4709 var camelCase = name.replace(rdashAlpha, fcamelCase);
4710
4711 ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
4712
4713 // From the awesome hack by Dean Edwards
4714 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
4715
4716 // If we're not dealing with a regular pixel number
4717 // but a number that has a weird ending, we need to convert it to pixels
4718 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
4719 // Remember the original values
4720 var left = style.left, rsLeft = elem.runtimeStyle.left;
4721
4722 // Put in the new values to get a computed value out
4723 elem.runtimeStyle.left = elem.currentStyle.left;
4724 style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
4725 ret = style.pixelLeft + "px";
4726
4727 // Revert the changed values
4728 style.left = left;
4729 elem.runtimeStyle.left = rsLeft;
4730 }
4731 }
4732
4733 return ret;
4734 },
4735
4736 // A method for quickly swapping in/out CSS properties to get correct calculations
4737 swap: function( elem, options, callback ) {
4738 var old = {};
4739
4740 // Remember the old values, and insert the new ones
4741 for ( var name in options ) {
4742 old[ name ] = elem.style[ name ];
4743 elem.style[ name ] = options[ name ];
4744 }
4745
4746 callback.call( elem );
4747
4748 // Revert the old values
4749 for ( var name in options ) {
4750 elem.style[ name ] = old[ name ];
4751 }
4752 }
4753});
4754
4755if ( jQuery.expr && jQuery.expr.filters ) {
4756 jQuery.expr.filters.hidden = function( elem ) {
4757 var width = elem.offsetWidth, height = elem.offsetHeight,
4758 skip = elem.nodeName.toLowerCase() === "tr";
4759
4760 return width === 0 && height === 0 && !skip ?
4761 true :
4762 width > 0 && height > 0 && !skip ?
4763 false :
4764 jQuery.curCSS(elem, "display") === "none";
4765 };
4766
4767 jQuery.expr.filters.visible = function( elem ) {
4768 return !jQuery.expr.filters.hidden( elem );
4769 };
4770}
4771var jsc = now(),
4772 rscript = /<script(.|\s)*?\/script>/gi,
4773 rselectTextarea = /select|textarea/i,
4774 rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
4775 jsre = /=\?(&|$)/,
4776 rquery = /\?/,
4777 rts = /(\?|&)_=.*?(&|$)/,
4778 rurl = /^(\w+:)?\/\/([^\/?#]+)/,
4779 r20 = /%20/g,
4780
4781 // Keep a copy of the old load method
4782 _load = jQuery.fn.load;
4783
4784jQuery.fn.extend({
4785 load: function( url, params, callback ) {
4786 if ( typeof url !== "string" ) {
4787 return _load.call( this, url );
4788
4789 // Don't do a request if no elements are being requested
4790 } else if ( !this.length ) {
4791 return this;
4792 }
4793
4794 var off = url.indexOf(" ");
4795 if ( off >= 0 ) {
4796 var selector = url.slice(off, url.length);
4797 url = url.slice(0, off);
4798 }
4799
4800 // Default to a GET request
4801 var type = "GET";
4802
4803 // If the second parameter was provided
4804 if ( params ) {
4805 // If it's a function
4806 if ( jQuery.isFunction( params ) ) {
4807 // We assume that it's the callback
4808 callback = params;
4809 params = null;
4810
4811 // Otherwise, build a param string
4812 } else if ( typeof params === "object" ) {
4813 params = jQuery.param( params, jQuery.ajaxSettings.traditional );
4814 type = "POST";
4815 }
4816 }
4817
4818 var self = this;
4819
4820 // Request the remote document
4821 jQuery.ajax({
4822 url: url,
4823 type: type,
4824 dataType: "html",
4825 data: params,
4826 complete: function( res, status ) {
4827 // If successful, inject the HTML into all the matched elements
4828 if ( status === "success" || status === "notmodified" ) {
4829 // See if a selector was specified
4830 self.html( selector ?
4831 // Create a dummy div to hold the results
4832 jQuery("<div />")
4833 // inject the contents of the document in, removing the scripts
4834 // to avoid any 'Permission Denied' errors in IE
4835 .append(res.responseText.replace(rscript, ""))
4836
4837 // Locate the specified elements
4838 .find(selector) :
4839
4840 // If not, just inject the full result
4841 res.responseText );
4842 }
4843
4844 if ( callback ) {
4845 self.each( callback, [res.responseText, status, res] );
4846 }
4847 }
4848 });
4849
4850 return this;
4851 },
4852
4853 serialize: function() {
4854 return jQuery.param(this.serializeArray());
4855 },
4856 serializeArray: function() {
4857 return this.map(function() {
4858 return this.elements ? jQuery.makeArray(this.elements) : this;
4859 })
4860 .filter(function() {
4861 return this.name && !this.disabled &&
4862 (this.checked || rselectTextarea.test(this.nodeName) ||
4863 rinput.test(this.type));
4864 })
4865 .map(function( i, elem ) {
4866 var val = jQuery(this).val();
4867
4868 return val == null ?
4869 null :
4870 jQuery.isArray(val) ?
4871 jQuery.map( val, function( val, i ) {
4872 return { name: elem.name, value: val };
4873 }) :
4874 { name: elem.name, value: val };
4875 }).get();
4876 }
4877});
4878
4879// Attach a bunch of functions for handling common AJAX events
4880jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
4881 jQuery.fn[o] = function( f ) {
4882 return this.bind(o, f);
4883 };
4884});
4885
4886jQuery.extend({
4887
4888 get: function( url, data, callback, type ) {
4889 // shift arguments if data argument was omited
4890 if ( jQuery.isFunction( data ) ) {
4891 type = type || callback;
4892 callback = data;
4893 data = null;
4894 }
4895
4896 return jQuery.ajax({
4897 type: "GET",
4898 url: url,
4899 data: data,
4900 success: callback,
4901 dataType: type
4902 });
4903 },
4904
4905 getScript: function( url, callback ) {
4906 return jQuery.get(url, null, callback, "script");
4907 },
4908
4909 getJSON: function( url, data, callback ) {
4910 return jQuery.get(url, data, callback, "json");
4911 },
4912
4913 post: function( url, data, callback, type ) {
4914 // shift arguments if data argument was omited
4915 if ( jQuery.isFunction( data ) ) {
4916 type = type || callback;
4917 callback = data;
4918 data = {};
4919 }
4920
4921 return jQuery.ajax({
4922 type: "POST",
4923 url: url,
4924 data: data,
4925 success: callback,
4926 dataType: type
4927 });
4928 },
4929
4930 ajaxSetup: function( settings ) {
4931 jQuery.extend( jQuery.ajaxSettings, settings );
4932 },
4933
4934 ajaxSettings: {
4935 url: location.href,
4936 global: true,
4937 type: "GET",
4938 contentType: "application/x-www-form-urlencoded",
4939 processData: true,
4940 async: true,
4941 /*
4942 timeout: 0,
4943 data: null,
4944 username: null,
4945 password: null,
4946 traditional: false,
4947 */
4948 // Create the request object; Microsoft failed to properly
4949 // implement the XMLHttpRequest in IE7 (can't request local files),
4950 // so we use the ActiveXObject when it is available
4951 // This function can be overriden by calling jQuery.ajaxSetup
4952 xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
4953 function() {
4954 return new window.XMLHttpRequest();
4955 } :
4956 function() {
4957 try {
4958 return new window.ActiveXObject("Microsoft.XMLHTTP");
4959 } catch(e) {}
4960 },
4961 accepts: {
4962 xml: "application/xml, text/xml",
4963 html: "text/html",
4964 script: "text/javascript, application/javascript",
4965 json: "application/json, text/javascript",
4966 text: "text/plain",
4967 _default: "*/*"
4968 }
4969 },
4970
4971 // Last-Modified header cache for next request
4972 lastModified: {},
4973 etag: {},
4974
4975 ajax: function( origSettings ) {
4976 var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
4977
4978 var jsonp, status, data,
4979 callbackContext = origSettings && origSettings.context || s,
4980 type = s.type.toUpperCase();
4981
4982 // convert data if not already a string
4983 if ( s.data && s.processData && typeof s.data !== "string" ) {
4984 s.data = jQuery.param( s.data, s.traditional );
4985 }
4986
4987 // Handle JSONP Parameter Callbacks
4988 if ( s.dataType === "jsonp" ) {
4989 if ( type === "GET" ) {
4990 if ( !jsre.test( s.url ) ) {
4991 s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
4992 }
4993 } else if ( !s.data || !jsre.test(s.data) ) {
4994 s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
4995 }
4996 s.dataType = "json";
4997 }
4998
4999 // Build temporary JSONP function
5000 if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
5001 jsonp = s.jsonpCallback || ("jsonp" + jsc++);
5002
5003 // Replace the =? sequence both in the query string and the data
5004 if ( s.data ) {
5005 s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
5006 }
5007
5008 s.url = s.url.replace(jsre, "=" + jsonp + "$1");
5009
5010 // We need to make sure
5011 // that a JSONP style response is executed properly
5012 s.dataType = "script";
5013
5014 // Handle JSONP-style loading
5015 window[ jsonp ] = window[ jsonp ] || function( tmp ) {
5016 data = tmp;
5017 success();
5018 complete();
5019 // Garbage collect
5020 window[ jsonp ] = undefined;
5021
5022 try {
5023 delete window[ jsonp ];
5024 } catch(e) {}
5025
5026 if ( head ) {
5027 head.removeChild( script );
5028 }
5029 };
5030 }
5031
5032 if ( s.dataType === "script" && s.cache === null ) {
5033 s.cache = false;
5034 }
5035
5036 if ( s.cache === false && type === "GET" ) {
5037 var ts = now();
5038
5039 // try replacing _= if it is there
5040 var ret = s.url.replace(rts, "$1_=" + ts + "$2");
5041
5042 // if nothing was replaced, add timestamp to the end
5043 s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
5044 }
5045
5046 // If data is available, append data to url for get requests
5047 if ( s.data && type === "GET" ) {
5048 s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
5049 }
5050
5051 // Watch for a new set of requests
5052 if ( s.global && ! jQuery.active++ ) {
5053 jQuery.event.trigger( "ajaxStart" );
5054 }
5055
5056 // Matches an absolute URL, and saves the domain
5057 var parts = rurl.exec( s.url ),
5058 remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
5059
5060 // If we're requesting a remote document
5061 // and trying to load JSON or Script with a GET
5062 if ( s.dataType === "script" && type === "GET" && remote ) {
5063 var head = document.getElementsByTagName("head")[0] || document.documentElement;
5064 var script = document.createElement("script");
5065 script.src = s.url;
5066 if ( s.scriptCharset ) {
5067 script.charset = s.scriptCharset;
5068 }
5069
5070 // Handle Script loading
5071 if ( !jsonp ) {
5072 var done = false;
5073
5074 // Attach handlers for all browsers
5075 script.onload = script.onreadystatechange = function() {
5076 if ( !done && (!this.readyState ||
5077 this.readyState === "loaded" || this.readyState === "complete") ) {
5078 done = true;
5079 success();
5080 complete();
5081
5082 // Handle memory leak in IE
5083 script.onload = script.onreadystatechange = null;
5084 if ( head && script.parentNode ) {
5085 head.removeChild( script );
5086 }
5087 }
5088 };
5089 }
5090
5091 // Use insertBefore instead of appendChild to circumvent an IE6 bug.
5092 // This arises when a base node is used (#2709 and #4378).
5093 head.insertBefore( script, head.firstChild );
5094
5095 // We handle everything using the script element injection
5096 return undefined;
5097 }
5098
5099 var requestDone = false;
5100
5101 // Create the request object
5102 var xhr = s.xhr();
5103
5104 if ( !xhr ) {
5105 return;
5106 }
5107
5108 // Open the socket
5109 // Passing null username, generates a login popup on Opera (#2865)
5110 if ( s.username ) {
5111 xhr.open(type, s.url, s.async, s.username, s.password);
5112 } else {
5113 xhr.open(type, s.url, s.async);
5114 }
5115
5116 // Need an extra try/catch for cross domain requests in Firefox 3
5117 try {
5118 // Set the correct header, if data is being sent
5119 if ( s.data || origSettings && origSettings.contentType ) {
5120 xhr.setRequestHeader("Content-Type", s.contentType);
5121 }
5122
5123 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
5124 if ( s.ifModified ) {
5125 if ( jQuery.lastModified[s.url] ) {
5126 xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
5127 }
5128
5129 if ( jQuery.etag[s.url] ) {
5130 xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
5131 }
5132 }
5133
5134 // Set header so the called script knows that it's an XMLHttpRequest
5135 // Only send the header if it's not a remote XHR
5136 if ( !remote ) {
5137 xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
5138 }
5139
5140 // Set the Accepts header for the server, depending on the dataType
5141 xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
5142 s.accepts[ s.dataType ] + ", */*" :
5143 s.accepts._default );
5144 } catch(e) {}
5145
5146 // Allow custom headers/mimetypes and early abort
5147 if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
5148 // Handle the global AJAX counter
5149 if ( s.global && ! --jQuery.active ) {
5150 jQuery.event.trigger( "ajaxStop" );
5151 }
5152
5153 // close opended socket
5154 xhr.abort();
5155 return false;
5156 }
5157
5158 if ( s.global ) {
5159 trigger("ajaxSend", [xhr, s]);
5160 }
5161
5162 // Wait for a response to come back
5163 var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
5164 // The request was aborted
5165 if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
5166 // Opera doesn't call onreadystatechange before this point
5167 // so we simulate the call
5168 if ( !requestDone ) {
5169 complete();
5170 }
5171
5172 requestDone = true;
5173 if ( xhr ) {
5174 xhr.onreadystatechange = jQuery.noop;
5175 }
5176
5177 // The transfer is complete and the data is available, or the request timed out
5178 } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
5179 requestDone = true;
5180 xhr.onreadystatechange = jQuery.noop;
5181
5182 status = isTimeout === "timeout" ?
5183 "timeout" :
5184 !jQuery.httpSuccess( xhr ) ?
5185 "error" :
5186 s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
5187 "notmodified" :
5188 "success";
5189
5190 var errMsg;
5191
5192 if ( status === "success" ) {
5193 // Watch for, and catch, XML document parse errors
5194 try {
5195 // process the data (runs the xml through httpData regardless of callback)
5196 data = jQuery.httpData( xhr, s.dataType, s );
5197 } catch(err) {
5198 status = "parsererror";
5199 errMsg = err;
5200 }
5201 }
5202
5203 // Make sure that the request was successful or notmodified
5204 if ( status === "success" || status === "notmodified" ) {
5205 // JSONP handles its own success callback
5206 if ( !jsonp ) {
5207 success();
5208 }
5209 } else {
5210 jQuery.handleError(s, xhr, status, errMsg);
5211 }
5212
5213 // Fire the complete handlers
5214 complete();
5215
5216 if ( isTimeout === "timeout" ) {
5217 xhr.abort();
5218 }
5219
5220 // Stop memory leaks
5221 if ( s.async ) {
5222 xhr = null;
5223 }
5224 }
5225 };
5226
5227 // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
5228 // Opera doesn't fire onreadystatechange at all on abort
5229 try {
5230 var oldAbort = xhr.abort;
5231 xhr.abort = function() {
5232 if ( xhr ) {
5233 oldAbort.call( xhr );
5234 }
5235
5236 onreadystatechange( "abort" );
5237 };
5238 } catch(e) { }
5239
5240 // Timeout checker
5241 if ( s.async && s.timeout > 0 ) {
5242 setTimeout(function() {
5243 // Check to see if the request is still happening
5244 if ( xhr && !requestDone ) {
5245 onreadystatechange( "timeout" );
5246 }
5247 }, s.timeout);
5248 }
5249
5250 // Send the data
5251 try {
5252 xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
5253 } catch(e) {
5254 jQuery.handleError(s, xhr, null, e);
5255 // Fire the complete handlers
5256 complete();
5257 }
5258
5259 // firefox 1.5 doesn't fire statechange for sync requests
5260 if ( !s.async ) {
5261 onreadystatechange();
5262 }
5263
5264 function success() {
5265 // If a local callback was specified, fire it and pass it the data
5266 if ( s.success ) {
5267 s.success.call( callbackContext, data, status, xhr );
5268 }
5269
5270 // Fire the global callback
5271 if ( s.global ) {
5272 trigger( "ajaxSuccess", [xhr, s] );
5273 }
5274 }
5275
5276 function complete() {
5277 // Process result
5278 if ( s.complete ) {
5279 s.complete.call( callbackContext, xhr, status);
5280 }
5281
5282 // The request was completed
5283 if ( s.global ) {
5284 trigger( "ajaxComplete", [xhr, s] );
5285 }
5286
5287 // Handle the global AJAX counter
5288 if ( s.global && ! --jQuery.active ) {
5289 jQuery.event.trigger( "ajaxStop" );
5290 }
5291 }
5292
5293 function trigger(type, args) {
5294 (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
5295 }
5296
5297 // return XMLHttpRequest to allow aborting the request etc.
5298 return xhr;
5299 },
5300
5301 handleError: function( s, xhr, status, e ) {
5302 // If a local callback was specified, fire it
5303 if ( s.error ) {
5304 s.error.call( s.context || s, xhr, status, e );
5305 }
5306
5307 // Fire the global callback
5308 if ( s.global ) {
5309 (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
5310 }
5311 },
5312
5313 // Counter for holding the number of active queries
5314 active: 0,
5315
5316 // Determines if an XMLHttpRequest was successful or not
5317 httpSuccess: function( xhr ) {
5318 try {
5319 // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
5320 return !xhr.status && location.protocol === "file:" ||
5321 // Opera returns 0 when status is 304
5322 ( xhr.status >= 200 && xhr.status < 300 ) ||
5323 xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
5324 } catch(e) {}
5325
5326 return false;
5327 },
5328
5329 // Determines if an XMLHttpRequest returns NotModified
5330 httpNotModified: function( xhr, url ) {
5331 var lastModified = xhr.getResponseHeader("Last-Modified"),
5332 etag = xhr.getResponseHeader("Etag");
5333
5334 if ( lastModified ) {
5335 jQuery.lastModified[url] = lastModified;
5336 }
5337
5338 if ( etag ) {
5339 jQuery.etag[url] = etag;
5340 }
5341
5342 // Opera returns 0 when status is 304
5343 return xhr.status === 304 || xhr.status === 0;
5344 },
5345
5346 httpData: function( xhr, type, s ) {
5347 var ct = xhr.getResponseHeader("content-type") || "",
5348 xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
5349 data = xml ? xhr.responseXML : xhr.responseText;
5350
5351 if ( xml && data.documentElement.nodeName === "parsererror" ) {
5352 jQuery.error( "parsererror" );
5353 }
5354
5355 // Allow a pre-filtering function to sanitize the response
5356 // s is checked to keep backwards compatibility
5357 if ( s && s.dataFilter ) {
5358 data = s.dataFilter( data, type );
5359 }
5360
5361 // The filter can actually parse the response
5362 if ( typeof data === "string" ) {
5363 // Get the JavaScript object, if JSON is used.
5364 if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
5365 data = jQuery.parseJSON( data );
5366
5367 // If the type is "script", eval it in global context
5368 } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
5369 jQuery.globalEval( data );
5370 }
5371 }
5372
5373 return data;
5374 },
5375
5376 // Serialize an array of form elements or a set of
5377 // key/values into a query string
5378 param: function( a, traditional ) {
5379 var s = [];
5380
5381 // Set traditional to true for jQuery <= 1.3.2 behavior.
5382 if ( traditional === undefined ) {
5383 traditional = jQuery.ajaxSettings.traditional;
5384 }
5385
5386 // If an array was passed in, assume that it is an array of form elements.
5387 if ( jQuery.isArray(a) || a.jquery ) {
5388 // Serialize the form elements
5389 jQuery.each( a, function() {
5390 add( this.name, this.value );
5391 });
5392
5393 } else {
5394 // If traditional, encode the "old" way (the way 1.3.2 or older
5395 // did it), otherwise encode params recursively.
5396 for ( var prefix in a ) {
5397 buildParams( prefix, a[prefix] );
5398 }
5399 }
5400
5401 // Return the resulting serialization
5402 return s.join("&").replace(r20, "+");
5403
5404 function buildParams( prefix, obj ) {
5405 if ( jQuery.isArray(obj) ) {
5406 // Serialize array item.
5407 jQuery.each( obj, function( i, v ) {
5408 if ( traditional || /\[\]$/.test( prefix ) ) {
5409 // Treat each array item as a scalar.
5410 add( prefix, v );
5411 } else {
5412 // If array item is non-scalar (array or object), encode its
5413 // numeric index to resolve deserialization ambiguity issues.
5414 // Note that rack (as of 1.0.0) can't currently deserialize
5415 // nested arrays properly, and attempting to do so may cause
5416 // a server error. Possible fixes are to modify rack's
5417 // deserialization algorithm or to provide an option or flag
5418 // to force array serialization to be shallow.
5419 buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
5420 }
5421 });
5422
5423 } else if ( !traditional && obj != null && typeof obj === "object" ) {
5424 // Serialize object item.
5425 jQuery.each( obj, function( k, v ) {
5426 buildParams( prefix + "[" + k + "]", v );
5427 });
5428
5429 } else {
5430 // Serialize scalar item.
5431 add( prefix, obj );
5432 }
5433 }
5434
5435 function add( key, value ) {
5436 // If value is a function, invoke it and return its value
5437 value = jQuery.isFunction(value) ? value() : value;
5438 s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
5439 }
5440 }
5441});
5442var elemdisplay = {},
5443 rfxtypes = /toggle|show|hide/,
5444 rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
5445 timerId,
5446 fxAttrs = [
5447 // height animations
5448 [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
5449 // width animations
5450 [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
5451 // opacity animations
5452 [ "opacity" ]
5453 ];
5454
5455jQuery.fn.extend({
5456 show: function( speed, callback ) {
5457 if ( speed || speed === 0) {
5458 return this.animate( genFx("show", 3), speed, callback);
5459
5460 } else {
5461 for ( var i = 0, l = this.length; i < l; i++ ) {
5462 var old = jQuery.data(this[i], "olddisplay");
5463
5464 this[i].style.display = old || "";
5465
5466 if ( jQuery.css(this[i], "display") === "none" ) {
5467 var nodeName = this[i].nodeName, display;
5468
5469 if ( elemdisplay[ nodeName ] ) {
5470 display = elemdisplay[ nodeName ];
5471
5472 } else {
5473 var elem = jQuery("<" + nodeName + " />").appendTo("body");
5474
5475 display = elem.css("display");
5476
5477 if ( display === "none" ) {
5478 display = "block";
5479 }
5480
5481 elem.remove();
5482
5483 elemdisplay[ nodeName ] = display;
5484 }
5485
5486 jQuery.data(this[i], "olddisplay", display);
5487 }
5488 }
5489
5490 // Set the display of the elements in a second loop
5491 // to avoid the constant reflow
5492 for ( var j = 0, k = this.length; j < k; j++ ) {
5493 this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
5494 }
5495
5496 return this;
5497 }
5498 },
5499
5500 hide: function( speed, callback ) {
5501 if ( speed || speed === 0 ) {
5502 return this.animate( genFx("hide", 3), speed, callback);
5503
5504 } else {
5505 for ( var i = 0, l = this.length; i < l; i++ ) {
5506 var old = jQuery.data(this[i], "olddisplay");
5507 if ( !old && old !== "none" ) {
5508 jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
5509 }
5510 }
5511
5512 // Set the display of the elements in a second loop
5513 // to avoid the constant reflow
5514 for ( var j = 0, k = this.length; j < k; j++ ) {
5515 this[j].style.display = "none";
5516 }
5517
5518 return this;
5519 }
5520 },
5521
5522 // Save the old toggle function
5523 _toggle: jQuery.fn.toggle,
5524
5525 toggle: function( fn, fn2 ) {
5526 var bool = typeof fn === "boolean";
5527
5528 if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
5529 this._toggle.apply( this, arguments );
5530
5531 } else if ( fn == null || bool ) {
5532 this.each(function() {
5533 var state = bool ? fn : jQuery(this).is(":hidden");
5534 jQuery(this)[ state ? "show" : "hide" ]();
5535 });
5536
5537 } else {
5538 this.animate(genFx("toggle", 3), fn, fn2);
5539 }
5540
5541 return this;
5542 },
5543
5544 fadeTo: function( speed, to, callback ) {
5545 return this.filter(":hidden").css("opacity", 0).show().end()
5546 .animate({opacity: to}, speed, callback);
5547 },
5548
5549 animate: function( prop, speed, easing, callback ) {
5550 var optall = jQuery.speed(speed, easing, callback);
5551
5552 if ( jQuery.isEmptyObject( prop ) ) {
5553 return this.each( optall.complete );
5554 }
5555
5556 return this[ optall.queue === false ? "each" : "queue" ](function() {
5557 var opt = jQuery.extend({}, optall), p,
5558 hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
5559 self = this;
5560
5561 for ( p in prop ) {
5562 var name = p.replace(rdashAlpha, fcamelCase);
5563
5564 if ( p !== name ) {
5565 prop[ name ] = prop[ p ];
5566 delete prop[ p ];
5567 p = name;
5568 }
5569
5570 if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
5571 return opt.complete.call(this);
5572 }
5573
5574 if ( ( p === "height" || p === "width" ) && this.style ) {
5575 // Store display property
5576 opt.display = jQuery.css(this, "display");
5577
5578 // Make sure that nothing sneaks out
5579 opt.overflow = this.style.overflow;
5580 }
5581
5582 if ( jQuery.isArray( prop[p] ) ) {
5583 // Create (if needed) and add to specialEasing
5584 (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
5585 prop[p] = prop[p][0];
5586 }
5587 }
5588
5589 if ( opt.overflow != null ) {
5590 this.style.overflow = "hidden";
5591 }
5592
5593 opt.curAnim = jQuery.extend({}, prop);
5594
5595 jQuery.each( prop, function( name, val ) {
5596 var e = new jQuery.fx( self, opt, name );
5597
5598 if ( rfxtypes.test(val) ) {
5599 e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
5600
5601 } else {
5602 var parts = rfxnum.exec(val),
5603 start = e.cur(true) || 0;
5604
5605 if ( parts ) {
5606 var end = parseFloat( parts[2] ),
5607 unit = parts[3] || "px";
5608
5609 // We need to compute starting value
5610 if ( unit !== "px" ) {
5611 self.style[ name ] = (end || 1) + unit;
5612 start = ((end || 1) / e.cur(true)) * start;
5613 self.style[ name ] = start + unit;
5614 }
5615
5616 // If a +=/-= token was provided, we're doing a relative animation
5617 if ( parts[1] ) {
5618 end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
5619 }
5620
5621 e.custom( start, end, unit );
5622
5623 } else {
5624 e.custom( start, val, "" );
5625 }
5626 }
5627 });
5628
5629 // For JS strict compliance
5630 return true;
5631 });
5632 },
5633
5634 stop: function( clearQueue, gotoEnd ) {
5635 var timers = jQuery.timers;
5636
5637 if ( clearQueue ) {
5638 this.queue([]);
5639 }
5640
5641 this.each(function() {
5642 // go in reverse order so anything added to the queue during the loop is ignored
5643 for ( var i = timers.length - 1; i >= 0; i-- ) {
5644 if ( timers[i].elem === this ) {
5645 if (gotoEnd) {
5646 // force the next step to be the last
5647 timers[i](true);
5648 }
5649
5650 timers.splice(i, 1);
5651 }
5652 }
5653 });
5654
5655 // start the next in the queue if the last step wasn't forced
5656 if ( !gotoEnd ) {
5657 this.dequeue();
5658 }
5659
5660 return this;
5661 }
5662
5663});
5664
5665// Generate shortcuts for custom animations
5666jQuery.each({
5667 slideDown: genFx("show", 1),
5668 slideUp: genFx("hide", 1),
5669 slideToggle: genFx("toggle", 1),
5670 fadeIn: { opacity: "show" },
5671 fadeOut: { opacity: "hide" }
5672}, function( name, props ) {
5673 jQuery.fn[ name ] = function( speed, callback ) {
5674 return this.animate( props, speed, callback );
5675 };
5676});
5677
5678jQuery.extend({
5679 speed: function( speed, easing, fn ) {
5680 var opt = speed && typeof speed === "object" ? speed : {
5681 complete: fn || !fn && easing ||
5682 jQuery.isFunction( speed ) && speed,
5683 duration: speed,
5684 easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
5685 };
5686
5687 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
5688 jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
5689
5690 // Queueing
5691 opt.old = opt.complete;
5692 opt.complete = function() {
5693 if ( opt.queue !== false ) {
5694 jQuery(this).dequeue();
5695 }
5696 if ( jQuery.isFunction( opt.old ) ) {
5697 opt.old.call( this );
5698 }
5699 };
5700
5701 return opt;
5702 },
5703
5704 easing: {
5705 linear: function( p, n, firstNum, diff ) {
5706 return firstNum + diff * p;
5707 },
5708 swing: function( p, n, firstNum, diff ) {
5709 return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
5710 }
5711 },
5712
5713 timers: [],
5714
5715 fx: function( elem, options, prop ) {
5716 this.options = options;
5717 this.elem = elem;
5718 this.prop = prop;
5719
5720 if ( !options.orig ) {
5721 options.orig = {};
5722 }
5723 }
5724
5725});
5726
5727jQuery.fx.prototype = {
5728 // Simple function for setting a style value
5729 update: function() {
5730 if ( this.options.step ) {
5731 this.options.step.call( this.elem, this.now, this );
5732 }
5733
5734 (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
5735
5736 // Set display property to block for height/width animations
5737 if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
5738 this.elem.style.display = "block";
5739 }
5740 },
5741
5742 // Get the current size
5743 cur: function( force ) {
5744 if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
5745 return this.elem[ this.prop ];
5746 }
5747
5748 var r = parseFloat(jQuery.css(this.elem, this.prop, force));
5749 return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
5750 },
5751
5752 // Start an animation from one number to another
5753 custom: function( from, to, unit ) {
5754 this.startTime = now();
5755 this.start = from;
5756 this.end = to;
5757 this.unit = unit || this.unit || "px";
5758 this.now = this.start;
5759 this.pos = this.state = 0;
5760
5761 var self = this;
5762 function t( gotoEnd ) {
5763 return self.step(gotoEnd);
5764 }
5765
5766 t.elem = this.elem;
5767
5768 if ( t() && jQuery.timers.push(t) && !timerId ) {
5769 timerId = setInterval(jQuery.fx.tick, 13);
5770 }
5771 },
5772
5773 // Simple 'show' function
5774 show: function() {
5775 // Remember where we started, so that we can go back to it later
5776 this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
5777 this.options.show = true;
5778
5779 // Begin the animation
5780 // Make sure that we start at a small width/height to avoid any
5781 // flash of content
5782 this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
5783
5784 // Start by showing the element
5785 jQuery( this.elem ).show();
5786 },
5787
5788 // Simple 'hide' function
5789 hide: function() {
5790 // Remember where we started, so that we can go back to it later
5791 this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
5792 this.options.hide = true;
5793
5794 // Begin the animation
5795 this.custom(this.cur(), 0);
5796 },
5797
5798 // Each step of an animation
5799 step: function( gotoEnd ) {
5800 var t = now(), done = true;
5801
5802 if ( gotoEnd || t >= this.options.duration + this.startTime ) {
5803 this.now = this.end;
5804 this.pos = this.state = 1;
5805 this.update();
5806
5807 this.options.curAnim[ this.prop ] = true;
5808
5809 for ( var i in this.options.curAnim ) {
5810 if ( this.options.curAnim[i] !== true ) {
5811 done = false;
5812 }
5813 }
5814
5815 if ( done ) {
5816 if ( this.options.display != null ) {
5817 // Reset the overflow
5818 this.elem.style.overflow = this.options.overflow;
5819
5820 // Reset the display
5821 var old = jQuery.data(this.elem, "olddisplay");
5822 this.elem.style.display = old ? old : this.options.display;
5823
5824 if ( jQuery.css(this.elem, "display") === "none" ) {
5825 this.elem.style.display = "block";
5826 }
5827 }
5828
5829 // Hide the element if the "hide" operation was done
5830 if ( this.options.hide ) {
5831 jQuery(this.elem).hide();
5832 }
5833
5834 // Reset the properties, if the item has been hidden or shown
5835 if ( this.options.hide || this.options.show ) {
5836 for ( var p in this.options.curAnim ) {
5837 jQuery.style(this.elem, p, this.options.orig[p]);
5838 }
5839 }
5840
5841 // Execute the complete function
5842 this.options.complete.call( this.elem );
5843 }
5844
5845 return false;
5846
5847 } else {
5848 var n = t - this.startTime;
5849 this.state = n / this.options.duration;
5850
5851 // Perform the easing function, defaults to swing
5852 var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
5853 var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
5854 this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
5855 this.now = this.start + ((this.end - this.start) * this.pos);
5856
5857 // Perform the next step of the animation
5858 this.update();
5859 }
5860
5861 return true;
5862 }
5863};
5864
5865jQuery.extend( jQuery.fx, {
5866 tick: function() {
5867 var timers = jQuery.timers;
5868
5869 for ( var i = 0; i < timers.length; i++ ) {
5870 if ( !timers[i]() ) {
5871 timers.splice(i--, 1);
5872 }
5873 }
5874
5875 if ( !timers.length ) {
5876 jQuery.fx.stop();
5877 }
5878 },
5879
5880 stop: function() {
5881 clearInterval( timerId );
5882 timerId = null;
5883 },
5884
5885 speeds: {
5886 slow: 600,
5887 fast: 200,
5888 // Default speed
5889 _default: 400
5890 },
5891
5892 step: {
5893 opacity: function( fx ) {
5894 jQuery.style(fx.elem, "opacity", fx.now);
5895 },
5896
5897 _default: function( fx ) {
5898 if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
5899 fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
5900 } else {
5901 fx.elem[ fx.prop ] = fx.now;
5902 }
5903 }
5904 }
5905});
5906
5907if ( jQuery.expr && jQuery.expr.filters ) {
5908 jQuery.expr.filters.animated = function( elem ) {
5909 return jQuery.grep(jQuery.timers, function( fn ) {
5910 return elem === fn.elem;
5911 }).length;
5912 };
5913}
5914
5915function genFx( type, num ) {
5916 var obj = {};
5917
5918 jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
5919 obj[ this ] = type;
5920 });
5921
5922 return obj;
5923}
5924if ( "getBoundingClientRect" in document.documentElement ) {
5925 jQuery.fn.offset = function( options ) {
5926 var elem = this[0];
5927
5928 if ( options ) {
5929 return this.each(function( i ) {
5930 jQuery.offset.setOffset( this, options, i );
5931 });
5932 }
5933
5934 if ( !elem || !elem.ownerDocument ) {
5935 return null;
5936 }
5937
5938 if ( elem === elem.ownerDocument.body ) {
5939 return jQuery.offset.bodyOffset( elem );
5940 }
5941
5942 var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
5943 clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
5944 top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
5945 left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
5946
5947 return { top: top, left: left };
5948 };
5949
5950} else {
5951 jQuery.fn.offset = function( options ) {
5952 var elem = this[0];
5953
5954 if ( options ) {
5955 return this.each(function( i ) {
5956 jQuery.offset.setOffset( this, options, i );
5957 });
5958 }
5959
5960 if ( !elem || !elem.ownerDocument ) {
5961 return null;
5962 }
5963
5964 if ( elem === elem.ownerDocument.body ) {
5965 return jQuery.offset.bodyOffset( elem );
5966 }
5967
5968 jQuery.offset.initialize();
5969
5970 var offsetParent = elem.offsetParent, prevOffsetParent = elem,
5971 doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
5972 body = doc.body, defaultView = doc.defaultView,
5973 prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
5974 top = elem.offsetTop, left = elem.offsetLeft;
5975
5976 while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
5977 if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
5978 break;
5979 }
5980
5981 computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
5982 top -= elem.scrollTop;
5983 left -= elem.scrollLeft;
5984
5985 if ( elem === offsetParent ) {
5986 top += elem.offsetTop;
5987 left += elem.offsetLeft;
5988
5989 if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
5990 top += parseFloat( computedStyle.borderTopWidth ) || 0;
5991 left += parseFloat( computedStyle.borderLeftWidth ) || 0;
5992 }
5993
5994 prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
5995 }
5996
5997 if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
5998 top += parseFloat( computedStyle.borderTopWidth ) || 0;
5999 left += parseFloat( computedStyle.borderLeftWidth ) || 0;
6000 }
6001
6002 prevComputedStyle = computedStyle;
6003 }
6004
6005 if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
6006 top += body.offsetTop;
6007 left += body.offsetLeft;
6008 }
6009
6010 if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
6011 top += Math.max( docElem.scrollTop, body.scrollTop );
6012 left += Math.max( docElem.scrollLeft, body.scrollLeft );
6013 }
6014
6015 return { top: top, left: left };
6016 };
6017}
6018
6019jQuery.offset = {
6020 initialize: function() {
6021 var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
6022 html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
6023
6024 jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
6025
6026 container.innerHTML = html;
6027 body.insertBefore( container, body.firstChild );
6028 innerDiv = container.firstChild;
6029 checkDiv = innerDiv.firstChild;
6030 td = innerDiv.nextSibling.firstChild.firstChild;
6031
6032 this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
6033 this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
6034
6035 checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
6036 // safari subtracts parent border width here which is 5px
6037 this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
6038 checkDiv.style.position = checkDiv.style.top = "";
6039
6040 innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
6041 this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
6042
6043 this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
6044
6045 body.removeChild( container );
6046 body = container = innerDiv = checkDiv = table = td = null;
6047 jQuery.offset.initialize = jQuery.noop;
6048 },
6049
6050 bodyOffset: function( body ) {
6051 var top = body.offsetTop, left = body.offsetLeft;
6052
6053 jQuery.offset.initialize();
6054
6055 if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
6056 top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
6057 left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
6058 }
6059
6060 return { top: top, left: left };
6061 },
6062
6063 setOffset: function( elem, options, i ) {
6064 // set position first, in-case top/left are set even on static elem
6065 if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
6066 elem.style.position = "relative";
6067 }
6068 var curElem = jQuery( elem ),
6069 curOffset = curElem.offset(),
6070 curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
6071 curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
6072
6073 if ( jQuery.isFunction( options ) ) {
6074 options = options.call( elem, i, curOffset );
6075 }
6076
6077 var props = {
6078 top: (options.top - curOffset.top) + curTop,
6079 left: (options.left - curOffset.left) + curLeft
6080 };
6081
6082 if ( "using" in options ) {
6083 options.using.call( elem, props );
6084 } else {
6085 curElem.css( props );
6086 }
6087 }
6088};
6089
6090
6091jQuery.fn.extend({
6092 position: function() {
6093 if ( !this[0] ) {
6094 return null;
6095 }
6096
6097 var elem = this[0],
6098
6099 // Get *real* offsetParent
6100 offsetParent = this.offsetParent(),
6101
6102 // Get correct offsets
6103 offset = this.offset(),
6104 parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
6105
6106 // Subtract element margins
6107 // note: when an element has margin: auto the offsetLeft and marginLeft
6108 // are the same in Safari causing offset.left to incorrectly be 0
6109 offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
6110 offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
6111
6112 // Add offsetParent borders
6113 parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
6114 parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
6115
6116 // Subtract the two offsets
6117 return {
6118 top: offset.top - parentOffset.top,
6119 left: offset.left - parentOffset.left
6120 };
6121 },
6122
6123 offsetParent: function() {
6124 return this.map(function() {
6125 var offsetParent = this.offsetParent || document.body;
6126 while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
6127 offsetParent = offsetParent.offsetParent;
6128 }
6129 return offsetParent;
6130 });
6131 }
6132});
6133
6134
6135// Create scrollLeft and scrollTop methods
6136jQuery.each( ["Left", "Top"], function( i, name ) {
6137 var method = "scroll" + name;
6138
6139 jQuery.fn[ method ] = function(val) {
6140 var elem = this[0], win;
6141
6142 if ( !elem ) {
6143 return null;
6144 }
6145
6146 if ( val !== undefined ) {
6147 // Set the scroll offset
6148 return this.each(function() {
6149 win = getWindow( this );
6150
6151 if ( win ) {
6152 win.scrollTo(
6153 !i ? val : jQuery(win).scrollLeft(),
6154 i ? val : jQuery(win).scrollTop()
6155 );
6156
6157 } else {
6158 this[ method ] = val;
6159 }
6160 });
6161 } else {
6162 win = getWindow( elem );
6163
6164 // Return the scroll offset
6165 return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
6166 jQuery.support.boxModel && win.document.documentElement[ method ] ||
6167 win.document.body[ method ] :
6168 elem[ method ];
6169 }
6170 };
6171});
6172
6173function getWindow( elem ) {
6174 return ("scrollTo" in elem && elem.document) ?
6175 elem :
6176 elem.nodeType === 9 ?
6177 elem.defaultView || elem.parentWindow :
6178 false;
6179}
6180// Create innerHeight, innerWidth, outerHeight and outerWidth methods
6181jQuery.each([ "Height", "Width" ], function( i, name ) {
6182
6183 var type = name.toLowerCase();
6184
6185 // innerHeight and innerWidth
6186 jQuery.fn["inner" + name] = function() {
6187 return this[0] ?
6188 jQuery.css( this[0], type, false, "padding" ) :
6189 null;
6190 };
6191
6192 // outerHeight and outerWidth
6193 jQuery.fn["outer" + name] = function( margin ) {
6194 return this[0] ?
6195 jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
6196 null;
6197 };
6198
6199 jQuery.fn[ type ] = function( size ) {
6200 // Get window width or height
6201 var elem = this[0];
6202 if ( !elem ) {
6203 return size == null ? null : this;
6204 }
6205
6206 if ( jQuery.isFunction( size ) ) {
6207 return this.each(function( i ) {
6208 var self = jQuery( this );
6209 self[ type ]( size.call( this, i, self[ type ]() ) );
6210 });
6211 }
6212
6213 return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
6214 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
6215 elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
6216 elem.document.body[ "client" + name ] :
6217
6218 // Get document width or height
6219 (elem.nodeType === 9) ? // is it a document
6220 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
6221 Math.max(
6222 elem.documentElement["client" + name],
6223 elem.body["scroll" + name], elem.documentElement["scroll" + name],
6224 elem.body["offset" + name], elem.documentElement["offset" + name]
6225 ) :
6226
6227 // Get or set width or height on the element
6228 size === undefined ?
6229 // Get width or height on the element
6230 jQuery.css( elem, type ) :
6231
6232 // Set the width or height on the element (default to pixels if value is unitless)
6233 this.css( type, typeof size === "string" ? size : size + "px" );
6234 };
6235
6236});
6237// Expose jQuery to the global object
6238window.jQuery = window.$ = jQuery;
6239
6240})(window); \ No newline at end of file
diff --git a/Blocks/syntax/tests/js/qunit.css b/Blocks/syntax/tests/js/qunit.css
new file mode 100644
index 0000000..cc54391
--- /dev/null
+++ b/Blocks/syntax/tests/js/qunit.css
@@ -0,0 +1,135 @@
1/**
2 * SyntaxHighlighter
3 * http://alexgorbatchev.com/SyntaxHighlighter
4 *
5 * SyntaxHighlighter is donationware. If you are using it, please donate.
6 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 *
8 * @version
9 * 3.0.83 (July 02 2010)
10 *
11 * @copyright
12 * Copyright (C) 2004-2010 Alex Gorbatchev.
13 *
14 * @license
15 * Dual licensed under the MIT and GPL licenses.
16 */
17
18ol#qunit-tests {
19 font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
20 margin:0;
21 padding:0;
22 list-style-position:inside;
23
24 font-size: smaller;
25}
26ol#qunit-tests li{
27 padding:0.4em 0.5em 0.4em 2.5em;
28 border-bottom:1px solid #fff;
29 font-size:small;
30 list-style-position:inside;
31}
32ol#qunit-tests li ol{
33 box-shadow: inset 0px 2px 13px #999;
34 -moz-box-shadow: inset 0px 2px 13px #999;
35 -webkit-box-shadow: inset 0px 2px 13px #999;
36 margin-top:0.5em;
37 margin-left:0;
38 padding:0.5em;
39 background-color:#fff;
40 border-radius:15px;
41 -moz-border-radius: 15px;
42 -webkit-border-radius: 15px;
43}
44ol#qunit-tests li li{
45 border-bottom:none;
46 margin:0.5em;
47 background-color:#fff;
48 list-style-position: inside;
49 padding:0.4em 0.5em 0.4em 0.5em;
50}
51
52ol#qunit-tests li li.pass{
53 border-left:26px solid #C6E746;
54 background-color:#fff;
55 color:#5E740B;
56 }
57ol#qunit-tests li li.fail{
58 border-left:26px solid #EE5757;
59 background-color:#fff;
60 color:#710909;
61}
62ol#qunit-tests li.pass{
63 background-color:#D2E0E6;
64 color:#528CE0;
65}
66ol#qunit-tests li.fail{
67 background-color:#EE5757;
68 color:#000;
69}
70ol#qunit-tests li strong {
71 cursor:pointer;
72}
73h1#qunit-header{
74 background-color:#0d3349;
75 margin:0;
76 padding:0.5em 0 0.5em 1em;
77 color:#fff;
78 font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
79 border-top-right-radius:15px;
80 border-top-left-radius:15px;
81 -moz-border-radius-topright:15px;
82 -moz-border-radius-topleft:15px;
83 -webkit-border-top-right-radius:15px;
84 -webkit-border-top-left-radius:15px;
85 text-shadow: rgba(0, 0, 0, 0.5) 4px 4px 1px;
86}
87h2#qunit-banner{
88 font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
89 height:5px;
90 margin:0;
91 padding:0;
92}
93h2#qunit-banner.qunit-pass{
94 background-color:#C6E746;
95}
96h2#qunit-banner.qunit-fail, #qunit-testrunner-toolbar {
97 background-color:#EE5757;
98}
99#qunit-testrunner-toolbar {
100 font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
101 padding:0;
102 /*width:80%;*/
103 padding:0em 0 0.5em 2em;
104 font-size: small;
105}
106h2#qunit-userAgent {
107 font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
108 background-color:#2b81af;
109 margin:0;
110 padding:0;
111 color:#fff;
112 font-size: small;
113 padding:0.5em 0 0.5em 2.5em;
114 text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
115}
116p#qunit-testresult{
117 font-family:"Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
118 margin:0;
119 font-size: small;
120 color:#2b81af;
121 border-bottom-right-radius:15px;
122 border-bottom-left-radius:15px;
123 -moz-border-radius-bottomright:15px;
124 -moz-border-radius-bottomleft:15px;
125 -webkit-border-bottom-right-radius:15px;
126 -webkit-border-bottom-left-radius:15px;
127 background-color:#D2E0E6;
128 padding:0.5em 0.5em 0.5em 2.5em;
129}
130strong b.fail{
131 color:#710909;
132 }
133strong b.pass{
134 color:#5E740B;
135 }
diff --git a/Blocks/syntax/tests/js/qunit.js b/Blocks/syntax/tests/js/qunit.js
new file mode 100644
index 0000000..9ef5f8d
--- /dev/null
+++ b/Blocks/syntax/tests/js/qunit.js
@@ -0,0 +1,1069 @@
1/*
2 * QUnit - A JavaScript Unit Testing Framework
3 *
4 * http://docs.jquery.com/QUnit
5 *
6 * Copyright (c) 2009 John Resig, Jörn Zaefferer
7 * Dual licensed under the MIT (MIT-LICENSE.txt)
8 * and GPL (GPL-LICENSE.txt) licenses.
9 */
10
11(function(window) {
12
13var QUnit = {
14
15 // Initialize the configuration options
16 init: function() {
17 config = {
18 stats: { all: 0, bad: 0 },
19 moduleStats: { all: 0, bad: 0 },
20 started: +new Date,
21 updateRate: 1000,
22 blocking: false,
23 autorun: false,
24 assertions: [],
25 filters: [],
26 queue: []
27 };
28
29 var tests = id("qunit-tests"),
30 banner = id("qunit-banner"),
31 result = id("qunit-testresult");
32
33 if ( tests ) {
34 tests.innerHTML = "";
35 }
36
37 if ( banner ) {
38 banner.className = "";
39 }
40
41 if ( result ) {
42 result.parentNode.removeChild( result );
43 }
44 },
45
46 // call on start of module test to prepend name to all tests
47 module: function(name, testEnvironment) {
48 config.currentModule = name;
49
50 synchronize(function() {
51 if ( config.currentModule ) {
52 QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
53 }
54
55 config.currentModule = name;
56 config.moduleTestEnvironment = testEnvironment;
57 config.moduleStats = { all: 0, bad: 0 };
58
59 QUnit.moduleStart( name, testEnvironment );
60 });
61 },
62
63 asyncTest: function(testName, expected, callback) {
64 if ( arguments.length === 2 ) {
65 callback = expected;
66 expected = 0;
67 }
68
69 QUnit.test(testName, expected, callback, true);
70 },
71
72 test: function(testName, expected, callback, async) {
73 var name = testName, testEnvironment, testEnvironmentArg;
74
75 if ( arguments.length === 2 ) {
76 callback = expected;
77 expected = null;
78 }
79 // is 2nd argument a testEnvironment?
80 if ( expected && typeof expected === 'object') {
81 testEnvironmentArg = expected;
82 expected = null;
83 }
84
85 if ( config.currentModule ) {
86 name = config.currentModule + " module: " + name;
87 }
88
89 if ( !validTest(name) ) {
90 return;
91 }
92
93 synchronize(function() {
94 QUnit.testStart( testName );
95
96 testEnvironment = extend({
97 setup: function() {},
98 teardown: function() {}
99 }, config.moduleTestEnvironment);
100 if (testEnvironmentArg) {
101 extend(testEnvironment,testEnvironmentArg);
102 }
103
104 // allow utility functions to access the current test environment
105 QUnit.current_testEnvironment = testEnvironment;
106
107 config.assertions = [];
108 config.expected = expected;
109
110 try {
111 if ( !config.pollution ) {
112 saveGlobal();
113 }
114
115 testEnvironment.setup.call(testEnvironment);
116 } catch(e) {
117 QUnit.ok( false, "Setup failed on " + name + ": " + e.message );
118 }
119
120 if ( async ) {
121 QUnit.stop();
122 }
123
124 try {
125 callback.call(testEnvironment);
126 } catch(e) {
127 fail("Test " + name + " died, exception and test follows", e, callback);
128 QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message );
129 // else next test will carry the responsibility
130 saveGlobal();
131
132 // Restart the tests if they're blocking
133 if ( config.blocking ) {
134 start();
135 }
136 }
137 });
138
139 synchronize(function() {
140 try {
141 checkPollution();
142 testEnvironment.teardown.call(testEnvironment);
143 } catch(e) {
144 QUnit.ok( false, "Teardown failed on " + name + ": " + e.message );
145 }
146
147 try {
148 QUnit.reset();
149 } catch(e) {
150 fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset);
151 }
152
153 if ( config.expected && config.expected != config.assertions.length ) {
154 QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" );
155 }
156
157 var good = 0, bad = 0,
158 tests = id("qunit-tests");
159
160 config.stats.all += config.assertions.length;
161 config.moduleStats.all += config.assertions.length;
162
163 if ( tests ) {
164 var ol = document.createElement("ol");
165 ol.style.display = "none";
166
167 for ( var i = 0; i < config.assertions.length; i++ ) {
168 var assertion = config.assertions[i];
169
170 var li = document.createElement("li");
171 li.className = assertion.result ? "pass" : "fail";
172 li.appendChild(document.createTextNode(assertion.message || "(no message)"));
173 ol.appendChild( li );
174
175 if ( assertion.result ) {
176 good++;
177 } else {
178 bad++;
179 config.stats.bad++;
180 config.moduleStats.bad++;
181 }
182 }
183
184 var b = document.createElement("strong");
185 b.innerHTML = name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>";
186
187 addEvent(b, "click", function() {
188 var next = b.nextSibling, display = next.style.display;
189 next.style.display = display === "none" ? "block" : "none";
190 });
191
192 addEvent(b, "dblclick", function(e) {
193 var target = e && e.target ? e.target : window.event.srcElement;
194 if ( target.nodeName.toLowerCase() === "strong" ) {
195 var text = "", node = target.firstChild;
196
197 while ( node.nodeType === 3 ) {
198 text += node.nodeValue;
199 node = node.nextSibling;
200 }
201
202 text = text.replace(/(^\s*|\s*$)/g, "");
203
204 if ( window.location ) {
205 window.location.href = window.location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent(text);
206 }
207 }
208 });
209
210 var li = document.createElement("li");
211 li.className = bad ? "fail" : "pass";
212 li.appendChild( b );
213 li.appendChild( ol );
214 tests.appendChild( li );
215
216 if ( bad ) {
217 var toolbar = id("qunit-testrunner-toolbar");
218 if ( toolbar ) {
219 toolbar.style.display = "block";
220 id("qunit-filter-pass").disabled = null;
221 id("qunit-filter-missing").disabled = null;
222 }
223 }
224
225 } else {
226 for ( var i = 0; i < config.assertions.length; i++ ) {
227 if ( !config.assertions[i].result ) {
228 bad++;
229 config.stats.bad++;
230 config.moduleStats.bad++;
231 }
232 }
233 }
234
235 QUnit.testDone( testName, bad, config.assertions.length );
236
237 if ( !window.setTimeout && !config.queue.length ) {
238 done();
239 }
240 });
241
242 if ( window.setTimeout && !config.doneTimer ) {
243 config.doneTimer = window.setTimeout(function(){
244 if ( !config.queue.length ) {
245 done();
246 } else {
247 synchronize( done );
248 }
249 }, 13);
250 }
251 },
252
253 /**
254 * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
255 */
256 expect: function(asserts) {
257 config.expected = asserts;
258 },
259
260 /**
261 * Asserts true.
262 * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
263 */
264 ok: function(a, msg) {
265 QUnit.log(a, msg);
266
267 config.assertions.push({
268 result: !!a,
269 message: msg
270 });
271 },
272
273 /**
274 * Checks that the first two arguments are equal, with an optional message.
275 * Prints out both actual and expected values.
276 *
277 * Prefered to ok( actual == expected, message )
278 *
279 * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
280 *
281 * @param Object actual
282 * @param Object expected
283 * @param String message (optional)
284 */
285 equal: function(actual, expected, message) {
286 push(expected == actual, actual, expected, message);
287 },
288
289 notEqual: function(actual, expected, message) {
290 push(expected != actual, actual, expected, message);
291 },
292
293 deepEqual: function(a, b, message) {
294 push(QUnit.equiv(a, b), a, b, message);
295 },
296
297 notDeepEqual: function(a, b, message) {
298 push(!QUnit.equiv(a, b), a, b, message);
299 },
300
301 strictEqual: function(actual, expected, message) {
302 push(expected === actual, actual, expected, message);
303 },
304
305 notStrictEqual: function(actual, expected, message) {
306 push(expected !== actual, actual, expected, message);
307 },
308
309 start: function() {
310 // A slight delay, to avoid any current callbacks
311 if ( window.setTimeout ) {
312 window.setTimeout(function() {
313 if ( config.timeout ) {
314 clearTimeout(config.timeout);
315 }
316
317 config.blocking = false;
318 process();
319 }, 13);
320 } else {
321 config.blocking = false;
322 process();
323 }
324 },
325
326 stop: function(timeout) {
327 config.blocking = true;
328
329 if ( timeout && window.setTimeout ) {
330 config.timeout = window.setTimeout(function() {
331 QUnit.ok( false, "Test timed out" );
332 QUnit.start();
333 }, timeout);
334 }
335 },
336
337 /**
338 * Resets the test setup. Useful for tests that modify the DOM.
339 */
340 reset: function() {
341 if ( window.jQuery ) {
342 jQuery("#main").html( config.fixture );
343 jQuery.event.global = {};
344 jQuery.ajaxSettings = extend({}, config.ajaxSettings);
345 }
346 },
347
348 /**
349 * Trigger an event on an element.
350 *
351 * @example triggerEvent( document.body, "click" );
352 *
353 * @param DOMElement elem
354 * @param String type
355 */
356 triggerEvent: function( elem, type, event ) {
357 if ( document.createEvent ) {
358 event = document.createEvent("MouseEvents");
359 event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
360 0, 0, 0, 0, 0, false, false, false, false, 0, null);
361 elem.dispatchEvent( event );
362
363 } else if ( elem.fireEvent ) {
364 elem.fireEvent("on"+type);
365 }
366 },
367
368 // Safe object type checking
369 is: function( type, obj ) {
370 return Object.prototype.toString.call( obj ) === "[object "+ type +"]";
371 },
372
373 // Logging callbacks
374 done: function(failures, total) {},
375 log: function(result, message) {},
376 testStart: function(name) {},
377 testDone: function(name, failures, total) {},
378 moduleStart: function(name, testEnvironment) {},
379 moduleDone: function(name, failures, total) {}
380};
381
382// Backwards compatibility, deprecated
383QUnit.equals = QUnit.equal;
384QUnit.same = QUnit.deepEqual;
385
386// Maintain internal state
387var config = {
388 // The queue of tests to run
389 queue: [],
390
391 // block until document ready
392 blocking: true
393};
394
395// Load paramaters
396(function() {
397 var location = window.location || { search: "", protocol: "file:" },
398 GETParams = location.search.slice(1).split('&');
399
400 for ( var i = 0; i < GETParams.length; i++ ) {
401 GETParams[i] = decodeURIComponent( GETParams[i] );
402 if ( GETParams[i] === "noglobals" ) {
403 GETParams.splice( i, 1 );
404 i--;
405 config.noglobals = true;
406 } else if ( GETParams[i].search('=') > -1 ) {
407 GETParams.splice( i, 1 );
408 i--;
409 }
410 }
411
412 // restrict modules/tests by get parameters
413 config.filters = GETParams;
414
415 // Figure out if we're running the tests from a server or not
416 QUnit.isLocal = !!(location.protocol === 'file:');
417})();
418
419// Expose the API as global variables, unless an 'exports'
420// object exists, in that case we assume we're in CommonJS
421if ( typeof exports === "undefined" || typeof require === "undefined" ) {
422 extend(window, QUnit);
423 window.QUnit = QUnit;
424} else {
425 extend(exports, QUnit);
426 exports.QUnit = QUnit;
427}
428
429if ( typeof document === "undefined" || document.readyState === "complete" ) {
430 config.autorun = true;
431}
432
433addEvent(window, "load", function() {
434 // Initialize the config, saving the execution queue
435 var oldconfig = extend({}, config);
436 QUnit.init();
437 extend(config, oldconfig);
438
439 config.blocking = false;
440
441 var userAgent = id("qunit-userAgent");
442 if ( userAgent ) {
443 userAgent.innerHTML = navigator.userAgent;
444 }
445
446 var toolbar = id("qunit-testrunner-toolbar");
447 if ( toolbar ) {
448 toolbar.style.display = "none";
449
450 var filter = document.createElement("input");
451 filter.type = "checkbox";
452 filter.id = "qunit-filter-pass";
453 filter.disabled = true;
454 addEvent( filter, "click", function() {
455 var li = document.getElementsByTagName("li");
456 for ( var i = 0; i < li.length; i++ ) {
457 if ( li[i].className.indexOf("pass") > -1 ) {
458 li[i].style.display = filter.checked ? "none" : "";
459 }
460 }
461 });
462 toolbar.appendChild( filter );
463
464 var label = document.createElement("label");
465 label.setAttribute("for", "qunit-filter-pass");
466 label.innerHTML = "Hide passed tests";
467 toolbar.appendChild( label );
468
469 var missing = document.createElement("input");
470 missing.type = "checkbox";
471 missing.id = "qunit-filter-missing";
472 missing.disabled = true;
473 addEvent( missing, "click", function() {
474 var li = document.getElementsByTagName("li");
475 for ( var i = 0; i < li.length; i++ ) {
476 if ( li[i].className.indexOf("fail") > -1 && li[i].innerHTML.indexOf('missing test - untested code is broken code') > - 1 ) {
477 li[i].parentNode.parentNode.style.display = missing.checked ? "none" : "block";
478 }
479 }
480 });
481 toolbar.appendChild( missing );
482
483 label = document.createElement("label");
484 label.setAttribute("for", "qunit-filter-missing");
485 label.innerHTML = "Hide missing tests (untested code is broken code)";
486 toolbar.appendChild( label );
487 }
488
489 var main = id('main');
490 if ( main ) {
491 config.fixture = main.innerHTML;
492 }
493
494 if ( window.jQuery ) {
495 config.ajaxSettings = window.jQuery.ajaxSettings;
496 }
497
498 QUnit.start();
499});
500
501function done() {
502 if ( config.doneTimer && window.clearTimeout ) {
503 window.clearTimeout( config.doneTimer );
504 config.doneTimer = null;
505 }
506
507 if ( config.queue.length ) {
508 config.doneTimer = window.setTimeout(function(){
509 if ( !config.queue.length ) {
510 done();
511 } else {
512 synchronize( done );
513 }
514 }, 13);
515
516 return;
517 }
518
519 config.autorun = true;
520
521 // Log the last module results
522 if ( config.currentModule ) {
523 QUnit.moduleDone( config.currentModule, config.moduleStats.bad, config.moduleStats.all );
524 }
525
526 var banner = id("qunit-banner"),
527 tests = id("qunit-tests"),
528 html = ['Tests completed in ',
529 +new Date - config.started, ' milliseconds.<br/>',
530 '<span class="passed">', config.stats.all - config.stats.bad, '</span> tests of <span class="total">', config.stats.all, '</span> passed, <span class="failed">', config.stats.bad,'</span> failed.'].join('');
531
532 if ( banner ) {
533 banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
534 }
535
536 if ( tests ) {
537 var result = id("qunit-testresult");
538
539 if ( !result ) {
540 result = document.createElement("p");
541 result.id = "qunit-testresult";
542 result.className = "result";
543 tests.parentNode.insertBefore( result, tests.nextSibling );
544 }
545
546 result.innerHTML = html;
547 }
548
549 QUnit.done( config.stats.bad, config.stats.all );
550}
551
552function validTest( name ) {
553 var i = config.filters.length,
554 run = false;
555
556 if ( !i ) {
557 return true;
558 }
559
560 while ( i-- ) {
561 var filter = config.filters[i],
562 not = filter.charAt(0) == '!';
563
564 if ( not ) {
565 filter = filter.slice(1);
566 }
567
568 if ( name.indexOf(filter) !== -1 ) {
569 return !not;
570 }
571
572 if ( not ) {
573 run = true;
574 }
575 }
576
577 return run;
578}
579
580function push(result, actual, expected, message) {
581 message = message || (result ? "okay" : "failed");
582 QUnit.ok( result, result ? message + ": " + QUnit.jsDump.parse(expected) : message + ", expected: " + QUnit.jsDump.parse(expected) + " result: " + QUnit.jsDump.parse(actual) );
583}
584
585function synchronize( callback ) {
586 config.queue.push( callback );
587
588 if ( config.autorun && !config.blocking ) {
589 process();
590 }
591}
592
593function process() {
594 var start = (new Date()).getTime();
595
596 while ( config.queue.length && !config.blocking ) {
597 if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) {
598 config.queue.shift()();
599
600 } else {
601 setTimeout( process, 13 );
602 break;
603 }
604 }
605}
606
607function saveGlobal() {
608 config.pollution = [];
609
610 if ( config.noglobals ) {
611 for ( var key in window ) {
612 config.pollution.push( key );
613 }
614 }
615}
616
617function checkPollution( name ) {
618 var old = config.pollution;
619 saveGlobal();
620
621 var newGlobals = diff( old, config.pollution );
622 if ( newGlobals.length > 0 ) {
623 ok( false, "Introduced global variable(s): " + newGlobals.join(", ") );
624 config.expected++;
625 }
626
627 var deletedGlobals = diff( config.pollution, old );
628 if ( deletedGlobals.length > 0 ) {
629 ok( false, "Deleted global variable(s): " + deletedGlobals.join(", ") );
630 config.expected++;
631 }
632}
633
634// returns a new Array with the elements that are in a but not in b
635function diff( a, b ) {
636 var result = a.slice();
637 for ( var i = 0; i < result.length; i++ ) {
638 for ( var j = 0; j < b.length; j++ ) {
639 if ( result[i] === b[j] ) {
640 result.splice(i, 1);
641 i--;
642 break;
643 }
644 }
645 }
646 return result;
647}
648
649function fail(message, exception, callback) {
650 if ( typeof console !== "undefined" && console.error && console.warn ) {
651 console.error(message);
652 console.error(exception);
653 console.warn(callback.toString());
654
655 } else if ( window.opera && opera.postError ) {
656 opera.postError(message, exception, callback.toString);
657 }
658}
659
660function extend(a, b) {
661 for ( var prop in b ) {
662 a[prop] = b[prop];
663 }
664
665 return a;
666}
667
668function addEvent(elem, type, fn) {
669 if ( elem.addEventListener ) {
670 elem.addEventListener( type, fn, false );
671 } else if ( elem.attachEvent ) {
672 elem.attachEvent( "on" + type, fn );
673 } else {
674 fn();
675 }
676}
677
678function id(name) {
679 return !!(typeof document !== "undefined" && document && document.getElementById) &&
680 document.getElementById( name );
681}
682
683// Test for equality any JavaScript type.
684// Discussions and reference: http://philrathe.com/articles/equiv
685// Test suites: http://philrathe.com/tests/equiv
686// Author: Philippe Rathé <[email protected]>
687QUnit.equiv = function () {
688
689 var innerEquiv; // the real equiv function
690 var callers = []; // stack to decide between skip/abort functions
691 var parents = []; // stack to avoiding loops from circular referencing
692
693
694 // Determine what is o.
695 function hoozit(o) {
696 if (QUnit.is("String", o)) {
697 return "string";
698
699 } else if (QUnit.is("Boolean", o)) {
700 return "boolean";
701
702 } else if (QUnit.is("Number", o)) {
703
704 if (isNaN(o)) {
705 return "nan";
706 } else {
707 return "number";
708 }
709
710 } else if (typeof o === "undefined") {
711 return "undefined";
712
713 // consider: typeof null === object
714 } else if (o === null) {
715 return "null";
716
717 // consider: typeof [] === object
718 } else if (QUnit.is( "Array", o)) {
719 return "array";
720
721 // consider: typeof new Date() === object
722 } else if (QUnit.is( "Date", o)) {
723 return "date";
724
725 // consider: /./ instanceof Object;
726 // /./ instanceof RegExp;
727 // typeof /./ === "function"; // => false in IE and Opera,
728 // true in FF and Safari
729 } else if (QUnit.is( "RegExp", o)) {
730 return "regexp";
731
732 } else if (typeof o === "object") {
733 return "object";
734
735 } else if (QUnit.is( "Function", o)) {
736 return "function";
737 } else {
738 return undefined;
739 }
740 }
741
742 // Call the o related callback with the given arguments.
743 function bindCallbacks(o, callbacks, args) {
744 var prop = hoozit(o);
745 if (prop) {
746 if (hoozit(callbacks[prop]) === "function") {
747 return callbacks[prop].apply(callbacks, args);
748 } else {
749 return callbacks[prop]; // or undefined
750 }
751 }
752 }
753
754 var callbacks = function () {
755
756 // for string, boolean, number and null
757 function useStrictEquality(b, a) {
758 if (b instanceof a.constructor || a instanceof b.constructor) {
759 // to catch short annotaion VS 'new' annotation of a declaration
760 // e.g. var i = 1;
761 // var j = new Number(1);
762 return a == b;
763 } else {
764 return a === b;
765 }
766 }
767
768 return {
769 "string": useStrictEquality,
770 "boolean": useStrictEquality,
771 "number": useStrictEquality,
772 "null": useStrictEquality,
773 "undefined": useStrictEquality,
774
775 "nan": function (b) {
776 return isNaN(b);
777 },
778
779 "date": function (b, a) {
780 return hoozit(b) === "date" && a.valueOf() === b.valueOf();
781 },
782
783 "regexp": function (b, a) {
784 return hoozit(b) === "regexp" &&
785 a.source === b.source && // the regex itself
786 a.global === b.global && // and its modifers (gmi) ...
787 a.ignoreCase === b.ignoreCase &&
788 a.multiline === b.multiline;
789 },
790
791 // - skip when the property is a method of an instance (OOP)
792 // - abort otherwise,
793 // initial === would have catch identical references anyway
794 "function": function () {
795 var caller = callers[callers.length - 1];
796 return caller !== Object &&
797 typeof caller !== "undefined";
798 },
799
800 "array": function (b, a) {
801 var i, j, loop;
802 var len;
803
804 // b could be an object literal here
805 if ( ! (hoozit(b) === "array")) {
806 return false;
807 }
808
809 len = a.length;
810 if (len !== b.length) { // safe and faster
811 return false;
812 }
813
814 //track reference to avoid circular references
815 parents.push(a);
816 for (i = 0; i < len; i++) {
817 loop = false;
818 for(j=0;j<parents.length;j++){
819 if(parents[j] === a[i]){
820 loop = true;//dont rewalk array
821 }
822 }
823 if (!loop && ! innerEquiv(a[i], b[i])) {
824 parents.pop();
825 return false;
826 }
827 }
828 parents.pop();
829 return true;
830 },
831
832 "object": function (b, a) {
833 var i, j, loop;
834 var eq = true; // unless we can proove it
835 var aProperties = [], bProperties = []; // collection of strings
836
837 // comparing constructors is more strict than using instanceof
838 if ( a.constructor !== b.constructor) {
839 return false;
840 }
841
842 // stack constructor before traversing properties
843 callers.push(a.constructor);
844 //track reference to avoid circular references
845 parents.push(a);
846
847 for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
848 loop = false;
849 for(j=0;j<parents.length;j++){
850 if(parents[j] === a[i])
851 loop = true; //don't go down the same path twice
852 }
853 aProperties.push(i); // collect a's properties
854
855 if (!loop && ! innerEquiv(a[i], b[i])) {
856 eq = false;
857 break;
858 }
859 }
860
861 callers.pop(); // unstack, we are done
862 parents.pop();
863
864 for (i in b) {
865 bProperties.push(i); // collect b's properties
866 }
867
868 // Ensures identical properties name
869 return eq && innerEquiv(aProperties.sort(), bProperties.sort());
870 }
871 };
872 }();
873
874 innerEquiv = function () { // can take multiple arguments
875 var args = Array.prototype.slice.apply(arguments);
876 if (args.length < 2) {
877 return true; // end transition
878 }
879
880 return (function (a, b) {
881 if (a === b) {
882 return true; // catch the most you can
883 } else if (a === null || b === null || typeof a === "undefined" || typeof b === "undefined" || hoozit(a) !== hoozit(b)) {
884 return false; // don't lose time with error prone cases
885 } else {
886 return bindCallbacks(a, callbacks, [b, a]);
887 }
888
889 // apply transition with (1..n) arguments
890 })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
891 };
892
893 return innerEquiv;
894
895}();
896
897/**
898 * jsDump
899 * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
900 * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
901 * Date: 5/15/2008
902 * @projectDescription Advanced and extensible data dumping for Javascript.
903 * @version 1.0.0
904 * @author Ariel Flesler
905 * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
906 */
907QUnit.jsDump = (function() {
908 function quote( str ) {
909 return '"' + str.toString().replace(/"/g, '\\"') + '"';
910 };
911 function literal( o ) {
912 return o + '';
913 };
914 function join( pre, arr, post ) {
915 var s = jsDump.separator(),
916 base = jsDump.indent(),
917 inner = jsDump.indent(1);
918 if ( arr.join )
919 arr = arr.join( ',' + s + inner );
920 if ( !arr )
921 return pre + post;
922 return [ pre, inner + arr, base + post ].join(s);
923 };
924 function array( arr ) {
925 var i = arr.length, ret = Array(i);
926 this.up();
927 while ( i-- )
928 ret[i] = this.parse( arr[i] );
929 this.down();
930 return join( '[', ret, ']' );
931 };
932
933 var reName = /^function (\w+)/;
934
935 var jsDump = {
936 parse:function( obj, type ) { //type is used mostly internally, you can fix a (custom)type in advance
937 var parser = this.parsers[ type || this.typeOf(obj) ];
938 type = typeof parser;
939
940 return type == 'function' ? parser.call( this, obj ) :
941 type == 'string' ? parser :
942 this.parsers.error;
943 },
944 typeOf:function( obj ) {
945 var type;
946 if ( obj === null ) {
947 type = "null";
948 } else if (typeof obj === "undefined") {
949 type = "undefined";
950 } else if (QUnit.is("RegExp", obj)) {
951 type = "regexp";
952 } else if (QUnit.is("Date", obj)) {
953 type = "date";
954 } else if (QUnit.is("Function", obj)) {
955 type = "function";
956 } else if (obj.setInterval && obj.document && !obj.nodeType) {
957 type = "window";
958 } else if (obj.nodeType === 9) {
959 type = "document";
960 } else if (obj.nodeType) {
961 type = "node";
962 } else if (typeof obj === "object" && typeof obj.length === "number" && obj.length >= 0) {
963 type = "array";
964 } else {
965 type = typeof obj;
966 }
967 return type;
968 },
969 separator:function() {
970 return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
971 },
972 indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
973 if ( !this.multiline )
974 return '';
975 var chr = this.indentChar;
976 if ( this.HTML )
977 chr = chr.replace(/\t/g,' ').replace(/ /g,'&nbsp;');
978 return Array( this._depth_ + (extra||0) ).join(chr);
979 },
980 up:function( a ) {
981 this._depth_ += a || 1;
982 },
983 down:function( a ) {
984 this._depth_ -= a || 1;
985 },
986 setParser:function( name, parser ) {
987 this.parsers[name] = parser;
988 },
989 // The next 3 are exposed so you can use them
990 quote:quote,
991 literal:literal,
992 join:join,
993 //
994 _depth_: 1,
995 // This is the list of parsers, to modify them, use jsDump.setParser
996 parsers:{
997 window: '[Window]',
998 document: '[Document]',
999 error:'[ERROR]', //when no parser is found, shouldn't happen
1000 unknown: '[Unknown]',
1001 'null':'null',
1002 undefined:'undefined',
1003 'function':function( fn ) {
1004 var ret = 'function',
1005 name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
1006 if ( name )
1007 ret += ' ' + name;
1008 ret += '(';
1009
1010 ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join('');
1011 return join( ret, this.parse(fn,'functionCode'), '}' );
1012 },
1013 array: array,
1014 nodelist: array,
1015 arguments: array,
1016 object:function( map ) {
1017 var ret = [ ];
1018 this.up();
1019 for ( var key in map )
1020 ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) );
1021 this.down();
1022 return join( '{', ret, '}' );
1023 },
1024 node:function( node ) {
1025 var open = this.HTML ? '&lt;' : '<',
1026 close = this.HTML ? '&gt;' : '>';
1027
1028 var tag = node.nodeName.toLowerCase(),
1029 ret = open + tag;
1030
1031 for ( var a in this.DOMAttrs ) {
1032 var val = node[this.DOMAttrs[a]];
1033 if ( val )
1034 ret += ' ' + a + '=' + this.parse( val, 'attribute' );
1035 }
1036 return ret + close + open + '/' + tag + close;
1037 },
1038 functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function
1039 var l = fn.length;
1040 if ( !l ) return '';
1041
1042 var args = Array(l);
1043 while ( l-- )
1044 args[l] = String.fromCharCode(97+l);//97 is 'a'
1045 return ' ' + args.join(', ') + ' ';
1046 },
1047 key:quote, //object calls it internally, the key part of an item in a map
1048 functionCode:'[code]', //function calls it internally, it's the content of the function
1049 attribute:quote, //node calls it internally, it's an html attribute value
1050 string:quote,
1051 date:quote,
1052 regexp:literal, //regex
1053 number:literal,
1054 'boolean':literal
1055 },
1056 DOMAttrs:{//attributes to dump from nodes, name=>realName
1057 id:'id',
1058 name:'name',
1059 'class':'className'
1060 },
1061 HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
1062 indentChar:' ',//indentation unit
1063 multiline:false //if true, items in a collection, are separated by a \n, else just a space.
1064 };
1065
1066 return jsDump;
1067})();
1068
1069})(this);
diff --git a/Blocks/syntax/tests/syntaxhighlighter_tests.html b/Blocks/syntax/tests/syntaxhighlighter_tests.html
new file mode 100644
index 0000000..58e963f
--- /dev/null
+++ b/Blocks/syntax/tests/syntaxhighlighter_tests.html
@@ -0,0 +1,249 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>SyntaxHighlighter Highlight Tests</title>
6
7 <!-- jQuery & QUnit -->
8 <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
9 <script type="text/javascript" src="js/qunit.js"></script>
10 <link type="text/css" rel="stylesheet" href="js/qunit.css"/>
11
12 <!-- SyntaxHighlighter -->
13 <script type="text/javascript" src="/sh/scripts/XRegExp.js"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
14 <script type="text/javascript" src="/sh/scripts/shCore.js"></script>
15 <script type="text/javascript" src="/sh/scripts/shLegacy.js"></script>
16 <script type="text/javascript" src="/sh/scripts/shBrushAppleScript.js"></script>
17 <script type="text/javascript" src="/sh/scripts/shBrushAS3.js"></script>
18 <script type="text/javascript" src="/sh/scripts/shBrushBash.js"></script>
19 <script type="text/javascript" src="/sh/scripts/shBrushColdFusion.js"></script>
20 <script type="text/javascript" src="/sh/scripts/shBrushCpp.js"></script>
21 <script type="text/javascript" src="/sh/scripts/shBrushCSharp.js"></script>
22 <script type="text/javascript" src="/sh/scripts/shBrushCss.js"></script>
23 <script type="text/javascript" src="/sh/scripts/shBrushDelphi.js"></script>
24 <script type="text/javascript" src="/sh/scripts/shBrushDiff.js"></script>
25 <script type="text/javascript" src="/sh/scripts/shBrushErlang.js"></script>
26 <script type="text/javascript" src="/sh/scripts/shBrushGroovy.js"></script>
27 <script type="text/javascript" src="/sh/scripts/shBrushJava.js"></script>
28 <script type="text/javascript" src="/sh/scripts/shBrushJavaFx.js"></script>
29 <script type="text/javascript" src="/sh/scripts/shBrushJScript.js"></script>
30 <script type="text/javascript" src="/sh/scripts/shBrushPerl.js"></script>
31 <script type="text/javascript" src="/sh/scripts/shBrushPhp.js"></script>
32 <script type="text/javascript" src="/sh/scripts/shBrushPlain.js"></script>
33 <script type="text/javascript" src="/sh/scripts/shBrushPowerShell.js"></script>
34 <script type="text/javascript" src="/sh/scripts/shBrushPython.js"></script>
35 <script type="text/javascript" src="/sh/scripts/shBrushRuby.js"></script>
36 <script type="text/javascript" src="/sh/scripts/shBrushSass.js"></script>
37 <script type="text/javascript" src="/sh/scripts/shBrushScala.js"></script>
38 <script type="text/javascript" src="/sh/scripts/shBrushSql.js"></script>
39 <script type="text/javascript" src="/sh/scripts/shBrushVb.js"></script>
40 <script type="text/javascript" src="/sh/scripts/shBrushXml.js"></script>
41
42 <link type="text/css" rel="stylesheet" href="/sh/styles/shCoreDefault.css"/>
43</head>
44
45<body>
46
47<h1 id="qunit-header">SyntaxHighlighter Highlight Lines Test</h1>
48<h2 id="qunit-banner"></h2>
49<div id="qunit-testrunner-toolbar"></div>
50<h2 id="qunit-userAgent"></h2>
51<ol id="qunit-tests"></ol>
52
53<button id="interaction">Run interaction tests</button>
54
55<div id="output">
56</div>
57
58<style>
59body {
60 background: white;
61}
62
63#interaction {
64 margin-top: 1em;
65 padding: 1em;
66 font-size: 1.5em;
67}
68
69.test-wrap {
70 width: 45%;
71 height: 400px;
72 overflow: auto;
73 float: left;
74 margin: 1em 1em 0 0;
75 border: 5px solid silver;
76 background: gray;
77 font-family: Helvetica;
78}
79
80.test-wrap h3 {
81 margin: 1em 0 0 1em;
82 color: white;
83 font-size: 1em;
84 font-weight: normal;
85}
86</style>
87
88<script type="text/javascript">
89var testQueue = [],
90 renderTests = [
91 '001_basic',
92 '002_brushes',
93 '003_script_tag',
94 '004_url_parsing',
95 '005_no_gutter',
96 '006_pad_line_numbers',
97 '007_collapse',
98 '008_first_line',
99 '009_class_name',
100 '010_highlight',
101 '011_smart_tabs',
102 '012_server_side',
103 '013_html_script',
104 '014_legacy'
105 ],
106 interactionTests = [
107 '007_collapse_interaction'
108 ]
109 ;
110
111function queue(func)
112{
113 testQueue.push(func);
114};
115
116function ok_sh($sh)
117{
118 ok($sh.length > 0, 'Element present');
119 ok($sh.is('div'), 'Element is DIV');
120 ok($sh.find('> div').is('.syntaxhighlighter'), 'Nested DIV is a .syntaxhighlighter');
121};
122
123function ok_toolbar($sh)
124{
125 var $target = $sh.find('> .syntaxhighlighter > .toolbar');
126 ok($target.length > 0, 'Toolbar present');
127 ok($target.is(':visible'), 'Toolbar visible');
128};
129
130function ok_caption($sh, value)
131{
132 var $target = $sh.find('> .syntaxhighlighter > table > caption');
133 ok($target.length > 0, 'Caption present');
134 ok($target.is(':visible'), 'Caption visible');
135
136 if (value != null)
137 equals($target.text(), value, 'Caption text');
138};
139
140function ok_gutter($sh)
141{
142 var $target = $sh.find('> .syntaxhighlighter > table > tbody > tr > .gutter');
143 ok($target.length > 0, 'Gutter present');
144 ok($target.is(':visible'), 'Gutter visible');
145};
146
147function ok_code($sh)
148{
149 var $target = $sh.find('> .syntaxhighlighter > table > tbody > tr > .code');
150 ok($target.length > 0, 'Code present');
151 ok($target.is(':visible'), 'Code visible');
152};
153
154function ok_collapsed($sh)
155{
156 ok($sh.find('> .syntaxhighlighter.collapsed').length == 1, '.collapsed present');
157};
158
159function loadTests(tests, addHtml)
160{
161 var html = '';
162
163 $.each(tests, function(index)
164 {
165 var name = this;
166
167 if (addHtml != false)
168 {
169 html += '<div class="test-wrap">\n'
170 html += '<h3>' + name + '</h3>\n';
171 }
172
173 $.ajax({
174 url: 'cases/' + name + '.html',
175 type: 'GET',
176 dataType: 'text',
177 async: false,
178 success: function(data)
179 {
180 html += data;
181 },
182 error: function()
183 {
184 html += '<p>Not found...</p>';
185 }
186 });
187
188 if (addHtml != false)
189 {
190 html += '</div>\n';
191
192 if (index % 2 != 0)
193 html += '<div style="clear:both"></div>\n';
194 }
195 });
196
197 //
198 // Looks like .html() is producing different results when it comes to
199 // content that has <script /> which type is NOT "text/javascript".
200 // $('#output').html(html);
201 //
202 $('#output')[0].innerHTML += html;
203
204 //
205 // However, if HTML assigned to to .innerHTML container <script/> tags,
206 // they are not executed, so we have to manually walk all of them and
207 // eval() the content.
208 //
209 $('#output script[type="text/javascript"][class!="executed"]').each(function()
210 {
211 eval($(this).text() || $(this).html());
212 $(this).addClass('executed')
213 });
214};
215
216function runTestQueue()
217{
218
219 $.each(testQueue, function()
220 {
221 this.apply(null);
222 });
223
224 testQueue = [];
225};
226
227$(document).ready(function()
228{
229 loadTests(renderTests);
230 SyntaxHighlighter.highlight();
231 runTestQueue();
232
233 $('#interaction').click(function()
234 {
235 loadTests(interactionTests, false /* addHtml */);
236 runTestQueue();
237 });
238});
239</script>
240
241
242<!-- jinwei.me Baidu tongji analytics -->
243<script type="text/javascript">
244var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
245document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F91918ac6d6854623883a2b546ebc00ac' type='text/javascript'%3E%3C/script%3E"));
246</script>
247
248</body>
249</html>
diff --git a/Blocks/syntax/tests/theme_tests.html b/Blocks/syntax/tests/theme_tests.html
new file mode 100644
index 0000000..49ddd3a
--- /dev/null
+++ b/Blocks/syntax/tests/theme_tests.html
@@ -0,0 +1,141 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3<head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>SyntaxHighlighter Theme Tests</title>
6 <script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
7</head>
8
9<body>
10
11<div id="output"></div>
12
13<style>
14body {
15 background: white;
16 font-family: Helvetica;
17}
18
19.test-wrap {
20 width: 100%;
21 height: 800px;
22 overflow: auto;
23 border: none;
24}
25</style>
26
27<script id="sample" type="text/plain">
28 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
29 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
30 <head>
31 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
32 <title>SyntaxHighlighter Theme Tests</title>
33 </head>
34
35 <body>
36 &lt;script>
37 /**
38 * Looks for a child or parent node which has specified classname.
39 * Equivalent to jQuery's $(container).find(".className")
40 * @param {Element} target Target element.
41 * @param {String} search Class name or node name to look for.
42 * @param {Boolean} reverse If set to true, will go up the node tree instead of down.
43 * @return {Element} Returns found child or parent element on null.
44 */
45 function findElement(target, search, reverse /* optional */)
46 {
47 if (target == null)
48 return null;
49
50 var nodes = reverse != true ? target.childNodes : [ target.parentNode ],
51 propertyToFind = { '#' : 'id', '.' : 'className' }[search.substr(0, 1)] || 'nodeName',
52 expectedValue,
53 found
54 ;
55
56 // main return of the found node
57 if ((target[propertyToFind] || '').indexOf(expectedValue) != -1)
58 return target;
59
60 return found;
61 };
62 &lt;/script>
63
64
65<!-- jinwei.me Baidu tongji analytics -->
66<script type="text/javascript">
67var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
68document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F91918ac6d6854623883a2b546ebc00ac' type='text/javascript'%3E%3C/script%3E"));
69</script>
70
71</body>
72 </html>
73</script>
74
75<script type="text/javascript">
76var themes = [
77 ['#fff', 'Default'],
78 ['#000', 'Django'],
79 ['#fff', 'Eclipse'],
80 ['#000', 'Emacs'],
81 ['#000', 'FadeToGrey'],
82 ['#000', 'MDUltra'],
83 ['#000', 'Midnight'],
84 ['#000', 'RDark']
85 ];
86
87$(document).ready(function()
88{
89 var sample = $('#sample').text().replace(/</g, '&lt;');
90
91 $.each(themes, function(index)
92 {
93 var $iframe = $('<iframe class="test-wrap" src="about:blank" />'),
94 background = this[0],
95 themeName = this[1]
96 ;
97
98 $('#output')
99 .append(''
100 + '<h1>'
101 + '<a href="#theme' + (index + 1) + '">next</a> '
102 + '<a name="theme' + index + '">'
103 + themeName
104 + '</a>'
105 + '</h1>'
106 )
107 .append($iframe)
108 ;
109
110 $iframe.ready(function()
111 {
112 var doc = $iframe[0].contentDocument;
113 $iframe.css('background', background);
114
115 doc.write(''
116 + '<scr' + 'ipt type="text/javascript" src="/sh/scripts/XRegExp.js"></scr' + 'ipt>'
117 + '<scr' + 'ipt type="text/javascript" src="/sh/scripts/shCore.js"></scr' + 'ipt>'
118 + '<scr' + 'ipt type="text/javascript" src="/sh/scripts/shBrushXml.js"></scr' + 'ipt>'
119 + '<scr' + 'ipt type="text/javascript" src="/sh/scripts/shBrushJScript.js"></scr' + 'ipt>'
120 + '<link type="text/css" rel="stylesheet" href="/sh/styles/shCore' + themeName + '.css"/>'
121 + '<pre type="syntaxhighlighter" class="brush: js; html-script: true; highlight: [5, 20]" title="This is SyntaxHighlighter theme ' + themeName + ' in action!">'
122 + sample
123 + '</pre>'
124 + '<pre type="syntaxhighlighter" class="brush: js; html-script: true; collapse: true">'
125 + sample
126 + '</pre>'
127 + '<scr' + 'ipt type="text/javascript">'
128 + 'SyntaxHighlighter.highlight();'
129 + '</scr' + 'ipt>'
130 );
131 doc.close();
132 });
133 });
134
135 $('#output a[name]:first').attr('name', 'top');
136 $('#output a[href]:last').attr('href', '#top').html('top');
137});
138</script>
139
140</body>
141</html>
diff --git a/Blocks/syntax/tests/webrick.rb b/Blocks/syntax/tests/webrick.rb
new file mode 100644
index 0000000..0b3c93c
--- /dev/null
+++ b/Blocks/syntax/tests/webrick.rb
@@ -0,0 +1,11 @@
1require 'webrick'
2include WEBrick
3
4s = HTTPServer.new(
5 :Port => 2010,
6 :DocumentRoot => Dir::pwd
7)
8s.mount('/sh/scripts', WEBrick::HTTPServlet::FileHandler, '../scripts')
9s.mount('/sh/styles', WEBrick::HTTPServlet::FileHandler, '../styles')
10trap('INT') { s.stop }
11s.start
diff --git a/Blocks/syntax/tests/webrick.sh b/Blocks/syntax/tests/webrick.sh
new file mode 100644
index 0000000..7e249f8
--- /dev/null
+++ b/Blocks/syntax/tests/webrick.sh
@@ -0,0 +1,2 @@
1#!/bin/sh
2ruby webrick.rb
Powered by cgit v1.2.3 (git 2.41.0)