SyntaxHighlighter Evolved - Version 3.2.0

Version Description

Download this release

Release Info

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

Code changes from version 3.1.13 to 3.2.0

Files changed (31) hide show
  1. readme.txt +7 -2
  2. syntaxhighlighter.php +1300 -1266
  3. syntaxhighlighter3/scripts/shAutoloader.js +138 -138
  4. syntaxhighlighter3/scripts/shBrushAS3.js +59 -59
  5. syntaxhighlighter3/scripts/shBrushAppleScript.js +99 -99
  6. syntaxhighlighter3/scripts/shBrushBash.js +75 -75
  7. syntaxhighlighter3/scripts/shBrushCSharp.js +65 -65
  8. syntaxhighlighter3/scripts/shBrushColdFusion.js +100 -100
  9. syntaxhighlighter3/scripts/shBrushCpp.js +97 -97
  10. syntaxhighlighter3/scripts/shBrushCss.js +91 -91
  11. syntaxhighlighter3/scripts/shBrushDelphi.js +55 -55
  12. syntaxhighlighter3/scripts/shBrushDiff.js +41 -41
  13. syntaxhighlighter3/scripts/shBrushErlang.js +52 -52
  14. syntaxhighlighter3/scripts/shBrushGroovy.js +67 -67
  15. syntaxhighlighter3/scripts/shBrushJScript.js +52 -52
  16. syntaxhighlighter3/scripts/shBrushJava.js +57 -57
  17. syntaxhighlighter3/scripts/shBrushJavaFX.js +58 -58
  18. syntaxhighlighter3/scripts/shBrushPerl.js +96 -96
  19. syntaxhighlighter3/scripts/shBrushPhp.js +88 -88
  20. syntaxhighlighter3/scripts/shBrushPlain.js +33 -33
  21. syntaxhighlighter3/scripts/shBrushPowerShell.js +75 -75
  22. syntaxhighlighter3/scripts/shBrushPython.js +64 -64
  23. syntaxhighlighter3/scripts/shBrushRuby.js +55 -55
  24. syntaxhighlighter3/scripts/shBrushSass.js +99 -99
  25. syntaxhighlighter3/scripts/shBrushScala.js +51 -51
  26. syntaxhighlighter3/scripts/shBrushSql.js +67 -67
  27. syntaxhighlighter3/scripts/shBrushVb.js +56 -56
  28. syntaxhighlighter3/scripts/shBrushXml.js +71 -71
  29. syntaxhighlighter3/scripts/shCore.js +16 -16
  30. syntaxhighlighter3/scripts/shLegacy.js +157 -157
  31. syntaxhighlighter3/styles/shCore.css +1 -1
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: Viper007Bond, automattic
3
  Donate link: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/donate/
4
  Tags: code, sourcecode, php, xhtml, html, css, WordPress.com
5
- Requires at least: 2.7
6
- Tested up to: 4.3
7
  Stable tag: trunk
8
 
9
  Easily post syntax-highlighted code to your site without having to modify the code at all. As seen on WordPress.com.
@@ -55,6 +55,11 @@ Make sure your theme's `footer.php` file has `<?php wp_footer(); ?>` somewhere i
55
 
56
  == ChangeLog ==
57
 
 
 
 
 
 
58
  = Version 3.1.13 =
59
 
60
  * Fix setting sanitization bug. Props Alexander Concha (@xknown).
2
  Contributors: Viper007Bond, automattic
3
  Donate link: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/donate/
4
  Tags: code, sourcecode, php, xhtml, html, css, WordPress.com
5
+ Requires at least: 4.2.3
6
+ Tested up to: 4.5
7
  Stable tag: trunk
8
 
9
  Easily post syntax-highlighted code to your site without having to modify the code at all. As seen on WordPress.com.
55
 
56
  == ChangeLog ==
57
 
58
+ = Version 3.2.0 =
59
+
60
+ * Don't parse shortcodes inside of HTML entities, which could result in broken HTML.
61
+ * Drop PHP4 support. This should result in PHP7 support.
62
+
63
  = Version 3.1.13 =
64
 
65
  * Fix setting sanitization bug. Props Alexander Concha (@xknown).
syntaxhighlighter.php CHANGED
@@ -1,1266 +1,1300 @@
1
- <?php /*
2
-
3
- **************************************************************************
4
-
5
- Plugin Name: SyntaxHighlighter Evolved
6
- Plugin URI: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/
7
- Version: 3.1.13
8
- Description: Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a>. <strong>TIP:</strong> Don't use the Visual editor if you don't want your code mangled. TinyMCE will "clean up" your HTML.
9
- Author: Alex Mills (Viper007Bond)
10
- Author URI: http://www.viper007bond.com/
11
-
12
- **************************************************************************
13
-
14
- Thanks to:
15
-
16
- * Alex Gorbatchev for writing the Javascript-powered synatax highlighter script
17
-
18
- * Andrew Ozz for writing the TinyMCE plugin
19
-
20
- **************************************************************************/
21
-
22
- class SyntaxHighlighter {
23
- // All of these variables are private. Filters are provided for things that can be modified.
24
- var $pluginver = '3.1.13'; // Plugin version
25
- var $agshver = false; // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3)
26
- var $shfolder = false; // Controls what subfolder to load SyntaxHighlighter from (v2 or v3)
27
- var $settings = array(); // Contains the user's settings
28
- var $defaultsettings = array(); // Contains the default settings
29
- var $brushes = array(); // Array of aliases => brushes
30
- var $shortcodes = array(); // Array of shortcodes to use
31
- var $themes = array(); // Array of themes
32
- var $usedbrushes = array(); // Stores used brushes so we know what to output
33
- var $encoded = false; // Used to mark that a character encode took place
34
- var $codeformat = false; // If set, SyntaxHighlighter::get_code_format() will return this value
35
- var $content_save_pre_ran = false; // It's possible for the "content_save_pre" filter to run multiple times, so keep track
36
-
37
- // Initalize the plugin by registering the hooks
38
- function __construct() {
39
- if ( ! function_exists( 'esc_html' ) )
40
- return;
41
-
42
- // Load localization domain
43
- load_plugin_textdomain( 'syntaxhighlighter', false, '/syntaxhighlighter/localization' );
44
-
45
- // Display hooks
46
- add_filter( 'the_content', array( $this, 'parse_shortcodes' ), 7 ); // Posts
47
- add_filter( 'comment_text', array( $this, 'parse_shortcodes_comment' ), 7 ); // Comments
48
- add_filter( 'bp_get_the_topic_post_content', array( $this, 'parse_shortcodes' ), 7 ); // BuddyPress
49
-
50
- // Into the database
51
- add_filter( 'content_save_pre', array( $this, 'encode_shortcode_contents_slashed_noquickedit' ), 1 ); // Posts
52
- add_filter( 'pre_comment_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // Comments
53
- add_filter( 'group_forum_post_text_before_save', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress
54
- add_filter( 'group_forum_topic_text_before_save', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress
55
-
56
- // Out of the database for editing
57
- add_filter( 'the_editor_content', array( $this, 'the_editor_content' ), 1 ); // Posts
58
- add_filter( 'comment_edit_pre', array( $this, 'decode_shortcode_contents' ), 1 ); // Comments
59
- add_filter( 'bp_get_the_topic_text', array( $this, 'decode_shortcode_contents' ), 1 ); // BuddyPress
60
- add_filter( 'bp_get_the_topic_post_edit_text', array( $this, 'decode_shortcode_contents' ), 1 ); // BuddyPress
61
-
62
- // Outputting SyntaxHighlighter's JS and CSS
63
- add_action( 'wp_head', array( $this, 'output_header_placeholder' ), 15 );
64
- add_action( 'admin_head', array( $this, 'output_header_placeholder' ), 15 ); // For comments
65
- add_action( 'wp_footer', array( $this, 'maybe_output_scripts' ), 15 );
66
- add_action( 'admin_footer', array( $this, 'maybe_output_scripts' ), 15 ); // For comments
67
-
68
- // Admin hooks
69
- add_action( 'admin_init', array( $this, 'register_setting' ) );
70
- add_action( 'admin_menu', array( $this, 'register_settings_page' ) );
71
- add_filter( 'mce_external_plugins', array( $this, 'add_tinymce_plugin' ) );
72
- add_filter( 'save_post', array( $this, 'mark_as_encoded' ), 10, 2 );
73
- add_filter( 'plugin_action_links', array( $this, 'settings_link' ), 10, 2 );
74
-
75
- // Register widget hooks
76
- // Requires change added in WordPress 2.9
77
- if ( class_exists('WP_Embed') ) {
78
- add_filter( 'widget_text', array( $this, 'widget_text_output' ), 7, 2 );
79
- add_filter( 'widget_update_callback', array( $this, 'widget_text_save' ), 1, 4 );
80
- add_filter( 'widget_form_callback', array( $this, 'widget_text_form' ), 1, 2 );
81
- }
82
-
83
-
84
- // Create array of default settings (you can use the filter to modify these)
85
- $this->defaultsettings = (array) apply_filters( 'syntaxhighlighter_defaultsettings', array(
86
- 'theme' => 'default',
87
- 'loadallbrushes' => 0,
88
- 'shversion' => 3,
89
- 'title' => '',
90
- 'autolinks' => 1,
91
- 'classname' => '',
92
- 'collapse' => 0,
93
- 'firstline' => 1,
94
- 'gutter' => 1,
95
- 'htmlscript' => 0,
96
- 'light' => 0,
97
- 'padlinenumbers' => 'false',
98
- 'smarttabs' => 1,
99
- 'tabsize' => 4,
100
- 'toolbar' => 0,
101
- 'wraplines' => 1, // 2.x only
102
- ) );
103
-
104
- // Create the settings array by merging the user's settings and the defaults
105
- $usersettings = (array) get_option('syntaxhighlighter_settings');
106
- $this->settings = wp_parse_args( $usersettings, $this->defaultsettings );
107
-
108
- // Dynamically set folder and version names for SynaxHighlighter
109
- if ( 2 == $this->settings['shversion'] ) {
110
- $this->shfolder = 'syntaxhighlighter2';
111
- $this->agshver = '2.1.364';
112
- } else {
113
- $this->shfolder = 'syntaxhighlighter3';
114
- $this->agshver = '3.0.9b';
115
- }
116
-
117
- // Register brush scripts
118
- wp_register_script( 'syntaxhighlighter-core', plugins_url( $this->shfolder . '/scripts/shCore.js', __FILE__ ), array(), $this->agshver );
119
- wp_register_script( 'syntaxhighlighter-brush-as3', plugins_url( $this->shfolder . '/scripts/shBrushAS3.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
120
- wp_register_script( 'syntaxhighlighter-brush-bash', plugins_url( $this->shfolder . '/scripts/shBrushBash.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
121
- wp_register_script( 'syntaxhighlighter-brush-coldfusion', plugins_url( $this->shfolder . '/scripts/shBrushColdFusion.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
122
- wp_register_script( 'syntaxhighlighter-brush-cpp', plugins_url( $this->shfolder . '/scripts/shBrushCpp.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
123
- wp_register_script( 'syntaxhighlighter-brush-csharp', plugins_url( $this->shfolder . '/scripts/shBrushCSharp.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
124
- wp_register_script( 'syntaxhighlighter-brush-css', plugins_url( $this->shfolder . '/scripts/shBrushCss.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
125
- wp_register_script( 'syntaxhighlighter-brush-delphi', plugins_url( $this->shfolder . '/scripts/shBrushDelphi.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
126
- wp_register_script( 'syntaxhighlighter-brush-diff', plugins_url( $this->shfolder . '/scripts/shBrushDiff.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
127
- wp_register_script( 'syntaxhighlighter-brush-erlang', plugins_url( $this->shfolder . '/scripts/shBrushErlang.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
128
- wp_register_script( 'syntaxhighlighter-brush-groovy', plugins_url( $this->shfolder . '/scripts/shBrushGroovy.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
129
- wp_register_script( 'syntaxhighlighter-brush-java', plugins_url( $this->shfolder . '/scripts/shBrushJava.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
130
- wp_register_script( 'syntaxhighlighter-brush-javafx', plugins_url( $this->shfolder . '/scripts/shBrushJavaFX.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
131
- wp_register_script( 'syntaxhighlighter-brush-jscript', plugins_url( $this->shfolder . '/scripts/shBrushJScript.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
132
- wp_register_script( 'syntaxhighlighter-brush-perl', plugins_url( $this->shfolder . '/scripts/shBrushPerl.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
133
- wp_register_script( 'syntaxhighlighter-brush-php', plugins_url( $this->shfolder . '/scripts/shBrushPhp.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
134
- wp_register_script( 'syntaxhighlighter-brush-plain', plugins_url( $this->shfolder . '/scripts/shBrushPlain.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
135
- wp_register_script( 'syntaxhighlighter-brush-powershell', plugins_url( $this->shfolder . '/scripts/shBrushPowerShell.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
136
- wp_register_script( 'syntaxhighlighter-brush-python', plugins_url( $this->shfolder . '/scripts/shBrushPython.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
137
- wp_register_script( 'syntaxhighlighter-brush-ruby', plugins_url( $this->shfolder . '/scripts/shBrushRuby.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
138
- wp_register_script( 'syntaxhighlighter-brush-scala', plugins_url( $this->shfolder . '/scripts/shBrushScala.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
139
- wp_register_script( 'syntaxhighlighter-brush-sql', plugins_url( $this->shfolder . '/scripts/shBrushSql.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
140
- wp_register_script( 'syntaxhighlighter-brush-vb', plugins_url( $this->shfolder . '/scripts/shBrushVb.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
141
- wp_register_script( 'syntaxhighlighter-brush-xml', plugins_url( $this->shfolder . '/scripts/shBrushXml.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
142
-
143
- // Register some popular third-party brushes
144
- wp_register_script( 'syntaxhighlighter-brush-clojure', plugins_url( 'third-party-brushes/shBrushClojure.js', __FILE__ ), array('syntaxhighlighter-core'), '20090602' );
145
- wp_register_script( 'syntaxhighlighter-brush-fsharp', plugins_url( 'third-party-brushes/shBrushFSharp.js', __FILE__ ), array('syntaxhighlighter-core'), '20091003' );
146
- wp_register_script( 'syntaxhighlighter-brush-latex', plugins_url( 'third-party-brushes/shBrushLatex.js', __FILE__ ), array('syntaxhighlighter-core'), '20090613' );
147
- wp_register_script( 'syntaxhighlighter-brush-matlabkey', plugins_url( 'third-party-brushes/shBrushMatlabKey.js', __FILE__ ), array('syntaxhighlighter-core'), '20091209' );
148
- wp_register_script( 'syntaxhighlighter-brush-objc', plugins_url( 'third-party-brushes/shBrushObjC.js', __FILE__ ), array('syntaxhighlighter-core'), '20091207' );
149
- wp_register_script( 'syntaxhighlighter-brush-r', plugins_url( 'third-party-brushes/shBrushR.js', __FILE__ ), array('syntaxhighlighter-core'), '20100919' );
150
-
151
- // Register theme stylesheets
152
- wp_register_style( 'syntaxhighlighter-core', plugins_url( $this->shfolder . '/styles/shCore.css', __FILE__ ), array(), $this->agshver );
153
- wp_register_style( 'syntaxhighlighter-theme-default', plugins_url( $this->shfolder . '/styles/shThemeDefault.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
154
- wp_register_style( 'syntaxhighlighter-theme-django', plugins_url( $this->shfolder . '/styles/shThemeDjango.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
155
- wp_register_style( 'syntaxhighlighter-theme-eclipse', plugins_url( $this->shfolder . '/styles/shThemeEclipse.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
156
- wp_register_style( 'syntaxhighlighter-theme-emacs', plugins_url( $this->shfolder . '/styles/shThemeEmacs.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
157
- wp_register_style( 'syntaxhighlighter-theme-fadetogrey', plugins_url( $this->shfolder . '/styles/shThemeFadeToGrey.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
158
- wp_register_style( 'syntaxhighlighter-theme-midnight', plugins_url( $this->shfolder . '/styles/shThemeMidnight.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
159
- wp_register_style( 'syntaxhighlighter-theme-rdark', plugins_url( $this->shfolder . '/styles/shThemeRDark.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
160
-
161
-
162
- // Create list of brush aliases and map them to their real brushes
163
- // The key is the language alias
164
- // The value is the script handle suffix: syntaxhighlighter-brush-ThisBitHere (your plugin needs to register the script itself)
165
- $this->brushes = (array) apply_filters( 'syntaxhighlighter_brushes', array(
166
- 'as3' => 'as3',
167
- 'actionscript3' => 'as3',
168
- 'bash' => 'bash',
169
- 'shell' => 'bash',
170
- 'coldfusion' => 'coldfusion',
171
- 'cf' => 'coldfusion',
172
- 'clojure' => 'clojure',
173
- 'clj' => 'clojure',
174
- 'cpp' => 'cpp',
175
- 'c' => 'cpp',
176
- 'c-sharp' => 'csharp',
177
- 'csharp' => 'csharp',
178
- 'css' => 'css',
179
- 'delphi' => 'delphi',
180
- 'pas' => 'delphi',
181
- 'pascal' => 'delphi',
182
- 'diff' => 'diff',
183
- 'patch' => 'diff',
184
- 'erl' => 'erlang',
185
- 'erlang' => 'erlang',
186
- 'fsharp' => 'fsharp',
187
- 'groovy' => 'groovy',
188
- 'java' => 'java',
189
- 'jfx' => 'javafx',
190
- 'javafx' => 'javafx',
191
- 'js' => 'jscript',
192
- 'jscript' => 'jscript',
193
- 'javascript' => 'jscript',
194
- 'latex' => 'latex', // Not used as a shortcode
195
- 'tex' => 'latex',
196
- 'matlab' => 'matlabkey',
197
- 'objc' => 'objc',
198
- 'obj-c' => 'objc',
199
- 'perl' => 'perl',
200
- 'pl' => 'perl',
201
- 'php' => 'php',
202
- 'plain' => 'plain',
203
- 'text' => 'plain',
204
- 'ps' => 'powershell',
205
- 'powershell' => 'powershell',
206
- 'py' => 'python',
207
- 'python' => 'python',
208
- 'r' => 'r', // Not used as a shortcode
209
- 'splus' => 'r',
210
- 'rails' => 'ruby',
211
- 'rb' => 'ruby',
212
- 'ror' => 'ruby',
213
- 'ruby' => 'ruby',
214
- 'scala' => 'scala',
215
- 'sql' => 'sql',
216
- 'vb' => 'vb',
217
- 'vbnet' => 'vb',
218
- 'xml' => 'xml',
219
- 'xhtml' => 'xml',
220
- 'xslt' => 'xml',
221
- 'html' => 'xml',
222
- ) );
223
-
224
-
225
- // Create a list of shortcodes to use. You can use the filter to add/remove ones.
226
- // If the language/lang parameter is left out, it's assumed the shortcode name is the language.
227
- // If that's invalid, then "plain" is used.
228
- $this->shortcodes = array( 'sourcecode', 'source', 'code' );
229
- $this->shortcodes = array_merge( $this->shortcodes, array_keys( $this->brushes ) );
230
-
231
- // Remove some shortcodes we don't want while still supporting them as language values
232
- unset( $this->shortcodes[array_search( 'latex', $this->shortcodes )] ); // Remove "latex" shortcode (it'll collide)
233
- unset( $this->shortcodes[array_search( 'r', $this->shortcodes )] ); // Remove "r" shortcode (too short)
234
-
235
- $this->shortcodes = (array) apply_filters( 'syntaxhighlighter_shortcodes', $this->shortcodes );
236
-
237
-
238
- // Register each shortcode with a placeholder callback so that strip_shortcodes() will work
239
- // The proper callback and such is done in SyntaxHighlighter::shortcode_hack()
240
- foreach ( $this->shortcodes as $shortcode )
241
- add_shortcode( $shortcode, '__return_true' );
242
-
243
-
244
- // Create list of themes and their human readable names
245
- // Plugins can add to this list: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-theme/
246
- $this->themes = (array) apply_filters( 'syntaxhighlighter_themes', array(
247
- 'default' => __( 'Default', 'syntaxhighlighter' ),
248
- 'django' => __( 'Django', 'syntaxhighlighter' ),
249
- 'eclipse' => __( 'Eclipse', 'syntaxhighlighter' ),
250
- 'emacs' => __( 'Emacs', 'syntaxhighlighter' ),
251
- 'fadetogrey' => __( 'Fade to Grey', 'syntaxhighlighter' ),
252
- 'midnight' => __( 'Midnight', 'syntaxhighlighter' ),
253
- 'rdark' => __( 'RDark', 'syntaxhighlighter' ),
254
- 'none' => __( '[None]', 'syntaxhighlighter' ),
255
- ) );
256
-
257
- // Other special characters that need to be encoded before going into the database (namely to work around kses)
258
- $this->specialchars = (array) apply_filters( 'syntaxhighlighter_specialchars', array(
259
- '\0' => '&#92;&#48;',
260
- ) );
261
- }
262
-
263
-
264
- // Register the settings page
265
- function register_settings_page() {
266
- add_options_page( __( 'SyntaxHighlighter Settings', 'syntaxhighlighter' ), __( 'SyntaxHighlighter', 'syntaxhighlighter' ), 'manage_options', 'syntaxhighlighter', array( $this, 'settings_page' ) );
267
- }
268
-
269
-
270
- // Register the plugin's setting
271
- function register_setting() {
272
- register_setting( 'syntaxhighlighter_settings', 'syntaxhighlighter_settings', array( $this, 'validate_settings' ) );
273
- }
274
-
275
-
276
- // Add the custom TinyMCE plugin which wraps plugin shortcodes in <pre> in TinyMCE
277
- function add_tinymce_plugin( $plugins ) {
278
- global $tinymce_version;
279
-
280
- add_action( 'admin_print_footer_scripts', array( $this, 'output_shortcodes_for_tinymce' ), 9 );
281
-
282
- if ( substr( $tinymce_version, 0, 1 ) < 4 ) {
283
- $plugins['syntaxhighlighter'] = plugins_url( 'syntaxhighlighter_mce.js', __FILE__ );
284
- } else {
285
- $plugins['syntaxhighlighter'] = add_query_arg( 'ver', $this->pluginver, plugins_url( 'syntaxhighlighter_mce-4.js', __FILE__ ) );
286
- wp_enqueue_script( 'syntaxhighlighter', plugins_url( 'syntaxhighlighter.js', __FILE__ ), array(), false, true );
287
- }
288
-
289
- return $plugins;
290
- }
291
-
292
-
293
- // Break the TinyMCE cache
294
- function break_tinymce_cache( $version ) {
295
- return $version . '-sh' . $this->pluginver;
296
- }
297
-
298
-
299
- // Add a "Settings" link to the plugins page
300
- function settings_link( $links, $file ) {
301
- static $this_plugin;
302
-
303
- if( empty($this_plugin) )
304
- $this_plugin = plugin_basename(__FILE__);
305
-
306
- if ( $file == $this_plugin )
307
- $links[] = '<a href="' . admin_url( 'options-general.php?page=syntaxhighlighter' ) . '">' . __( 'Settings', 'syntaxhighlighter' ) . '</a>';
308
-
309
- return $links;
310
- }
311
-
312
-
313
- // Output list of shortcode tags for the TinyMCE plugin
314
- function output_shortcodes_for_tinymce() {
315
- $shortcodes = array();
316
-
317
- foreach ( $this->shortcodes as $shortcode )
318
- $shortcodes[] = preg_quote( $shortcode );
319
-
320
- echo "<script type='text/javascript'>\n";
321
- echo " var syntaxHLcodes = '" . implode( '|', $shortcodes ) . "';\n";
322
- echo "</script>\n";
323
- }
324
-
325
-
326
- // A filter function that runs do_shortcode() but only with this plugin's shortcodes
327
- function shortcode_hack( $content, $callback ) {
328
- global $shortcode_tags;
329
-
330
- // Backup current registered shortcodes and clear them all out
331
- $orig_shortcode_tags = $shortcode_tags;
332
- remove_all_shortcodes();
333
-
334
- // Register all of this plugin's shortcodes
335
- foreach ( $this->shortcodes as $shortcode )
336
- add_shortcode( $shortcode, $callback );
337
-
338
- // Do the shortcodes (only this plugins's are registered)
339
- $content = $this->do_shortcode_keep_escaped_tags( $content );
340
-
341
- // Put the original shortcodes back
342
- $shortcode_tags = $orig_shortcode_tags;
343
-
344
- return $content;
345
- }
346
-
347
-
348
- // This is a clone of do_shortcode() that uses a different callback function
349
- // The new callback function will keep escaped tags escaped, i.e. [[foo]]
350
- // Up to date as of r18324 (3.2)
351
- function do_shortcode_keep_escaped_tags( $content ) {
352
- global $shortcode_tags;
353
-
354
- if (empty($shortcode_tags) || !is_array($shortcode_tags))
355
- return $content;
356
-
357
- $pattern = get_shortcode_regex();
358
- return preg_replace_callback('/'.$pattern.'/s', array( $this, 'do_shortcode_tag_keep_escaped_tags' ), $content);
359
- }
360
-
361
-
362
- // Callback for above do_shortcode_keep_escaped_tags() function
363
- // It's a clone of core's do_shortcode_tag() function with a modification to the escaped shortcode return
364
- // Up to date as of r18324 (3.2)
365
- function do_shortcode_tag_keep_escaped_tags( $m ) {
366
- global $shortcode_tags;
367
-
368
- // allow [[foo]] syntax for escaping a tag
369
- if ( $m[1] == '[' && $m[6] == ']' ) {
370
- return $m[0]; // This line was modified for this plugin (no substr call)
371
- }
372
-
373
- $tag = $m[2];
374
- $attr = shortcode_parse_atts( $m[3] );
375
-
376
- if ( isset( $m[5] ) ) {
377
- // enclosing tag - extra parameter
378
- return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, $m[5], $tag ) . $m[6];
379
- } else {
380
- // self-closing tag
381
- return $m[1] . call_user_func( $shortcode_tags[$tag], $attr, NULL, $tag ) . $m[6];
382
- }
383
- }
384
-
385
- // The main filter for the post contents. The regular shortcode filter can't be used as it's post-wpautop().
386
- function parse_shortcodes( $content ) {
387
- return $this->shortcode_hack( $content, array( $this, 'shortcode_callback' ) );
388
- }
389
-
390
-
391
- // HTML entity encode the contents of shortcodes
392
- function encode_shortcode_contents( $content ) {
393
- return $this->shortcode_hack( $content, array( $this, 'encode_shortcode_contents_callback' ) );
394
- }
395
-
396
-
397
- // HTML entity encode the contents of shortcodes. Expects slashed content.
398
- function encode_shortcode_contents_slashed( $content ) {
399
- return addslashes( $this->encode_shortcode_contents( stripslashes( $content ) ) );
400
- }
401
-
402
-
403
- // HTML entity encode the contents of shortcodes. Expects slashed content. Aborts if AJAX.
404
- function encode_shortcode_contents_slashed_noquickedit( $content ) {
405
-
406
- // In certain weird circumstances, the content gets run through "content_save_pre" twice
407
- // Keep track and don't allow this filter to be run twice
408
- // I couldn't easily figure out why this happens and didn't bother looking into it further as this works fine
409
- if ( true == $this->content_save_pre_ran ) {
410
- return $content;
411
- }
412
- $this->content_save_pre_ran = true;
413
-
414
- // Post quick edits aren't decoded for display, so we don't need to encode them (again)
415
- // This also aborts for (un)trashing to avoid extra encoding.
416
- if ( empty( $_POST ) || ( ! empty( $_POST['action'] ) && 'inline-save' == $_POST['action'] ) ) {
417
- return $content;
418
- }
419
-
420
- return $this->encode_shortcode_contents_slashed( $content );
421
- }
422
-
423
-
424
- // HTML entity decode the contents of shortcodes
425
- function decode_shortcode_contents( $content ) {
426
- return $this->shortcode_hack( $content, array( $this, 'decode_shortcode_contents_callback' ) );
427
- }
428
-
429
-
430
- // The callback function for SyntaxHighlighter::encode_shortcode_contents()
431
- function encode_shortcode_contents_callback( $atts, $code = '', $tag = false ) {
432
- $this->encoded = true;
433
- $code = str_replace( array_keys($this->specialchars), array_values($this->specialchars), htmlspecialchars( $code ) );
434
- return '[' . $tag . $this->atts2string( $atts ) . "]{$code}[/$tag]";
435
- }
436
-
437
-
438
- // The callback function for SyntaxHighlighter::decode_shortcode_contents()
439
- // Shortcode attribute values need to not be quoted with TinyMCE disabled for some reason (weird bug)
440
- function decode_shortcode_contents_callback( $atts, $code = '', $tag = false ) {
441
- $quotes = ( user_can_richedit() ) ? true : false;
442
- $code = str_replace( array_values($this->specialchars), array_keys($this->specialchars), htmlspecialchars_decode( $code ) );
443
- return '[' . $tag . $this->atts2string( $atts, $quotes ) . "]{$code}[/$tag]";
444
- }
445
-
446
-
447
- // Dynamically format the post content for the edit form
448
- function the_editor_content( $content ) {
449
- global $post;
450
-
451
- // New code format (stored encoded in database)
452
- if ( 2 == $this->get_code_format( $post ) ) {
453
- // If TinyMCE is disabled or the HTML tab is set to be displayed first, we need to decode the HTML
454
- if ( !user_can_richedit() || 'html' == wp_default_editor() )
455
- $content = $this->decode_shortcode_contents( $content );
456
- }
457
-
458
- // Old code format (stored raw in database)
459
- else {
460
- // If TinyMCE is enabled and is set to be displayed first, we need to encode the HTML
461
- if ( user_can_richedit() && 'html' != wp_default_editor() )
462
- $content = $this->encode_shortcode_contents( $content );
463
- }
464
-
465
- return $content;
466
- }
467
-
468
-
469
- // Run SyntaxHighlighter::encode_shortcode_contents() on the contents of the text widget
470
- function widget_text_save( $instance, $new_instance, $old_instance, $widgetclass ) {
471
- if ( 'text' == $widgetclass->id_base ) {
472
- // Re-save the widget settings but this time with the shortcode contents encoded
473
- $new_instance['text'] = $this->encode_shortcode_contents( $new_instance['text'] );
474
- $instance = $widgetclass->update( $new_instance, $old_instance );
475
-
476
- // And flag it as encoded
477
- $instance['syntaxhighlighter_encoded'] = true;
478
- }
479
-
480
- return $instance;
481
- }
482
-
483
-
484
- // Run SyntaxHighlighter::decode_shortcode_contents_callback() on the contents of the text widget form
485
- function widget_text_form( $instance, $widgetclass ) {
486
- if ( 'text' == $widgetclass->id_base && !empty($instance['syntaxhighlighter_encoded']) ) {
487
- $instance['text'] = $this->shortcode_hack( $instance['text'], array( $this, 'decode_shortcode_contents_callback' ) );
488
- }
489
-
490
- return $instance;
491
- }
492
-
493
-
494
- // Run SyntaxHighlighter::parse_shortcodes() on the contents of a text widget
495
- function widget_text_output( $content, $instance = false ) {
496
- $this->codeformat = ( false === $instance || empty($instance['syntaxhighlighter_encoded']) ) ? 1 : 2;
497
- $content = $this->parse_shortcodes( $content );
498
- $this->codeformat = false;
499
-
500
- return $content;
501
- }
502
-
503
-
504
- // Run SyntaxHighlighter::parse_shortcodes() on the contents of a comment
505
- function parse_shortcodes_comment( $content ) {
506
- $this->codeformat = 2;
507
- $content = $this->parse_shortcodes( $content );
508
- $this->codeformat = false;
509
-
510
- return $content;
511
- }
512
-
513
-
514
- // This function determines what version of SyntaxHighlighter was used when the post was written
515
- // This is because the code was stored differently for different versions of SyntaxHighlighter
516
- function get_code_format( $post ) {
517
- if ( false !== $this->codeformat )
518
- return $this->codeformat;
519
-
520
- if ( empty($post) )
521
- $post = new stdClass();
522
-
523
- if ( null !== $version = apply_filters( 'syntaxhighlighter_pre_getcodeformat', null, $post ) )
524
- return $version;
525
-
526
- $version = ( empty($post->ID) || get_post_meta( $post->ID, '_syntaxhighlighter_encoded', true ) || get_post_meta( $post->ID, 'syntaxhighlighter_encoded', true ) ) ? 2 : 1;
527
-
528
- return apply_filters( 'syntaxhighlighter_getcodeformat', $version, $post );
529
- }
530
-
531
-
532
- // Adds a post meta saying that HTML entities are encoded (for backwards compatibility)
533
- function mark_as_encoded( $post_ID, $post ) {
534
- if ( false == $this->encoded || 'revision' == $post->post_type )
535
- return;
536
-
537
- delete_post_meta( $post_ID, 'syntaxhighlighter_encoded' ); // Previously used
538
- add_post_meta( $post_ID, '_syntaxhighlighter_encoded', true, true );
539
- }
540
-
541
-
542
- // Transforms an attributes array into a 'key="value"' format (i.e. reverses the process)
543
- function atts2string( $atts, $quotes = true ) {
544
- if ( empty($atts) )
545
- return '';
546
-
547
- $atts = $this->attributefix( $atts );
548
-
549
- // Re-map [code="php"] style tags
550
- if ( isset($atts[0]) ) {
551
- if ( empty($atts['language']) )
552
- $atts['language'] = $atts[0];
553
-
554
- unset($atts[0]);
555
- }
556
-
557
- $strings = array();
558
- foreach ( $atts as $key => $value )
559
- $strings[] = ( $quotes ) ? $key . '="' . esc_attr( $value ) . '"' : $key . '=' . esc_attr( $value );
560
-
561
- return ' ' . implode( ' ', $strings );
562
- }
563
-
564
-
565
- // Simple function for escaping just single quotes (the original js_escape() escapes more than we need)
566
- function js_escape_singlequotes( $string ) {
567
- return str_replace( "'", "\'", $string );
568
- }
569
-
570
-
571
- // Output an anchor in the header for the Javascript to use.
572
- // In the <head>, we don't know if we'll need this plugin's CSS and JavaScript yet but we will in the footer.
573
- function output_header_placeholder() {
574
- echo '<style type="text/css" id="syntaxhighlighteranchor"></style>' . "\n";
575
- }
576
-
577
-
578
- // Output any needed scripts. This is meant for the footer.
579
- function maybe_output_scripts() {
580
- global $wp_styles;
581
-
582
- if ( 1 == $this->settings['loadallbrushes'] )
583
- $this->usedbrushes = array_flip( array_values( $this->brushes ) );
584
-
585
- if ( empty($this->usedbrushes) )
586
- return;
587
-
588
- $scripts = array();
589
- foreach ( $this->usedbrushes as $brush => $unused )
590
- $scripts[] = 'syntaxhighlighter-brush-' . strtolower( $brush );
591
-
592
- wp_print_scripts( $scripts );
593
-
594
- // Stylesheets can't be in the footer, so inject them via Javascript
595
- echo "<script type='text/javascript'>\n";
596
- echo " (function(){\n";
597
- echo " var corecss = document.createElement('link');\n";
598
- echo " var themecss = document.createElement('link');\n";
599
-
600
- if ( !is_a($wp_styles, 'WP_Styles') )
601
- $wp_styles = new WP_Styles();
602
-
603
- $needcore = false;
604
- if ( 'none' == $this->settings['theme'] ) {
605
- $needcore = true;
606
- } else {
607
- $theme = ( !empty($this->themes[$this->settings['theme']]) ) ? strtolower($this->settings['theme']) : $this->defaultsettings['theme'];
608
- $theme = 'syntaxhighlighter-theme-' . $theme;
609
-
610
- // See if the requested theme has been registered
611
- if ( !empty($wp_styles) && !empty($wp_styles->registered) && !empty($wp_styles->registered[$theme]) && !empty($wp_styles->registered[$theme]->src) ) {
612
-
613
- // Users can register their own stylesheet and may opt to not load the core stylesheet if they wish for some reason
614
- if ( is_array($wp_styles->registered[$theme]->deps) && in_array( 'syntaxhighlighter-core', $wp_styles->registered[$theme]->deps ) )
615
- $needcore = true;
616
- }
617
-
618
- // Otherwise use the default theme
619
- else {
620
- $theme = 'syntaxhighlighter-theme-' . $this->defaultsettings['theme'];
621
- $needcore = true;
622
- }
623
- }
624
-
625
- if ( $needcore && !empty($wp_styles) && !empty($wp_styles->registered) && !empty($wp_styles->registered['syntaxhighlighter-core']) && !empty($wp_styles->registered['syntaxhighlighter-core']->src) ) :
626
- $corecssurl = add_query_arg( 'ver', $this->agshver, $wp_styles->registered['syntaxhighlighter-core']->src );
627
- $corecssurl = apply_filters( 'syntaxhighlighter_csscoreurl', $corecssurl );
628
- ?>
629
- var corecssurl = "<?php echo esc_js( $corecssurl ); ?>";
630
- if ( corecss.setAttribute ) {
631
- corecss.setAttribute( "rel", "stylesheet" );
632
- corecss.setAttribute( "type", "text/css" );
633
- corecss.setAttribute( "href", corecssurl );
634
- } else {
635
- corecss.rel = "stylesheet";
636
- corecss.href = corecssurl;
637
- }
638
- document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
639
- <?php
640
- endif; // Endif $needcore
641
-
642
- if ( 'none' != $this->settings['theme'] ) : ?>
643
- var themecssurl = "<?php echo esc_js( apply_filters( 'syntaxhighlighter_cssthemeurl', add_query_arg( 'ver', $this->agshver, $wp_styles->registered[$theme]->src ) ) ); ?>";
644
- if ( themecss.setAttribute ) {
645
- themecss.setAttribute( "rel", "stylesheet" );
646
- themecss.setAttribute( "type", "text/css" );
647
- themecss.setAttribute( "href", themecssurl );
648
- } else {
649
- themecss.rel = "stylesheet";
650
- themecss.href = themecssurl;
651
- }
652
- //document.getElementById("syntaxhighlighteranchor").appendChild(themecss);
653
- document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
654
- <?php
655
- endif; // Endif none != theme
656
-
657
- echo " })();\n";
658
-
659
- switch ( $this->settings['shversion'] ) {
660
- case 2:
661
- echo " SyntaxHighlighter.config.clipboardSwf = '" . esc_js( apply_filters( 'syntaxhighlighter_clipboardurl', plugins_url( 'syntaxhighlighter2/scripts/clipboard.swf', __FILE__ ) ) ) . "';\n";
662
- echo " SyntaxHighlighter.config.strings.expandSource = '" . $this->js_escape_singlequotes( __( 'show source', 'syntaxhighlighter' ) ) . "';\n";
663
- echo " SyntaxHighlighter.config.strings.viewSource = '" . $this->js_escape_singlequotes( __( 'view source', 'syntaxhighlighter' ) ) . "';\n";
664
- echo " SyntaxHighlighter.config.strings.copyToClipboard = '" . $this->js_escape_singlequotes( __( 'copy to clipboard', 'syntaxhighlighter' ) ) . "';\n";
665
- echo " SyntaxHighlighter.config.strings.copyToClipboardConfirmation = '" . $this->js_escape_singlequotes( __( 'The code is in your clipboard now', 'syntaxhighlighter' ) ) . "';\n";
666
- echo " SyntaxHighlighter.config.strings.print = '" . $this->js_escape_singlequotes( __( 'print', 'syntaxhighlighter' ) ) . "';\n";
667
- echo " SyntaxHighlighter.config.strings.help = '" . $this->js_escape_singlequotes( __( '?', 'syntaxhighlighter' ) ) . "';\n";
668
- echo " SyntaxHighlighter.config.strings.alert = '" . $this->js_escape_singlequotes( __( 'SyntaxHighlighter\n\n', 'syntaxhighlighter' ) ) . "';\n";
669
- echo " SyntaxHighlighter.config.strings.noBrush = '" . $this->js_escape_singlequotes( __( "Can't find brush for: ", 'syntaxhighlighter' ) ) . "';\n";
670
- echo " SyntaxHighlighter.config.strings.brushNotHtmlScript = '" . $this->js_escape_singlequotes( __( "Brush wasn't configured for html-script option: ", 'syntaxhighlighter' ) ) . "';\n";
671
- break;
672
- case 3:
673
- echo " SyntaxHighlighter.config.strings.expandSource = '" . $this->js_escape_singlequotes( __( '+ expand source', 'syntaxhighlighter' ) ) . "';\n";
674
- echo " SyntaxHighlighter.config.strings.help = '" . $this->js_escape_singlequotes( __( '?', 'syntaxhighlighter' ) ) . "';\n";
675
- echo " SyntaxHighlighter.config.strings.alert = '" . $this->js_escape_singlequotes( __( 'SyntaxHighlighter\n\n', 'syntaxhighlighter' ) ) . "';\n";
676
- echo " SyntaxHighlighter.config.strings.noBrush = '" . $this->js_escape_singlequotes( __( "Can't find brush for: ", 'syntaxhighlighter' ) ) . "';\n";
677
- echo " SyntaxHighlighter.config.strings.brushNotHtmlScript = '" . $this->js_escape_singlequotes( __( "Brush wasn't configured for html-script option: ", 'syntaxhighlighter' ) ) . "';\n";
678
- break;
679
- }
680
-
681
- if ( 1 != $this->settings['autolinks'] )
682
- echo " SyntaxHighlighter.defaults['auto-links'] = false;\n";
683
-
684
- if ( !empty($this->settings['classname']) )
685
- echo " SyntaxHighlighter.defaults['class-name'] = '" . $this->js_escape_singlequotes( $this->settings['classname'] ) . "';\n";
686
-
687
- if ( 1 == $this->settings['collapse'] )
688
- echo " SyntaxHighlighter.defaults['collapse'] = true;\n";
689
-
690
- if ( 1 != $this->settings['firstline'] )
691
- echo " SyntaxHighlighter.defaults['first-line'] = " . $this->settings['firstline'] . ";\n";
692
-
693
- if ( 1 != $this->settings['gutter'] )
694
- echo " SyntaxHighlighter.defaults['gutter'] = false;\n";
695
-
696
- /*
697
- if ( 1 == $this->settings['htmlscript'] )
698
- echo " SyntaxHighlighter.defaults['html-script'] = true;\n";
699
- */
700
-
701
- if ( 1 == $this->settings['light'] )
702
- echo " SyntaxHighlighter.defaults['light'] = true;\n";
703
-
704
- echo " SyntaxHighlighter.defaults['pad-line-numbers'] = ";
705
- switch ( $this->settings['padlinenumbers'] ) {
706
- case 'true':
707
- echo 'true';
708
- break;
709
- case 'false';
710
- echo 'false';
711
- break;
712
- default;
713
- echo (int) $this->settings['padlinenumbers'];
714
- }
715
- echo ";\n";
716
-
717
- if ( 1 != $this->settings['smarttabs'] )
718
- echo " SyntaxHighlighter.defaults['smart-tabs'] = false;\n";
719
-
720
- if ( 4 != $this->settings['tabsize'] )
721
- echo " SyntaxHighlighter.defaults['tab-size'] = " . $this->settings['tabsize'] . ";\n";
722
-
723
- if ( 1 != $this->settings['toolbar'] )
724
- echo " SyntaxHighlighter.defaults['toolbar'] = false;\n";
725
-
726
- // 2.x only for now
727
- if ( 1 != $this->settings['wraplines'] )
728
- echo " SyntaxHighlighter.defaults['wrap-lines'] = false;\n";
729
-
730
- ?> SyntaxHighlighter.all();
731
- </script>
732
- <?php
733
- }
734
-
735
-
736
- // No-name attribute fixing
737
- function attributefix( $atts = array() ) {
738
- if ( empty($atts[0]) )
739
- return $atts;
740
-
741
- // Quoted value
742
- if ( 0 !== preg_match( '#=("|\')(.*?)\1#', $atts[0], $match ) )
743
- $atts[0] = $match[2];
744
-
745
- // Unquoted value
746
- elseif ( '=' == substr( $atts[0], 0, 1 ) )
747
- $atts[0] = substr( $atts[0], 1 );
748
-
749
- return $atts;
750
- }
751
-
752
-
753
- // Shortcode handler for transforming the shortcodes to their final <pre>'s
754
- function shortcode_callback( $atts, $code = '', $tag = false ) {
755
- global $post;
756
-
757
- if ( false === $tag || empty($code) )
758
- return $code;
759
-
760
- // Avoid PHP notices
761
- if ( !isset($post) )
762
- $post = null;
763
-
764
- $code = apply_filters( 'syntaxhighlighter_precode', $code, $atts, $tag );
765
-
766
- // Error fixing for [tag="language"]
767
- if ( isset($atts[0]) ) {
768
- $atts = $this->attributefix( $atts );
769
- $atts['language'] = $atts[0];
770
- unset($atts[0]);
771
- }
772
-
773
- // Default out all of the available parameters to "false" (easy way to check if they're set or not)
774
- // Note this isn't the same as if the user passes the string "false" to the shortcode
775
- $atts = (array) apply_filters( 'syntaxhighlighter_shortcodeatts', shortcode_atts( array(
776
- 'language' => false,
777
- 'lang' => false,
778
- 'type' => false, // language alias
779
- 'autolinks' => false,
780
- 'classname' => false,
781
- 'collapse' => false,
782
- 'firstline' => false,
783
- 'fontsize' => false,
784
- 'gutter' => false,
785
- 'highlight' => false,
786
- 'htmlscript' => false,
787
- 'light' => false,
788
- 'padlinenumbers' => false,
789
- 'smarttabs' => false,
790
- 'tabsize' => false,
791
- 'title' => $this->settings['title'],
792
- 'toolbar' => false,
793
- 'wraplines' => false,
794
- ), $atts ) );
795
-
796
- // Check for language shortcode tag such as [php]code[/php]
797
- if ( isset($this->brushes[$tag]) ) {
798
- $lang = $tag;
799
- }
800
-
801
- // If a valid tag is not used, it must be sourcecode/source/code
802
- else {
803
- $atts = $this->attributefix( $atts );
804
-
805
- // Check for the "language" attribute
806
- if ( false !== $atts['language'] )
807
- $lang = $atts['language'];
808
-
809
- // Check for the "lang" attribute
810
- elseif ( false !== $atts['lang'] )
811
- $lang = $atts['lang'];
812
-
813
- // Default to plain text
814
- else
815
- $lang = 'text';
816
-
817
- // All language aliases are lowercase
818
- $lang = strtolower( $lang );
819
-
820
- // Validate passed attribute
821
- if ( !isset($this->brushes[$lang]) )
822
- return $code;
823
- }
824
-
825
- // Switch from the alias to the real brush name (so custom aliases can be used)
826
- $lang = $this->brushes[$lang];
827
-
828
- // Register this brush as used so it's script will be outputted
829
- $this->usedbrushes[$lang] = true;
830
-
831
- $params = array();
832
- $params[] = "brush: $lang;";
833
-
834
- // Fix bug that prevents collapse from working if the toolbar is off or light mode is on
835
- if ( 'true' == $atts['collapse'] || '1' === $atts['collapse'] || 1 == $this->settings['collapse'] ) {
836
- $atts['toolbar'] = 'true';
837
- $atts['light'] = 'false';
838
- }
839
-
840
- // Parameter renaming (the shortcode API doesn't like parameter names with dashes)
841
- $rename_map = array(
842
- 'autolinks' => 'auto-links',
843
- 'classname' => 'class-name',
844
- 'firstline' => 'first-line',
845
- 'fontsize' => 'font-size',
846
- 'htmlscript' => 'html-script',
847
- 'padlinenumbers' => 'pad-line-numbers',
848
- 'smarttabs' => 'smart-tabs',
849
- 'tabsize' => 'tab-size',
850
- 'wraplines' => 'wrap-lines',
851
- );
852
-
853
- // Allowed configuration parameters and their type
854
- // Use the proper names (see above)
855
- $allowed_atts = (array) apply_filters( 'syntaxhighlighter_allowedatts', array(
856
- 'auto-links' => 'boolean',
857
- 'class-name' => 'other',
858
- 'collapse' => 'boolean',
859
- 'first-line' => 'integer',
860
- 'font-size' => 'integer',
861
- 'gutter' => 'boolean',
862
- 'highlight' => 'other',
863
- 'html-script' => 'boolean',
864
- 'light' => 'boolean',
865
- 'pad-line-numbers' => 'other',
866
- 'smart-tabs' => 'boolean',
867
- 'tab-size' => 'integer',
868
- 'title' => 'other',
869
- 'toolbar' => 'boolean',
870
- 'wrap-lines' => 'boolean',
871
- ) );
872
-
873
- $title = '';
874
-
875
- // Sanitize configuration parameters and such
876
- foreach ( $atts as $key => $value ) {
877
- $key = strtolower( $key );
878
-
879
- // Put back parameter names that have been renamed for shortcode use
880
- if ( !empty($rename_map[$key]) )
881
- $key = $rename_map[$key];
882
-
883
- // This this parameter if it's unknown, not set, or the language which was already handled
884
- if ( empty($allowed_atts[$key]) || false === $value || in_array( $key, array( 'language', 'lang' ) ) )
885
- continue;
886
-
887
- // Sanitize values
888
- switch ( $allowed_atts[$key] ) {
889
- case 'boolean':
890
- $value = strtolower( $value );
891
- if ( 'true' === $value || '1' === $value || 'on' == $value )
892
- $value = 'true';
893
- elseif ( 'false' === $value || '0' === $value || 'off' == $value )
894
- $value = 'false';
895
- else
896
- continue 2; // Invalid value, ditch parameter
897
- break;
898
-
899
- // integer
900
- case 'integer':
901
- $value = (int) $value;
902
- break;
903
- }
904
-
905
- // Sanitize the "classname" parameter
906
- if ( 'class-name' == $key )
907
- $value = trim( preg_replace( '/[^a-zA-Z0-9 _-]/i', '', $value ) );
908
-
909
- // Special sanitization for "pad-line-numbers"
910
- if ( 'pad-line-numbers' == $key ) {
911
- $value = strtolower( $value );
912
- if ( 'true' === $value || '1' === $value )
913
- $value = 'true';
914
- elseif ( 'false' === $value || '0' === $value )
915
- $value = 'false';
916
- else
917
- $value = (int) $value;
918
- }
919
-
920
- // Add % sign to "font-size"
921
- if ( 'font-size' == $key )
922
- $value = $value . '%';
923
-
924
- // If "html-script", then include the XML brush as it's needed
925
- if ( 'html-script' == $key && 'true' == $value )
926
- $this->usedbrushes['xml'] = true;
927
-
928
- // Sanitize row highlights
929
- if ( 'highlight' == $key ) {
930
- if ( false === strpos( $value, ',' ) && false === strpos( $value, '-' ) ) {
931
- $value = (int) $value;
932
- } else {
933
- $lines = explode( ',', $value );
934
- $highlights = array();
935
-
936
- foreach ( $lines as $line ) {
937
- // Line range
938
- if ( false !== strpos( $line, '-' ) ) {
939
- list( $range_start, $range_end ) = array_map( 'intval', explode( '-', $line ) );
940
- if ( ! $range_start || ! $range_end || $range_end <= $range_start )
941
- continue;
942
-
943
- for ( $i = $range_start; $i <= $range_end; $i++ )
944
- $highlights[] = $i;
945
- } else {
946
- $highlights[] = (int) $line;
947
- }
948
- }
949
-
950
- natsort( $highlights );
951
-
952
- $value = implode( ',', $highlights );
953
- }
954
-
955
- if ( empty( $value ) )
956
- continue;
957
-
958
- // Wrap highlight in [ ]
959
- $params[] = "$key: [$value];";
960
- continue;
961
- }
962
-
963
- // Don't allow HTML in the title parameter
964
- if ( 'title' == $key ) {
965
- $value = strip_tags( html_entity_decode( strip_tags( $value ) ) );
966
- }
967
-
968
- $params[] = "$key: $value;";
969
-
970
- // Set the title variable if the title parameter is set (but not for feeds)
971
- if ( 'title' == $key && ! is_feed() )
972
- $title = ' title="' . esc_attr( $value ) . '"';
973
- }
974
-
975
- $code = ( false === strpos( $code, '<' ) && false === strpos( $code, '>' ) && 2 == $this->get_code_format($post) ) ? strip_tags( $code ) : htmlspecialchars( $code );
976
-
977
- $params[] = 'notranslate'; // For Google, see http://otto42.com/9k
978
-
979
- $params = apply_filters( 'syntaxhighlighter_cssclasses', $params ); // Use this to add additional CSS classes / SH parameters
980
-
981
- return apply_filters( 'syntaxhighlighter_htmlresult', '<pre class="' . esc_attr( implode( ' ', $params ) ) . '"' . $title . '>' . $code . '</pre>' );;
982
- }
983
-
984
-
985
- // Settings page
986
- function settings_page() { ?>
987
-
988
- <script type="text/javascript">
989
- // <![CDATA[
990
- jQuery(document).ready(function($) {
991
- // Confirm pressing of the "Reset to Defaults" button
992
- $("#syntaxhighlighter-defaults").click(function(){
993
- var areyousure = confirm("<?php echo esc_js( __( 'Are you sure you want to reset your settings to the defaults?', 'syntaxhighlighter' ) ); ?>");
994
- if ( true != areyousure ) return false;
995
- });
996
- <?php if ( !empty( $_GET['defaults'] ) ) : ?>
997
- $("#message p strong").text("<?php echo esc_js( __( 'Settings reset to defaults.', 'syntaxhighlighter' ) ); ?>");
998
- <?php endif; ?>
999
- });
1000
- // ]]>
1001
- </script>
1002
-
1003
- <div class="wrap">
1004
- <?php if ( function_exists('screen_icon') ) screen_icon(); ?>
1005
- <h2><?php _e( 'SyntaxHighlighter Settings', 'syntaxhighlighter' ); ?></h2>
1006
-
1007
- <form method="post" action="options.php">
1008
-
1009
- <?php settings_fields('syntaxhighlighter_settings'); ?>
1010
-
1011
-
1012
- <table class="form-table">
1013
- <tr valign="top">
1014
- <th scope="row"><label for="syntaxhighlighter-shversion"><?php _e( 'Highlighter Version', 'syntaxhighlighter' ); ?></label></th>
1015
- <td>
1016
- <select name="syntaxhighlighter_settings[shversion]" id="syntaxhighlighter-shversion" class="postform">
1017
- <?php
1018
- $versions = array(
1019
- 3 => __( 'Version 3.x', 'syntaxhighlighter' ),
1020
- 2 => __( 'Version 2.x', 'syntaxhighlighter' ),
1021
- );
1022
-
1023
- foreach ( $versions as $version => $name ) {
1024
- echo ' <option value="' . esc_attr( $version ) . '"' . selected( $this->settings['shversion'], $version, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n";
1025
- }
1026
- ?>
1027
- </select><br />
1028
- <?php _e( 'Version 3 allows visitors to easily highlight portions of your code with their mouse (either by dragging or double-clicking) and copy it to their clipboard. No toolbar containing a Flash-based button is required.', 'syntaxhighlighter' ); ?><br />
1029
- <?php _e( 'Version 2 allows for line wrapping, something that version 3 does not do at this time.', 'syntaxhighlighter' ); ?>
1030
- </td>
1031
- </tr>
1032
- <tr valign="top">
1033
- <th scope="row"><label for="syntaxhighlighter-theme"><?php _e( 'Color Theme', 'syntaxhighlighter' ); ?></label></th>
1034
- <td>
1035
- <select name="syntaxhighlighter_settings[theme]" id="syntaxhighlighter-theme" class="postform">
1036
- <?php
1037
- foreach ( $this->themes as $theme => $name ) {
1038
- echo ' <option value="' . esc_attr( $theme ) . '"' . selected( $this->settings['theme'], $theme, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n";
1039
- }
1040
- ?>
1041
- </select>
1042
- </td>
1043
- </tr>
1044
- <tr valign="top">
1045
- <th scope="row"><?php _e( 'Load All Brushes', 'syntaxhighlighter' ); ?></th>
1046
- <td>
1047
- <fieldset>
1048
- <legend class="hidden"><?php _e( 'Load All Brushes', 'syntaxhighlighter' ); ?></legend>
1049
- <label for="syntaxhighlighter-loadallbrushes"><input name="syntaxhighlighter_settings[loadallbrushes]" type="checkbox" id="syntaxhighlighter-loadallbrushes" value="1" <?php checked( $this->settings['loadallbrushes'], 1 ); ?> /> <?php _e( 'Always load all language files (for directly using <code>&lt;pre&gt;</code> tags rather than shortcodes)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If left unchecked (default), then language files will only be loaded when needed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If unsure, leave this box unchecked', 'syntaxhighlighter' ); ?></label>
1050
- </fieldset>
1051
- </td>
1052
- </tr>
1053
- </table>
1054
-
1055
- <h3><?php _e( 'Defaults', 'syntaxhighlighter' ); ?></h3>
1056
-
1057
- <p><?php _e( 'All of the settings below can be configured on a per-code block basis, but you can control the defaults of all code blocks here.', 'syntaxhighlighter' ); ?></p>
1058
-
1059
- <table class="form-table">
1060
- <tr valign="top">
1061
- <th scope="row"><?php _e( 'Miscellaneous', 'syntaxhighlighter' ); ?></th>
1062
- <td>
1063
- <fieldset>
1064
- <legend class="hidden"><?php _e( 'Miscellaneous', 'syntaxhighlighter' ); ?></legend>
1065
-
1066
- <label for="syntaxhighlighter-gutter"><input name="syntaxhighlighter_settings[gutter]" type="checkbox" id="syntaxhighlighter-gutter" value="1" <?php checked( $this->settings['gutter'], 1 ); ?> /> <?php _e( 'Display line numbers', 'syntaxhighlighter' ); ?></label><br />
1067
- <label for="syntaxhighlighter-toolbar"><input name="syntaxhighlighter_settings[toolbar]" type="checkbox" id="syntaxhighlighter-toolbar" value="1" <?php checked( $this->settings['toolbar'], 1 ); ?> /> <?php _e( 'Display the toolbar', 'syntaxhighlighter' ); ?></label><br />
1068
- <label for="syntaxhighlighter-autolinks"><input name="syntaxhighlighter_settings[autolinks]" type="checkbox" id="syntaxhighlighter-autolinks" value="1" <?php checked( $this->settings['autolinks'], 1 ); ?> /> <?php _e( 'Automatically make URLs clickable', 'syntaxhighlighter' ); ?></label><br />
1069
- <label for="syntaxhighlighter-collapse"><input name="syntaxhighlighter_settings[collapse]" type="checkbox" id="syntaxhighlighter-collapse" value="1" <?php checked( $this->settings['collapse'], 1 ); ?> /> <?php _e( 'Collapse code boxes', 'syntaxhighlighter' ); ?></label><br />
1070
- <label for="syntaxhighlighter-light"><input name="syntaxhighlighter_settings[light]" type="checkbox" id="syntaxhighlighter-light" value="1" <?php checked( $this->settings['light'], 1 ); ?> /> <?php _e( 'Use the light display mode, best for single lines of code', 'syntaxhighlighter' ); ?></label><br />
1071
- <label for="syntaxhighlighter-smarttabs"><input name="syntaxhighlighter_settings[smarttabs]" type="checkbox" id="syntaxhighlighter-smarttabs" value="1" <?php checked( $this->settings['smarttabs'], 1 ); ?> /> <?php _e( 'Use smart tabs allowing tabs being used for alignment', 'syntaxhighlighter' ); ?></label><br />
1072
- <label for="syntaxhighlighter-wraplines"><input name="syntaxhighlighter_settings[wraplines]" type="checkbox" id="syntaxhighlighter-wraplines" value="1" <?php checked( $this->settings['wraplines'], 1 ); ?> /> <?php _e( 'Wrap long lines (v2.x only, disabling this will make a scrollbar show instead)', 'syntaxhighlighter' ); ?></label><br />
1073
- <!--<label for="syntaxhighlighter-htmlscript"><input name="syntaxhighlighter_settings[htmlscript]" type="checkbox" id="syntaxhighlighter-htmlscript" value="1" <?php checked( $this->settings['htmlscript'], 1 ); ?> /> <?php _e( 'Enable &quot;HTML script&quot; mode by default (see the bottom of this page for details). Checking this box is not recommended as this mode only works with certain languages.', 'syntaxhighlighter' ); ?></label>-->
1074
- </fieldset>
1075
- </td>
1076
- </tr>
1077
- <tr valign="top">
1078
- <th scope="row"><label for="syntaxhighlighter-classname"><?php _e( 'Additional CSS Class(es)', 'syntaxhighlighter' ); ?></label></th>
1079
- <td><input name="syntaxhighlighter_settings[classname]" type="text" id="syntaxhighlighter-classname" value="<?php echo esc_attr( $this->settings['classname'] ); ?>" class="regular-text" /></td>
1080
- </tr>
1081
- <tr valign="top">
1082
- <th scope="row"><label for="syntaxhighlighter-firstline"><?php _e( 'Starting Line Number', 'syntaxhighlighter' ); ?></label></th>
1083
- <td><input name="syntaxhighlighter_settings[firstline]" type="text" id="syntaxhighlighter-firstline" value="<?php echo esc_attr( $this->settings['firstline'] ); ?>" class="small-text" /></td>
1084
- </tr>
1085
- <tr valign="top">
1086
- <th scope="row"><label for="syntaxhighlighter-padlinenumbers"><?php _e( 'Line Number Padding', 'syntaxhighlighter' ); ?></label></th>
1087
- <td>
1088
- <select name="syntaxhighlighter_settings[padlinenumbers]" id="syntaxhighlighter-padlinenumbers" class="postform">
1089
- <?php
1090
- $linepaddings = array(
1091
- 'false' => __( 'Off', 'syntaxhighlighter' ),
1092
- 'true' => __( 'Automatic', 'syntaxhighlighter' ),
1093
- 1 => 1,
1094
- 2 => 2,
1095
- 3 => 3,
1096
- 4 => 4,
1097
- 5 => 5,
1098
- );
1099
-
1100
- foreach ( $linepaddings as $value => $name ) {
1101
- echo ' <option value="' . esc_attr( $value ) . '"' . selected( $this->settings['padlinenumbers'], $value, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n";
1102
- }
1103
- ?>
1104
- </select>
1105
- </td>
1106
- </tr>
1107
- <tr valign="top">
1108
- <th scope="row"><label for="syntaxhighlighter-tabsize"><?php _e( 'Tab Size', 'syntaxhighlighter' ); ?></label></th>
1109
- <td><input name="syntaxhighlighter_settings[tabsize]" type="text" id="syntaxhighlighter-tabsize" value="<?php echo esc_attr( $this->settings['tabsize'] ); ?>" class="small-text" /></td>
1110
- </tr>
1111
- <tr valign="top">
1112
- <th scope="row"><label for="syntaxhighlighter-title"><?php _e( 'Title', 'syntaxhighlighter' ); ?></label></th>
1113
- <td>
1114
- <input name="syntaxhighlighter_settings[title]" type="text" id="syntaxhighlighter-title" value="<?php echo esc_attr( $this->settings['title'] ); ?>" class="regular-text" /><br />
1115
- <?php _e( 'Some optional default text to display above each code block or as the clickable text for collapsed code blocks.', 'syntaxhighlighter' ); ?>
1116
- </td>
1117
- </tr>
1118
- </table>
1119
-
1120
- <p class="submit">
1121
- <?php
1122
- if ( function_exists( 'submit_button' ) ) {
1123
- submit_button( null, 'primary', 'syntaxhighlighter-submit', false );
1124
- echo ' ';
1125
- submit_button( __( 'Reset to Defaults', 'syntaxhighlighter' ), 'primary', 'syntaxhighlighter-defaults', false );
1126
- } else {
1127
- echo '<input type="submit" name="syntaxhighlighter-submit" class="button-primary" value="' . __( 'Save Changes') . '" />' . "\n";
1128
- echo '<input type="submit" name="syntaxhighlighter-defaults" id="syntaxhighlighter-defaults" class="button-primary" value="' . __( 'Reset to Defaults', 'syntaxhighlighter' ) . '" />' . "\n";
1129
- }
1130
- ?>
1131
- </p>
1132
-
1133
- </form>
1134
-
1135
- <h3><?php _e( 'Preview', 'syntaxhighlighter' ); ?></h3>
1136
-
1137
- <p><?php _e( 'Click &quot;Save Changes&quot; to update this preview.', 'syntaxhighlighter' ); ?>
1138
-
1139
- <?php
1140
-
1141
- echo '<div';
1142
- if ( ! empty( $GLOBALS['content_width'] ) )
1143
- echo ' style="max-width:' . intval( $GLOBALS['content_width'] ) . 'px"';
1144
- echo '>';
1145
-
1146
- $title = ( empty( $this->settings['title'] ) && 1 != $this->settings['collapse'] ) ? ' title="Code example: (this example was added using the title parameter)"' : '';
1147
-
1148
- // Site owners may opt to disable the short tags, i.e. [php]
1149
- $democode = apply_filters( 'syntaxhighlighter_democode', '[sourcecode language="php" htmlscript="true" highlight="12"' . $title . ']<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1150
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1151
- <head>
1152
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1153
- <title>PHP Code Example</title>
1154
- </head>
1155
- <body>
1156
- <h1>' . __( 'PHP Code Example', 'syntaxhighlighter' ) . '</h1>
1157
-
1158
- <p><?php echo \'' . __( 'Hello World!', 'syntaxhighlighter' ) . '\'; ?></p>
1159
-
1160
- <p>' . __( 'This line is highlighted.', 'syntaxhighlighter' ) . '</p>
1161
-
1162
- <div class="foobar">
1163
- ' . __( ' This is an
1164
- example of smart
1165
- tabs.', 'syntaxhighlighter' ) . '
1166
- </div>
1167
-
1168
- <p><a href="http://wordpress.org/">' . __( 'WordPress' ) . '</a></p>
1169
- </body>
1170
- </html>[/sourcecode]' );
1171
-
1172
- $this->codeformat = 1;
1173
- echo $this->parse_shortcodes( $democode );
1174
- $this->codeformat = false;
1175
-
1176
- echo '</div>';
1177
- ?>
1178
-
1179
- <h3 style="margin-top:30px"><?php _e( 'Shortcode Parameters', 'syntaxhighlighter' ); ?></h3>
1180
-
1181
- <p><?php printf( __( 'These are the parameters you can pass to the shortcode and what they do. For the booleans (i.e. on/off), pass %1$s/%2$s or %3$s/%4$s.', 'syntaxhighlighter' ), '<code>true</code>', '<code>1</code>', '<code>false</code>', '<code>0</code>' ); ?></p>
1182
-
1183
- <ul class="ul-disc">
1184
- <li><?php printf( _x( '%1$s or %2$s &#8212; The language syntax to highlight with. You can alternately just use that as the tag, such as <code>[php]code[/php]</code>. <a href="%3$s">Click here</a> for a list of valid tags (under &quot;aliases&quot;).', 'language parameter', 'syntaxhighlighter' ), '<code>lang</code>', '<code>language</code>', 'http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes' ); ?></li>
1185
- <li><?php printf( _x( '%s &#8212; Toggle automatic URL linking.', 'autolinks parameter', 'syntaxhighlighter' ), '<code>autolinks</code>' ); ?></li>
1186
- <li><?php printf( _x( '%s &#8212; Add an additional CSS class to the code box.', 'classname parameter', 'syntaxhighlighter' ), '<code>classname</code>' ); ?></li>
1187
- <li><?php printf( _x( '%s &#8212; Toggle collapsing the code box by default, requiring a click to expand it. Good for large code posts.', 'collapse parameter', 'syntaxhighlighter' ), '<code>collapse</code>' ); ?></li>
1188
- <li><?php printf( _x( '%s &#8212; An interger specifying what number the first line should be (for the line numbering).', 'firstline parameter', 'syntaxhighlighter' ), '<code>firstline</code>' ); ?></li>
1189
- <li><?php printf( _x( '%s &#8212; Toggle the left-side line numbering.', 'gutter parameter', 'syntaxhighlighter' ), '<code>gutter</code>' ); ?></li>
1190
- <li><?php printf( _x( '%1$s &#8212; A comma-separated list of line numbers to highlight. You can also specify a range. Example: %2$s', 'highlight parameter', 'syntaxhighlighter' ), '<code>highlight</code>', '<code>2,5-10,12</code>' ); ?></li>
1191
- <li><?php printf( _x( "%s &#8212; Toggle highlighting any extra HTML/XML. Good for when you're mixing HTML/XML with another language, such as having PHP inside an HTML web page. The above preview has it enabled for example. This only works with certain languages.", 'htmlscript parameter', 'syntaxhighlighter' ), '<code>htmlscript</code>' ); ?></li>
1192
- <li><?php printf( _x( '%s &#8212; Toggle light mode which disables the gutter and toolbar all at once.', 'light parameter', 'syntaxhighlighter' ), '<code>light</code>' ); ?></li>
1193
- <li><?php printf( _x( '%s &#8212; Controls line number padding. Valid values are <code>false</code> (no padding), <code>true</code> (automatic padding), or an integer (forced padding).', 'padlinenumbers parameter', 'syntaxhighlighter' ), '<code>padlinenumbers</code>' ); ?></li>
1194
- <li><?php printf( _x( '%1$s (v3 only) &#8212; Sets some text to show up before the code. Very useful when combined with the %2$s parameter.', 'title parameter', 'syntaxhighlighter' ), '<code>title</code>', '<code>collapse</code>' ); ?></li>
1195
- <li><?php printf( _x( '%s &#8212; Toggle the toolbar (buttons in v2, the about question mark in v3)', 'toolbar parameter', 'syntaxhighlighter' ), '<code>toolbar</code>' ); ?></li>
1196
- <li><?php printf( _x( '%s (v2 only) &#8212; Toggle line wrapping.', 'wraplines parameter', 'syntaxhighlighter'), '<code>wraplines</code>' ); ?></li>
1197
- </ul>
1198
-
1199
- <p><?php _e( 'Some example shortcodes:', 'syntaxhighlighter' ); ?></p>
1200
-
1201
- <ul class="ul-disc">
1202
- <li><code>[php]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/php]</code></li>
1203
- <li><code>[css autolinks=&quot;false&quot; classname=&quot;myclass&quot; collapse=&quot;false&quot; firstline=&quot;1&quot; gutter=&quot;true&quot; highlight=&quot;1-3,6,9&quot; htmlscript=&quot;false&quot; light=&quot;false&quot; padlinenumbers=&quot;false&quot; smarttabs=&quot;true&quot; tabsize=&quot;4&quot; toolbar=&quot;true&quot; title=&quot;<?php _e( 'example-filename.php', 'syntaxhighlighter' ); ?>&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/css]</code></li>
1204
- <li><code>[code lang=&quot;js&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/code]</code></li>
1205
- <li><code>[sourcecode language=&quot;plain&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/sourcecode]</code></li>
1206
- </ul>
1207
-
1208
- <?php $this->maybe_output_scripts(); ?>
1209
-
1210
- </div>
1211
-
1212
- <?php
1213
- }
1214
-
1215
-
1216
- // Validate the settings sent from the settings page
1217
- function validate_settings( $settings ) {
1218
- if ( !empty($_POST['syntaxhighlighter-defaults']) ) {
1219
- $settings = $this->defaultsettings;
1220
- $_REQUEST['_wp_http_referer'] = add_query_arg( 'defaults', 'true', $_REQUEST['_wp_http_referer'] );
1221
- } else {
1222
- $settings['shversion'] = ( ! empty($settings['shversion']) && 2 == $settings['shversion'] ) ? 2 : 3;
1223
-
1224
- $settings['theme'] = ( ! empty($settings['theme']) && isset($this->themes[$settings['theme']]) ) ? strtolower($settings['theme']) : $this->defaultsettings['theme'];
1225
-
1226
- $settings['loadallbrushes'] = ( ! empty($settings['loadallbrushes']) ) ? 1 : 0;
1227
- $settings['autolinks'] = ( ! empty($settings['autolinks']) ) ? 1 : 0;
1228
- $settings['collapse'] = ( ! empty($settings['collapse']) ) ? 1 : 0;
1229
- $settings['gutter'] = ( ! empty($settings['gutter']) ) ? 1 : 0;
1230
- $settings['light'] = ( ! empty($settings['light']) ) ? 1 : 0;
1231
- $settings['smarttabs'] = ( ! empty($settings['smarttabs']) ) ? 1 : 0;
1232
- $settings['toolbar'] = ( ! empty($settings['toolbar']) ) ? 1 : 0; // May be overridden below
1233
- $settings['wraplines'] = ( ! empty($settings['wraplines']) ) ? 1 : 0; // 2.x only for now
1234
-
1235
- // If the version changed, then force change the toolbar version setting
1236
- if ( $settings['shversion'] != $this->settings['shversion'] ) {
1237
- $settings['toolbar'] = ( 2 == $settings['shversion'] ) ? 1 : 0;
1238
- }
1239
-
1240
- if ( 'true' != $settings['padlinenumbers'] && 'false' != $settings['padlinenumbers'] )
1241
- $settings['padlinenumbers'] = (int) $settings['padlinenumbers'];
1242
-
1243
- $settings['classname'] = ( !empty($settings['classname']) ) ? preg_replace( '/[^ A-Za-z0-9_-]*/', '', $settings['classname'] ) : '';
1244
- $settings['firstline'] = (int) ( ( !empty($settings['firstline']) ) ? $settings['firstline'] : $this->defaultsettings['firstline'] );
1245
- $settings['tabsize'] = (int) ( ( !empty($settings['tabsize']) ) ? $settings['tabsize'] : $this->defaultsettings['tabsize'] );
1246
- }
1247
-
1248
- return $settings;
1249
- }
1250
-
1251
-
1252
- // PHP4 compatibility
1253
- function SyntaxHighlighter() {
1254
- $this->__construct();
1255
- }
1256
- }
1257
-
1258
-
1259
- // Start this plugin once all other plugins are fully loaded
1260
- add_action( 'init', 'SyntaxHighlighter', 5 );
1261
- function SyntaxHighlighter() {
1262
- global $SyntaxHighlighter;
1263
- $SyntaxHighlighter = new SyntaxHighlighter();
1264
- }
1265
-
1266
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /*
2
+
3
+ **************************************************************************
4
+
5
+ Plugin Name: SyntaxHighlighter Evolved
6
+ Plugin URI: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/
7
+ Version: 3.2.0
8
+ Description: Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a>. <strong>TIP:</strong> Don't use the Visual editor if you don't want your code mangled. TinyMCE will "clean up" your HTML.
9
+ Author: Alex Mills (Viper007Bond)
10
+ Author URI: http://www.viper007bond.com/
11
+
12
+ **************************************************************************
13
+
14
+ Thanks to:
15
+
16
+ * Alex Gorbatchev for writing the Javascript-powered syntax highlighter script
17
+
18
+ * Andrew Ozz for writing the TinyMCE plugin
19
+
20
+ **************************************************************************/
21
+
22
+ class SyntaxHighlighter {
23
+ // All of these variables are private. Filters are provided for things that can be modified.
24
+ var $pluginver = '3.2.0'; // Plugin version
25
+ var $agshver = false; // Alex Gorbatchev's SyntaxHighlighter version (dynamically set below due to v2 vs v3)
26
+ var $shfolder = false; // Controls what subfolder to load SyntaxHighlighter from (v2 or v3)
27
+ var $settings = array(); // Contains the user's settings
28
+ var $defaultsettings = array(); // Contains the default settings
29
+ var $brushes = array(); // Array of aliases => brushes
30
+ var $shortcodes = array(); // Array of shortcodes to use
31
+ var $themes = array(); // Array of themes
32
+ var $usedbrushes = array(); // Stores used brushes so we know what to output
33
+ var $encoded = false; // Used to mark that a character encode took place
34
+ var $codeformat = false; // If set, SyntaxHighlighter::get_code_format() will return this value
35
+ var $content_save_pre_ran = false; // It's possible for the "content_save_pre" filter to run multiple times, so keep track
36
+
37
+ // Initalize the plugin by registering the hooks
38
+ function __construct() {
39
+ if ( ! function_exists( 'do_shortcodes_in_html_tags' ) )
40
+ return;
41
+
42
+ // Load localization domain
43
+ load_plugin_textdomain( 'syntaxhighlighter', false, '/syntaxhighlighter/localization' );
44
+
45
+ // Display hooks
46
+ add_filter( 'the_content', array( $this, 'parse_shortcodes' ), 7 ); // Posts
47
+ add_filter( 'comment_text', array( $this, 'parse_shortcodes_comment' ), 7 ); // Comments
48
+ add_filter( 'bp_get_the_topic_post_content', array( $this, 'parse_shortcodes' ), 7 ); // BuddyPress
49
+
50
+ // Into the database
51
+ add_filter( 'content_save_pre', array( $this, 'encode_shortcode_contents_slashed_noquickedit' ), 1 ); // Posts
52
+ add_filter( 'pre_comment_content', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // Comments
53
+ add_filter( 'group_forum_post_text_before_save', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress
54
+ add_filter( 'group_forum_topic_text_before_save', array( $this, 'encode_shortcode_contents_slashed' ), 1 ); // BuddyPress
55
+
56
+ // Out of the database for editing
57
+ add_filter( 'the_editor_content', array( $this, 'the_editor_content' ), 1 ); // Posts
58
+ add_filter( 'comment_edit_pre', array( $this, 'decode_shortcode_contents' ), 1 ); // Comments
59
+ add_filter( 'bp_get_the_topic_text', array( $this, 'decode_shortcode_contents' ), 1 ); // BuddyPress
60
+ add_filter( 'bp_get_the_topic_post_edit_text', array( $this, 'decode_shortcode_contents' ), 1 ); // BuddyPress
61
+
62
+ // Outputting SyntaxHighlighter's JS and CSS
63
+ add_action( 'wp_head', array( $this, 'output_header_placeholder' ), 15 );
64
+ add_action( 'admin_head', array( $this, 'output_header_placeholder' ), 15 ); // For comments
65
+ add_action( 'wp_footer', array( $this, 'maybe_output_scripts' ), 15 );
66
+ add_action( 'admin_footer', array( $this, 'maybe_output_scripts' ), 15 ); // For comments
67
+
68
+ // Admin hooks
69
+ add_action( 'admin_init', array( $this, 'register_setting' ) );
70
+ add_action( 'admin_menu', array( $this, 'register_settings_page' ) );
71
+ add_filter( 'mce_external_plugins', array( $this, 'add_tinymce_plugin' ) );
72
+ add_filter( 'save_post', array( $this, 'mark_as_encoded' ), 10, 2 );
73
+ add_filter( 'plugin_action_links', array( $this, 'settings_link' ), 10, 2 );
74
+
75
+ // Register widget hooks
76
+ add_filter( 'widget_text', array( $this, 'widget_text_output' ), 7, 2 );
77
+ add_filter( 'widget_update_callback', array( $this, 'widget_text_save' ), 1, 4 );
78
+ add_filter( 'widget_form_callback', array( $this, 'widget_text_form' ), 1, 2 );
79
+
80
+
81
+ // Create array of default settings (you can use the filter to modify these)
82
+ $this->defaultsettings = (array) apply_filters( 'syntaxhighlighter_defaultsettings', array(
83
+ 'theme' => 'default',
84
+ 'loadallbrushes' => 0,
85
+ 'shversion' => 3,
86
+ 'title' => '',
87
+ 'autolinks' => 1,
88
+ 'classname' => '',
89
+ 'collapse' => 0,
90
+ 'firstline' => 1,
91
+ 'gutter' => 1,
92
+ 'htmlscript' => 0,
93
+ 'light' => 0,
94
+ 'padlinenumbers' => 'false',
95
+ 'smarttabs' => 1,
96
+ 'tabsize' => 4,
97
+ 'toolbar' => 0,
98
+ 'wraplines' => 1, // 2.x only
99
+ ) );
100
+
101
+ // Create the settings array by merging the user's settings and the defaults
102
+ $usersettings = (array) get_option('syntaxhighlighter_settings');
103
+ $this->settings = wp_parse_args( $usersettings, $this->defaultsettings );
104
+
105
+ // Dynamically set folder and version names for SynaxHighlighter
106
+ if ( 2 == $this->settings['shversion'] ) {
107
+ $this->shfolder = 'syntaxhighlighter2';
108
+ $this->agshver = '2.1.364';
109
+ } else {
110
+ $this->shfolder = 'syntaxhighlighter3';
111
+ $this->agshver = '3.0.9b';
112
+ }
113
+
114
+ // Register brush scripts
115
+ wp_register_script( 'syntaxhighlighter-core', plugins_url( $this->shfolder . '/scripts/shCore.js', __FILE__ ), array(), $this->agshver );
116
+ wp_register_script( 'syntaxhighlighter-brush-as3', plugins_url( $this->shfolder . '/scripts/shBrushAS3.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
117
+ wp_register_script( 'syntaxhighlighter-brush-bash', plugins_url( $this->shfolder . '/scripts/shBrushBash.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
118
+ wp_register_script( 'syntaxhighlighter-brush-coldfusion', plugins_url( $this->shfolder . '/scripts/shBrushColdFusion.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
119
+ wp_register_script( 'syntaxhighlighter-brush-cpp', plugins_url( $this->shfolder . '/scripts/shBrushCpp.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
120
+ wp_register_script( 'syntaxhighlighter-brush-csharp', plugins_url( $this->shfolder . '/scripts/shBrushCSharp.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
121
+ wp_register_script( 'syntaxhighlighter-brush-css', plugins_url( $this->shfolder . '/scripts/shBrushCss.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
122
+ wp_register_script( 'syntaxhighlighter-brush-delphi', plugins_url( $this->shfolder . '/scripts/shBrushDelphi.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
123
+ wp_register_script( 'syntaxhighlighter-brush-diff', plugins_url( $this->shfolder . '/scripts/shBrushDiff.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
124
+ wp_register_script( 'syntaxhighlighter-brush-erlang', plugins_url( $this->shfolder . '/scripts/shBrushErlang.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
125
+ wp_register_script( 'syntaxhighlighter-brush-groovy', plugins_url( $this->shfolder . '/scripts/shBrushGroovy.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
126
+ wp_register_script( 'syntaxhighlighter-brush-java', plugins_url( $this->shfolder . '/scripts/shBrushJava.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
127
+ wp_register_script( 'syntaxhighlighter-brush-javafx', plugins_url( $this->shfolder . '/scripts/shBrushJavaFX.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
128
+ wp_register_script( 'syntaxhighlighter-brush-jscript', plugins_url( $this->shfolder . '/scripts/shBrushJScript.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
129
+ wp_register_script( 'syntaxhighlighter-brush-perl', plugins_url( $this->shfolder . '/scripts/shBrushPerl.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
130
+ wp_register_script( 'syntaxhighlighter-brush-php', plugins_url( $this->shfolder . '/scripts/shBrushPhp.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
131
+ wp_register_script( 'syntaxhighlighter-brush-plain', plugins_url( $this->shfolder . '/scripts/shBrushPlain.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
132
+ wp_register_script( 'syntaxhighlighter-brush-powershell', plugins_url( $this->shfolder . '/scripts/shBrushPowerShell.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
133
+ wp_register_script( 'syntaxhighlighter-brush-python', plugins_url( $this->shfolder . '/scripts/shBrushPython.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
134
+ wp_register_script( 'syntaxhighlighter-brush-ruby', plugins_url( $this->shfolder . '/scripts/shBrushRuby.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
135
+ wp_register_script( 'syntaxhighlighter-brush-scala', plugins_url( $this->shfolder . '/scripts/shBrushScala.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
136
+ wp_register_script( 'syntaxhighlighter-brush-sql', plugins_url( $this->shfolder . '/scripts/shBrushSql.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
137
+ wp_register_script( 'syntaxhighlighter-brush-vb', plugins_url( $this->shfolder . '/scripts/shBrushVb.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
138
+ wp_register_script( 'syntaxhighlighter-brush-xml', plugins_url( $this->shfolder . '/scripts/shBrushXml.js', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
139
+
140
+ // Register some popular third-party brushes
141
+ wp_register_script( 'syntaxhighlighter-brush-clojure', plugins_url( 'third-party-brushes/shBrushClojure.js', __FILE__ ), array('syntaxhighlighter-core'), '20090602' );
142
+ wp_register_script( 'syntaxhighlighter-brush-fsharp', plugins_url( 'third-party-brushes/shBrushFSharp.js', __FILE__ ), array('syntaxhighlighter-core'), '20091003' );
143
+ wp_register_script( 'syntaxhighlighter-brush-latex', plugins_url( 'third-party-brushes/shBrushLatex.js', __FILE__ ), array('syntaxhighlighter-core'), '20090613' );
144
+ wp_register_script( 'syntaxhighlighter-brush-matlabkey', plugins_url( 'third-party-brushes/shBrushMatlabKey.js', __FILE__ ), array('syntaxhighlighter-core'), '20091209' );
145
+ wp_register_script( 'syntaxhighlighter-brush-objc', plugins_url( 'third-party-brushes/shBrushObjC.js', __FILE__ ), array('syntaxhighlighter-core'), '20091207' );
146
+ wp_register_script( 'syntaxhighlighter-brush-r', plugins_url( 'third-party-brushes/shBrushR.js', __FILE__ ), array('syntaxhighlighter-core'), '20100919' );
147
+
148
+ // Register theme stylesheets
149
+ wp_register_style( 'syntaxhighlighter-core', plugins_url( $this->shfolder . '/styles/shCore.css', __FILE__ ), array(), $this->agshver );
150
+ wp_register_style( 'syntaxhighlighter-theme-default', plugins_url( $this->shfolder . '/styles/shThemeDefault.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
151
+ wp_register_style( 'syntaxhighlighter-theme-django', plugins_url( $this->shfolder . '/styles/shThemeDjango.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
152
+ wp_register_style( 'syntaxhighlighter-theme-eclipse', plugins_url( $this->shfolder . '/styles/shThemeEclipse.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
153
+ wp_register_style( 'syntaxhighlighter-theme-emacs', plugins_url( $this->shfolder . '/styles/shThemeEmacs.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
154
+ wp_register_style( 'syntaxhighlighter-theme-fadetogrey', plugins_url( $this->shfolder . '/styles/shThemeFadeToGrey.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
155
+ wp_register_style( 'syntaxhighlighter-theme-midnight', plugins_url( $this->shfolder . '/styles/shThemeMidnight.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
156
+ wp_register_style( 'syntaxhighlighter-theme-rdark', plugins_url( $this->shfolder . '/styles/shThemeRDark.css', __FILE__ ), array('syntaxhighlighter-core'), $this->agshver );
157
+
158
+
159
+ // Create list of brush aliases and map them to their real brushes
160
+ // The key is the language alias
161
+ // The value is the script handle suffix: syntaxhighlighter-brush-ThisBitHere (your plugin needs to register the script itself)
162
+ $this->brushes = (array) apply_filters( 'syntaxhighlighter_brushes', array(
163
+ 'as3' => 'as3',
164
+ 'actionscript3' => 'as3',
165
+ 'bash' => 'bash',
166
+ 'shell' => 'bash',
167
+ 'coldfusion' => 'coldfusion',
168
+ 'cf' => 'coldfusion',
169
+ 'clojure' => 'clojure',
170
+ 'clj' => 'clojure',
171
+ 'cpp' => 'cpp',
172
+ 'c' => 'cpp',
173
+ 'c-sharp' => 'csharp',
174
+ 'csharp' => 'csharp',
175
+ 'css' => 'css',
176
+ 'delphi' => 'delphi',
177
+ 'pas' => 'delphi',
178
+ 'pascal' => 'delphi',
179
+ 'diff' => 'diff',
180
+ 'patch' => 'diff',
181
+ 'erl' => 'erlang',
182
+ 'erlang' => 'erlang',
183
+ 'fsharp' => 'fsharp',
184
+ 'groovy' => 'groovy',
185
+ 'java' => 'java',
186
+ 'jfx' => 'javafx',
187
+ 'javafx' => 'javafx',
188
+ 'js' => 'jscript',
189
+ 'jscript' => 'jscript',
190
+ 'javascript' => 'jscript',
191
+ 'latex' => 'latex', // Not used as a shortcode
192
+ 'tex' => 'latex',
193
+ 'matlab' => 'matlabkey',
194
+ 'objc' => 'objc',
195
+ 'obj-c' => 'objc',
196
+ 'perl' => 'perl',
197
+ 'pl' => 'perl',
198
+ 'php' => 'php',
199
+ 'plain' => 'plain',
200
+ 'text' => 'plain',
201
+ 'ps' => 'powershell',
202
+ 'powershell' => 'powershell',
203
+ 'py' => 'python',
204
+ 'python' => 'python',
205
+ 'r' => 'r', // Not used as a shortcode
206
+ 'splus' => 'r',
207
+ 'rails' => 'ruby',
208
+ 'rb' => 'ruby',
209
+ 'ror' => 'ruby',
210
+ 'ruby' => 'ruby',
211
+ 'scala' => 'scala',
212
+ 'sql' => 'sql',
213
+ 'vb' => 'vb',
214
+ 'vbnet' => 'vb',
215
+ 'xml' => 'xml',
216
+ 'xhtml' => 'xml',
217
+ 'xslt' => 'xml',
218
+ 'html' => 'xml',
219
+ ) );
220
+
221
+
222
+ // Create a list of shortcodes to use. You can use the filter to add/remove ones.
223
+ // If the language/lang parameter is left out, it's assumed the shortcode name is the language.
224
+ // If that's invalid, then "plain" is used.
225
+ $this->shortcodes = array( 'sourcecode', 'source', 'code' );
226
+ $this->shortcodes = array_merge( $this->shortcodes, array_keys( $this->brushes ) );
227
+
228
+ // Remove some shortcodes we don't want while still supporting them as language values
229
+ unset( $this->shortcodes[array_search( 'latex', $this->shortcodes )] ); // Remove "latex" shortcode (it'll collide)
230
+ unset( $this->shortcodes[array_search( 'r', $this->shortcodes )] ); // Remove "r" shortcode (too short)
231
+
232
+ $this->shortcodes = (array) apply_filters( 'syntaxhighlighter_shortcodes', $this->shortcodes );
233
+
234
+
235
+ // Register each shortcode with a placeholder callback so that strip_shortcodes() will work
236
+ // The proper callback and such is done in SyntaxHighlighter::shortcode_hack()
237
+ foreach ( $this->shortcodes as $shortcode )
238
+ add_shortcode( $shortcode, '__return_empty_string' );
239
+
240
+
241
+ // Create list of themes and their human readable names
242
+ // Plugins can add to this list: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/adding-a-new-theme/
243
+ $this->themes = (array) apply_filters( 'syntaxhighlighter_themes', array(
244
+ 'default' => __( 'Default', 'syntaxhighlighter' ),
245
+ 'django' => __( 'Django', 'syntaxhighlighter' ),
246
+ 'eclipse' => __( 'Eclipse', 'syntaxhighlighter' ),
247
+ 'emacs' => __( 'Emacs', 'syntaxhighlighter' ),
248
+ 'fadetogrey' => __( 'Fade to Grey', 'syntaxhighlighter' ),
249
+ 'midnight' => __( 'Midnight', 'syntaxhighlighter' ),
250
+ 'rdark' => __( 'RDark', 'syntaxhighlighter' ),
251
+ 'none' => __( '[None]', 'syntaxhighlighter' ),
252
+ ) );
253
+
254
+ // Other special characters that need to be encoded before going into the database (namely to work around kses)
255
+ $this->specialchars = (array) apply_filters( 'syntaxhighlighter_specialchars', array(
256
+ '\0' => '&#92;&#48;',
257
+ ) );
258
+ }
259
+
260
+
261
+ // Register the settings page
262
+ function register_settings_page() {
263
+ add_options_page( __( 'SyntaxHighlighter Settings', 'syntaxhighlighter' ), __( 'SyntaxHighlighter', 'syntaxhighlighter' ), 'manage_options', 'syntaxhighlighter', array( $this, 'settings_page' ) );
264
+ }
265
+
266
+
267
+ // Register the plugin's setting
268
+ function register_setting() {
269
+ register_setting( 'syntaxhighlighter_settings', 'syntaxhighlighter_settings', array( $this, 'validate_settings' ) );
270
+ }
271
+
272
+
273
+ // Add the custom TinyMCE plugin which wraps plugin shortcodes in <pre> in TinyMCE
274
+ function add_tinymce_plugin( $plugins ) {
275
+ global $tinymce_version;
276
+
277
+ add_action( 'admin_print_footer_scripts', array( $this, 'output_shortcodes_for_tinymce' ), 9 );
278
+
279
+ if ( substr( $tinymce_version, 0, 1 ) < 4 ) {
280
+ $plugins['syntaxhighlighter'] = plugins_url( 'syntaxhighlighter_mce.js', __FILE__ );
281
+ } else {
282
+ $plugins['syntaxhighlighter'] = add_query_arg( 'ver', $this->pluginver, plugins_url( 'syntaxhighlighter_mce-4.js', __FILE__ ) );
283
+ wp_enqueue_script( 'syntaxhighlighter', plugins_url( 'syntaxhighlighter.js', __FILE__ ), array(), false, true );
284
+ }
285
+
286
+ return $plugins;
287
+ }
288
+
289
+
290
+ // Break the TinyMCE cache
291
+ function break_tinymce_cache( $version ) {
292
+ return $version . '-sh' . $this->pluginver;
293
+ }
294
+
295
+
296
+ // Add a "Settings" link to the plugins page
297
+ function settings_link( $links, $file ) {
298
+ static $this_plugin;
299
+
300
+ if( empty($this_plugin) )
301
+ $this_plugin = plugin_basename(__FILE__);
302
+
303
+ if ( $file == $this_plugin )
304
+ $links[] = '<a href="' . admin_url( 'options-general.php?page=syntaxhighlighter' ) . '">' . __( 'Settings', 'syntaxhighlighter' ) . '</a>';
305
+
306
+ return $links;
307
+ }
308
+
309
+
310
+ // Output list of shortcode tags for the TinyMCE plugin
311
+ function output_shortcodes_for_tinymce() {
312
+ $shortcodes = array();
313
+
314
+ foreach ( $this->shortcodes as $shortcode )
315
+ $shortcodes[] = preg_quote( $shortcode );
316
+
317
+ echo "<script type='text/javascript'>\n";
318
+ echo " var syntaxHLcodes = '" . implode( '|', $shortcodes ) . "';\n";
319
+ echo "</script>\n";
320
+ }
321
+
322
+
323
+ /**
324
+ * Process only this plugin's shortcodes.
325
+ *
326
+ * If we waited for the normal do_shortcode() call at priority 11,
327
+ * then wpautop() and maybe others would mangle all of the code.
328
+ *
329
+ * So instead we hook in earlier with this function and process
330
+ * just this plugins's shortcodes. To do this requires some trickery.
331
+ *
332
+ * First we need to clear out all existing shortcodes, then register
333
+ * just this plugin's ones, process them, and then restore the original
334
+ * list of shortcodes.
335
+ *
336
+ * To make matters more complicated, if someone has done [[code]foo[/code]]
337
+ * in order to display the shortcode (not render it), then do_shortcode()
338
+ * will strip the outside brackets and when do_shortcode() runs a second
339
+ * time later on, it will render it.
340
+ *
341
+ * So instead before do_shortcode() runs for the first time, we add
342
+ * even more brackets escaped shortcodes in order to result in
343
+ * the shortcodes actually being displayed instead rendered.
344
+ *
345
+ * We only need to do this for this plugin's shortcodes however
346
+ * as all other shortcodes such as [[gallery]] will be untouched
347
+ * by this pass of do_shortcode.
348
+ *
349
+ * Phew!
350
+ *
351
+ * @param string $content The post content.
352
+ * @param string $callback The callback function that should be used for add_shortcode()
353
+ *
354
+ * @return string The filtered content, with this plugin's shortcodes parsed.
355
+ */
356
+ function shortcode_hack( $content, $callback ) {
357
+ global $shortcode_tags;
358
+
359
+ // Regex is slow. Let's do some strpos() checks first.
360
+ if ( ! $this->string_has_shortcodes( $content, $this->shortcodes ) ) {
361
+ return $content;
362
+ }
363
+
364
+ // Backup current registered shortcodes and clear them all out
365
+ $orig_shortcode_tags = $shortcode_tags;
366
+ remove_all_shortcodes();
367
+
368
+ // Register all of this plugin's shortcodes
369
+ foreach ( $this->shortcodes as $shortcode ) {
370
+ add_shortcode( $shortcode, $callback );
371
+ }
372
+
373
+ // Extra escape escaped shortcodes because do_shortcode() is going to strip a pair of square brackets when it runs
374
+ $content = preg_replace_callback(
375
+ '/' . get_shortcode_regex( $this->shortcodes ) . '/',
376
+ array( $this, 'shortcode_hack_extra_escape_escaped_shortcodes' ),
377
+ $content
378
+ );
379
+
380
+ // Do the shortcodes (only this plugins's are registered)
381
+ $content = do_shortcode( $content, true );
382
+
383
+ // Put the original shortcodes back
384
+ $shortcode_tags = $orig_shortcode_tags;
385
+
386
+ return $content;
387
+ }
388
+
389
+
390
+ /**
391
+ * A quick checker to see if any of this plugin's shortcodes are in use in a string.
392
+ * Since all of the tags can't be self-closing, we look for the closing tag.
393
+ *
394
+ * @param string $string The string to look through. This is a post's contents usually.
395
+ * @param array $shortcodes The array of shortcodes to look for.
396
+ *
397
+ * @return bool Whether any shortcode usage was found.
398
+ */
399
+ function string_has_shortcodes( $string, $shortcodes ) {
400
+ foreach ( $shortcodes as $shortcode ) {
401
+ if ( false !== strpos( $string, "[/{$shortcode}]" ) ) {
402
+ return true;
403
+ }
404
+ }
405
+
406
+ return false;
407
+ }
408
+
409
+
410
+ /**
411
+ * Add extra square brackets around escaped shortcodes.
412
+ * This is to counteract the beginning of the do_shortcode_tag() function.
413
+ *
414
+ * @param array $match The array of matches generated by get_shortcode_regex()
415
+ *
416
+ * @return string What should be placed into the post content. In this case it's the raw match, or an extra-wrapped raw match.
417
+ */
418
+ function shortcode_hack_extra_escape_escaped_shortcodes( $match ) {
419
+ if ( $match[1] == '[' && $match[6] == ']' ) {
420
+ return '[' . $match[0] . ']';
421
+ }
422
+
423
+ return $match[0];
424
+ }
425
+
426
+
427
+ // The main filter for the post contents. The regular shortcode filter can't be used as it's post-wpautop().
428
+ function parse_shortcodes( $content ) {
429
+ return $this->shortcode_hack( $content, array( $this, 'shortcode_callback' ) );
430
+ }
431
+
432
+
433
+ // HTML entity encode the contents of shortcodes
434
+ function encode_shortcode_contents( $content ) {
435
+ return $this->shortcode_hack( $content, array( $this, 'encode_shortcode_contents_callback' ) );
436
+ }
437
+
438
+
439
+ // HTML entity encode the contents of shortcodes. Expects slashed content.
440
+ function encode_shortcode_contents_slashed( $content ) {
441
+ return addslashes( $this->encode_shortcode_contents( stripslashes( $content ) ) );
442
+ }
443
+
444
+
445
+ // HTML entity encode the contents of shortcodes. Expects slashed content. Aborts if AJAX.
446
+ function encode_shortcode_contents_slashed_noquickedit( $content ) {
447
+
448
+ // In certain weird circumstances, the content gets run through "content_save_pre" twice
449
+ // Keep track and don't allow this filter to be run twice
450
+ // I couldn't easily figure out why this happens and didn't bother looking into it further as this works fine
451
+ if ( true == $this->content_save_pre_ran ) {
452
+ return $content;
453
+ }
454
+ $this->content_save_pre_ran = true;
455
+
456
+ // Post quick edits aren't decoded for display, so we don't need to encode them (again)
457
+ // This also aborts for (un)trashing to avoid extra encoding.
458
+ if ( empty( $_POST ) || ( ! empty( $_POST['action'] ) && 'inline-save' == $_POST['action'] ) ) {
459
+ return $content;
460
+ }
461
+
462
+ return $this->encode_shortcode_contents_slashed( $content );
463
+ }
464
+
465
+
466
+ // HTML entity decode the contents of shortcodes
467
+ function decode_shortcode_contents( $content ) {
468
+ return $this->shortcode_hack( $content, array( $this, 'decode_shortcode_contents_callback' ) );
469
+ }
470
+
471
+
472
+ // The callback function for SyntaxHighlighter::encode_shortcode_contents()
473
+ function encode_shortcode_contents_callback( $atts, $code = '', $tag = false ) {
474
+ $this->encoded = true;
475
+ $code = str_replace( array_keys($this->specialchars), array_values($this->specialchars), htmlspecialchars( $code ) );
476
+ return '[' . $tag . $this->atts2string( $atts ) . "]{$code}[/$tag]";
477
+ }
478
+
479
+
480
+ // The callback function for SyntaxHighlighter::decode_shortcode_contents()
481
+ // Shortcode attribute values need to not be quoted with TinyMCE disabled for some reason (weird bug)
482
+ function decode_shortcode_contents_callback( $atts, $code = '', $tag = false ) {
483
+ $quotes = ( user_can_richedit() ) ? true : false;
484
+ $code = str_replace( array_values($this->specialchars), array_keys($this->specialchars), htmlspecialchars_decode( $code ) );
485
+ return '[' . $tag . $this->atts2string( $atts, $quotes ) . "]{$code}[/$tag]";
486
+ }
487
+
488
+
489
+ // Dynamically format the post content for the edit form
490
+ function the_editor_content( $content ) {
491
+ global $post;
492
+
493
+ // New code format (stored encoded in database)
494
+ if ( 2 == $this->get_code_format( $post ) ) {
495
+ // If TinyMCE is disabled or the HTML tab is set to be displayed first, we need to decode the HTML
496
+ if ( !user_can_richedit() || 'html' == wp_default_editor() )
497
+ $content = $this->decode_shortcode_contents( $content );
498
+ }
499
+
500
+ // Old code format (stored raw in database)
501
+ else {
502
+ // If TinyMCE is enabled and is set to be displayed first, we need to encode the HTML
503
+ if ( user_can_richedit() && 'html' != wp_default_editor() )
504
+ $content = $this->encode_shortcode_contents( $content );
505
+ }
506
+
507
+ return $content;
508
+ }
509
+
510
+
511
+ // Run SyntaxHighlighter::encode_shortcode_contents() on the contents of the text widget
512
+ function widget_text_save( $instance, $new_instance, $old_instance, $widgetclass ) {
513
+ if ( 'text' == $widgetclass->id_base ) {
514
+ // Re-save the widget settings but this time with the shortcode contents encoded
515
+ $new_instance['text'] = $this->encode_shortcode_contents( $new_instance['text'] );
516
+ $instance = $widgetclass->update( $new_instance, $old_instance );
517
+
518
+ // And flag it as encoded
519
+ $instance['syntaxhighlighter_encoded'] = true;
520
+ }
521
+
522
+ return $instance;
523
+ }
524
+
525
+
526
+ // Run SyntaxHighlighter::decode_shortcode_contents_callback() on the contents of the text widget form
527
+ function widget_text_form( $instance, $widgetclass ) {
528
+ if ( 'text' == $widgetclass->id_base && !empty($instance['syntaxhighlighter_encoded']) ) {
529
+ $instance['text'] = $this->shortcode_hack( $instance['text'], array( $this, 'decode_shortcode_contents_callback' ) );
530
+ }
531
+
532
+ return $instance;
533
+ }
534
+
535
+
536
+ // Run SyntaxHighlighter::parse_shortcodes() on the contents of a text widget
537
+ function widget_text_output( $content, $instance = false ) {
538
+ $this->codeformat = ( false === $instance || empty($instance['syntaxhighlighter_encoded']) ) ? 1 : 2;
539
+ $content = $this->parse_shortcodes( $content );
540
+ $this->codeformat = false;
541
+
542
+ return $content;
543
+ }
544
+
545
+
546
+ // Run SyntaxHighlighter::parse_shortcodes() on the contents of a comment
547
+ function parse_shortcodes_comment( $content ) {
548
+ $this->codeformat = 2;
549
+ $content = $this->parse_shortcodes( $content );
550
+ $this->codeformat = false;
551
+
552
+ return $content;
553
+ }
554
+
555
+
556
+ // This function determines what version of SyntaxHighlighter was used when the post was written
557
+ // This is because the code was stored differently for different versions of SyntaxHighlighter
558
+ function get_code_format( $post ) {
559
+ if ( false !== $this->codeformat )
560
+ return $this->codeformat;
561
+
562
+ if ( empty($post) )
563
+ $post = new stdClass();
564
+
565
+ if ( null !== $version = apply_filters( 'syntaxhighlighter_pre_getcodeformat', null, $post ) )
566
+ return $version;
567
+
568
+ $version = ( empty($post->ID) || get_post_meta( $post->ID, '_syntaxhighlighter_encoded', true ) || get_post_meta( $post->ID, 'syntaxhighlighter_encoded', true ) ) ? 2 : 1;
569
+
570
+ return apply_filters( 'syntaxhighlighter_getcodeformat', $version, $post );
571
+ }
572
+
573
+
574
+ // Adds a post meta saying that HTML entities are encoded (for backwards compatibility)
575
+ function mark_as_encoded( $post_ID, $post ) {
576
+ if ( false == $this->encoded || 'revision' == $post->post_type )
577
+ return;
578
+
579
+ delete_post_meta( $post_ID, 'syntaxhighlighter_encoded' ); // Previously used
580
+ add_post_meta( $post_ID, '_syntaxhighlighter_encoded', true, true );
581
+ }
582
+
583
+
584
+ // Transforms an attributes array into a 'key="value"' format (i.e. reverses the process)
585
+ function atts2string( $atts, $quotes = true ) {
586
+ if ( empty($atts) )
587
+ return '';
588
+
589
+ $atts = $this->attributefix( $atts );
590
+
591
+ // Re-map [code="php"] style tags
592
+ if ( isset($atts[0]) ) {
593
+ if ( empty($atts['language']) )
594
+ $atts['language'] = $atts[0];
595
+
596
+ unset($atts[0]);
597
+ }
598
+
599
+ $strings = array();
600
+ foreach ( $atts as $key => $value )
601
+ $strings[] = ( $quotes ) ? $key . '="' . esc_attr( $value ) . '"' : $key . '=' . esc_attr( $value );
602
+
603
+ return ' ' . implode( ' ', $strings );
604
+ }
605
+
606
+
607
+ // Simple function for escaping just single quotes (the original js_escape() escapes more than we need)
608
+ function js_escape_singlequotes( $string ) {
609
+ return str_replace( "'", "\'", $string );
610
+ }
611
+
612
+
613
+ // Output an anchor in the header for the Javascript to use.
614
+ // In the <head>, we don't know if we'll need this plugin's CSS and JavaScript yet but we will in the footer.
615
+ function output_header_placeholder() {
616
+ echo '<style type="text/css" id="syntaxhighlighteranchor"></style>' . "\n";
617
+ }
618
+
619
+
620
+ // Output any needed scripts. This is meant for the footer.
621
+ function maybe_output_scripts() {
622
+ global $wp_styles;
623
+
624
+ if ( 1 == $this->settings['loadallbrushes'] )
625
+ $this->usedbrushes = array_flip( array_values( $this->brushes ) );
626
+
627
+ if ( empty($this->usedbrushes) )
628
+ return;
629
+
630
+ $scripts = array();
631
+ foreach ( $this->usedbrushes as $brush => $unused )
632
+ $scripts[] = 'syntaxhighlighter-brush-' . strtolower( $brush );
633
+
634
+ wp_print_scripts( $scripts );
635
+
636
+ // Stylesheets can't be in the footer, so inject them via Javascript
637
+ echo "<script type='text/javascript'>\n";
638
+ echo " (function(){\n";
639
+ echo " var corecss = document.createElement('link');\n";
640
+ echo " var themecss = document.createElement('link');\n";
641
+
642
+ if ( !is_a($wp_styles, 'WP_Styles') )
643
+ $wp_styles = new WP_Styles();
644
+
645
+ $needcore = false;
646
+ if ( 'none' == $this->settings['theme'] ) {
647
+ $needcore = true;
648
+ } else {
649
+ $theme = ( !empty($this->themes[$this->settings['theme']]) ) ? strtolower($this->settings['theme']) : $this->defaultsettings['theme'];
650
+ $theme = 'syntaxhighlighter-theme-' . $theme;
651
+
652
+ // See if the requested theme has been registered
653
+ if ( !empty($wp_styles) && !empty($wp_styles->registered) && !empty($wp_styles->registered[$theme]) && !empty($wp_styles->registered[$theme]->src) ) {
654
+
655
+ // Users can register their own stylesheet and may opt to not load the core stylesheet if they wish for some reason
656
+ if ( is_array($wp_styles->registered[$theme]->deps) && in_array( 'syntaxhighlighter-core', $wp_styles->registered[$theme]->deps ) )
657
+ $needcore = true;
658
+ }
659
+
660
+ // Otherwise use the default theme
661
+ else {
662
+ $theme = 'syntaxhighlighter-theme-' . $this->defaultsettings['theme'];
663
+ $needcore = true;
664
+ }
665
+ }
666
+
667
+ if ( $needcore && !empty($wp_styles) && !empty($wp_styles->registered) && !empty($wp_styles->registered['syntaxhighlighter-core']) && !empty($wp_styles->registered['syntaxhighlighter-core']->src) ) :
668
+ $corecssurl = add_query_arg( 'ver', $this->agshver, $wp_styles->registered['syntaxhighlighter-core']->src );
669
+ $corecssurl = apply_filters( 'syntaxhighlighter_csscoreurl', $corecssurl );
670
+ ?>
671
+ var corecssurl = "<?php echo esc_js( $corecssurl ); ?>";
672
+ if ( corecss.setAttribute ) {
673
+ corecss.setAttribute( "rel", "stylesheet" );
674
+ corecss.setAttribute( "type", "text/css" );
675
+ corecss.setAttribute( "href", corecssurl );
676
+ } else {
677
+ corecss.rel = "stylesheet";
678
+ corecss.href = corecssurl;
679
+ }
680
+ document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
681
+ <?php
682
+ endif; // Endif $needcore
683
+
684
+ if ( 'none' != $this->settings['theme'] ) : ?>
685
+ var themecssurl = "<?php echo esc_js( apply_filters( 'syntaxhighlighter_cssthemeurl', add_query_arg( 'ver', $this->agshver, $wp_styles->registered[$theme]->src ) ) ); ?>";
686
+ if ( themecss.setAttribute ) {
687
+ themecss.setAttribute( "rel", "stylesheet" );
688
+ themecss.setAttribute( "type", "text/css" );
689
+ themecss.setAttribute( "href", themecssurl );
690
+ } else {
691
+ themecss.rel = "stylesheet";
692
+ themecss.href = themecssurl;
693
+ }
694
+ //document.getElementById("syntaxhighlighteranchor").appendChild(themecss);
695
+ document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
696
+ <?php
697
+ endif; // Endif none != theme
698
+
699
+ echo " })();\n";
700
+
701
+ switch ( $this->settings['shversion'] ) {
702
+ case 2:
703
+ echo " SyntaxHighlighter.config.clipboardSwf = '" . esc_js( apply_filters( 'syntaxhighlighter_clipboardurl', plugins_url( 'syntaxhighlighter2/scripts/clipboard.swf', __FILE__ ) ) ) . "';\n";
704
+ echo " SyntaxHighlighter.config.strings.expandSource = '" . $this->js_escape_singlequotes( __( 'show source', 'syntaxhighlighter' ) ) . "';\n";
705
+ echo " SyntaxHighlighter.config.strings.viewSource = '" . $this->js_escape_singlequotes( __( 'view source', 'syntaxhighlighter' ) ) . "';\n";
706
+ echo " SyntaxHighlighter.config.strings.copyToClipboard = '" . $this->js_escape_singlequotes( __( 'copy to clipboard', 'syntaxhighlighter' ) ) . "';\n";
707
+ echo " SyntaxHighlighter.config.strings.copyToClipboardConfirmation = '" . $this->js_escape_singlequotes( __( 'The code is in your clipboard now', 'syntaxhighlighter' ) ) . "';\n";
708
+ echo " SyntaxHighlighter.config.strings.print = '" . $this->js_escape_singlequotes( __( 'print', 'syntaxhighlighter' ) ) . "';\n";
709
+ echo " SyntaxHighlighter.config.strings.help = '" . $this->js_escape_singlequotes( __( '?', 'syntaxhighlighter' ) ) . "';\n";
710
+ echo " SyntaxHighlighter.config.strings.alert = '" . $this->js_escape_singlequotes( __( 'SyntaxHighlighter\n\n', 'syntaxhighlighter' ) ) . "';\n";
711
+ echo " SyntaxHighlighter.config.strings.noBrush = '" . $this->js_escape_singlequotes( __( "Can't find brush for: ", 'syntaxhighlighter' ) ) . "';\n";
712
+ echo " SyntaxHighlighter.config.strings.brushNotHtmlScript = '" . $this->js_escape_singlequotes( __( "Brush wasn't configured for html-script option: ", 'syntaxhighlighter' ) ) . "';\n";
713
+ break;
714
+ case 3:
715
+ echo " SyntaxHighlighter.config.strings.expandSource = '" . $this->js_escape_singlequotes( __( '+ expand source', 'syntaxhighlighter' ) ) . "';\n";
716
+ echo " SyntaxHighlighter.config.strings.help = '" . $this->js_escape_singlequotes( __( '?', 'syntaxhighlighter' ) ) . "';\n";
717
+ echo " SyntaxHighlighter.config.strings.alert = '" . $this->js_escape_singlequotes( __( 'SyntaxHighlighter\n\n', 'syntaxhighlighter' ) ) . "';\n";
718
+ echo " SyntaxHighlighter.config.strings.noBrush = '" . $this->js_escape_singlequotes( __( "Can't find brush for: ", 'syntaxhighlighter' ) ) . "';\n";
719
+ echo " SyntaxHighlighter.config.strings.brushNotHtmlScript = '" . $this->js_escape_singlequotes( __( "Brush wasn't configured for html-script option: ", 'syntaxhighlighter' ) ) . "';\n";
720
+ break;
721
+ }
722
+
723
+ if ( 1 != $this->settings['autolinks'] )
724
+ echo " SyntaxHighlighter.defaults['auto-links'] = false;\n";
725
+
726
+ if ( !empty($this->settings['classname']) )
727
+ echo " SyntaxHighlighter.defaults['class-name'] = '" . $this->js_escape_singlequotes( $this->settings['classname'] ) . "';\n";
728
+
729
+ if ( 1 == $this->settings['collapse'] )
730
+ echo " SyntaxHighlighter.defaults['collapse'] = true;\n";
731
+
732
+ if ( 1 != $this->settings['firstline'] )
733
+ echo " SyntaxHighlighter.defaults['first-line'] = " . $this->settings['firstline'] . ";\n";
734
+
735
+ if ( 1 != $this->settings['gutter'] )
736
+ echo " SyntaxHighlighter.defaults['gutter'] = false;\n";
737
+
738
+ /*
739
+ if ( 1 == $this->settings['htmlscript'] )
740
+ echo " SyntaxHighlighter.defaults['html-script'] = true;\n";
741
+ */
742
+
743
+ if ( 1 == $this->settings['light'] )
744
+ echo " SyntaxHighlighter.defaults['light'] = true;\n";
745
+
746
+ echo " SyntaxHighlighter.defaults['pad-line-numbers'] = ";
747
+ switch ( $this->settings['padlinenumbers'] ) {
748
+ case 'true':
749
+ echo 'true';
750
+ break;
751
+ case 'false';
752
+ echo 'false';
753
+ break;
754
+ default;
755
+ echo (int) $this->settings['padlinenumbers'];
756
+ }
757
+ echo ";\n";
758
+
759
+ if ( 1 != $this->settings['smarttabs'] )
760
+ echo " SyntaxHighlighter.defaults['smart-tabs'] = false;\n";
761
+
762
+ if ( 4 != $this->settings['tabsize'] )
763
+ echo " SyntaxHighlighter.defaults['tab-size'] = " . $this->settings['tabsize'] . ";\n";
764
+
765
+ if ( 1 != $this->settings['toolbar'] )
766
+ echo " SyntaxHighlighter.defaults['toolbar'] = false;\n";
767
+
768
+ // 2.x only for now
769
+ if ( 1 != $this->settings['wraplines'] )
770
+ echo " SyntaxHighlighter.defaults['wrap-lines'] = false;\n";
771
+
772
+ ?> SyntaxHighlighter.all();
773
+ </script>
774
+ <?php
775
+ }
776
+
777
+
778
+ // No-name attribute fixing
779
+ function attributefix( $atts = array() ) {
780
+ if ( empty($atts[0]) )
781
+ return $atts;
782
+
783
+ // Quoted value
784
+ if ( 0 !== preg_match( '#=("|\')(.*?)\1#', $atts[0], $match ) )
785
+ $atts[0] = $match[2];
786
+
787
+ // Unquoted value
788
+ elseif ( '=' == substr( $atts[0], 0, 1 ) )
789
+ $atts[0] = substr( $atts[0], 1 );
790
+
791
+ return $atts;
792
+ }
793
+
794
+
795
+ // Shortcode handler for transforming the shortcodes to their final <pre>'s
796
+ function shortcode_callback( $atts, $code = '', $tag = false ) {
797
+ global $post;
798
+
799
+ if ( false === $tag || empty($code) )
800
+ return $code;
801
+
802
+ // Avoid PHP notices
803
+ if ( !isset($post) )
804
+ $post = null;
805
+
806
+ $code = apply_filters( 'syntaxhighlighter_precode', $code, $atts, $tag );
807
+
808
+ // Error fixing for [tag="language"]
809
+ if ( isset($atts[0]) ) {
810
+ $atts = $this->attributefix( $atts );
811
+ $atts['language'] = $atts[0];
812
+ unset($atts[0]);
813
+ }
814
+
815
+ // Default out all of the available parameters to "false" (easy way to check if they're set or not)
816
+ // Note this isn't the same as if the user passes the string "false" to the shortcode
817
+ $atts = (array) apply_filters( 'syntaxhighlighter_shortcodeatts', shortcode_atts( array(
818
+ 'language' => false,
819
+ 'lang' => false,
820
+ 'type' => false, // language alias
821
+ 'autolinks' => false,
822
+ 'classname' => false,
823
+ 'collapse' => false,
824
+ 'firstline' => false,
825
+ 'fontsize' => false,
826
+ 'gutter' => false,
827
+ 'highlight' => false,
828
+ 'htmlscript' => false,
829
+ 'light' => false,
830
+ 'padlinenumbers' => false,
831
+ 'smarttabs' => false,
832
+ 'tabsize' => false,
833
+ 'title' => $this->settings['title'],
834
+ 'toolbar' => false,
835
+ 'wraplines' => false,
836
+ ), $atts ) );
837
+
838
+ // Check for language shortcode tag such as [php]code[/php]
839
+ if ( isset($this->brushes[$tag]) ) {
840
+ $lang = $tag;
841
+ }
842
+
843
+ // If a valid tag is not used, it must be sourcecode/source/code
844
+ else {
845
+ $atts = $this->attributefix( $atts );
846
+
847
+ // Check for the "language" attribute
848
+ if ( false !== $atts['language'] )
849
+ $lang = $atts['language'];
850
+
851
+ // Check for the "lang" attribute
852
+ elseif ( false !== $atts['lang'] )
853
+ $lang = $atts['lang'];
854
+
855
+ // Default to plain text
856
+ else
857
+ $lang = 'text';
858
+
859
+ // All language aliases are lowercase
860
+ $lang = strtolower( $lang );
861
+
862
+ // Validate passed attribute
863
+ if ( !isset($this->brushes[$lang]) )
864
+ return $code;
865
+ }
866
+
867
+ // Switch from the alias to the real brush name (so custom aliases can be used)
868
+ $lang = $this->brushes[$lang];
869
+
870
+ // Register this brush as used so it's script will be outputted
871
+ $this->usedbrushes[$lang] = true;
872
+
873
+ $params = array();
874
+ $params[] = "brush: $lang;";
875
+
876
+ // Fix bug that prevents collapse from working if the toolbar is off or light mode is on
877
+ if ( 'true' == $atts['collapse'] || '1' === $atts['collapse'] || 1 == $this->settings['collapse'] ) {
878
+ $atts['toolbar'] = 'true';
879
+ $atts['light'] = 'false';
880
+ }
881
+
882
+ // Parameter renaming (the shortcode API doesn't like parameter names with dashes)
883
+ $rename_map = array(
884
+ 'autolinks' => 'auto-links',
885
+ 'classname' => 'class-name',
886
+ 'firstline' => 'first-line',
887
+ 'fontsize' => 'font-size',
888
+ 'htmlscript' => 'html-script',
889
+ 'padlinenumbers' => 'pad-line-numbers',
890
+ 'smarttabs' => 'smart-tabs',
891
+ 'tabsize' => 'tab-size',
892
+ 'wraplines' => 'wrap-lines',
893
+ );
894
+
895
+ // Allowed configuration parameters and their type
896
+ // Use the proper names (see above)
897
+ $allowed_atts = (array) apply_filters( 'syntaxhighlighter_allowedatts', array(
898
+ 'auto-links' => 'boolean',
899
+ 'class-name' => 'other',
900
+ 'collapse' => 'boolean',
901
+ 'first-line' => 'integer',
902
+ 'font-size' => 'integer',
903
+ 'gutter' => 'boolean',
904
+ 'highlight' => 'other',
905
+ 'html-script' => 'boolean',
906
+ 'light' => 'boolean',
907
+ 'pad-line-numbers' => 'other',
908
+ 'smart-tabs' => 'boolean',
909
+ 'tab-size' => 'integer',
910
+ 'title' => 'other',
911
+ 'toolbar' => 'boolean',
912
+ 'wrap-lines' => 'boolean',
913
+ ) );
914
+
915
+ $title = '';
916
+
917
+ // Sanitize configuration parameters and such
918
+ foreach ( $atts as $key => $value ) {
919
+ $key = strtolower( $key );
920
+
921
+ // Put back parameter names that have been renamed for shortcode use
922
+ if ( !empty($rename_map[$key]) )
923
+ $key = $rename_map[$key];
924
+
925
+ // This this parameter if it's unknown, not set, or the language which was already handled
926
+ if ( empty($allowed_atts[$key]) || false === $value || in_array( $key, array( 'language', 'lang' ) ) )
927
+ continue;
928
+
929
+ // Sanitize values
930
+ switch ( $allowed_atts[$key] ) {
931
+ case 'boolean':
932
+ $value = strtolower( $value );
933
+ if ( 'true' === $value || '1' === $value || 'on' == $value )
934
+ $value = 'true';
935
+ elseif ( 'false' === $value || '0' === $value || 'off' == $value )
936
+ $value = 'false';
937
+ else
938
+ continue 2; // Invalid value, ditch parameter
939
+ break;
940
+
941
+ // integer
942
+ case 'integer':
943
+ $value = (int) $value;
944
+ break;
945
+ }
946
+
947
+ // Sanitize the "classname" parameter
948
+ if ( 'class-name' == $key )
949
+ $value = trim( preg_replace( '/[^a-zA-Z0-9 _-]/i', '', $value ) );
950
+
951
+ // Special sanitization for "pad-line-numbers"
952
+ if ( 'pad-line-numbers' == $key ) {
953
+ $value = strtolower( $value );
954
+ if ( 'true' === $value || '1' === $value )
955
+ $value = 'true';
956
+ elseif ( 'false' === $value || '0' === $value )
957
+ $value = 'false';
958
+ else
959
+ $value = (int) $value;
960
+ }
961
+
962
+ // Add % sign to "font-size"
963
+ if ( 'font-size' == $key )
964
+ $value = $value . '%';
965
+
966
+ // If "html-script", then include the XML brush as it's needed
967
+ if ( 'html-script' == $key && 'true' == $value )
968
+ $this->usedbrushes['xml'] = true;
969
+
970
+ // Sanitize row highlights
971
+ if ( 'highlight' == $key ) {
972
+ if ( false === strpos( $value, ',' ) && false === strpos( $value, '-' ) ) {
973
+ $value = (int) $value;
974
+ } else {
975
+ $lines = explode( ',', $value );
976
+ $highlights = array();
977
+
978
+ foreach ( $lines as $line ) {
979
+ // Line range
980
+ if ( false !== strpos( $line, '-' ) ) {
981
+ list( $range_start, $range_end ) = array_map( 'intval', explode( '-', $line ) );
982
+ if ( ! $range_start || ! $range_end || $range_end <= $range_start )
983
+ continue;
984
+
985
+ for ( $i = $range_start; $i <= $range_end; $i++ )
986
+ $highlights[] = $i;
987
+ } else {
988
+ $highlights[] = (int) $line;
989
+ }
990
+ }
991
+
992
+ natsort( $highlights );
993
+
994
+ $value = implode( ',', $highlights );
995
+ }
996
+
997
+ if ( empty( $value ) )
998
+ continue;
999
+
1000
+ // Wrap highlight in [ ]
1001
+ $params[] = "$key: [$value];";
1002
+ continue;
1003
+ }
1004
+
1005
+ // Don't allow HTML in the title parameter
1006
+ if ( 'title' == $key ) {
1007
+ $value = strip_tags( html_entity_decode( strip_tags( $value ) ) );
1008
+ }
1009
+
1010
+ $params[] = "$key: $value;";
1011
+
1012
+ // Set the title variable if the title parameter is set (but not for feeds)
1013
+ if ( 'title' == $key && ! is_feed() )
1014
+ $title = ' title="' . esc_attr( $value ) . '"';
1015
+ }
1016
+
1017
+ $code = ( false === strpos( $code, '<' ) && false === strpos( $code, '>' ) && 2 == $this->get_code_format($post) ) ? strip_tags( $code ) : htmlspecialchars( $code );
1018
+
1019
+ $params[] = 'notranslate'; // For Google, see http://otto42.com/9k
1020
+
1021
+ $params = apply_filters( 'syntaxhighlighter_cssclasses', $params ); // Use this to add additional CSS classes / SH parameters
1022
+
1023
+ return apply_filters( 'syntaxhighlighter_htmlresult', '<pre class="' . esc_attr( implode( ' ', $params ) ) . '"' . $title . '>' . $code . '</pre>' );;
1024
+ }
1025
+
1026
+
1027
+ // Settings page
1028
+ function settings_page() { ?>
1029
+
1030
+ <script type="text/javascript">
1031
+ // <![CDATA[
1032
+ jQuery(document).ready(function($) {
1033
+ // Confirm pressing of the "Reset to Defaults" button
1034
+ $("#syntaxhighlighter-defaults").click(function(){
1035
+ var areyousure = confirm("<?php echo esc_js( __( 'Are you sure you want to reset your settings to the defaults?', 'syntaxhighlighter' ) ); ?>");
1036
+ if ( true != areyousure ) return false;
1037
+ });
1038
+ <?php if ( !empty( $_GET['defaults'] ) ) : ?>
1039
+ $("#message p strong").text("<?php echo esc_js( __( 'Settings reset to defaults.', 'syntaxhighlighter' ) ); ?>");
1040
+ <?php endif; ?>
1041
+ });
1042
+ // ]]>
1043
+ </script>
1044
+
1045
+ <div class="wrap">
1046
+ <?php if ( function_exists('screen_icon') ) screen_icon(); ?>
1047
+ <h2><?php _e( 'SyntaxHighlighter Settings', 'syntaxhighlighter' ); ?></h2>
1048
+
1049
+ <form method="post" action="options.php">
1050
+
1051
+ <?php settings_fields('syntaxhighlighter_settings'); ?>
1052
+
1053
+
1054
+ <table class="form-table">
1055
+ <tr valign="top">
1056
+ <th scope="row"><label for="syntaxhighlighter-shversion"><?php _e( 'Highlighter Version', 'syntaxhighlighter' ); ?></label></th>
1057
+ <td>
1058
+ <select name="syntaxhighlighter_settings[shversion]" id="syntaxhighlighter-shversion" class="postform">
1059
+ <?php
1060
+ $versions = array(
1061
+ 3 => __( 'Version 3.x', 'syntaxhighlighter' ),
1062
+ 2 => __( 'Version 2.x', 'syntaxhighlighter' ),
1063
+ );
1064
+
1065
+ foreach ( $versions as $version => $name ) {
1066
+ echo ' <option value="' . esc_attr( $version ) . '"' . selected( $this->settings['shversion'], $version, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n";
1067
+ }
1068
+ ?>
1069
+ </select><br />
1070
+ <?php _e( 'Version 3 allows visitors to easily highlight portions of your code with their mouse (either by dragging or double-clicking) and copy it to their clipboard. No toolbar containing a Flash-based button is required.', 'syntaxhighlighter' ); ?><br />
1071
+ <?php _e( 'Version 2 allows for line wrapping, something that version 3 does not do at this time.', 'syntaxhighlighter' ); ?>
1072
+ </td>
1073
+ </tr>
1074
+ <tr valign="top">
1075
+ <th scope="row"><label for="syntaxhighlighter-theme"><?php _e( 'Color Theme', 'syntaxhighlighter' ); ?></label></th>
1076
+ <td>
1077
+ <select name="syntaxhighlighter_settings[theme]" id="syntaxhighlighter-theme" class="postform">
1078
+ <?php
1079
+ foreach ( $this->themes as $theme => $name ) {
1080
+ echo ' <option value="' . esc_attr( $theme ) . '"' . selected( $this->settings['theme'], $theme, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n";
1081
+ }
1082
+ ?>
1083
+ </select>
1084
+ </td>
1085
+ </tr>
1086
+ <tr valign="top">
1087
+ <th scope="row"><?php _e( 'Load All Brushes', 'syntaxhighlighter' ); ?></th>
1088
+ <td>
1089
+ <fieldset>
1090
+ <legend class="hidden"><?php _e( 'Load All Brushes', 'syntaxhighlighter' ); ?></legend>
1091
+ <label for="syntaxhighlighter-loadallbrushes"><input name="syntaxhighlighter_settings[loadallbrushes]" type="checkbox" id="syntaxhighlighter-loadallbrushes" value="1" <?php checked( $this->settings['loadallbrushes'], 1 ); ?> /> <?php _e( 'Always load all language files (for directly using <code>&lt;pre&gt;</code> tags rather than shortcodes)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If left unchecked (default), then language files will only be loaded when needed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If unsure, leave this box unchecked', 'syntaxhighlighter' ); ?></label>
1092
+ </fieldset>
1093
+ </td>
1094
+ </tr>
1095
+ </table>
1096
+
1097
+ <h3><?php _e( 'Defaults', 'syntaxhighlighter' ); ?></h3>
1098
+
1099
+ <p><?php _e( 'All of the settings below can be configured on a per-code block basis, but you can control the defaults of all code blocks here.', 'syntaxhighlighter' ); ?></p>
1100
+
1101
+ <table class="form-table">
1102
+ <tr valign="top">
1103
+ <th scope="row"><?php _e( 'Miscellaneous', 'syntaxhighlighter' ); ?></th>
1104
+ <td>
1105
+ <fieldset>
1106
+ <legend class="hidden"><?php _e( 'Miscellaneous', 'syntaxhighlighter' ); ?></legend>
1107
+
1108
+ <label for="syntaxhighlighter-gutter"><input name="syntaxhighlighter_settings[gutter]" type="checkbox" id="syntaxhighlighter-gutter" value="1" <?php checked( $this->settings['gutter'], 1 ); ?> /> <?php _e( 'Display line numbers', 'syntaxhighlighter' ); ?></label><br />
1109
+ <label for="syntaxhighlighter-toolbar"><input name="syntaxhighlighter_settings[toolbar]" type="checkbox" id="syntaxhighlighter-toolbar" value="1" <?php checked( $this->settings['toolbar'], 1 ); ?> /> <?php _e( 'Display the toolbar', 'syntaxhighlighter' ); ?></label><br />
1110
+ <label for="syntaxhighlighter-autolinks"><input name="syntaxhighlighter_settings[autolinks]" type="checkbox" id="syntaxhighlighter-autolinks" value="1" <?php checked( $this->settings['autolinks'], 1 ); ?> /> <?php _e( 'Automatically make URLs clickable', 'syntaxhighlighter' ); ?></label><br />
1111
+ <label for="syntaxhighlighter-collapse"><input name="syntaxhighlighter_settings[collapse]" type="checkbox" id="syntaxhighlighter-collapse" value="1" <?php checked( $this->settings['collapse'], 1 ); ?> /> <?php _e( 'Collapse code boxes', 'syntaxhighlighter' ); ?></label><br />
1112
+ <label for="syntaxhighlighter-light"><input name="syntaxhighlighter_settings[light]" type="checkbox" id="syntaxhighlighter-light" value="1" <?php checked( $this->settings['light'], 1 ); ?> /> <?php _e( 'Use the light display mode, best for single lines of code', 'syntaxhighlighter' ); ?></label><br />
1113
+ <label for="syntaxhighlighter-smarttabs"><input name="syntaxhighlighter_settings[smarttabs]" type="checkbox" id="syntaxhighlighter-smarttabs" value="1" <?php checked( $this->settings['smarttabs'], 1 ); ?> /> <?php _e( 'Use smart tabs allowing tabs being used for alignment', 'syntaxhighlighter' ); ?></label><br />
1114
+ <label for="syntaxhighlighter-wraplines"><input name="syntaxhighlighter_settings[wraplines]" type="checkbox" id="syntaxhighlighter-wraplines" value="1" <?php checked( $this->settings['wraplines'], 1 ); ?> /> <?php _e( 'Wrap long lines (v2.x only, disabling this will make a scrollbar show instead)', 'syntaxhighlighter' ); ?></label><br />
1115
+ <!--<label for="syntaxhighlighter-htmlscript"><input name="syntaxhighlighter_settings[htmlscript]" type="checkbox" id="syntaxhighlighter-htmlscript" value="1" <?php checked( $this->settings['htmlscript'], 1 ); ?> /> <?php _e( 'Enable &quot;HTML script&quot; mode by default (see the bottom of this page for details). Checking this box is not recommended as this mode only works with certain languages.', 'syntaxhighlighter' ); ?></label>-->
1116
+ </fieldset>
1117
+ </td>
1118
+ </tr>
1119
+ <tr valign="top">
1120
+ <th scope="row"><label for="syntaxhighlighter-classname"><?php _e( 'Additional CSS Class(es)', 'syntaxhighlighter' ); ?></label></th>
1121
+ <td><input name="syntaxhighlighter_settings[classname]" type="text" id="syntaxhighlighter-classname" value="<?php echo esc_attr( $this->settings['classname'] ); ?>" class="regular-text" /></td>
1122
+ </tr>
1123
+ <tr valign="top">
1124
+ <th scope="row"><label for="syntaxhighlighter-firstline"><?php _e( 'Starting Line Number', 'syntaxhighlighter' ); ?></label></th>
1125
+ <td><input name="syntaxhighlighter_settings[firstline]" type="text" id="syntaxhighlighter-firstline" value="<?php echo esc_attr( $this->settings['firstline'] ); ?>" class="small-text" /></td>
1126
+ </tr>
1127
+ <tr valign="top">
1128
+ <th scope="row"><label for="syntaxhighlighter-padlinenumbers"><?php _e( 'Line Number Padding', 'syntaxhighlighter' ); ?></label></th>
1129
+ <td>
1130
+ <select name="syntaxhighlighter_settings[padlinenumbers]" id="syntaxhighlighter-padlinenumbers" class="postform">
1131
+ <?php
1132
+ $linepaddings = array(
1133
+ 'false' => __( 'Off', 'syntaxhighlighter' ),
1134
+ 'true' => __( 'Automatic', 'syntaxhighlighter' ),
1135
+ 1 => 1,
1136
+ 2 => 2,
1137
+ 3 => 3,
1138
+ 4 => 4,
1139
+ 5 => 5,
1140
+ );
1141
+
1142
+ foreach ( $linepaddings as $value => $name ) {
1143
+ echo ' <option value="' . esc_attr( $value ) . '"' . selected( $this->settings['padlinenumbers'], $value, false ) . '>' . esc_html( $name ) . "&nbsp;</option>\n";
1144
+ }
1145
+ ?>
1146
+ </select>
1147
+ </td>
1148
+ </tr>
1149
+ <tr valign="top">
1150
+ <th scope="row"><label for="syntaxhighlighter-tabsize"><?php _e( 'Tab Size', 'syntaxhighlighter' ); ?></label></th>
1151
+ <td><input name="syntaxhighlighter_settings[tabsize]" type="text" id="syntaxhighlighter-tabsize" value="<?php echo esc_attr( $this->settings['tabsize'] ); ?>" class="small-text" /></td>
1152
+ </tr>
1153
+ <tr valign="top">
1154
+ <th scope="row"><label for="syntaxhighlighter-title"><?php _e( 'Title', 'syntaxhighlighter' ); ?></label></th>
1155
+ <td>
1156
+ <input name="syntaxhighlighter_settings[title]" type="text" id="syntaxhighlighter-title" value="<?php echo esc_attr( $this->settings['title'] ); ?>" class="regular-text" /><br />
1157
+ <?php _e( 'Some optional default text to display above each code block or as the clickable text for collapsed code blocks.', 'syntaxhighlighter' ); ?>
1158
+ </td>
1159
+ </tr>
1160
+ </table>
1161
+
1162
+ <p class="submit">
1163
+ <?php
1164
+ if ( function_exists( 'submit_button' ) ) {
1165
+ submit_button( null, 'primary', 'syntaxhighlighter-submit', false );
1166
+ echo ' ';
1167
+ submit_button( __( 'Reset to Defaults', 'syntaxhighlighter' ), 'primary', 'syntaxhighlighter-defaults', false );
1168
+ } else {
1169
+ echo '<input type="submit" name="syntaxhighlighter-submit" class="button-primary" value="' . __( 'Save Changes') . '" />' . "\n";
1170
+ echo '<input type="submit" name="syntaxhighlighter-defaults" id="syntaxhighlighter-defaults" class="button-primary" value="' . __( 'Reset to Defaults', 'syntaxhighlighter' ) . '" />' . "\n";
1171
+ }
1172
+ ?>
1173
+ </p>
1174
+
1175
+ </form>
1176
+
1177
+ <h3><?php _e( 'Preview', 'syntaxhighlighter' ); ?></h3>
1178
+
1179
+ <p><?php _e( 'Click &quot;Save Changes&quot; to update this preview.', 'syntaxhighlighter' ); ?>
1180
+
1181
+ <?php
1182
+
1183
+ echo '<div';
1184
+ if ( ! empty( $GLOBALS['content_width'] ) )
1185
+ echo ' style="max-width:' . intval( $GLOBALS['content_width'] ) . 'px"';
1186
+ echo '>';
1187
+
1188
+ $title = ( empty( $this->settings['title'] ) && 1 != $this->settings['collapse'] ) ? ' title="Code example: (this example was added using the title parameter)"' : '';
1189
+
1190
+ // Site owners may opt to disable the short tags, i.e. [php]
1191
+ $democode = apply_filters( 'syntaxhighlighter_democode', '[sourcecode language="php" htmlscript="true" highlight="12"' . $title . ']<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1192
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1193
+ <head>
1194
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1195
+ <title>PHP Code Example</title>
1196
+ </head>
1197
+ <body>
1198
+ <h1>' . __( 'PHP Code Example', 'syntaxhighlighter' ) . '</h1>
1199
+
1200
+ <p><?php echo \'' . __( 'Hello World!', 'syntaxhighlighter' ) . '\'; ?></p>
1201
+
1202
+ <p>' . __( 'This line is highlighted.', 'syntaxhighlighter' ) . '</p>
1203
+
1204
+ <div class="foobar">
1205
+ ' . __( ' This is an
1206
+ example of smart
1207
+ tabs.', 'syntaxhighlighter' ) . '
1208
+ </div>
1209
+
1210
+ <p><a href="http://wordpress.org/">' . __( 'WordPress' ) . '</a></p>
1211
+ </body>
1212
+ </html>[/sourcecode]' );
1213
+
1214
+ $this->codeformat = 1;
1215
+ echo $this->parse_shortcodes( $democode );
1216
+ $this->codeformat = false;
1217
+
1218
+ echo '</div>';
1219
+ ?>
1220
+
1221
+ <h3 style="margin-top:30px"><?php _e( 'Shortcode Parameters', 'syntaxhighlighter' ); ?></h3>
1222
+
1223
+ <p><?php printf( __( 'These are the parameters you can pass to the shortcode and what they do. For the booleans (i.e. on/off), pass %1$s/%2$s or %3$s/%4$s.', 'syntaxhighlighter' ), '<code>true</code>', '<code>1</code>', '<code>false</code>', '<code>0</code>' ); ?></p>
1224
+
1225
+ <ul class="ul-disc">
1226
+ <li><?php printf( _x( '%1$s or %2$s &#8212; The language syntax to highlight with. You can alternately just use that as the tag, such as <code>[php]code[/php]</code>. <a href="%3$s">Click here</a> for a list of valid tags (under &quot;aliases&quot;).', 'language parameter', 'syntaxhighlighter' ), '<code>lang</code>', '<code>language</code>', 'http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes' ); ?></li>
1227
+ <li><?php printf( _x( '%s &#8212; Toggle automatic URL linking.', 'autolinks parameter', 'syntaxhighlighter' ), '<code>autolinks</code>' ); ?></li>
1228
+ <li><?php printf( _x( '%s &#8212; Add an additional CSS class to the code box.', 'classname parameter', 'syntaxhighlighter' ), '<code>classname</code>' ); ?></li>
1229
+ <li><?php printf( _x( '%s &#8212; Toggle collapsing the code box by default, requiring a click to expand it. Good for large code posts.', 'collapse parameter', 'syntaxhighlighter' ), '<code>collapse</code>' ); ?></li>
1230
+ <li><?php printf( _x( '%s &#8212; An interger specifying what number the first line should be (for the line numbering).', 'firstline parameter', 'syntaxhighlighter' ), '<code>firstline</code>' ); ?></li>
1231
+ <li><?php printf( _x( '%s &#8212; Toggle the left-side line numbering.', 'gutter parameter', 'syntaxhighlighter' ), '<code>gutter</code>' ); ?></li>
1232
+ <li><?php printf( _x( '%1$s &#8212; A comma-separated list of line numbers to highlight. You can also specify a range. Example: %2$s', 'highlight parameter', 'syntaxhighlighter' ), '<code>highlight</code>', '<code>2,5-10,12</code>' ); ?></li>
1233
+ <li><?php printf( _x( "%s &#8212; Toggle highlighting any extra HTML/XML. Good for when you're mixing HTML/XML with another language, such as having PHP inside an HTML web page. The above preview has it enabled for example. This only works with certain languages.", 'htmlscript parameter', 'syntaxhighlighter' ), '<code>htmlscript</code>' ); ?></li>
1234
+ <li><?php printf( _x( '%s &#8212; Toggle light mode which disables the gutter and toolbar all at once.', 'light parameter', 'syntaxhighlighter' ), '<code>light</code>' ); ?></li>
1235
+ <li><?php printf( _x( '%s &#8212; Controls line number padding. Valid values are <code>false</code> (no padding), <code>true</code> (automatic padding), or an integer (forced padding).', 'padlinenumbers parameter', 'syntaxhighlighter' ), '<code>padlinenumbers</code>' ); ?></li>
1236
+ <li><?php printf( _x( '%1$s (v3 only) &#8212; Sets some text to show up before the code. Very useful when combined with the %2$s parameter.', 'title parameter', 'syntaxhighlighter' ), '<code>title</code>', '<code>collapse</code>' ); ?></li>
1237
+ <li><?php printf( _x( '%s &#8212; Toggle the toolbar (buttons in v2, the about question mark in v3)', 'toolbar parameter', 'syntaxhighlighter' ), '<code>toolbar</code>' ); ?></li>
1238
+ <li><?php printf( _x( '%s (v2 only) &#8212; Toggle line wrapping.', 'wraplines parameter', 'syntaxhighlighter'), '<code>wraplines</code>' ); ?></li>
1239
+ </ul>
1240
+
1241
+ <p><?php _e( 'Some example shortcodes:', 'syntaxhighlighter' ); ?></p>
1242
+
1243
+ <ul class="ul-disc">
1244
+ <li><code>[php]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/php]</code></li>
1245
+ <li><code>[css autolinks=&quot;false&quot; classname=&quot;myclass&quot; collapse=&quot;false&quot; firstline=&quot;1&quot; gutter=&quot;true&quot; highlight=&quot;1-3,6,9&quot; htmlscript=&quot;false&quot; light=&quot;false&quot; padlinenumbers=&quot;false&quot; smarttabs=&quot;true&quot; tabsize=&quot;4&quot; toolbar=&quot;true&quot; title=&quot;<?php _e( 'example-filename.php', 'syntaxhighlighter' ); ?>&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/css]</code></li>
1246
+ <li><code>[code lang=&quot;js&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/code]</code></li>
1247
+ <li><code>[sourcecode language=&quot;plain&quot;]<?php _e( 'your code here', 'syntaxhighlighter' ); ?>[/sourcecode]</code></li>
1248
+ </ul>
1249
+
1250
+ <?php $this->maybe_output_scripts(); ?>
1251
+
1252
+ </div>
1253
+
1254
+ <?php
1255
+ }
1256
+
1257
+
1258
+ // Validate the settings sent from the settings page
1259
+ function validate_settings( $settings ) {
1260
+ if ( !empty($_POST['syntaxhighlighter-defaults']) ) {
1261
+ $settings = $this->defaultsettings;
1262
+ $_REQUEST['_wp_http_referer'] = add_query_arg( 'defaults', 'true', $_REQUEST['_wp_http_referer'] );
1263
+ } else {
1264
+ $settings['shversion'] = ( ! empty($settings['shversion']) && 2 == $settings['shversion'] ) ? 2 : 3;
1265
+
1266
+ $settings['theme'] = ( ! empty($settings['theme']) && isset($this->themes[$settings['theme']]) ) ? strtolower($settings['theme']) : $this->defaultsettings['theme'];
1267
+
1268
+ $settings['loadallbrushes'] = ( ! empty($settings['loadallbrushes']) ) ? 1 : 0;
1269
+ $settings['autolinks'] = ( ! empty($settings['autolinks']) ) ? 1 : 0;
1270
+ $settings['collapse'] = ( ! empty($settings['collapse']) ) ? 1 : 0;
1271
+ $settings['gutter'] = ( ! empty($settings['gutter']) ) ? 1 : 0;
1272
+ $settings['light'] = ( ! empty($settings['light']) ) ? 1 : 0;
1273
+ $settings['smarttabs'] = ( ! empty($settings['smarttabs']) ) ? 1 : 0;
1274
+ $settings['toolbar'] = ( ! empty($settings['toolbar']) ) ? 1 : 0; // May be overridden below
1275
+ $settings['wraplines'] = ( ! empty($settings['wraplines']) ) ? 1 : 0; // 2.x only for now
1276
+
1277
+ // If the version changed, then force change the toolbar version setting
1278
+ if ( $settings['shversion'] != $this->settings['shversion'] ) {
1279
+ $settings['toolbar'] = ( 2 == $settings['shversion'] ) ? 1 : 0;
1280
+ }
1281
+
1282
+ if ( 'true' != $settings['padlinenumbers'] && 'false' != $settings['padlinenumbers'] )
1283
+ $settings['padlinenumbers'] = (int) $settings['padlinenumbers'];
1284
+
1285
+ $settings['classname'] = ( !empty($settings['classname']) ) ? preg_replace( '/[^ A-Za-z0-9_-]*/', '', $settings['classname'] ) : '';
1286
+ $settings['firstline'] = (int) ( ( !empty($settings['firstline']) ) ? $settings['firstline'] : $this->defaultsettings['firstline'] );
1287
+ $settings['tabsize'] = (int) ( ( !empty($settings['tabsize']) ) ? $settings['tabsize'] : $this->defaultsettings['tabsize'] );
1288
+ }
1289
+
1290
+ return $settings;
1291
+ }
1292
+ }
1293
+
1294
+
1295
+ // Start this plugin once all other plugins are fully loaded
1296
+ add_action( 'init', 'SyntaxHighlighter', 5 );
1297
+ function SyntaxHighlighter() {
1298
+ global $SyntaxHighlighter;
1299
+ $SyntaxHighlighter = new SyntaxHighlighter();
1300
+ }
syntaxhighlighter3/scripts/shAutoloader.js CHANGED
@@ -1,138 +1,138 @@
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- (function() {
18
-
19
- var 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
- */
38
- sh.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 && scripts[url] === undefined)
86
- {
87
- if(elements[i].params['html-script'] === 'true')
88
- {
89
- if(scripts[brushes['xml']] === undefined) {
90
- loadScript(brushes['xml']);
91
- scripts[url] = false;
92
- }
93
- }
94
-
95
- scripts[url] = false;
96
- loadScript(url);
97
- }
98
- }
99
-
100
- function loadScript(url)
101
- {
102
- var script = document.createElement('script'),
103
- done = false
104
- ;
105
-
106
- script.src = url;
107
- script.type = 'text/javascript';
108
- script.language = 'javascript';
109
- script.onload = script.onreadystatechange = function()
110
- {
111
- if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
112
- {
113
- done = true;
114
- scripts[url] = true;
115
- checkAll();
116
-
117
- // Handle memory leak in IE
118
- script.onload = script.onreadystatechange = null;
119
- script.parentNode.removeChild(script);
120
- }
121
- };
122
-
123
- // sync way of adding script tags to the page
124
- document.body.appendChild(script);
125
- };
126
-
127
- function checkAll()
128
- {
129
- for(var url in scripts)
130
- if (scripts[url] == false)
131
- return;
132
-
133
- if (allCalled)
134
- SyntaxHighlighter.highlight(allParams);
135
- };
136
- };
137
-
138
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ (function() {
18
+
19
+ var 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
+ */
38
+ sh.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 && scripts[url] === undefined)
86
+ {
87
+ if(elements[i].params['html-script'] === 'true')
88
+ {
89
+ if(scripts[brushes['xml']] === undefined) {
90
+ loadScript(brushes['xml']);
91
+ scripts[url] = false;
92
+ }
93
+ }
94
+
95
+ scripts[url] = false;
96
+ loadScript(url);
97
+ }
98
+ }
99
+
100
+ function loadScript(url)
101
+ {
102
+ var script = document.createElement('script'),
103
+ done = false
104
+ ;
105
+
106
+ script.src = url;
107
+ script.type = 'text/javascript';
108
+ script.language = 'javascript';
109
+ script.onload = script.onreadystatechange = function()
110
+ {
111
+ if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
112
+ {
113
+ done = true;
114
+ scripts[url] = true;
115
+ checkAll();
116
+
117
+ // Handle memory leak in IE
118
+ script.onload = script.onreadystatechange = null;
119
+ script.parentNode.removeChild(script);
120
+ }
121
+ };
122
+
123
+ // sync way of adding script tags to the page
124
+ document.body.appendChild(script);
125
+ };
126
+
127
+ function checkAll()
128
+ {
129
+ for(var url in scripts)
130
+ if (scripts[url] == false)
131
+ return;
132
+
133
+ if (allCalled)
134
+ SyntaxHighlighter.highlight(allParams);
135
+ };
136
+ };
137
+
138
+ })();
syntaxhighlighter3/scripts/shBrushAS3.js CHANGED
@@ -1,59 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushAppleScript.js CHANGED
@@ -1,100 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 ask attachment boolean class constant delete duplicate empty exists id integer list make message modal modified new no pi properties quit real record remove rest result reveal reverse run running save string word yes';
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, // operators
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|clipboard info|set the clipboard to|(the )?clipboard|entire contents|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|return(ed)?|second(?! item)(s)?|list (disks|folder)|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|starting at|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
60
- css: 'color4' },
61
-
62
- { regex: /\b(?:tracks|paragraph|text item(s)?)\b/g,
63
- css: 'classes' },
64
-
65
- { regex: /\b(?:AppleScript|album|video kind|grouping|length|text item delimiters|quoted form|POSIX path(?= of))\b/g,
66
- css: 'properties' },
67
-
68
- { regex: /\b(?:run|exists|count)\b/g,
69
- css: 'commandNames' },
70
-
71
- { regex: /\b(?:POSIX (file|path))\b/g,
72
- css: 'additionClasses' },
73
-
74
- { regex: /\b(?:message|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|regexp|string result|using( delimiters)?|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor))\b/g,
75
- css: 'additionParameterNames' },
76
-
77
- { regex: /\b(?:display(ing| (alert|dialog|mode))?|choose( ((remote )?application|color|folder|from list|URL))?|(do( shell)?|load|run|store) script|re_compile|find text)\b/g,
78
- css: 'additionCommandNames' },
79
-
80
- { regex: /\b(?:xxx)\b/g,
81
- css: 'parameterNames' },
82
-
83
- { regex: /\b(?:true|false|none)\b/g,
84
- css: 'enumeratedValues' },
85
-
86
-
87
- { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
88
- { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
89
- { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
90
- ];
91
- };
92
-
93
- Brush.prototype = new SyntaxHighlighter.Highlighter();
94
- Brush.aliases = ['applescript'];
95
-
96
- SyntaxHighlighter.brushes.AppleScript = Brush;
97
-
98
- // CommonJS
99
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 ask attachment boolean class constant delete duplicate empty exists id integer list make message modal modified new no pi properties quit real record remove rest result reveal reverse run running save string word yes';
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, // operators
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|clipboard info|set the clipboard to|(the )?clipboard|entire contents|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|return(ed)?|second(?! item)(s)?|list (disks|folder)|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|starting at|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
60
+ css: 'color4' },
61
+
62
+ { regex: /\b(?:tracks|paragraph|text item(s)?)\b/g,
63
+ css: 'classes' },
64
+
65
+ { regex: /\b(?:AppleScript|album|video kind|grouping|length|text item delimiters|quoted form|POSIX path(?= of))\b/g,
66
+ css: 'properties' },
67
+
68
+ { regex: /\b(?:run|exists|count)\b/g,
69
+ css: 'commandNames' },
70
+
71
+ { regex: /\b(?:POSIX (file|path))\b/g,
72
+ css: 'additionClasses' },
73
+
74
+ { regex: /\b(?:message|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|regexp|string result|using( delimiters)?|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor))\b/g,
75
+ css: 'additionParameterNames' },
76
+
77
+ { regex: /\b(?:display(ing| (alert|dialog|mode))?|choose( ((remote )?application|color|folder|from list|URL))?|(do( shell)?|load|run|store) script|re_compile|find text)\b/g,
78
+ css: 'additionCommandNames' },
79
+
80
+ { regex: /\b(?:xxx)\b/g,
81
+ css: 'parameterNames' },
82
+
83
+ { regex: /\b(?:true|false|none)\b/g,
84
+ css: 'enumeratedValues' },
85
+
86
+
87
+ { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
88
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
89
+ { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
90
+ ];
91
+ };
92
+
93
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
94
+ Brush.aliases = ['applescript'];
95
+
96
+ SyntaxHighlighter.brushes.AppleScript = Brush;
97
+
98
+ // CommonJS
99
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
100
  })();
syntaxhighlighter3/scripts/shBrushBash.js CHANGED
@@ -1,75 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
-
22
- function Brush()
23
- {
24
- function hereDocProcess(match, regexInfo)
25
- {
26
- var constructor = SyntaxHighlighter.Match,
27
- result = []
28
- ;
29
- if (match.here_doc != null)
30
- result.push(new constructor(match.here_doc, match.index + match[0].indexOf(match.here_doc), 'string'));
31
-
32
- if (match.full_tag != null)
33
- result.push(new constructor(match.full_tag, match.index, 'preprocessor'));
34
-
35
- if (match.end_tag != null)
36
- result.push(new constructor(match.end_tag, match.index + match[0].lastIndexOf(match.end_tag), 'preprocessor'));
37
- return result;
38
- }
39
- var keywords = 'if fi then elif else for do done until while break continue case esac function return in eq ne ge le';
40
- var commands = 'alias apropos awk basename base64 bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
41
- 'cksum clear cmp comm command cp cron crontab crypt csplit cut date dc dd ddrescue declare df ' +
42
- 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
43
- 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
44
- 'free fsck ftp gawk gcc gdb getconf getopts grep groups gzip hash head history hostname id ifconfig ' +
45
- 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
46
- 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
47
- 'mv nasm nc ndisasm netstat nice nl nohup nslookup objdump od open op passwd paste pathchk ping popd pr printcap ' +
48
- 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
49
- 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
50
- 'sleep sort source split ssh strace strings su sudo sum symlink sync tail tar tee test time ' +
51
- 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
52
- 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
53
- 'vi watch wc whereis which who whoami Wget xargs xxd yes chsh'
54
- ;
55
-
56
- this.regexList = [
57
- { regex: /^#!.*$/gm, css: 'preprocessor bold' },
58
- { regex: /\/[\w-\/]+/gm, css: 'plain' },
59
- { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
60
- { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
61
- { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
62
- { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
63
- { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' }, // commands
64
- { regex: new XRegExp("(?<full_tag>(&lt;|<){2}(?<tag>\\w+)) .*$(?<here_doc>[\\s\\S]*)(?<end_tag>^\\k<tag>$)",'gm'), func: hereDocProcess }
65
- ];
66
- }
67
-
68
- Brush.prototype = new SyntaxHighlighter.Highlighter();
69
- Brush.aliases = ['bash', 'shell', 'sh'];
70
-
71
- SyntaxHighlighter.brushes.Bash = Brush;
72
-
73
- // CommonJS
74
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
+
22
+ function Brush()
23
+ {
24
+ function hereDocProcess(match, regexInfo)
25
+ {
26
+ var constructor = SyntaxHighlighter.Match,
27
+ result = []
28
+ ;
29
+ if (match.here_doc != null)
30
+ result.push(new constructor(match.here_doc, match.index + match[0].indexOf(match.here_doc), 'string'));
31
+
32
+ if (match.full_tag != null)
33
+ result.push(new constructor(match.full_tag, match.index, 'preprocessor'));
34
+
35
+ if (match.end_tag != null)
36
+ result.push(new constructor(match.end_tag, match.index + match[0].lastIndexOf(match.end_tag), 'preprocessor'));
37
+ return result;
38
+ }
39
+ var keywords = 'if fi then elif else for do done until while break continue case esac function return in eq ne ge le';
40
+ var commands = 'alias apropos awk basename base64 bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
41
+ 'cksum clear cmp comm command cp cron crontab crypt csplit cut date dc dd ddrescue declare df ' +
42
+ 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
43
+ 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
44
+ 'free fsck ftp gawk gcc gdb getconf getopts grep groups gzip hash head history hostname id ifconfig ' +
45
+ 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
46
+ 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
47
+ 'mv nasm nc ndisasm netstat nice nl nohup nslookup objdump od open op passwd paste pathchk ping popd pr printcap ' +
48
+ 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
49
+ 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
50
+ 'sleep sort source split ssh strace strings su sudo sum symlink sync tail tar tee test time ' +
51
+ 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
52
+ 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
53
+ 'vi watch wc whereis which who whoami Wget xargs xxd yes chsh'
54
+ ;
55
+
56
+ this.regexList = [
57
+ { regex: /^#!.*$/gm, css: 'preprocessor bold' },
58
+ { regex: /\/[\w-\/]+/gm, css: 'plain' },
59
+ { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
60
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
61
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
62
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
63
+ { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' }, // commands
64
+ { regex: new XRegExp("(?<full_tag>(&lt;|<){2}(?<tag>\\w+)) .*$(?<here_doc>[\\s\\S]*)(?<end_tag>^\\k<tag>$)",'gm'), func: hereDocProcess }
65
+ ];
66
+ }
67
+
68
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
69
+ Brush.aliases = ['bash', 'shell', 'sh'];
70
+
71
+ SyntaxHighlighter.brushes.Bash = Brush;
72
+
73
+ // CommonJS
74
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
75
+ })();
syntaxhighlighter3/scripts/shBrushCSharp.js CHANGED
@@ -1,65 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
-
22
- function Brush()
23
- {
24
- var keywords = 'abstract as async await base bool break byte case catch char checked class const ' +
25
- 'continue decimal default delegate do double else enum event explicit volatile ' +
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 var ' +
31
- 'from group by into select let where orderby join on equals ascending descending';
32
-
33
- function fixComments(match, regexInfo)
34
- {
35
- var css = (match[0].indexOf("///") == 0)
36
- ? 'color1'
37
- : 'comments'
38
- ;
39
-
40
- return [new SyntaxHighlighter.Match(match[0], match.index, css)];
41
- }
42
-
43
- this.regexList = [
44
- { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
45
- { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
46
- { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
47
- { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
48
- { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
49
- { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
50
- { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
51
- { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
52
- { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
53
- ];
54
-
55
- this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
56
- };
57
-
58
- Brush.prototype = new SyntaxHighlighter.Highlighter();
59
- Brush.aliases = ['c#', 'c-sharp', 'csharp'];
60
-
61
- SyntaxHighlighter.brushes.CSharp = Brush;
62
-
63
- // CommonJS
64
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
+
22
+ function Brush()
23
+ {
24
+ var keywords = 'abstract as async await base bool break byte case catch char checked class const ' +
25
+ 'continue decimal default delegate do double else enum event explicit volatile ' +
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 var ' +
31
+ 'from group by into select let where orderby join on equals ascending descending';
32
+
33
+ function fixComments(match, regexInfo)
34
+ {
35
+ var css = (match[0].indexOf("///") == 0)
36
+ ? 'color1'
37
+ : 'comments'
38
+ ;
39
+
40
+ return [new SyntaxHighlighter.Match(match[0], match.index, css)];
41
+ }
42
+
43
+ this.regexList = [
44
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
45
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
46
+ { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
47
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
48
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
49
+ { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
50
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
51
+ { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
52
+ { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
53
+ ];
54
+
55
+ this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
56
+ };
57
+
58
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
59
+ Brush.aliases = ['c#', 'c-sharp', 'csharp'];
60
+
61
+ SyntaxHighlighter.brushes.CSharp = Brush;
62
+
63
+ // CommonJS
64
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
65
+ })();
syntaxhighlighter3/scripts/shBrushColdFusion.js CHANGED
@@ -1,100 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushCpp.js CHANGED
@@ -1,97 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 char16_t char32_t 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 = 'alignas alignof auto break case catch class const constexpr decltype __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 noexcept nullptr ' +
56
- 'ref register reinterpret_cast return selectany ' +
57
- 'sizeof static static_cast static_assert struct switch template this ' +
58
- 'thread thread_local 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', 'cc', 'c++', 'c', 'h', 'hpp', 'h++'];
92
-
93
- SyntaxHighlighter.brushes.Cpp = Brush;
94
-
95
- // CommonJS
96
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 char16_t char32_t 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 = 'alignas alignof auto break case catch class const constexpr decltype __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 noexcept nullptr ' +
56
+ 'ref register reinterpret_cast return selectany ' +
57
+ 'sizeof static static_cast static_assert struct switch template this ' +
58
+ 'thread thread_local 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', 'cc', 'c++', 'c', 'h', 'hpp', 'h++'];
92
+
93
+ SyntaxHighlighter.brushes.Cpp = Brush;
94
+
95
+ // CommonJS
96
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
97
+ })();
syntaxhighlighter3/scripts/shBrushCss.js CHANGED
@@ -1,91 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushDelphi.js CHANGED
@@ -1,55 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushDiff.js CHANGED
@@ -1,41 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
-
22
- function Brush()
23
- {
24
- this.regexList = [
25
- { regex: /^\+\+\+ .*$/gm, css: 'color2' }, // new file
26
- { regex: /^\-\-\- .*$/gm, css: 'color2' }, // old file
27
- { regex: /^\s.*$/gm, css: 'color1' }, // unchanged
28
- { regex: /^@@.*@@.*$/gm, css: 'variable' }, // location
29
- { regex: /^\+.*$/gm, css: 'string' }, // additions
30
- { regex: /^\-.*$/gm, css: 'color3' } // deletions
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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
+
22
+ function Brush()
23
+ {
24
+ this.regexList = [
25
+ { regex: /^\+\+\+ .*$/gm, css: 'color2' }, // new file
26
+ { regex: /^\-\-\- .*$/gm, css: 'color2' }, // old file
27
+ { regex: /^\s.*$/gm, css: 'color1' }, // unchanged
28
+ { regex: /^@@.*@@.*$/gm, css: 'variable' }, // location
29
+ { regex: /^\+.*$/gm, css: 'string' }, // additions
30
+ { regex: /^\-.*$/gm, css: 'color3' } // deletions
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
+ })();
syntaxhighlighter3/scripts/shBrushErlang.js CHANGED
@@ -1,52 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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.Erlang = Brush;
49
-
50
- // CommonJS
51
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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.Erlang = Brush;
49
+
50
+ // CommonJS
51
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
52
+ })();
syntaxhighlighter3/scripts/shBrushGroovy.js CHANGED
@@ -1,67 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushJScript.js CHANGED
@@ -1,52 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
-
22
- function Brush()
23
- {
24
- var keywords = 'break case catch class continue ' +
25
- 'default delete do else enum export extends false ' +
26
- 'for function if implements import in instanceof ' +
27
- 'interface let new null package private protected ' +
28
- 'static return super switch ' +
29
- 'this throw true try typeof var while with yield';
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', 'json'];
47
-
48
- SyntaxHighlighter.brushes.JScript = Brush;
49
-
50
- // CommonJS
51
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
+
22
+ function Brush()
23
+ {
24
+ var keywords = 'break case catch class continue ' +
25
+ 'default delete do else enum export extends false ' +
26
+ 'for function if implements import in instanceof ' +
27
+ 'interface let new null package private protected ' +
28
+ 'static return super switch ' +
29
+ 'this throw true try typeof var while with yield';
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', 'json'];
47
+
48
+ SyntaxHighlighter.brushes.JScript = Brush;
49
+
50
+ // CommonJS
51
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
52
+ })();
syntaxhighlighter3/scripts/shBrushJava.js CHANGED
@@ -1,57 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushJavaFX.js CHANGED
@@ -1,58 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushPerl.js CHANGED
@@ -1,96 +1,96 @@
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- // feature
47
- 'say';
48
-
49
- var keywords =
50
- 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
51
- 'for foreach goto if import last local my next no our package redo ref ' +
52
- 'require return sub tie tied unless untie until use wantarray while ' +
53
- // feature
54
- 'given when default ' +
55
- // Try::Tiny
56
- 'try catch finally ' +
57
- // Moose
58
- 'has extends with before after around override augment';
59
-
60
- this.regexList = [
61
- { regex: /(<<|&lt;&lt;)((\w+)|(['"])(.+?)\4)[\s\S]+?\n\3\5\n/g, css: 'string' }, // here doc (maybe html encoded)
62
- { regex: /#.*$/gm, css: 'comments' },
63
- { regex: /^#!.*\n/g, css: 'preprocessor' }, // shebang
64
- { regex: /-?\w+(?=\s*=(>|&gt;))/g, css: 'string' }, // fat comma
65
-
66
- // is this too much?
67
- { regex: /\bq[qwxr]?\([\s\S]*?\)/g, css: 'string' }, // quote-like operators ()
68
- { regex: /\bq[qwxr]?\{[\s\S]*?\}/g, css: 'string' }, // quote-like operators {}
69
- { regex: /\bq[qwxr]?\[[\s\S]*?\]/g, css: 'string' }, // quote-like operators []
70
- { regex: /\bq[qwxr]?(<|&lt;)[\s\S]*?(>|&gt;)/g, css: 'string' }, // quote-like operators <>
71
- { regex: /\bq[qwxr]?([^\w({<[])[\s\S]*?\1/g, css: 'string' }, // quote-like operators non-paired
72
-
73
- { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
74
- { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
75
- // currently ignoring single quote package separator and utf8 names
76
- { regex: /(?:&amp;|[$@%*]|\$#)\$?[a-zA-Z_](\w+|::)*/g, css: 'variable' },
77
- { regex: /\b__(?:END|DATA)__\b[\s\S]*$/g, css: 'comments' },
78
-
79
- // don't capture the newline after =cut so that =cut\n\n=head1 will start a new pod section
80
- { regex: /(^|\n)=\w[\s\S]*?(\n=cut\s*(?=\n)|$)/g, css: 'comments' }, // pod
81
-
82
- { regex: new RegExp(this.getKeywords(funcs), 'gm'), css: 'functions' },
83
- { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
84
- ];
85
-
86
- this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
87
- }
88
-
89
- Brush.prototype = new SyntaxHighlighter.Highlighter();
90
- Brush.aliases = ['perl', 'Perl', 'pl'];
91
-
92
- SyntaxHighlighter.brushes.Perl = Brush;
93
-
94
- // CommonJS
95
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
96
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ // feature
47
+ 'say';
48
+
49
+ var keywords =
50
+ 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
51
+ 'for foreach goto if import last local my next no our package redo ref ' +
52
+ 'require return sub tie tied unless untie until use wantarray while ' +
53
+ // feature
54
+ 'given when default ' +
55
+ // Try::Tiny
56
+ 'try catch finally ' +
57
+ // Moose
58
+ 'has extends with before after around override augment';
59
+
60
+ this.regexList = [
61
+ { regex: /(<<|&lt;&lt;)((\w+)|(['"])(.+?)\4)[\s\S]+?\n\3\5\n/g, css: 'string' }, // here doc (maybe html encoded)
62
+ { regex: /#.*$/gm, css: 'comments' },
63
+ { regex: /^#!.*\n/g, css: 'preprocessor' }, // shebang
64
+ { regex: /-?\w+(?=\s*=(>|&gt;))/g, css: 'string' }, // fat comma
65
+
66
+ // is this too much?
67
+ { regex: /\bq[qwxr]?\([\s\S]*?\)/g, css: 'string' }, // quote-like operators ()
68
+ { regex: /\bq[qwxr]?\{[\s\S]*?\}/g, css: 'string' }, // quote-like operators {}
69
+ { regex: /\bq[qwxr]?\[[\s\S]*?\]/g, css: 'string' }, // quote-like operators []
70
+ { regex: /\bq[qwxr]?(<|&lt;)[\s\S]*?(>|&gt;)/g, css: 'string' }, // quote-like operators <>
71
+ { regex: /\bq[qwxr]?([^\w({<[])[\s\S]*?\1/g, css: 'string' }, // quote-like operators non-paired
72
+
73
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
74
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
75
+ // currently ignoring single quote package separator and utf8 names
76
+ { regex: /(?:&amp;|[$@%*]|\$#)\$?[a-zA-Z_](\w+|::)*/g, css: 'variable' },
77
+ { regex: /\b__(?:END|DATA)__\b[\s\S]*$/g, css: 'comments' },
78
+
79
+ // don't capture the newline after =cut so that =cut\n\n=head1 will start a new pod section
80
+ { regex: /(^|\n)=\w[\s\S]*?(\n=cut\s*(?=\n)|$)/g, css: 'comments' }, // pod
81
+
82
+ { regex: new RegExp(this.getKeywords(funcs), 'gm'), css: 'functions' },
83
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
84
+ ];
85
+
86
+ this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
87
+ }
88
+
89
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
90
+ Brush.aliases = ['perl', 'Perl', 'pl'];
91
+
92
+ SyntaxHighlighter.brushes.Perl = Brush;
93
+
94
+ // CommonJS
95
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
96
+ })();
syntaxhighlighter3/scripts/shBrushPhp.js CHANGED
@@ -1,88 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 finally for foreach ' +
61
- 'function global goto if implements include include_once interface instanceof insteadof namespace new ' +
62
- 'old_function or private protected public return require require_once static switch ' +
63
- 'trait throw try use var while xor yield ';
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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 finally for foreach ' +
61
+ 'function global goto if implements include include_once interface instanceof insteadof namespace new ' +
62
+ 'old_function or private protected public return require require_once static switch ' +
63
+ 'trait throw try use var while xor yield ';
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
+ })();
syntaxhighlighter3/scripts/shBrushPlain.js CHANGED
@@ -1,33 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushPowerShell.js CHANGED
@@ -1,75 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
-
22
- function Brush()
23
- {
24
- // Contributed by Joel 'Jaykul' Bennett, http://PoshCode.org | http://HuddledMasses.org
25
- var keywords = 'while validateset validaterange validatepattern validatelength validatecount ' +
26
- 'until trap switch return ref process param parameter in if global: '+
27
- 'function foreach for finally filter end elseif else dynamicparam do default ' +
28
- 'continue cmdletbinding break begin alias \\? % #script #private #local #global '+
29
- 'mandatory parametersetname position valuefrompipeline ' +
30
- 'valuefrompipelinebypropertyname valuefromremainingarguments helpmessage ';
31
-
32
- var operators = ' and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' +
33
- 'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' +
34
- 'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' +
35
- 'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' +
36
- 'lt match ne not notcontains notlike notmatch or regex replace wildcard';
37
-
38
- var verbs = 'write where wait use update unregister undo trace test tee take suspend ' +
39
- 'stop start split sort skip show set send select scroll resume restore ' +
40
- 'restart resolve resize reset rename remove register receive read push ' +
41
- 'pop ping out new move measure limit join invoke import group get format ' +
42
- 'foreach export expand exit enter enable disconnect disable debug cxnew ' +
43
- 'copy convertto convertfrom convert connect complete compare clear ' +
44
- 'checkpoint aggregate add';
45
-
46
- // I can't find a way to match the comment based help in multi-line comments, because SH won't highlight in highlights, and javascript doesn't support lookbehind
47
- var commenthelp = ' component description example externalhelp forwardhelpcategory forwardhelptargetname forwardhelptargetname functionality inputs link notes outputs parameter remotehelprunspace role synopsis';
48
-
49
- this.regexList = [
50
- { regex: new RegExp('^\\s*#[#\\s]*\\.('+this.getKeywords(commenthelp)+').*$', 'gim'), css: 'preprocessor help bold' }, // comment-based help
51
- { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
52
- { regex: /(&lt;|<)#[\s\S]*?#(&gt;|>)/gm, css: 'comments here' }, // multi-line comments
53
-
54
- { regex: new RegExp('@"\\n[\\s\\S]*?\\n"@', 'gm'), css: 'script string here' }, // double quoted here-strings
55
- { regex: new RegExp("@'\\n[\\s\\S]*?\\n'@", 'gm'), css: 'script string single here' }, // single quoted here-strings
56
- { regex: new RegExp('"(?:\\$\\([^\\)]*\\)|[^"]|`"|"")*[^`]"','g'), css: 'string' }, // double quoted strings
57
- { regex: new RegExp("'(?:[^']|'')*'", 'g'), css: 'string single' }, // single quoted strings
58
-
59
- { regex: new RegExp('[\\$|@|@@](?:(?:global|script|private|env):)?[A-Z0-9_]+', 'gi'), css: 'variable' }, // $variables
60
- { regex: new RegExp('(?:\\b'+verbs.replace(/ /g, '\\b|\\b')+')-[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'functions' }, // functions and cmdlets
61
- { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, // keywords
62
- { regex: new RegExp('-'+this.getKeywords(operators), 'gmi'), css: 'operator value' }, // operators
63
- { regex: new RegExp('\\[[A-Z_\\[][A-Z0-9_. `,\\[\\]]*\\]', 'gi'), css: 'constants' }, // .Net [Type]s
64
- { regex: new RegExp('\\s+-(?!'+this.getKeywords(operators)+')[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'color1' }, // parameters
65
- ];
66
- };
67
-
68
- Brush.prototype = new SyntaxHighlighter.Highlighter();
69
- Brush.aliases = ['powershell', 'ps', 'posh'];
70
-
71
- SyntaxHighlighter.brushes.PowerShell = Brush;
72
-
73
- // CommonJS
74
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null);
21
+
22
+ function Brush()
23
+ {
24
+ // Contributed by Joel 'Jaykul' Bennett, http://PoshCode.org | http://HuddledMasses.org
25
+ var keywords = 'while validateset validaterange validatepattern validatelength validatecount ' +
26
+ 'until trap switch return ref process param parameter in if global: '+
27
+ 'function foreach for finally filter end elseif else dynamicparam do default ' +
28
+ 'continue cmdletbinding break begin alias \\? % #script #private #local #global '+
29
+ 'mandatory parametersetname position valuefrompipeline ' +
30
+ 'valuefrompipelinebypropertyname valuefromremainingarguments helpmessage ';
31
+
32
+ var operators = ' and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle ' +
33
+ 'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains ' +
34
+ 'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt ' +
35
+ 'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like ' +
36
+ 'lt match ne not notcontains notlike notmatch or regex replace wildcard';
37
+
38
+ var verbs = 'write where wait use update unregister undo trace test tee take suspend ' +
39
+ 'stop start split sort skip show set send select scroll resume restore ' +
40
+ 'restart resolve resize reset rename remove register receive read push ' +
41
+ 'pop ping out new move measure limit join invoke import group get format ' +
42
+ 'foreach export expand exit enter enable disconnect disable debug cxnew ' +
43
+ 'copy convertto convertfrom convert connect complete compare clear ' +
44
+ 'checkpoint aggregate add';
45
+
46
+ // I can't find a way to match the comment based help in multi-line comments, because SH won't highlight in highlights, and javascript doesn't support lookbehind
47
+ var commenthelp = ' component description example externalhelp forwardhelpcategory forwardhelptargetname forwardhelptargetname functionality inputs link notes outputs parameter remotehelprunspace role synopsis';
48
+
49
+ this.regexList = [
50
+ { regex: new RegExp('^\\s*#[#\\s]*\\.('+this.getKeywords(commenthelp)+').*$', 'gim'), css: 'preprocessor help bold' }, // comment-based help
51
+ { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
52
+ { regex: /(&lt;|<)#[\s\S]*?#(&gt;|>)/gm, css: 'comments here' }, // multi-line comments
53
+
54
+ { regex: new RegExp('@"\\n[\\s\\S]*?\\n"@', 'gm'), css: 'script string here' }, // double quoted here-strings
55
+ { regex: new RegExp("@'\\n[\\s\\S]*?\\n'@", 'gm'), css: 'script string single here' }, // single quoted here-strings
56
+ { regex: new RegExp('"(?:\\$\\([^\\)]*\\)|[^"]|`"|"")*[^`]"','g'), css: 'string' }, // double quoted strings
57
+ { regex: new RegExp("'(?:[^']|'')*'", 'g'), css: 'string single' }, // single quoted strings
58
+
59
+ { regex: new RegExp('[\\$|@|@@](?:(?:global|script|private|env):)?[A-Z0-9_]+', 'gi'), css: 'variable' }, // $variables
60
+ { regex: new RegExp('(?:\\b'+verbs.replace(/ /g, '\\b|\\b')+')-[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'functions' }, // functions and cmdlets
61
+ { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, // keywords
62
+ { regex: new RegExp('-'+this.getKeywords(operators), 'gmi'), css: 'operator value' }, // operators
63
+ { regex: new RegExp('\\[[A-Z_\\[][A-Z0-9_. `,\\[\\]]*\\]', 'gi'), css: 'constants' }, // .Net [Type]s
64
+ { regex: new RegExp('\\s+-(?!'+this.getKeywords(operators)+')[a-zA-Z_][a-zA-Z0-9_]*', 'gmi'), css: 'color1' }, // parameters
65
+ ];
66
+ };
67
+
68
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
69
+ Brush.aliases = ['powershell', 'ps', 'posh'];
70
+
71
+ SyntaxHighlighter.brushes.PowerShell = Brush;
72
+
73
+ // CommonJS
74
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
75
+ })();
syntaxhighlighter3/scripts/shBrushPython.js CHANGED
@@ -1,64 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 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
+ })();
syntaxhighlighter3/scripts/shBrushRuby.js CHANGED
@@ -1,55 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushSass.js CHANGED
@@ -1,99 +1,99 @@
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- function getKeywordsPrependedBy(keywords, by)
35
- {
36
- return '(?:' + keywords.replace(/^\s+|\s+$/g, '').replace(/\s+/g, '|' + by + '\\b').replace(/^/, by + '\\b') + ')\\b';
37
- }
38
-
39
- var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
40
- 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
41
- 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
42
- 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
43
- 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
44
- 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
45
- 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
46
- 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
47
- 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
48
- 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
49
- 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
50
- 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
51
- 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
52
- 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index zoom';
53
-
54
- var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
55
- 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
56
- 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+
57
- 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
58
- 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
59
- 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
60
- 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
61
- 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
62
- 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
63
- 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
64
- 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
65
- 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
66
- 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
67
- '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';
68
-
69
- var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
70
-
71
- var statements = 'important default';
72
- var preprocessor = 'import extend debug warn if else for while mixin function include content media';
73
-
74
- var r = SyntaxHighlighter.regexLib;
75
-
76
- this.regexList = [
77
- { regex: r.multiLineCComments, css: 'comments' }, // multiline comments
78
- { regex: r.singleLineCComments, css: 'comments' }, // singleline comments
79
- { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings
80
- { regex: r.singleQuotedString, css: 'string' }, // single quoted strings
81
- { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
82
- { regex: /\b(-?\d+)(\.\d+)?(px|em|rem|pt|\:|\%|)\b/g, css: 'value' }, // sizes
83
- { regex: /\$[\w-]+/g, css: 'variable' }, // variables
84
- { regex: new RegExp(getKeywordsPrependedBy(statements, '!'), 'g'), css: 'color3' }, // statements
85
- { regex: new RegExp(getKeywordsPrependedBy(preprocessor, '@'), 'g'), css: 'preprocessor' }, // preprocessor
86
- { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
87
- { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
88
- { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
89
- ];
90
- };
91
-
92
- Brush.prototype = new SyntaxHighlighter.Highlighter();
93
- Brush.aliases = ['sass', 'scss'];
94
-
95
- SyntaxHighlighter.brushes.Sass = Brush;
96
-
97
- // CommonJS
98
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
99
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ function getKeywordsPrependedBy(keywords, by)
35
+ {
36
+ return '(?:' + keywords.replace(/^\s+|\s+$/g, '').replace(/\s+/g, '|' + by + '\\b').replace(/^/, by + '\\b') + ')\\b';
37
+ }
38
+
39
+ var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
40
+ 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
41
+ 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
42
+ 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
43
+ 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
44
+ 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
45
+ 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
46
+ 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
47
+ 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
48
+ 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
49
+ 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
50
+ 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
51
+ 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
52
+ 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index zoom';
53
+
54
+ var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
55
+ 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
56
+ 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+
57
+ 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
58
+ 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
59
+ 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
60
+ 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
61
+ 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
62
+ 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
63
+ 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
64
+ 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
65
+ 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
66
+ 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
67
+ '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';
68
+
69
+ var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
70
+
71
+ var statements = 'important default';
72
+ var preprocessor = 'import extend debug warn if else for while mixin function include content media';
73
+
74
+ var r = SyntaxHighlighter.regexLib;
75
+
76
+ this.regexList = [
77
+ { regex: r.multiLineCComments, css: 'comments' }, // multiline comments
78
+ { regex: r.singleLineCComments, css: 'comments' }, // singleline comments
79
+ { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings
80
+ { regex: r.singleQuotedString, css: 'string' }, // single quoted strings
81
+ { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
82
+ { regex: /\b(-?\d+)(\.\d+)?(px|em|rem|pt|\:|\%|)\b/g, css: 'value' }, // sizes
83
+ { regex: /\$[\w-]+/g, css: 'variable' }, // variables
84
+ { regex: new RegExp(getKeywordsPrependedBy(statements, '!'), 'g'), css: 'color3' }, // statements
85
+ { regex: new RegExp(getKeywordsPrependedBy(preprocessor, '@'), 'g'), css: 'preprocessor' }, // preprocessor
86
+ { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
87
+ { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
88
+ { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
89
+ ];
90
+ };
91
+
92
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
93
+ Brush.aliases = ['sass', 'scss'];
94
+
95
+ SyntaxHighlighter.brushes.Sass = Brush;
96
+
97
+ // CommonJS
98
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
99
+ })();
syntaxhighlighter3/scripts/shBrushScala.js CHANGED
@@ -1,51 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushSql.js CHANGED
@@ -1,67 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 comments
50
- { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multi line comments
51
- { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
52
- { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
53
- { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
54
- { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
55
- { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
56
- ];
57
- };
58
-
59
- Brush.prototype = new SyntaxHighlighter.Highlighter();
60
- Brush.aliases = ['sql'];
61
-
62
- SyntaxHighlighter.brushes.Sql = Brush;
63
-
64
- // CommonJS
65
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
66
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 comments
50
+ { regex: /\/\*([^\*][\s\S]*?)?\*\//gm, css: 'comments' }, // multi line comments
51
+ { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
52
+ { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
53
+ { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
54
+ { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
55
+ { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
56
+ ];
57
+ };
58
+
59
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
60
+ Brush.aliases = ['sql'];
61
+
62
+ SyntaxHighlighter.brushes.Sql = Brush;
63
+
64
+ // CommonJS
65
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
66
+ })();
67
+
syntaxhighlighter3/scripts/shBrushVb.js CHANGED
@@ -1,56 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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
+ })();
syntaxhighlighter3/scripts/shBrushXml.js CHANGED
@@ -1,71 +1,71 @@
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- ;(function()
18
- {
19
- // CommonJS
20
- SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 = XRegExp.exec(code, XRegExp('(&lt;|<)[\\s\\/\\?!]*(?<name>[:\\w-\\.]+)', 'xg')),
29
- result = []
30
- ;
31
-
32
- if (match.attributes != null)
33
- {
34
- var attributes,
35
- pos = 0,
36
- regex = XRegExp('(?<name> [\\w:.-]+)' +
37
- '\\s*=\\s*' +
38
- '(?<value> ".*?"|\'.*?\'|\\w+)',
39
- 'xg');
40
-
41
- while ((attributes = XRegExp.exec(code, regex, pos)) != null)
42
- {
43
- result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
44
- result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
45
- pos = attributes.index + attributes[0].length;
46
- }
47
- }
48
-
49
- if (tag != null)
50
- result.push(
51
- new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
52
- );
53
-
54
- return result;
55
- }
56
-
57
- this.regexList = [
58
- { regex: XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
59
- { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
60
- { regex: XRegExp('(&lt;|<)[\\s\\/\\?!]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
61
- ];
62
- };
63
-
64
- Brush.prototype = new SyntaxHighlighter.Highlighter();
65
- Brush.aliases = ['xml', 'xhtml', 'xslt', 'html', 'plist'];
66
-
67
- SyntaxHighlighter.brushes.Xml = Brush;
68
-
69
- // CommonJS
70
- typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
71
- })();
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ ;(function()
18
+ {
19
+ // CommonJS
20
+ SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? 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 = XRegExp.exec(code, XRegExp('(&lt;|<)[\\s\\/\\?!]*(?<name>[:\\w-\\.]+)', 'xg')),
29
+ result = []
30
+ ;
31
+
32
+ if (match.attributes != null)
33
+ {
34
+ var attributes,
35
+ pos = 0,
36
+ regex = XRegExp('(?<name> [\\w:.-]+)' +
37
+ '\\s*=\\s*' +
38
+ '(?<value> ".*?"|\'.*?\'|\\w+)',
39
+ 'xg');
40
+
41
+ while ((attributes = XRegExp.exec(code, regex, pos)) != null)
42
+ {
43
+ result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
44
+ result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
45
+ pos = attributes.index + attributes[0].length;
46
+ }
47
+ }
48
+
49
+ if (tag != null)
50
+ result.push(
51
+ new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
52
+ );
53
+
54
+ return result;
55
+ }
56
+
57
+ this.regexList = [
58
+ { regex: XRegExp('(\\&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\&gt;|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
59
+ { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // <!-- ... -->
60
+ { regex: XRegExp('(&lt;|<)[\\s\\/\\?!]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(&gt;|>)', 'sg'), func: process }
61
+ ];
62
+ };
63
+
64
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
65
+ Brush.aliases = ['xml', 'xhtml', 'xslt', 'html', 'plist'];
66
+
67
+ SyntaxHighlighter.brushes.Xml = Brush;
68
+
69
+ // CommonJS
70
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
71
+ })();
syntaxhighlighter3/scripts/shCore.js CHANGED
@@ -1,17 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
  var XRegExp;if(XRegExp=XRegExp||function(e){"use strict";function t(e,t,n){var r;for(r in c.prototype)c.prototype.hasOwnProperty(r)&&(e[r]=c.prototype[r]);return e.xregexp={captureNames:t,isNative:!!n},e}function n(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function r(e,r,i){if(!c.isRegExp(e))throw new TypeError("type RegExp expected");var a=p.replace.call(n(e)+(r||""),E,"");return i&&(a=p.replace.call(a,RegExp("["+i+"]+","g"),"")),e=e.xregexp&&!e.xregexp.isNative?t(c(e.source,a),e.xregexp.captureNames?e.xregexp.captureNames.slice(0):null):t(RegExp(e.source,a),null,!0)}function i(e,t){var n=e.length;if(Array.prototype.lastIndexOf)return e.lastIndexOf(t);for(;n--;)if(e[n]===t)return n;return-1}function a(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]"}function l(e){return e=e||{},"all"===e||e.all?e={natives:!0,extensibility:!0}:a(e,"string")&&(e=c.forEach(e,/[^\s,]+/,function(e){this[e]=!0},{})),e}function s(e,t,n,r){var i,a,l=m.length,s=null;R=!0;try{for(;l--;)if(a=m[l],!("all"!==a.scope&&a.scope!==n||a.trigger&&!a.trigger.call(r))&&(a.pattern.lastIndex=t,i=d.exec.call(a.pattern,e),i&&i.index===t)){s={output:a.handler.call(r,i,n),match:i};break}}catch(o){throw o}finally{R=!1}return s}function o(e){c.addToken=g[e?"on":"off"],f.extensibility=e}function u(e){RegExp.prototype.exec=(e?d:p).exec,RegExp.prototype.test=(e?d:p).test,String.prototype.match=(e?d:p).match,String.prototype.replace=(e?d:p).replace,String.prototype.split=(e?d:p).split,f.natives=e}var c,g,h,f={natives:!1,extensibility:!1},p={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},d={},x={},m=[],v="default",b="class",y={"default":/^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/,"class":/^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/},w=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,E=/([\s\S])(?=[\s\S]*\1)/g,N=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,S=p.exec.call(/()??/,"")[1]===e,H=RegExp.prototype.sticky!==e,R=!1,T="gim"+(H?"y":"");return c=function(n,i){if(c.isRegExp(n)){if(i!==e)throw new TypeError("can't supply flags when constructing one RegExp from another");return r(n)}if(R)throw Error("can't call the XRegExp constructor within token definition functions");var a,l,o,u=[],g=v,h={hasNamedCapture:!1,captureNames:[],hasFlag:function(e){return i.indexOf(e)>-1}},f=0;if(n=n===e?"":n+"",i=i===e?"":i+"",p.match.call(i,E))throw new SyntaxError("invalid duplicate regular expression flag");for(n=p.replace.call(n,/^\(\?([\w$]+)\)/,function(e,t){if(p.test.call(/[gy]/,t))throw new SyntaxError("can't use flag g or y in mode modifier");return i=p.replace.call(i+t,E,""),""}),c.forEach(i,/[\s\S]/,function(e){if(0>T.indexOf(e[0]))throw new SyntaxError("invalid regular expression flag "+e[0])});n.length>f;)a=s(n,f,g,h),a?(u.push(a.output),f+=a.match[0].length||1):(l=p.exec.call(y[g],n.slice(f)),l?(u.push(l[0]),f+=l[0].length):(o=n.charAt(f),"["===o?g=b:"]"===o&&(g=v),u.push(o),++f));return t(RegExp(u.join(""),p.replace.call(i,/[^gimy]+/g,"")),h.hasNamedCapture?h.captureNames:null)},g={on:function(e,t,n){n=n||{},e&&m.push({pattern:r(e,"g"+(H?"y":"")),handler:t,scope:n.scope||v,trigger:n.trigger||null}),n.customFlags&&(T=p.replace.call(T+n.customFlags,E,""))},off:function(){throw Error("extensibility must be installed before using addToken")}},c.addToken=g.off,c.cache=function(e,t){var n=e+"/"+(t||"");return x[n]||(x[n]=c(e,t))},c.escape=function(e){return p.replace.call(e,/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},c.exec=function(e,t,n,i){var a,l=r(t,"g"+(i&&H?"y":""),i===!1?"y":"");return l.lastIndex=n=n||0,a=d.exec.call(l,e),i&&a&&a.index!==n&&(a=null),t.global&&(t.lastIndex=a?l.lastIndex:0),a},c.forEach=function(e,t,n,r){for(var i,a=0,l=-1;i=c.exec(e,t,a);)n.call(r,i,++l,e,t),a=i.index+(i[0].length||1);return r},c.globalize=function(e){return r(e,"g")},c.install=function(e){e=l(e),!f.natives&&e.natives&&u(!0),!f.extensibility&&e.extensibility&&o(!0)},c.isInstalled=function(e){return!!f[e]},c.isRegExp=function(e){return a(e,"regexp")},c.matchChain=function(e,t){return function n(e,r){var i,a=t[r].regex?t[r]:{regex:t[r]},l=[],s=function(e){l.push(a.backref?e[a.backref]||"":e[0])};for(i=0;e.length>i;++i)c.forEach(e[i],a.regex,s);return r!==t.length-1&&l.length?n(l,r+1):l}([e],0)},c.replace=function(t,n,i,a){var l,s=c.isRegExp(n),o=n;return s?(a===e&&n.global&&(a="all"),o=r(n,"all"===a?"g":"","all"===a?"":"g")):"all"===a&&(o=RegExp(c.escape(n+""),"g")),l=d.replace.call(t+"",o,i),s&&n.global&&(n.lastIndex=0),l},c.split=function(e,t,n){return d.split.call(e,t,n)},c.test=function(e,t,n,r){return!!c.exec(e,t,n,r)},c.uninstall=function(e){e=l(e),f.natives&&e.natives&&u(!1),f.extensibility&&e.extensibility&&o(!1)},c.union=function(e,t){var n,r,i,l,s=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,o=0,u=function(e,t,i){var a=r[o-n];if(t){if(++o,a)return"(?<"+a+">"}else if(i)return"\\"+(+i+n);return e},g=[];if(!a(e,"array")||!e.length)throw new TypeError("patterns must be a nonempty array");for(l=0;e.length>l;++l)i=e[l],c.isRegExp(i)?(n=o,r=i.xregexp&&i.xregexp.captureNames||[],g.push(c(i.source).source.replace(s,u))):g.push(c.escape(i));return c(g.join("|"),t)},c.version="2.0.0",d.exec=function(t){var r,a,l,s,o;if(this.global||(s=this.lastIndex),r=p.exec.apply(this,arguments)){if(!S&&r.length>1&&i(r,"")>-1&&(l=RegExp(this.source,p.replace.call(n(this),"g","")),p.replace.call((t+"").slice(r.index),l,function(){var t;for(t=1;arguments.length-2>t;++t)arguments[t]===e&&(r[t]=e)})),this.xregexp&&this.xregexp.captureNames)for(o=1;r.length>o;++o)a=this.xregexp.captureNames[o-1],a&&(r[a]=r[o]);this.global&&!r[0].length&&this.lastIndex>r.index&&(this.lastIndex=r.index)}return this.global||(this.lastIndex=s),r},d.test=function(e){return!!d.exec.call(this,e)},d.match=function(e){if(c.isRegExp(e)){if(e.global){var t=p.match.apply(this,arguments);return e.lastIndex=0,t}}else e=RegExp(e);return d.exec.call(e,this)},d.replace=function(e,t){var n,r,l,s,o=c.isRegExp(e);return o?(e.xregexp&&(n=e.xregexp.captureNames),e.global||(s=e.lastIndex)):e+="",a(t,"function")?r=p.replace.call(this+"",e,function(){var r,i=arguments;if(n)for(i[0]=new String(i[0]),r=0;n.length>r;++r)n[r]&&(i[0][n[r]]=i[r+1]);return o&&e.global&&(e.lastIndex=i[i.length-2]+i[0].length),t.apply(null,i)}):(l=this+"",r=p.replace.call(l,e,function(){var e=arguments;return p.replace.call(t+"",w,function(t,r,a){var l;if(r){if(l=+r,e.length-3>=l)return e[l]||"";if(l=n?i(n,r):-1,0>l)throw new SyntaxError("backreference to undefined group "+t);return e[l+1]||""}if("$"===a)return"$";if("&"===a||0===+a)return e[0];if("`"===a)return e[e.length-1].slice(0,e[e.length-2]);if("'"===a)return e[e.length-1].slice(e[e.length-2]+e[0].length);if(a=+a,!isNaN(a)){if(a>e.length-3)throw new SyntaxError("backreference to undefined group "+t);return e[a]||""}throw new SyntaxError("invalid token "+t)})})),o&&(e.lastIndex=e.global?0:s),r},d.split=function(t,n){if(!c.isRegExp(t))return p.split.apply(this,arguments);var r,i=this+"",a=t.lastIndex,l=[],s=0;return n=(n===e?-1:n)>>>0,c.forEach(i,t,function(e){e.index+e[0].length>s&&(l.push(i.slice(s,e.index)),e.length>1&&e.index<i.length&&Array.prototype.push.apply(l,e.slice(1)),r=e[0].length,s=e.index+r)}),s===i.length?(!p.test.call(t,"")||r)&&l.push(""):l.push(i.slice(s)),t.lastIndex=a,l.length>n?l.slice(0,n):l},h=g.on,h(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(e,t){if("B"===e[1]&&t===v)return e[0];throw new SyntaxError("invalid escape "+e[0])},{scope:"all"}),h(/\[(\^?)]/,function(e){return e[1]?"[\\s\\S]":"\\b\\B"}),h(/(?:\(\?#[^)]*\))+/,function(e){return p.test.call(N,e.input.slice(e.index+e[0].length))?"":"(?:)"}),h(/\\k<([\w$]+)>/,function(e){var t=isNaN(e[1])?i(this.captureNames,e[1])+1:+e[1],n=e.index+e[0].length;if(!t||t>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+e[0]);return"\\"+t+(n===e.input.length||isNaN(e.input.charAt(n))?"":"(?:)")}),h(/(?:\s+|#.*)+/,function(e){return p.test.call(N,e.input.slice(e.index+e[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),h(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),h(/\(\?P?<([\w$]+)>/,function(e){if(!isNaN(e[1]))throw new SyntaxError("can't use integer as capture name "+e[0]);return this.captureNames.push(e[1]),this.hasNamedCapture=!0,"("}),h(/\\(\d+)/,function(e,t){if(!(t===v&&/^[1-9]/.test(e[1])&&+e[1]<=this.captureNames.length)&&"0"!==e[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+e[0]);return e[0]},{scope:"all"}),h(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),"undefined"!=typeof exports&&(exports.XRegExp=c),c}(),SyntaxHighlighter===void 0)var SyntaxHighlighter=function(){function e(e){return document.createElement("div").appendChild(document.createTextNode(e)).parentNode.innerHTML.replace(/"/g,"&quot;")}function t(e,t){return-1!=e.className.indexOf(t)}function n(e,n){t(e,n)||(e.className+=" "+n)}function r(e,t){e.className=e.className.replace(t,"")}function i(e){for(var t=[],n=0,r=e.length;r>n;n++)t.push(e[n]);return t}function a(e){return e.split(/\r?\n/)}function l(e){var t="highlighter_";return 0==e.indexOf(t)?e:t+e}function s(e){return B.vars.highlighters[l(e)]}function o(e){return document.getElementById(l(e))}function u(e){B.vars.highlighters[l(e.id)]=e}function c(e,t,n){if(null==e)return null;var r,i,a=1!=n?e.childNodes:[e.parentNode],l={"#":"id",".":"className"}[t.substr(0,1)]||"nodeName";if(r="nodeName"!=l?t.substr(1):t.toUpperCase(),-1!=(e[l]||"").indexOf(r))return e;for(var s=0,o=a.length;a&&o>s&&null==i;s++)i=c(a[s],t,n);return i}function g(e,t){return c(e,t,!0)}function h(e,t,n){n=Math.max(n||0,0);for(var r=n,i=e.length;i>r;r++)if(e[r]==t)return r;return-1}function f(e){return(e||"")+(""+Math.round(1e6*Math.random()))}function p(e,t){var n,r={};for(n in e)r[n]=e[n];for(n in t)r[n]=t[n];return r}function d(e){var t={"true":!0,"false":!1}[e];return null==t?e:t}function x(e,t,n,r,i){var a=(screen.width-n)/2,l=(screen.height-r)/2;i+=", left="+a+", top="+l+", width="+n+", height="+r,i=i.replace(/^,/,"");var s=window.open(e,t,i);return s.focus(),s}function m(e,t,n,r){function i(e){e=e||window.event,e.target||(e.target=e.srcElement,e.preventDefault=function(){this.returnValue=!1}),n.call(r||window,e)}e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i,!1)}function v(e){window.alert(B.config.strings.alert+e)}function b(e,t){var n=B.vars.discoveredBrushes,r=null;if(null==n){n={};for(var i in B.brushes){var a=B.brushes[i],l=a.aliases;if(null!=l){a.brushName=i.toLowerCase();for(var s=0,o=l.length;o>s;s++)n[l[s]]=i}}B.vars.discoveredBrushes=n}return r=B.brushes[n[e]],null==r&&t&&v(B.config.strings.noBrush+e),r}function y(e,t){for(var n=a(e),r=0,i=n.length;i>r;r++)n[r]=t(n[r],r);return n.join("\r\n")}function w(e){return e.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g,"")}function E(e){for(var t,n={},r=XRegExp("^\\[(?<values>(.*?))\\]$"),i=0,a=XRegExp("(?<name>[\\w-]+)\\s*:\\s*(?<value>[\\w%#-]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");null!=(t=XRegExp.exec(e,a,i));){var l=t.value.replace(/^['"]|['"]$/g,"");if(null!=l&&r.test(l)){var s=XRegExp.exec(l,r);l=s.values.length>0?s.values.split(/\s*,\s*/):[]}n[t.name]=l,i=t.index+t[0].length}return n}function N(e,t){return null==e||0==e.length||"\n"==e?e:(e=e.replace(/</g,"&lt;"),e=e.replace(/ {2,}/g,function(e){for(var t="",n=0,r=e.length;r-1>n;n++)t+=B.config.space;return t+" "}),null!=t&&(e=y(e,function(e){if(0==e.length)return"";var n="";return e=e.replace(/^(&nbsp;| )+/,function(e){return n=e,""}),0==e.length?n:n+'<code class="'+t+'">'+e+"</code>"})),e)}function S(e,t){for(var n=""+e;t>n.length;)n="0"+n;return n}function H(e,t){for(var n="",r=0;t>r;r++)n+=" ";return e.replace(/\t/g,n)}function R(e,t){function n(e,t,n){return e.substr(0,t)+i.substr(0,n)+e.substr(t+1,e.length)}for(var r=(a(e)," "),i="",l=0;50>l;l++)i+=" ";return e=y(e,function(e){if(-1==e.indexOf(r))return e;for(var i=0;-1!=(i=e.indexOf(r));){var a=t-i%t;e=n(e,i,a)}return e})}function T(e){var t=/<br\s*\/?>|&lt;br\s*\/?&gt;/gi;return 1==B.config.bloggerMode&&(e=e.replace(t,"\n")),1==B.config.stripBrs&&(e=e.replace(t,"")),e}function C(e){return e.replace(/^\s+|\s+$/g,"")}function P(e){for(var t=a(T(e)),n=/^\s*/,r=1e3,i=0,l=t.length;l>i&&r>0;i++){var s=t[i];if(0!=C(s).length){var o=n.exec(s);if(null==o)return e;r=Math.min(o[0].length,r)}}if(r>0)for(var i=0,l=t.length;l>i;i++)t[i]=t[i].substr(r);return t.join("\n")}function k(e,t){return e.index<t.index?-1:e.index>t.index?1:e.length<t.length?-1:e.length>t.length?1:0}function L(e,t){function n(e){return e[0]}var r=null,i=[],a=t.func?t.func:n;for(pos=0;null!=(r=XRegExp.exec(e,t.regex,pos));){var l=a(r,t);"string"==typeof l&&(l=[new B.Match(l,r.index,t.css)]),i=i.concat(l),pos=r.index+r[0].length}return i}function I(e){var t=/(.*)((&gt;|&lt;).*)/;return e.replace(B.regexLib.url,function(e){var n="",r=null;return(r=t.exec(e))&&(e=r[1],n=r[2]),'<a href="'+e+'">'+e+"</a>"+n})}function A(){for(var e=document.getElementsByTagName("script"),t=[],n=0,r=e.length;r>n;n++)"syntaxhighlighter"==e[n].type&&t.push(e[n]);return t}function M(e){var t="<![CDATA[",n="]]>",r=C(e),i=!1,a=t.length,l=n.length;0==r.indexOf(t)&&(r=r.substring(a),i=!0);var s=r.length;return r.indexOf(n)==s-l&&(r=r.substring(0,s-l),i=!0),i?r:e}function X(e){var t,i=e.target,a=g(i,".syntaxhighlighter"),l=g(i,".container"),o=document.createElement("textarea");if(l&&a&&!c(l,"textarea")){t=s(a.id),n(a,"source");for(var u=l.childNodes,h=[],f=0,p=u.length;p>f;f++)h.push(u[f].innerText||u[f].textContent);h=h.join("\r"),h=h.replace(/\u00a0/g," "),o.appendChild(document.createTextNode(h)),l.appendChild(o),o.focus(),o.select(),m(o,"blur",function(){o.parentNode.removeChild(o),r(a,"source")})}}"undefined"!=typeof require&&XRegExp===void 0&&(XRegExp=require("xregexp").XRegExp);var B={defaults:{"class-name":"","first-line":1,"pad-line-numbers":!1,highlight:null,title:null,"smart-tabs":!0,"tab-size":4,gutter:!0,toolbar:!0,"quick-code":!0,collapse:!1,"auto-links":!0,light:!1,unindent:!0,"html-script":!1},config:{space:"&nbsp;",useScriptTags:!0,bloggerMode:!1,stripBrs:!1,tagName:"pre",strings:{expandSource:"expand source",help:"?",alert:"SyntaxHighlighter\n\n",noBrush:"Can't find brush for: ",brushNotHtmlScript:"Brush wasn't configured for html-script option: ",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 (Wed, 16 Apr 2014 03:56:09 GMT)</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-2013 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>'}},vars:{discoveredBrushes:null,highlighters:{}},brushes:{},regexLib:{multiLineCComments:XRegExp("/\\*.*?\\*/","gs"),singleLineCComments:/\/\/.*$/gm,singleLinePerlComments:/#.*$/gm,doubleQuotedString:/"([^\\"\n]|\\.)*"/g,singleQuotedString:/'([^\\'\n]|\\.)*'/g,multiLineDoubleQuotedString:XRegExp('"([^\\\\"]|\\\\.)*"',"gs"),multiLineSingleQuotedString:XRegExp("'([^\\\\']|\\\\.)*'","gs"),xmlComments:XRegExp("(&lt;|<)!--.*?--(&gt;|>)","gs"),url:/\w+:\/\/[\w-.\/?%&=:@;#]*/g,phpScriptTags:{left:/(&lt;|<)\?(?:=|php)?/g,right:/\?(&gt;|>)/g,eof:!0},aspScriptTags:{left:/(&lt;|<)%=?/g,right:/%(&gt;|>)/g},scriptScriptTags:{left:/(&lt;|<)\s*script.*?(&gt;|>)/gi,right:/(&lt;|<)\/\s*script\s*(&gt;|>)/gi}},toolbar:{getHtml:function(e){function t(e,t){return B.toolbar.getButtonHtml(e,t,B.config.strings[t])}for(var n='<div class="toolbar">',r=B.toolbar.items,i=r.list,a=0,l=i.length;l>a;a++)n+=(r[i[a]].getHtml||t)(e,i[a]);return n+="</div>"},getButtonHtml:function(t,n,r){return n=e(n),'<span><a href="#" class="toolbar_item command_'+n+" "+n+'">'+e(r)+"</a></span>"},handler:function(e){function t(e){var t=RegExp(e+"_(\\w+)"),n=t.exec(r);return n?n[1]:null}var n=e.target,r=n.className||"",i=s(g(n,".syntaxhighlighter").id),a=t("command");i&&a&&B.toolbar.items[a].execute(i),e.preventDefault()},items:{list:["expandSource","help"],expandSource:{getHtml:function(e){if(1!=e.getParam("collapse"))return"";var t=e.getParam("title");return B.toolbar.getButtonHtml(e,"expandSource",t?t:B.config.strings.expandSource)},execute:function(e){var t=o(e.id);r(t,"collapsed")}},help:{execute:function(){var e=x("","_blank",500,250,"scrollbars=0"),t=e.document;t.write(B.config.strings.aboutDialog),t.close(),e.focus()}}}},findElements:function(e,t){var n=t?[t]:i(document.getElementsByTagName(B.config.tagName)),r=B.config,a=[];if(r.useScriptTags&&(n=n.concat(A())),0===n.length)return a;for(var l=0,s=n.length;s>l;l++){var o={target:n[l],params:p(e,E(n[l].className))};null!=o.params.brush&&a.push(o)}return a},highlight:function(e,t){var n=this.findElements(e,t),r="innerHTML",i=null,a=B.config;if(0!==n.length)for(var l=0,s=n.length;s>l;l++){var o,t=n[l],u=t.target,c=t.params,g=c.brush;if(null!=g){if("true"==c["html-script"]||1==B.defaults["html-script"])i=new B.HtmlScript(g),g="htmlscript";else{var h=b(g);if(!h)continue;i=new h}o=u[r],a.useScriptTags&&(o=M(o)),""!=(u.title||"")&&(c.title=u.title),c.brush=g,i.init(c),t=i.getDiv(o),""!=(u.id||"")&&(t.id=u.id),u.parentNode.replaceChild(t,u)}}},all:function(e){m(window,"load",function(){B.highlight(e)})}};return B.Match=function(e,t,n){this.value=e,this.index=t,this.length=e.length,this.css=n,this.brushName=null},B.Match.prototype.toString=function(){return this.value},B.HtmlScript=function(e){function t(e,t){for(var n=0,r=e.length;r>n;n++)e[n].index+=t}function n(e){for(var n,a=e.code,l=[],s=r.regexList,o=e.index+e.left.length,u=r.htmlScript,c=0,g=s.length;g>c;c++)n=L(a,s[c]),t(n,o),l=l.concat(n);null!=u.left&&null!=e.left&&(n=L(e.left,u.left),t(n,e.index),l=l.concat(n)),null!=u.right&&null!=e.right&&(n=L(e.right,u.right),t(n,e.index+e[0].lastIndexOf(e.right)),l=l.concat(n));for(var h=0,g=l.length;g>h;h++)l[h].brushName=i.brushName;return l}var r,i=b(e),a=new B.brushes.Xml,l=this,s="getDiv getHtml init".split(" ");if(null!=i){r=new i;for(var o=0,u=s.length;u>o;o++)(function(){var e=s[o];l[e]=function(){return a[e].apply(a,arguments)}})();return null==r.htmlScript?(v(B.config.strings.brushNotHtmlScript+e),void 0):(a.regexList.push({regex:r.htmlScript.code,func:n}),void 0)}},B.Highlighter=function(){},B.Highlighter.prototype={getParam:function(e,t){var n=this.params[e];return d(null==n?t:n)},create:function(e){return document.createElement(e)},findMatches:function(e,t){var n=[];if(null!=e)for(var r=0,i=e.length;i>r;r++)"object"==typeof e[r]&&(n=n.concat(L(t,e[r])));return this.removeNestedMatches(n.sort(k))},removeNestedMatches:function(e){for(var t=0,n=e.length;n>t;t++)if(null!==e[t])for(var r=e[t],i=r.index+r.length,a=t+1,n=e.length;n>a&&null!==e[t];a++){var l=e[a];if(null!==l){if(l.index>i)break;l.index==r.index&&l.length>r.length?e[t]=null:l.index>=r.index&&i>l.index&&(e[a]=null)}}return e},figureOutLineNumbers:function(e){var t=[],n=parseInt(this.getParam("first-line"));return y(e,function(e,r){t.push(r+n)}),t},isLineHighlighted:function(e){var t=this.getParam("highlight",[]);return"object"!=typeof t&&null==t.push&&(t=[t]),-1!=h(t,""+e)},getLineHtml:function(e,t,n){var r=["line","number"+t,"index"+e,"alt"+(""+(0==t%2?1:2))];return this.isLineHighlighted(t)&&r.push("highlighted"),0==t&&r.push("break"),'<div class="'+r.join(" ")+'">'+n+"</div>"},getLineNumbersHtml:function(e,t){var n="",r=a(e).length,i=parseInt(this.getParam("first-line")),l=this.getParam("pad-line-numbers");1==l?l=(""+(i+r-1)).length:1==isNaN(l)&&(l=0);for(var s=0;r>s;s++){var o=t?t[s]:i+s,e=0==o?B.config.space:S(o,l);n+=this.getLineHtml(s,o,e)}return n},getCodeLinesHtml:function(e,t){e=C(e);for(var n=a(e),r=(this.getParam("pad-line-numbers"),parseInt(this.getParam("first-line"))),e="",i=this.getParam("brush"),l=0,s=n.length;s>l;l++){var o=n[l],u=/^(&nbsp;|\s)+/.exec(o),c=null,g=t?t[l]:r+l;null!=u&&(c=""+u[0],o=o.substr(c.length),c=c.replace(" ",B.config.space)),o=C(o),0==o.length&&(o=B.config.space),e+=this.getLineHtml(l,g,(null!=c?'<code class="'+i+' spaces">'+c+"</code>":"")+o)}return e},getTitleHtml:function(t){return t?"<caption>"+e(t)+"</caption>":""},getMatchesHtml:function(e,t){function n(e){var t=e?e.brushName||a:a;return t?t+" ":""}for(var r=0,i="",a=this.getParam("brush",""),l=0,s=t.length;s>l;l++){var o,u=t[l];null!==u&&0!==u.length&&(o=n(u),i+=N(e.substr(r,u.index-r),o+"plain")+N(u.value,o+u.css),r=u.index+u.length+(u.offset||0))}return i+=N(e.substr(r),n()+"plain")},getHtml:function(t){var n,r,i,a="",s=["syntaxhighlighter"];return 1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1),className="syntaxhighlighter",1==this.getParam("collapse")&&s.push("collapsed"),0==(gutter=this.getParam("gutter"))&&s.push("nogutter"),s.push(this.getParam("class-name")),s.push(this.getParam("brush")),t=w(t).replace(/\r/g," "),n=this.getParam("tab-size"),t=1==this.getParam("smart-tabs")?R(t,n):H(t,n),this.getParam("unindent")&&(t=P(t)),gutter&&(i=this.figureOutLineNumbers(t)),r=this.findMatches(this.regexList,t),a=this.getMatchesHtml(t,r),a=this.getCodeLinesHtml(a,i),this.getParam("auto-links")&&(a=I(a)),"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.match(/MSIE/)&&s.push("ie"),a='<div id="'+l(this.id)+'" class="'+e(s.join(" "))+'">'+(this.getParam("toolbar")?B.toolbar.getHtml(this):"")+'<table border="0" cellpadding="0" cellspacing="0">'+this.getTitleHtml(this.getParam("title"))+"<tbody>"+"<tr>"+(gutter?'<td class="gutter">'+this.getLineNumbersHtml(t)+"</td>":"")+'<td class="code">'+'<div class="container">'+a+"</div>"+"</td>"+"</tr>"+"</tbody>"+"</table>"+"</div>"},getDiv:function(e){null===e&&(e=""),this.code=e;var t=this.create("div");return t.innerHTML=this.getHtml(e),this.getParam("toolbar")&&m(c(t,".toolbar"),"click",B.toolbar.handler),this.getParam("quick-code")&&m(c(t,".code"),"dblclick",X),t},init:function(e){this.id=f(),u(this),this.params=p(B.defaults,e||{}),1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1)},getKeywords:function(e){return e=e.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"|"),"\\b(?:"+e+")\\b"},forHtmlScript:function(e){var t={end:e.right.source};e.eof&&(t.end="(?:(?:"+t.end+")|$)"),this.htmlScript={left:{regex:e.left,css:"script"},right:{regex:e.right,css:"script"},code:XRegExp("(?<left>"+e.left.source+")"+"(?<code>.*?)"+"(?<right>"+t.end+")","sgi")}}},B}();"undefined"!=typeof exports?exports.SyntaxHighlighter=SyntaxHighlighter:null;
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
  var XRegExp;if(XRegExp=XRegExp||function(e){"use strict";function t(e,t,n){var r;for(r in c.prototype)c.prototype.hasOwnProperty(r)&&(e[r]=c.prototype[r]);return e.xregexp={captureNames:t,isNative:!!n},e}function n(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function r(e,r,i){if(!c.isRegExp(e))throw new TypeError("type RegExp expected");var a=p.replace.call(n(e)+(r||""),E,"");return i&&(a=p.replace.call(a,RegExp("["+i+"]+","g"),"")),e=e.xregexp&&!e.xregexp.isNative?t(c(e.source,a),e.xregexp.captureNames?e.xregexp.captureNames.slice(0):null):t(RegExp(e.source,a),null,!0)}function i(e,t){var n=e.length;if(Array.prototype.lastIndexOf)return e.lastIndexOf(t);for(;n--;)if(e[n]===t)return n;return-1}function a(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object "+t+"]"}function l(e){return e=e||{},"all"===e||e.all?e={natives:!0,extensibility:!0}:a(e,"string")&&(e=c.forEach(e,/[^\s,]+/,function(e){this[e]=!0},{})),e}function s(e,t,n,r){var i,a,l=m.length,s=null;R=!0;try{for(;l--;)if(a=m[l],!("all"!==a.scope&&a.scope!==n||a.trigger&&!a.trigger.call(r))&&(a.pattern.lastIndex=t,i=d.exec.call(a.pattern,e),i&&i.index===t)){s={output:a.handler.call(r,i,n),match:i};break}}catch(o){throw o}finally{R=!1}return s}function o(e){c.addToken=g[e?"on":"off"],f.extensibility=e}function u(e){RegExp.prototype.exec=(e?d:p).exec,RegExp.prototype.test=(e?d:p).test,String.prototype.match=(e?d:p).match,String.prototype.replace=(e?d:p).replace,String.prototype.split=(e?d:p).split,f.natives=e}var c,g,h,f={natives:!1,extensibility:!1},p={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},d={},x={},m=[],v="default",b="class",y={"default":/^(?:\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??)/,"class":/^(?:\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S]))/},w=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,E=/([\s\S])(?=[\s\S]*\1)/g,N=/^(?:[?*+]|{\d+(?:,\d*)?})\??/,S=p.exec.call(/()??/,"")[1]===e,H=RegExp.prototype.sticky!==e,R=!1,T="gim"+(H?"y":"");return c=function(n,i){if(c.isRegExp(n)){if(i!==e)throw new TypeError("can't supply flags when constructing one RegExp from another");return r(n)}if(R)throw Error("can't call the XRegExp constructor within token definition functions");var a,l,o,u=[],g=v,h={hasNamedCapture:!1,captureNames:[],hasFlag:function(e){return i.indexOf(e)>-1}},f=0;if(n=n===e?"":n+"",i=i===e?"":i+"",p.match.call(i,E))throw new SyntaxError("invalid duplicate regular expression flag");for(n=p.replace.call(n,/^\(\?([\w$]+)\)/,function(e,t){if(p.test.call(/[gy]/,t))throw new SyntaxError("can't use flag g or y in mode modifier");return i=p.replace.call(i+t,E,""),""}),c.forEach(i,/[\s\S]/,function(e){if(0>T.indexOf(e[0]))throw new SyntaxError("invalid regular expression flag "+e[0])});n.length>f;)a=s(n,f,g,h),a?(u.push(a.output),f+=a.match[0].length||1):(l=p.exec.call(y[g],n.slice(f)),l?(u.push(l[0]),f+=l[0].length):(o=n.charAt(f),"["===o?g=b:"]"===o&&(g=v),u.push(o),++f));return t(RegExp(u.join(""),p.replace.call(i,/[^gimy]+/g,"")),h.hasNamedCapture?h.captureNames:null)},g={on:function(e,t,n){n=n||{},e&&m.push({pattern:r(e,"g"+(H?"y":"")),handler:t,scope:n.scope||v,trigger:n.trigger||null}),n.customFlags&&(T=p.replace.call(T+n.customFlags,E,""))},off:function(){throw Error("extensibility must be installed before using addToken")}},c.addToken=g.off,c.cache=function(e,t){var n=e+"/"+(t||"");return x[n]||(x[n]=c(e,t))},c.escape=function(e){return p.replace.call(e,/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},c.exec=function(e,t,n,i){var a,l=r(t,"g"+(i&&H?"y":""),i===!1?"y":"");return l.lastIndex=n=n||0,a=d.exec.call(l,e),i&&a&&a.index!==n&&(a=null),t.global&&(t.lastIndex=a?l.lastIndex:0),a},c.forEach=function(e,t,n,r){for(var i,a=0,l=-1;i=c.exec(e,t,a);)n.call(r,i,++l,e,t),a=i.index+(i[0].length||1);return r},c.globalize=function(e){return r(e,"g")},c.install=function(e){e=l(e),!f.natives&&e.natives&&u(!0),!f.extensibility&&e.extensibility&&o(!0)},c.isInstalled=function(e){return!!f[e]},c.isRegExp=function(e){return a(e,"regexp")},c.matchChain=function(e,t){return function n(e,r){var i,a=t[r].regex?t[r]:{regex:t[r]},l=[],s=function(e){l.push(a.backref?e[a.backref]||"":e[0])};for(i=0;e.length>i;++i)c.forEach(e[i],a.regex,s);return r!==t.length-1&&l.length?n(l,r+1):l}([e],0)},c.replace=function(t,n,i,a){var l,s=c.isRegExp(n),o=n;return s?(a===e&&n.global&&(a="all"),o=r(n,"all"===a?"g":"","all"===a?"":"g")):"all"===a&&(o=RegExp(c.escape(n+""),"g")),l=d.replace.call(t+"",o,i),s&&n.global&&(n.lastIndex=0),l},c.split=function(e,t,n){return d.split.call(e,t,n)},c.test=function(e,t,n,r){return!!c.exec(e,t,n,r)},c.uninstall=function(e){e=l(e),f.natives&&e.natives&&u(!1),f.extensibility&&e.extensibility&&o(!1)},c.union=function(e,t){var n,r,i,l,s=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g,o=0,u=function(e,t,i){var a=r[o-n];if(t){if(++o,a)return"(?<"+a+">"}else if(i)return"\\"+(+i+n);return e},g=[];if(!a(e,"array")||!e.length)throw new TypeError("patterns must be a nonempty array");for(l=0;e.length>l;++l)i=e[l],c.isRegExp(i)?(n=o,r=i.xregexp&&i.xregexp.captureNames||[],g.push(c(i.source).source.replace(s,u))):g.push(c.escape(i));return c(g.join("|"),t)},c.version="2.0.0",d.exec=function(t){var r,a,l,s,o;if(this.global||(s=this.lastIndex),r=p.exec.apply(this,arguments)){if(!S&&r.length>1&&i(r,"")>-1&&(l=RegExp(this.source,p.replace.call(n(this),"g","")),p.replace.call((t+"").slice(r.index),l,function(){var t;for(t=1;arguments.length-2>t;++t)arguments[t]===e&&(r[t]=e)})),this.xregexp&&this.xregexp.captureNames)for(o=1;r.length>o;++o)a=this.xregexp.captureNames[o-1],a&&(r[a]=r[o]);this.global&&!r[0].length&&this.lastIndex>r.index&&(this.lastIndex=r.index)}return this.global||(this.lastIndex=s),r},d.test=function(e){return!!d.exec.call(this,e)},d.match=function(e){if(c.isRegExp(e)){if(e.global){var t=p.match.apply(this,arguments);return e.lastIndex=0,t}}else e=RegExp(e);return d.exec.call(e,this)},d.replace=function(e,t){var n,r,l,s,o=c.isRegExp(e);return o?(e.xregexp&&(n=e.xregexp.captureNames),e.global||(s=e.lastIndex)):e+="",a(t,"function")?r=p.replace.call(this+"",e,function(){var r,i=arguments;if(n)for(i[0]=new String(i[0]),r=0;n.length>r;++r)n[r]&&(i[0][n[r]]=i[r+1]);return o&&e.global&&(e.lastIndex=i[i.length-2]+i[0].length),t.apply(null,i)}):(l=this+"",r=p.replace.call(l,e,function(){var e=arguments;return p.replace.call(t+"",w,function(t,r,a){var l;if(r){if(l=+r,e.length-3>=l)return e[l]||"";if(l=n?i(n,r):-1,0>l)throw new SyntaxError("backreference to undefined group "+t);return e[l+1]||""}if("$"===a)return"$";if("&"===a||0===+a)return e[0];if("`"===a)return e[e.length-1].slice(0,e[e.length-2]);if("'"===a)return e[e.length-1].slice(e[e.length-2]+e[0].length);if(a=+a,!isNaN(a)){if(a>e.length-3)throw new SyntaxError("backreference to undefined group "+t);return e[a]||""}throw new SyntaxError("invalid token "+t)})})),o&&(e.lastIndex=e.global?0:s),r},d.split=function(t,n){if(!c.isRegExp(t))return p.split.apply(this,arguments);var r,i=this+"",a=t.lastIndex,l=[],s=0;return n=(n===e?-1:n)>>>0,c.forEach(i,t,function(e){e.index+e[0].length>s&&(l.push(i.slice(s,e.index)),e.length>1&&e.index<i.length&&Array.prototype.push.apply(l,e.slice(1)),r=e[0].length,s=e.index+r)}),s===i.length?(!p.test.call(t,"")||r)&&l.push(""):l.push(i.slice(s)),t.lastIndex=a,l.length>n?l.slice(0,n):l},h=g.on,h(/\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4})|x(?![\dA-Fa-f]{2}))/,function(e,t){if("B"===e[1]&&t===v)return e[0];throw new SyntaxError("invalid escape "+e[0])},{scope:"all"}),h(/\[(\^?)]/,function(e){return e[1]?"[\\s\\S]":"\\b\\B"}),h(/(?:\(\?#[^)]*\))+/,function(e){return p.test.call(N,e.input.slice(e.index+e[0].length))?"":"(?:)"}),h(/\\k<([\w$]+)>/,function(e){var t=isNaN(e[1])?i(this.captureNames,e[1])+1:+e[1],n=e.index+e[0].length;if(!t||t>this.captureNames.length)throw new SyntaxError("backreference to undefined group "+e[0]);return"\\"+t+(n===e.input.length||isNaN(e.input.charAt(n))?"":"(?:)")}),h(/(?:\s+|#.*)+/,function(e){return p.test.call(N,e.input.slice(e.index+e[0].length))?"":"(?:)"},{trigger:function(){return this.hasFlag("x")},customFlags:"x"}),h(/\./,function(){return"[\\s\\S]"},{trigger:function(){return this.hasFlag("s")},customFlags:"s"}),h(/\(\?P?<([\w$]+)>/,function(e){if(!isNaN(e[1]))throw new SyntaxError("can't use integer as capture name "+e[0]);return this.captureNames.push(e[1]),this.hasNamedCapture=!0,"("}),h(/\\(\d+)/,function(e,t){if(!(t===v&&/^[1-9]/.test(e[1])&&+e[1]<=this.captureNames.length)&&"0"!==e[1])throw new SyntaxError("can't use octal escape or backreference to undefined group "+e[0]);return e[0]},{scope:"all"}),h(/\((?!\?)/,function(){return this.hasFlag("n")?"(?:":(this.captureNames.push(null),"(")},{customFlags:"n"}),"undefined"!=typeof exports&&(exports.XRegExp=c),c}(),SyntaxHighlighter===void 0)var SyntaxHighlighter=function(){function e(e){return document.createElement("div").appendChild(document.createTextNode(e)).parentNode.innerHTML.replace(/"/g,"&quot;")}function t(e,t){return-1!=e.className.indexOf(t)}function n(e,n){t(e,n)||(e.className+=" "+n)}function r(e,t){e.className=e.className.replace(t,"")}function i(e){for(var t=[],n=0,r=e.length;r>n;n++)t.push(e[n]);return t}function a(e){return e.split(/\r?\n/)}function l(e){var t="highlighter_";return 0==e.indexOf(t)?e:t+e}function s(e){return B.vars.highlighters[l(e)]}function o(e){return document.getElementById(l(e))}function u(e){B.vars.highlighters[l(e.id)]=e}function c(e,t,n){if(null==e)return null;var r,i,a=1!=n?e.childNodes:[e.parentNode],l={"#":"id",".":"className"}[t.substr(0,1)]||"nodeName";if(r="nodeName"!=l?t.substr(1):t.toUpperCase(),-1!=(e[l]||"").indexOf(r))return e;for(var s=0,o=a.length;a&&o>s&&null==i;s++)i=c(a[s],t,n);return i}function g(e,t){return c(e,t,!0)}function h(e,t,n){n=Math.max(n||0,0);for(var r=n,i=e.length;i>r;r++)if(e[r]==t)return r;return-1}function f(e){return(e||"")+(""+Math.round(1e6*Math.random()))}function p(e,t){var n,r={};for(n in e)r[n]=e[n];for(n in t)r[n]=t[n];return r}function d(e){var t={"true":!0,"false":!1}[e];return null==t?e:t}function x(e,t,n,r,i){var a=(screen.width-n)/2,l=(screen.height-r)/2;i+=", left="+a+", top="+l+", width="+n+", height="+r,i=i.replace(/^,/,"");var s=window.open(e,t,i);return s.focus(),s}function m(e,t,n,r){function i(e){e=e||window.event,e.target||(e.target=e.srcElement,e.preventDefault=function(){this.returnValue=!1}),n.call(r||window,e)}e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i,!1)}function v(e){window.alert(B.config.strings.alert+e)}function b(e,t){var n=B.vars.discoveredBrushes,r=null;if(null==n){n={};for(var i in B.brushes){var a=B.brushes[i],l=a.aliases;if(null!=l){a.brushName=i.toLowerCase();for(var s=0,o=l.length;o>s;s++)n[l[s]]=i}}B.vars.discoveredBrushes=n}return r=B.brushes[n[e]],null==r&&t&&v(B.config.strings.noBrush+e),r}function y(e,t){for(var n=a(e),r=0,i=n.length;i>r;r++)n[r]=t(n[r],r);return n.join("\r\n")}function w(e){return e.replace(/^[ ]*[\n]+|[\n]*[ ]*$/g,"")}function E(e){for(var t,n={},r=XRegExp("^\\[(?<values>(.*?))\\]$"),i=0,a=XRegExp("(?<name>[\\w-]+)\\s*:\\s*(?<value>[\\w%#-]+|\\[.*?\\]|\".*?\"|'.*?')\\s*;?","g");null!=(t=XRegExp.exec(e,a,i));){var l=t.value.replace(/^['"]|['"]$/g,"");if(null!=l&&r.test(l)){var s=XRegExp.exec(l,r);l=s.values.length>0?s.values.split(/\s*,\s*/):[]}n[t.name]=l,i=t.index+t[0].length}return n}function N(e,t){return null==e||0==e.length||"\n"==e?e:(e=e.replace(/</g,"&lt;"),e=e.replace(/ {2,}/g,function(e){for(var t="",n=0,r=e.length;r-1>n;n++)t+=B.config.space;return t+" "}),null!=t&&(e=y(e,function(e){if(0==e.length)return"";var n="";return e=e.replace(/^(&nbsp;| )+/,function(e){return n=e,""}),0==e.length?n:n+'<code class="'+t+'">'+e+"</code>"})),e)}function S(e,t){for(var n=""+e;t>n.length;)n="0"+n;return n}function H(e,t){for(var n="",r=0;t>r;r++)n+=" ";return e.replace(/\t/g,n)}function R(e,t){function n(e,t,n){return e.substr(0,t)+i.substr(0,n)+e.substr(t+1,e.length)}for(var r=(a(e)," "),i="",l=0;50>l;l++)i+=" ";return e=y(e,function(e){if(-1==e.indexOf(r))return e;for(var i=0;-1!=(i=e.indexOf(r));){var a=t-i%t;e=n(e,i,a)}return e})}function T(e){var t=/<br\s*\/?>|&lt;br\s*\/?&gt;/gi;return 1==B.config.bloggerMode&&(e=e.replace(t,"\n")),1==B.config.stripBrs&&(e=e.replace(t,"")),e}function C(e){return e.replace(/^\s+|\s+$/g,"")}function P(e){for(var t=a(T(e)),n=/^\s*/,r=1e3,i=0,l=t.length;l>i&&r>0;i++){var s=t[i];if(0!=C(s).length){var o=n.exec(s);if(null==o)return e;r=Math.min(o[0].length,r)}}if(r>0)for(var i=0,l=t.length;l>i;i++)t[i]=t[i].substr(r);return t.join("\n")}function k(e,t){return e.index<t.index?-1:e.index>t.index?1:e.length<t.length?-1:e.length>t.length?1:0}function L(e,t){function n(e){return e[0]}var r=null,i=[],a=t.func?t.func:n;for(pos=0;null!=(r=XRegExp.exec(e,t.regex,pos));){var l=a(r,t);"string"==typeof l&&(l=[new B.Match(l,r.index,t.css)]),i=i.concat(l),pos=r.index+r[0].length}return i}function I(e){var t=/(.*)((&gt;|&lt;).*)/;return e.replace(B.regexLib.url,function(e){var n="",r=null;return(r=t.exec(e))&&(e=r[1],n=r[2]),'<a href="'+e+'">'+e+"</a>"+n})}function A(){for(var e=document.getElementsByTagName("script"),t=[],n=0,r=e.length;r>n;n++)"syntaxhighlighter"==e[n].type&&t.push(e[n]);return t}function M(e){var t="<![CDATA[",n="]]>",r=C(e),i=!1,a=t.length,l=n.length;0==r.indexOf(t)&&(r=r.substring(a),i=!0);var s=r.length;return r.indexOf(n)==s-l&&(r=r.substring(0,s-l),i=!0),i?r:e}function X(e){var t,i=e.target,a=g(i,".syntaxhighlighter"),l=g(i,".container"),o=document.createElement("textarea");if(l&&a&&!c(l,"textarea")){t=s(a.id),n(a,"source");for(var u=l.childNodes,h=[],f=0,p=u.length;p>f;f++)h.push(u[f].innerText||u[f].textContent);h=h.join("\r"),h=h.replace(/\u00a0/g," "),o.appendChild(document.createTextNode(h)),l.appendChild(o),o.focus(),o.select(),m(o,"blur",function(){o.parentNode.removeChild(o),r(a,"source")})}}"undefined"!=typeof require&&XRegExp===void 0&&(XRegExp=require("xregexp").XRegExp);var B={defaults:{"class-name":"","first-line":1,"pad-line-numbers":!1,highlight:null,title:null,"smart-tabs":!0,"tab-size":4,gutter:!0,toolbar:!0,"quick-code":!0,collapse:!1,"auto-links":!0,light:!1,unindent:!0,"html-script":!1},config:{space:"&nbsp;",useScriptTags:!0,bloggerMode:!1,stripBrs:!1,tagName:"pre",strings:{expandSource:"expand source",help:"?",alert:"SyntaxHighlighter\n\n",noBrush:"Can't find brush for: ",brushNotHtmlScript:"Brush wasn't configured for html-script option: ",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 (Wed, 16 Apr 2014 03:56:09 GMT)</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-2013 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>'}},vars:{discoveredBrushes:null,highlighters:{}},brushes:{},regexLib:{multiLineCComments:XRegExp("/\\*.*?\\*/","gs"),singleLineCComments:/\/\/.*$/gm,singleLinePerlComments:/#.*$/gm,doubleQuotedString:/"([^\\"\n]|\\.)*"/g,singleQuotedString:/'([^\\'\n]|\\.)*'/g,multiLineDoubleQuotedString:XRegExp('"([^\\\\"]|\\\\.)*"',"gs"),multiLineSingleQuotedString:XRegExp("'([^\\\\']|\\\\.)*'","gs"),xmlComments:XRegExp("(&lt;|<)!--.*?--(&gt;|>)","gs"),url:/\w+:\/\/[\w-.\/?%&=:@;#]*/g,phpScriptTags:{left:/(&lt;|<)\?(?:=|php)?/g,right:/\?(&gt;|>)/g,eof:!0},aspScriptTags:{left:/(&lt;|<)%=?/g,right:/%(&gt;|>)/g},scriptScriptTags:{left:/(&lt;|<)\s*script.*?(&gt;|>)/gi,right:/(&lt;|<)\/\s*script\s*(&gt;|>)/gi}},toolbar:{getHtml:function(e){function t(e,t){return B.toolbar.getButtonHtml(e,t,B.config.strings[t])}for(var n='<div class="toolbar">',r=B.toolbar.items,i=r.list,a=0,l=i.length;l>a;a++)n+=(r[i[a]].getHtml||t)(e,i[a]);return n+="</div>"},getButtonHtml:function(t,n,r){return n=e(n),'<span><a href="#" class="toolbar_item command_'+n+" "+n+'">'+e(r)+"</a></span>"},handler:function(e){function t(e){var t=RegExp(e+"_(\\w+)"),n=t.exec(r);return n?n[1]:null}var n=e.target,r=n.className||"",i=s(g(n,".syntaxhighlighter").id),a=t("command");i&&a&&B.toolbar.items[a].execute(i),e.preventDefault()},items:{list:["expandSource","help"],expandSource:{getHtml:function(e){if(1!=e.getParam("collapse"))return"";var t=e.getParam("title");return B.toolbar.getButtonHtml(e,"expandSource",t?t:B.config.strings.expandSource)},execute:function(e){var t=o(e.id);r(t,"collapsed")}},help:{execute:function(){var e=x("","_blank",500,250,"scrollbars=0"),t=e.document;t.write(B.config.strings.aboutDialog),t.close(),e.focus()}}}},findElements:function(e,t){var n=t?[t]:i(document.getElementsByTagName(B.config.tagName)),r=B.config,a=[];if(r.useScriptTags&&(n=n.concat(A())),0===n.length)return a;for(var l=0,s=n.length;s>l;l++){var o={target:n[l],params:p(e,E(n[l].className))};null!=o.params.brush&&a.push(o)}return a},highlight:function(e,t){var n=this.findElements(e,t),r="innerHTML",i=null,a=B.config;if(0!==n.length)for(var l=0,s=n.length;s>l;l++){var o,t=n[l],u=t.target,c=t.params,g=c.brush;if(null!=g){if("true"==c["html-script"]||1==B.defaults["html-script"])i=new B.HtmlScript(g),g="htmlscript";else{var h=b(g);if(!h)continue;i=new h}o=u[r],a.useScriptTags&&(o=M(o)),""!=(u.title||"")&&(c.title=u.title),c.brush=g,i.init(c),t=i.getDiv(o),""!=(u.id||"")&&(t.id=u.id),u.parentNode.replaceChild(t,u)}}},all:function(e){m(window,"load",function(){B.highlight(e)})}};return B.Match=function(e,t,n){this.value=e,this.index=t,this.length=e.length,this.css=n,this.brushName=null},B.Match.prototype.toString=function(){return this.value},B.HtmlScript=function(e){function t(e,t){for(var n=0,r=e.length;r>n;n++)e[n].index+=t}function n(e){for(var n,a=e.code,l=[],s=r.regexList,o=e.index+e.left.length,u=r.htmlScript,c=0,g=s.length;g>c;c++)n=L(a,s[c]),t(n,o),l=l.concat(n);null!=u.left&&null!=e.left&&(n=L(e.left,u.left),t(n,e.index),l=l.concat(n)),null!=u.right&&null!=e.right&&(n=L(e.right,u.right),t(n,e.index+e[0].lastIndexOf(e.right)),l=l.concat(n));for(var h=0,g=l.length;g>h;h++)l[h].brushName=i.brushName;return l}var r,i=b(e),a=new B.brushes.Xml,l=this,s="getDiv getHtml init".split(" ");if(null!=i){r=new i;for(var o=0,u=s.length;u>o;o++)(function(){var e=s[o];l[e]=function(){return a[e].apply(a,arguments)}})();return null==r.htmlScript?(v(B.config.strings.brushNotHtmlScript+e),void 0):(a.regexList.push({regex:r.htmlScript.code,func:n}),void 0)}},B.Highlighter=function(){},B.Highlighter.prototype={getParam:function(e,t){var n=this.params[e];return d(null==n?t:n)},create:function(e){return document.createElement(e)},findMatches:function(e,t){var n=[];if(null!=e)for(var r=0,i=e.length;i>r;r++)"object"==typeof e[r]&&(n=n.concat(L(t,e[r])));return this.removeNestedMatches(n.sort(k))},removeNestedMatches:function(e){for(var t=0,n=e.length;n>t;t++)if(null!==e[t])for(var r=e[t],i=r.index+r.length,a=t+1,n=e.length;n>a&&null!==e[t];a++){var l=e[a];if(null!==l){if(l.index>i)break;l.index==r.index&&l.length>r.length?e[t]=null:l.index>=r.index&&i>l.index&&(e[a]=null)}}return e},figureOutLineNumbers:function(e){var t=[],n=parseInt(this.getParam("first-line"));return y(e,function(e,r){t.push(r+n)}),t},isLineHighlighted:function(e){var t=this.getParam("highlight",[]);return"object"!=typeof t&&null==t.push&&(t=[t]),-1!=h(t,""+e)},getLineHtml:function(e,t,n){var r=["line","number"+t,"index"+e,"alt"+(""+(0==t%2?1:2))];return this.isLineHighlighted(t)&&r.push("highlighted"),0==t&&r.push("break"),'<div class="'+r.join(" ")+'">'+n+"</div>"},getLineNumbersHtml:function(e,t){var n="",r=a(e).length,i=parseInt(this.getParam("first-line")),l=this.getParam("pad-line-numbers");1==l?l=(""+(i+r-1)).length:1==isNaN(l)&&(l=0);for(var s=0;r>s;s++){var o=t?t[s]:i+s,e=0==o?B.config.space:S(o,l);n+=this.getLineHtml(s,o,e)}return n},getCodeLinesHtml:function(e,t){e=C(e);for(var n=a(e),r=(this.getParam("pad-line-numbers"),parseInt(this.getParam("first-line"))),e="",i=this.getParam("brush"),l=0,s=n.length;s>l;l++){var o=n[l],u=/^(&nbsp;|\s)+/.exec(o),c=null,g=t?t[l]:r+l;null!=u&&(c=""+u[0],o=o.substr(c.length),c=c.replace(" ",B.config.space)),o=C(o),0==o.length&&(o=B.config.space),e+=this.getLineHtml(l,g,(null!=c?'<code class="'+i+' spaces">'+c+"</code>":"")+o)}return e},getTitleHtml:function(t){return t?"<caption>"+e(t)+"</caption>":""},getMatchesHtml:function(e,t){function n(e){var t=e?e.brushName||a:a;return t?t+" ":""}for(var r=0,i="",a=this.getParam("brush",""),l=0,s=t.length;s>l;l++){var o,u=t[l];null!==u&&0!==u.length&&(o=n(u),i+=N(e.substr(r,u.index-r),o+"plain")+N(u.value,o+u.css),r=u.index+u.length+(u.offset||0))}return i+=N(e.substr(r),n()+"plain")},getHtml:function(t){var n,r,i,a="",s=["syntaxhighlighter"];return 1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1),className="syntaxhighlighter",1==this.getParam("collapse")&&s.push("collapsed"),0==(gutter=this.getParam("gutter"))&&s.push("nogutter"),s.push(this.getParam("class-name")),s.push(this.getParam("brush")),t=w(t).replace(/\r/g," "),n=this.getParam("tab-size"),t=1==this.getParam("smart-tabs")?R(t,n):H(t,n),this.getParam("unindent")&&(t=P(t)),gutter&&(i=this.figureOutLineNumbers(t)),r=this.findMatches(this.regexList,t),a=this.getMatchesHtml(t,r),a=this.getCodeLinesHtml(a,i),this.getParam("auto-links")&&(a=I(a)),"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.match(/MSIE/)&&s.push("ie"),a='<div id="'+l(this.id)+'" class="'+e(s.join(" "))+'">'+(this.getParam("toolbar")?B.toolbar.getHtml(this):"")+'<table border="0" cellpadding="0" cellspacing="0">'+this.getTitleHtml(this.getParam("title"))+"<tbody>"+"<tr>"+(gutter?'<td class="gutter">'+this.getLineNumbersHtml(t)+"</td>":"")+'<td class="code">'+'<div class="container">'+a+"</div>"+"</td>"+"</tr>"+"</tbody>"+"</table>"+"</div>"},getDiv:function(e){null===e&&(e=""),this.code=e;var t=this.create("div");return t.innerHTML=this.getHtml(e),this.getParam("toolbar")&&m(c(t,".toolbar"),"click",B.toolbar.handler),this.getParam("quick-code")&&m(c(t,".code"),"dblclick",X),t},init:function(e){this.id=f(),u(this),this.params=p(B.defaults,e||{}),1==this.getParam("light")&&(this.params.toolbar=this.params.gutter=!1)},getKeywords:function(e){return e=e.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"|"),"\\b(?:"+e+")\\b"},forHtmlScript:function(e){var t={end:e.right.source};e.eof&&(t.end="(?:(?:"+t.end+")|$)"),this.htmlScript={left:{regex:e.left,css:"script"},right:{regex:e.right,css:"script"},code:XRegExp("(?<left>"+e.left.source+")"+"(?<code>.*?)"+"(?<right>"+t.end+")","sgi")}}},B}();"undefined"!=typeof exports?exports.SyntaxHighlighter=SyntaxHighlighter:null;
syntaxhighlighter3/scripts/shLegacy.js CHANGED
@@ -1,157 +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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
- *
11
- * @copyright
12
- * Copyright (C) 2004-2013 Alex Gorbatchev.
13
- *
14
- * @license
15
- * Dual licensed under the MIT and GPL licenses.
16
- */
17
- var dp = {
18
- SyntaxHighlighter : {}
19
- };
20
-
21
- dp.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 = XRegExp('^' + name + '\\[(?<value>\\w+)\\]$', 'gi'),
34
- match = null
35
- ;
36
-
37
- for (var i = 0; i < list.length; i++)
38
- if ((match = XRegExp.exec(list[i], regex)) != 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
- };
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 (Wed, 16 Apr 2014 03:56:09 GMT)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2013 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * Dual licensed under the MIT and GPL licenses.
16
+ */
17
+ var dp = {
18
+ SyntaxHighlighter : {}
19
+ };
20
+
21
+ dp.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 = XRegExp('^' + name + '\\[(?<value>\\w+)\\]$', 'gi'),
34
+ match = null
35
+ ;
36
+
37
+ for (var i = 0; i < list.length; i++)
38
+ if ((match = XRegExp.exec(list[i], regex)) != 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
+ };
syntaxhighlighter3/styles/shCore.css CHANGED
@@ -44,7 +44,7 @@
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;
44
  vertical-align: baseline !important;
45
  width: auto !important;
46
  box-sizing: content-box !important;
47
+ font-family: Monaco, "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;