Version Description
Download this release
Release Info
Developer | akarmenia |
Plugin | Crayon Syntax Highlighter |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- crayon_fonts.class.php +38 -0
- crayon_formatter.class.php +450 -0
- crayon_highlighter.class.php +315 -0
- crayon_langs.class.php +338 -0
- crayon_parser.class.php +249 -0
- crayon_resource.class.php +307 -0
- crayon_settings.class.php +604 -0
- crayon_settings_wp.class.php +543 -0
- crayon_themes.class.php +25 -0
- crayon_wp.class.php +228 -0
- css/admin_style.css +173 -0
- css/fonts/monaco/monaco-webfont.eot +0 -0
- css/fonts/monaco/monaco-webfont.svg +239 -0
- css/fonts/monaco/monaco-webfont.ttf +0 -0
- css/fonts/monaco/monaco-webfont.woff +0 -0
- css/fonts/monaco/monaco.css +13 -0
- css/images/crayon_logo.png +0 -0
- css/images/crayon_logo_square.png +0 -0
- css/images/facebook.png +0 -0
- css/images/google.png +0 -0
- css/images/thumb_horizontal.png +0 -0
- css/images/thumb_vertical.png +0 -0
- css/images/toolbar/nums_dark.png +0 -0
- css/images/toolbar/nums_light.png +0 -0
- css/images/toolbar/plain_dark.png +0 -0
- css/images/toolbar/plain_light.png +0 -0
- css/images/track_horizontal.png +0 -0
- css/images/track_vertical.png +0 -0
- css/images/twitter.png +0 -0
- css/scrollbar.css +48 -0
- css/style.css +194 -0
- fonts/arial.css +3 -0
- fonts/courier new.css +3 -0
- fonts/monaco.css +5 -0
- fonts/monospace.css +3 -0
- fonts/tahoma.css +3 -0
- fonts/times.css +3 -0
- fonts/verdana.css +3 -0
- global.php +145 -0
- js/crayon.js +502 -0
- js/crayon_admin.js +257 -0
- js/jquery-1.5.min.js +16 -0
- langs/c#/c#.txt +21 -0
- langs/c#/modifier.txt +19 -0
- langs/c#/reserved.txt +12 -0
- langs/c#/statement.txt +23 -0
- langs/c#/type.txt +26 -0
- langs/c++/c++.txt +21 -0
- langs/c++/modifier.txt +30 -0
- langs/c++/reserved.txt +55 -0
- langs/c++/statement.txt +16 -0
- langs/c++/type.txt +42 -0
- langs/c/c.txt +21 -0
- langs/c/modifier.txt +36 -0
- langs/c/reserved.txt +52 -0
- langs/c/type.txt +6 -0
- langs/css/css.txt +16 -0
- langs/default/default.txt +22 -0
- langs/default/modifier.txt +10 -0
- langs/default/operator.txt +44 -0
- langs/default/reserved.txt +13 -0
- langs/default/statement.txt +37 -0
- langs/default/type.txt +28 -0
- langs/extensions.txt +13 -0
- langs/html/html.txt +17 -0
- langs/java/java.txt +23 -0
- langs/java/modifier.txt +5 -0
- langs/java/reserved.txt +1 -0
- langs/js/js.txt +21 -0
- langs/js/reserved.txt +136 -0
- langs/objc/constant.txt +4 -0
- langs/objc/modifier.txt +16 -0
- langs/objc/modifier_at.txt +4 -0
- langs/objc/objc.txt +21 -0
- langs/objc/reserved.txt +8 -0
- langs/objc/reserved_at.txt +1 -0
- langs/objc/statement.txt +10 -0
- langs/objc/statement_at.txt +13 -0
- langs/objc/type.txt +22 -0
- langs/php/compile.txt +7 -0
- langs/php/construct.txt +14 -0
- langs/php/php.txt +27 -0
- langs/php/reserved.txt +257 -0
- langs/python/exception.txt +50 -0
- langs/python/function.txt +80 -0
- langs/python/modifier.txt +1 -0
- langs/python/module.txt +432 -0
- langs/python/python.txt +27 -0
- langs/python/reserved.txt +18 -0
- langs/python/statement.txt +21 -0
- langs/python/type.txt +4 -0
- langs/readme.txt +92 -0
- langs/vb/modifier.txt +19 -0
- langs/vb/reserved.txt +37 -0
- langs/vb/statement.txt +13 -0
- langs/vb/type.txt +28 -0
- langs/vb/vb.txt +21 -0
- log.txt +6 -0
- readme.txt +48 -0
- themes/classic/classic.css +148 -0
- themes/twilight/twilight.css +152 -0
- util/ajax.php +13 -0
- util/crayon_log.class.php +91 -0
- util/crayon_timer.class.php +24 -0
- util/crayon_util.class.php +343 -0
- util/exceptions.php +109 -0
- util/help.htm +76 -0
- util/list_langs.php +25 -0
- util/preview.php +50 -0
- util/sample/c#.txt +10 -0
- util/sample/c++.txt +17 -0
- util/sample/c.txt +8 -0
- util/sample/css.txt +12 -0
- util/sample/default.txt +8 -0
- util/sample/html.txt +10 -0
- util/sample/java.txt +8 -0
- util/sample/js.txt +12 -0
- util/sample/objc.txt +8 -0
- util/sample/php.txt +10 -0
- util/sample/python.txt +9 -0
- util/sample/vb.txt +10 -0
- util/settings_list.txt +48 -0
- util/touch.txt +18 -0
crayon_fonts.class.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_RESOURCE_PHP);
|
4 |
+
|
5 |
+
/* Manages fonts once they are loaded. */
|
6 |
+
class CrayonFonts extends CrayonResourceCollection {
|
7 |
+
// Properties and Constants ===============================================
|
8 |
+
|
9 |
+
const DEFAULT_FONT = 'theme-font';
|
10 |
+
const DEFAULT_FONT_NAME = 'Theme Default';
|
11 |
+
|
12 |
+
// Methods ================================================================
|
13 |
+
|
14 |
+
function __construct() {
|
15 |
+
$this->set_default(self::DEFAULT_FONT, self::DEFAULT_FONT_NAME);
|
16 |
+
$this->directory(CRAYON_FONT_PATH);
|
17 |
+
}
|
18 |
+
|
19 |
+
// XXX Override
|
20 |
+
|
21 |
+
public function path($id) {
|
22 |
+
return CRAYON_FONT_PATH . "$id.css";
|
23 |
+
}
|
24 |
+
|
25 |
+
// XXX Override
|
26 |
+
|
27 |
+
public function load_process() {
|
28 |
+
if (!$this->is_state_loading()) {
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
$this->load_resources();
|
32 |
+
$default = $this->resource_instance(self::DEFAULT_FONT, self::DEFAULT_FONT_NAME);
|
33 |
+
// If some idiot puts a font with the default font name, this will replace it
|
34 |
+
|
35 |
+
$this->add(self::DEFAULT_FONT, $default);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
?>
|
crayon_formatter.class.php
ADDED
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_HIGHLIGHTER_PHP);
|
4 |
+
require_once (CRAYON_SETTINGS_PHP);
|
5 |
+
require_once (CRAYON_PARSER_PHP);
|
6 |
+
require_once (CRAYON_THEMES_PHP);
|
7 |
+
|
8 |
+
/* Manages formatting the html with html and css. */
|
9 |
+
class CrayonFormatter {
|
10 |
+
// Properties and Constants ===============================================
|
11 |
+
/* Used to temporarily store the array of CrayonElements passed to format_code(), so that
|
12 |
+
format_matches() can access them and identify which elements were captured and format
|
13 |
+
accordingly. This must be static for preg_replace_callback() to access it.*/
|
14 |
+
private static $elements = array();
|
15 |
+
|
16 |
+
// Methods ================================================================
|
17 |
+
private function __construct() {}
|
18 |
+
|
19 |
+
/* Formats the code using the regex and stores the elements for later use. */
|
20 |
+
public static function format_code($code, $language, $highlight = TRUE, $hl = NULL) {
|
21 |
+
// Ensure the language is defined
|
22 |
+
if ($language != NULL && $highlight) {
|
23 |
+
/* Perform the replace on the code using the regex, pass the captured matches for
|
24 |
+
formatting before they are replaced */
|
25 |
+
try {
|
26 |
+
// Match language regex
|
27 |
+
$elements = $language->elements();
|
28 |
+
$regex = $language->regex();
|
29 |
+
if (!empty($regex) && !empty($elements)) {
|
30 |
+
// Get array of CrayonElements
|
31 |
+
self::$elements = array_values($elements);
|
32 |
+
$code = preg_replace_callback($regex, 'CrayonFormatter::format_match', $code);
|
33 |
+
}
|
34 |
+
|
35 |
+
} catch (Exception $e) {
|
36 |
+
$error = 'An error occured when formatting: ' . $e->message();
|
37 |
+
$hl ? $hl->log($error) : CrayonLog::syslog($error);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
return $code;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* Performs a replace to format each match based on the captured element. */
|
44 |
+
private static function format_match($matches) {
|
45 |
+
/* First index in $matches is full match, subsequent indices are groups.
|
46 |
+
* Minimum number of elements in array is 2, so minimum captured group is 0. */
|
47 |
+
$captured_group_number = count($matches) - 2;
|
48 |
+
if (array_key_exists($captured_group_number, self::$elements)) {
|
49 |
+
$captured_element = self::$elements[$captured_group_number];
|
50 |
+
// Separate lines and add css class.
|
51 |
+
$css = $captured_element->css() . CrayonLangs::known_elements($captured_element->fallback());
|
52 |
+
return self::split_lines($matches[0], $css);
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
/* Prints the formatted code, option to override the line numbers with a custom string */
|
57 |
+
public static function print_code($hl, $code, $line_numbers = TRUE, $print = TRUE) {
|
58 |
+
if (get_class($hl) != CRAYON_HIGHLIGHTER) {
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
|
62 |
+
// Generate the code lines and separate each line as a div
|
63 |
+
$print_code = '';
|
64 |
+
$print_nums = '';
|
65 |
+
$hl->line_count(preg_match_all("|^.*$|m", $code, $code_lines));
|
66 |
+
for ($i = 1; $i <= $hl->line_count(); $i++) {
|
67 |
+
$code_line = $code_lines[0][$i - 1];
|
68 |
+
// Check if the current line has been selected
|
69 |
+
$marked_lines = $hl->marked();
|
70 |
+
// Check if lines need to be marked as important
|
71 |
+
if ($hl->setting_val(CrayonSettings::MARKING) && in_array($i, $marked_lines)) {
|
72 |
+
$marked_num = ' crayon-marked-num';
|
73 |
+
$marked_line = ' crayon-marked-line';
|
74 |
+
// If multiple lines are marked, only show borders for top and bottom lines
|
75 |
+
if (!in_array($i - 1, $marked_lines)) {
|
76 |
+
$marked_num .= ' crayon-top';
|
77 |
+
$marked_line .= ' crayon-top';
|
78 |
+
}
|
79 |
+
// Single lines are both the top and bottom of the multiple marked lines
|
80 |
+
if (!in_array($i + 1, $marked_lines)) {
|
81 |
+
$marked_num .= ' crayon-bottom';
|
82 |
+
$marked_line .= ' crayon-bottom';
|
83 |
+
}
|
84 |
+
} else {
|
85 |
+
$marked_num = $marked_line = '';
|
86 |
+
}
|
87 |
+
// Stripe odd lines
|
88 |
+
if ($hl->setting_val(CrayonSettings::STRIPED) && $i % 2 == 0) {
|
89 |
+
$striped_num = ' crayon-striped-num';
|
90 |
+
$striped_line = ' crayon-striped-line';
|
91 |
+
} else {
|
92 |
+
$striped_num = $striped_line = '';
|
93 |
+
}
|
94 |
+
// Generate the lines
|
95 |
+
$print_code .= '<div class="crayon-line' . $marked_line . $striped_line . '" id="line-' . $i . '">' . $code_line . '</div>';
|
96 |
+
if (!is_string($line_numbers)) {
|
97 |
+
$print_nums .= '<div class="crayon-num' . $marked_num . $striped_num . '">' . $i . '</div>';
|
98 |
+
}
|
99 |
+
}
|
100 |
+
// If $line_numbers is a string, display it
|
101 |
+
if (is_string($line_numbers) && !empty($line_numbers)) {
|
102 |
+
$print_nums .= '<div class="crayon-num">' . $line_numbers . '</div>';
|
103 |
+
} else if ( empty($line_numbers) ) {
|
104 |
+
$print_nums = FALSE;
|
105 |
+
}
|
106 |
+
// Determine whether to print title
|
107 |
+
$title = $hl->title();
|
108 |
+
$print_title = ($hl->setting_val(CrayonSettings::SHOW_TITLE) && $title ? '<span class="crayon-title">' . $title . '</span>' : '');
|
109 |
+
// Determine whether to print language
|
110 |
+
$print_lang = '';
|
111 |
+
if ($hl->language()) {
|
112 |
+
$lang = $hl->language()->name();
|
113 |
+
switch ($hl->setting_index(CrayonSettings::SHOW_LANG)) {
|
114 |
+
case 0 :
|
115 |
+
if ($hl->language()->id() == CrayonLangs::DEFAULT_LANG) {
|
116 |
+
break;
|
117 |
+
}
|
118 |
+
// Falls through
|
119 |
+
case 1 :
|
120 |
+
$print_lang = '<span class="crayon-language">' . $lang . '</span>';
|
121 |
+
break;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
// Unique ID for this instance of Crayon
|
125 |
+
$uid = 'crayon-' . uniqid();
|
126 |
+
// Disable functionality for errors
|
127 |
+
$error = $hl->error();
|
128 |
+
// Combined settings for code
|
129 |
+
$code_settings = '';
|
130 |
+
// Disable mouseover for touchscreen devices and mobiles, if we are told to
|
131 |
+
$touch = FALSE; // Whether we have detected a touchscreen device
|
132 |
+
if ($hl->setting_val(CrayonSettings::TOUCHSCREEN) && CrayonUtil::is_touch()) {
|
133 |
+
$touch = TRUE;
|
134 |
+
$code_settings .= ' touchscreen';
|
135 |
+
}
|
136 |
+
// Draw the plain code and toolbar
|
137 |
+
$toolbar_settings = '';
|
138 |
+
if (empty($error) && $hl->setting_index(CrayonSettings::TOOLBAR) != 2) {
|
139 |
+
// Enable mouseover setting for toolbar
|
140 |
+
if ($hl->setting_index(CrayonSettings::TOOLBAR) == 0 && !$touch) {
|
141 |
+
// No touchscreen detected
|
142 |
+
$toolbar_settings .= ' mouseover';
|
143 |
+
if ($hl->setting_val(CrayonSettings::TOOLBAR_OVERLAY)) {
|
144 |
+
$toolbar_settings .= ' overlay';
|
145 |
+
}
|
146 |
+
if ($hl->setting_val(CrayonSettings::TOOLBAR_HIDE)) {
|
147 |
+
$toolbar_settings .= ' hide';
|
148 |
+
}
|
149 |
+
if ($hl->setting_val(CrayonSettings::TOOLBAR_DELAY)) {
|
150 |
+
$toolbar_settings .= ' delay';
|
151 |
+
}
|
152 |
+
} else if ($hl->setting_index(CrayonSettings::TOOLBAR) == 1) {
|
153 |
+
// Always display the toolbar
|
154 |
+
$toolbar_settings .= 'show';
|
155 |
+
} else {
|
156 |
+
$toolbar_settings .= '';
|
157 |
+
}
|
158 |
+
if ($hl->setting_val(CrayonSettings::PLAIN)) {
|
159 |
+
// Different events to display plain code
|
160 |
+
switch ($hl->setting_index(CrayonSettings::SHOW_PLAIN)) {
|
161 |
+
case 0 :
|
162 |
+
$plain_settings = 'dblclick';
|
163 |
+
break;
|
164 |
+
case 1 :
|
165 |
+
$plain_settings = 'click';
|
166 |
+
break;
|
167 |
+
case 2 :
|
168 |
+
$plain_settings = 'mouseover';
|
169 |
+
break;
|
170 |
+
default :
|
171 |
+
$plain_settings = '';
|
172 |
+
}
|
173 |
+
$tab = $hl->setting_val(CrayonSettings::TAB_SIZE);
|
174 |
+
// TODO doesn't seem to work at the moment
|
175 |
+
$plain_style = "-moz-tab-size:$tab; -o-tab-size:$tab; -webkit-tab-size:$tab; tab-size:$tab;";
|
176 |
+
$print_plain = '<textarea class="crayon-plain" settings="' . $plain_settings . '" readonly wrap="off" style="' . $plain_style .'">' . $hl->code() . '</textarea>';
|
177 |
+
$print_plain_button = '<a href="#" class="crayon-plain-button crayon-button" title="Toggle Plain Code" onclick="toggle_plain(\'' . $uid . '\'); return false;"></a>';
|
178 |
+
} else {
|
179 |
+
$print_plain = $plain_settings = $print_plain_button = '';
|
180 |
+
}
|
181 |
+
if ($hl->setting_val(CrayonSettings::NUMS_TOGGLE)) {
|
182 |
+
$print_nums_button = '<a href="#" class="crayon-nums-button crayon-button" title="Toggle Line Numbers" onclick="toggle_nums(\'' . $uid . '\'); return false;"></a>';
|
183 |
+
} else {
|
184 |
+
$print_nums_button = '';
|
185 |
+
}
|
186 |
+
/* The table is rendered invisible by CSS and enabled with JS when asked to. If JS
|
187 |
+
is not enabled or fails, the toolbar won't work so there is no point to display it. */
|
188 |
+
$toolbar = <<<EOT
|
189 |
+
<div class="crayon-toolbar" settings="{$toolbar_settings}">
|
190 |
+
{$print_title}
|
191 |
+
<div class="crayon-tools">
|
192 |
+
{$print_nums_button}
|
193 |
+
{$print_plain_button}
|
194 |
+
{$print_lang}
|
195 |
+
</div>
|
196 |
+
</div>
|
197 |
+
{$print_plain}
|
198 |
+
EOT;
|
199 |
+
} else {
|
200 |
+
$toolbar = $plain_settings = '';
|
201 |
+
}
|
202 |
+
|
203 |
+
// Print strings
|
204 |
+
$output = $main_style = $code_style = $font_style = '';
|
205 |
+
|
206 |
+
// Line numbers visibility
|
207 |
+
$num_vis = $num_settings = '';
|
208 |
+
if ($line_numbers === FALSE) {
|
209 |
+
$num_vis = 'crayon-invisible';
|
210 |
+
} else {
|
211 |
+
$num_settings = ($hl->setting_val(CrayonSettings::NUMS) ? 'show' : 'hide');
|
212 |
+
}
|
213 |
+
|
214 |
+
// If theme not found, use default
|
215 |
+
$theme_id = $hl->setting_val(CrayonSettings::THEME);
|
216 |
+
$theme = CrayonResources::themes()->get($theme_id);
|
217 |
+
if (!$theme) {
|
218 |
+
$theme = CrayonResources::themes()->get_default();
|
219 |
+
$theme_id = CrayonThemes::DEFAULT_THEME;
|
220 |
+
}
|
221 |
+
$theme_id_dashed = CrayonUtil::clean_css_name($theme_id);
|
222 |
+
|
223 |
+
// Only load css once for each theme
|
224 |
+
if (!empty($theme_id) && $theme != NULL && !$theme->used()) {
|
225 |
+
// Record usage
|
226 |
+
$theme->used(TRUE);
|
227 |
+
// Add style
|
228 |
+
$url = CrayonGlobalSettings::plugin_path() . CrayonUtil::path_f_slash(CRAYON_THEME_DIR) . $theme_id . '/' . $theme_id . '.css?ver' . CRAYON_VERSION;
|
229 |
+
$output .= '<link rel="stylesheet" type="text/css" href="' . $url . '" />' . CRAYON_NL;
|
230 |
+
}
|
231 |
+
|
232 |
+
// Load font css if not default
|
233 |
+
$font_id = $hl->setting_val(CrayonSettings::FONT);
|
234 |
+
$font_id_dashed = '';
|
235 |
+
$font = CrayonResources::fonts()->get($font_id);
|
236 |
+
if ($hl->setting_val(CrayonSettings::FONT) != CrayonFonts::DEFAULT_FONT && !empty($font_id) && $font != NULL && !$font->used()) {
|
237 |
+
$url = CrayonGlobalSettings::plugin_path() . CrayonUtil::path_f_slash(CRAYON_FONT_DIR) . $font_id . '.css?ver' . CRAYON_VERSION;
|
238 |
+
$output .= '<link rel="stylesheet" type="text/css" href="' . $url . '" />' . CRAYON_NL;
|
239 |
+
$font_id_dashed = ' crayon-font-' . CrayonUtil::clean_css_name($font_id);
|
240 |
+
}
|
241 |
+
|
242 |
+
// Determine font size
|
243 |
+
if ($hl->setting_val(CrayonSettings::FONT_SIZE_ENABLE)) {
|
244 |
+
$font_size = $hl->setting_val(CrayonSettings::FONT_SIZE);
|
245 |
+
$font_height = ($font_size + 4) . 'px;';
|
246 |
+
$toolbar_height = ($font_size + 8) . 'px;';
|
247 |
+
$font_style = "#$uid * { font-size: " . $font_size . "px; line-height: $font_height}\n\t";
|
248 |
+
$font_style .= "#$uid .crayon-toolbar, #$uid .crayon-toolbar div { height: $toolbar_height line-height: $toolbar_height }\n\t";
|
249 |
+
$font_style .= "#$uid .crayon-num, #$uid .crayon-line, #$uid .crayon-toolbar a.crayon-button { height: $font_height }";
|
250 |
+
}
|
251 |
+
|
252 |
+
// Determine scrollbar visibility
|
253 |
+
switch ($hl->setting_index(CrayonSettings::SCROLL) && !$touch) {
|
254 |
+
case 0 :
|
255 |
+
$code_settings .= ' scroll-mouseover';
|
256 |
+
break;
|
257 |
+
default :
|
258 |
+
$code_settings .= ' scroll-always';
|
259 |
+
}
|
260 |
+
|
261 |
+
// Disable animations
|
262 |
+
if ($hl->setting_val(CrayonSettings::DISABLE_ANIM)) {
|
263 |
+
$code_settings .= ' disable-anim';
|
264 |
+
}
|
265 |
+
|
266 |
+
// Determine dimensions
|
267 |
+
if ($hl->setting_val(CrayonSettings::HEIGHT_SET)) {
|
268 |
+
$height_style = self::dimension_style($hl, CrayonSettings::HEIGHT);
|
269 |
+
// XXX Only set height for main, not code (if toolbar always visible, code will cover main)
|
270 |
+
if ($hl->setting_index(CrayonSettings::HEIGHT_UNIT) == 0) {
|
271 |
+
$main_style .= $height_style;
|
272 |
+
}
|
273 |
+
}
|
274 |
+
if ($hl->setting_val(CrayonSettings::WIDTH_SET)) {
|
275 |
+
$width_style = self::dimension_style($hl, CrayonSettings::WIDTH);
|
276 |
+
$code_style .= $width_style;
|
277 |
+
if ($hl->setting_index(CrayonSettings::WIDTH_UNIT) == 0) {
|
278 |
+
$main_style .= $width_style;
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
// Determine margins
|
283 |
+
if ($hl->setting_val(CrayonSettings::TOP_SET)) {
|
284 |
+
$code_style .= ' margin-top: ' . $hl->setting_val(CrayonSettings::TOP_MARGIN) . 'px;';
|
285 |
+
}
|
286 |
+
if ($hl->setting_val(CrayonSettings::BOTTOM_SET)) {
|
287 |
+
$code_style .= ' margin-bottom: ' . $hl->setting_val(CrayonSettings::BOTTOM_MARGIN) . 'px;';
|
288 |
+
}
|
289 |
+
if ($hl->setting_val(CrayonSettings::LEFT_SET)) {
|
290 |
+
$code_style .= ' margin-left: ' . $hl->setting_val(CrayonSettings::LEFT_MARGIN) . 'px;';
|
291 |
+
}
|
292 |
+
if ($hl->setting_val(CrayonSettings::RIGHT_SET)) {
|
293 |
+
$code_style .= ' margin-right: ' . $hl->setting_val(CrayonSettings::RIGHT_MARGIN) . 'px;';
|
294 |
+
}
|
295 |
+
|
296 |
+
// Determine horizontal alignment
|
297 |
+
$align_style = ' float: none;';
|
298 |
+
switch ($hl->setting_index(CrayonSettings::H_ALIGN)) {
|
299 |
+
case 1 :
|
300 |
+
$align_style = ' float: left;';
|
301 |
+
break;
|
302 |
+
case 2 :
|
303 |
+
$align_style = ' float: none; margin-left: auto; margin-right: auto;';
|
304 |
+
break;
|
305 |
+
case 3 :
|
306 |
+
$align_style = ' float: right;';
|
307 |
+
break;
|
308 |
+
}
|
309 |
+
$code_style .= $align_style;
|
310 |
+
|
311 |
+
// Determine allowed float elements
|
312 |
+
if ($hl->setting_val(CrayonSettings::FLOAT_ENABLE)) {
|
313 |
+
$clear_style = ' clear: none;';
|
314 |
+
} else {
|
315 |
+
$clear_style = ' clear: both;';
|
316 |
+
}
|
317 |
+
$code_style .= $clear_style;
|
318 |
+
|
319 |
+
if ($hl->setting_val(CrayonSettings::FONT_SIZE_ENABLE)) {
|
320 |
+
// Produce style for individual crayon
|
321 |
+
$output .= <<<EOT
|
322 |
+
<style type="text/css">
|
323 |
+
{$font_style}
|
324 |
+
</style>
|
325 |
+
EOT;
|
326 |
+
}
|
327 |
+
|
328 |
+
// Produce output
|
329 |
+
$output .= <<<EOT
|
330 |
+
<div id="{$uid}" class="crayon-syntax crayon-theme-{$theme_id_dashed}{$font_id_dashed}" settings="{$code_settings}" style="{$code_style}">
|
331 |
+
{$toolbar}
|
332 |
+
<div class="crayon-main" style="{$main_style}">
|
333 |
+
<table class="crayon-table" cellpadding="0" cellspacing="0">
|
334 |
+
<tr class="crayon-row">
|
335 |
+
EOT;
|
336 |
+
|
337 |
+
if ($print_nums !== FALSE) {
|
338 |
+
$output .= <<<EOT
|
339 |
+
<td class="crayon-nums {$num_vis}" settings="{$num_settings}">
|
340 |
+
<div class="crayon-nums-content">{$print_nums}</div>
|
341 |
+
</td>
|
342 |
+
EOT;
|
343 |
+
}
|
344 |
+
|
345 |
+
$output .= <<<EOT
|
346 |
+
<td class="crayon-code"><div class="crayon-pre">{$print_code}</div></td>
|
347 |
+
</tr>
|
348 |
+
</table>
|
349 |
+
</div>
|
350 |
+
</div>
|
351 |
+
EOT;
|
352 |
+
// Debugging stats
|
353 |
+
$runtime = $hl->runtime();
|
354 |
+
if (!$hl->setting_val(CrayonSettings::DISABLE_RUNTIME) && is_array($runtime) && !empty($runtime)) {
|
355 |
+
$output = CRAYON_NL . CRAYON_NL . '<!-- Crayon Syntax Highlighter v' . CRAYON_VERSION . ' -->'
|
356 |
+
. CRAYON_NL . $output . CRAYON_NL . '<!-- ';
|
357 |
+
foreach ($hl->runtime() as $type => $time) {
|
358 |
+
$output .= '[' . $type . ': ' . sprintf('%.4f seconds', $time) . '] ';
|
359 |
+
}
|
360 |
+
$output .= '-->' . CRAYON_NL . CRAYON_NL;
|
361 |
+
}
|
362 |
+
// Determine whether to print to screen or save
|
363 |
+
if ($print) {
|
364 |
+
echo $output;
|
365 |
+
} else {
|
366 |
+
return $output;
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
function print_error($hl, $error, $line_numbers = 'ERROR', $print = TRUE) {
|
371 |
+
if (get_class($hl) != CRAYON_HIGHLIGHTER) {
|
372 |
+
return;
|
373 |
+
}
|
374 |
+
// Either print the error returned by the handler, or a custom error message
|
375 |
+
if ($hl->setting_val(CrayonSettings::ERROR_MSG_SHOW)) {
|
376 |
+
$error = $hl->setting_val(CrayonSettings::ERROR_MSG);
|
377 |
+
}
|
378 |
+
$error = self::split_lines(trim($error), 'error');
|
379 |
+
return self::print_code($hl, $error, $line_numbers, $print);
|
380 |
+
}
|
381 |
+
|
382 |
+
// Auxiliary Methods ======================================================
|
383 |
+
/* Prepares code for formatting. */
|
384 |
+
public static function clean_code($code) {
|
385 |
+
if (empty($code)) {
|
386 |
+
return $code;
|
387 |
+
}
|
388 |
+
/* Replace <, > and & characters, as these can appear as HTML tags and entities. */
|
389 |
+
$code = htmlspecialchars($code, ENT_NOQUOTES);
|
390 |
+
// Replace 2 spaces with html escaped characters
|
391 |
+
$code = preg_replace('| |', ' ', $code);
|
392 |
+
// Replace tabs with 4 spaces
|
393 |
+
$code = preg_replace('|\t|', str_repeat(' ', CrayonGlobalSettings::val(CrayonSettings::TAB_SIZE)), $code);
|
394 |
+
/* $code = preg_replace('|\t|', ' ', $code);
|
395 |
+
// Add a line break for empty lines
|
396 |
+
$code = preg_replace('|^$|m', ' ', $code); // CRAYON_BR ^\r$\n becomes ^\r<br/>\n
|
397 |
+
// The last line can be entirely blank, without any \n, we need to make it render as a
|
398 |
+
// blank line, just like in a text editor when you do a \n
|
399 |
+
$code = preg_replace('|$\r?\n|', "\n ", $code);*/
|
400 |
+
return $code;
|
401 |
+
}
|
402 |
+
|
403 |
+
public static function split_lines($code, $class) {
|
404 |
+
$code = self::clean_code($code);
|
405 |
+
$code = preg_replace('|^|m', "<span class=\"$class\">", $code);
|
406 |
+
$code = preg_replace('|$|m', "</span>", $code);
|
407 |
+
return $code;
|
408 |
+
}
|
409 |
+
|
410 |
+
private static function dimension_style($hl, $name) {
|
411 |
+
$mode = $unit = '';
|
412 |
+
switch ($name) {
|
413 |
+
case CrayonSettings::HEIGHT :
|
414 |
+
$mode = CrayonSettings::HEIGHT_MODE;
|
415 |
+
$unit = CrayonSettings::HEIGHT_UNIT;
|
416 |
+
break;
|
417 |
+
case CrayonSettings::WIDTH :
|
418 |
+
$mode = CrayonSettings::WIDTH_MODE;
|
419 |
+
$unit = CrayonSettings::WIDTH_UNIT;
|
420 |
+
break;
|
421 |
+
}
|
422 |
+
// XXX Uses actual index value to identify options
|
423 |
+
$mode = $hl->setting_index($mode);
|
424 |
+
$unit = $hl->setting_index($unit);
|
425 |
+
$dim_mode = $dim_unit = '';
|
426 |
+
if ($mode !== FALSE) {
|
427 |
+
switch ($mode) {
|
428 |
+
case 0 :
|
429 |
+
$dim_mode .= 'max-';
|
430 |
+
break;
|
431 |
+
case 1 :
|
432 |
+
$dim_mode .= 'min-';
|
433 |
+
break;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
$dim_mode .= $name;
|
437 |
+
if ($unit !== FALSE) {
|
438 |
+
switch ($unit) {
|
439 |
+
case 0 :
|
440 |
+
$dim_unit = 'px';
|
441 |
+
break;
|
442 |
+
case 1 :
|
443 |
+
$dim_unit = '%';
|
444 |
+
break;
|
445 |
+
}
|
446 |
+
}
|
447 |
+
return ' ' . $dim_mode . ': ' . $hl->setting_val($name) . $dim_unit . ';';
|
448 |
+
}
|
449 |
+
}
|
450 |
+
?>
|
crayon_highlighter.class.php
ADDED
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Class includes
|
3 |
+
require_once ('global.php');
|
4 |
+
require_once (CRAYON_PARSER_PHP);
|
5 |
+
require_once (CRAYON_FORMATTER_PHP);
|
6 |
+
require_once (CRAYON_SETTINGS_PHP);
|
7 |
+
require_once (CRAYON_LANGS_PHP);
|
8 |
+
|
9 |
+
/* The main class for managing the syntax highlighter */
|
10 |
+
class CrayonHighlighter {
|
11 |
+
// Properties and Constants ===============================================
|
12 |
+
private $url = '';
|
13 |
+
private $code = '';
|
14 |
+
private $formatted_code = '';
|
15 |
+
private $title = '';
|
16 |
+
private $line_count = 0;
|
17 |
+
private $marked_lines = array();
|
18 |
+
private $error = '';
|
19 |
+
// Determine whether the code needs to be loaded, parsed or formatted
|
20 |
+
private $needs_load = TRUE;
|
21 |
+
private $needs_parse = TRUE;
|
22 |
+
private $needs_format = TRUE;
|
23 |
+
// Record the script run times
|
24 |
+
private $runtime = array();
|
25 |
+
|
26 |
+
// Objects
|
27 |
+
// Stores the CrayonLang being used
|
28 |
+
private $language = NULL;
|
29 |
+
// A copy of the current global settings which can be overridden
|
30 |
+
private $settings = NULL;
|
31 |
+
|
32 |
+
// Methods ================================================================
|
33 |
+
function __construct($url = NULL, $language = NULL) {
|
34 |
+
if ($url !== NULL) {
|
35 |
+
$this->url($url);
|
36 |
+
}
|
37 |
+
if ($language !== NULL) {
|
38 |
+
$this->language($language);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
/* Tries to load the code locally, then attempts to load it remotely */
|
43 |
+
private function load() {
|
44 |
+
if (empty($this->url)) {
|
45 |
+
$this->error('The specified URL is empty, please provide a valid URL.');
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
/* Try to replace the URL with an absolute path if it is local, used to prevent scripts
|
49 |
+
from executing when they are loaded. */
|
50 |
+
$url = $this->url;
|
51 |
+
$local = FALSE; // Whether to read locally
|
52 |
+
$site_http = CrayonGlobalSettings::site_http();
|
53 |
+
$site_path = CrayonGlobalSettings::site_path();
|
54 |
+
|
55 |
+
// Try to replace the site URL with a path to force local loading
|
56 |
+
if (strpos($url, $site_http) !== FALSE || strpos($url, $site_path) !== FALSE ) {
|
57 |
+
$url = str_replace($site_http, $site_path, $url);
|
58 |
+
// Attempt to load locally
|
59 |
+
$local = TRUE;
|
60 |
+
} else {
|
61 |
+
$scheme = parse_url($url, PHP_URL_SCHEME);
|
62 |
+
if (empty($scheme)) {
|
63 |
+
// No url scheme is given - path may be given as relative
|
64 |
+
$url = preg_replace('#^(\\/*)?#', $site_path . $this->setting_val(CrayonSettings::LOCAL_PATH), $url);
|
65 |
+
$local = TRUE;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
// Try to find the file locally
|
69 |
+
if ($local == TRUE || strpos($url, $site_path) !== FALSE) {
|
70 |
+
if ( ($contents = CrayonUtil::file($url)) !== FALSE ) {
|
71 |
+
$this->code($contents);
|
72 |
+
} else {
|
73 |
+
$local = FALSE;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
// If reading the url locally produced an error or failed, attempt remote request
|
77 |
+
if ($local == FALSE/* || $this->code == FALSE*/) {
|
78 |
+
$http_code = 0;
|
79 |
+
if (function_exists('wp_remote_get')) {
|
80 |
+
// If available, use the built in wp remote http get function, we don't need SSL
|
81 |
+
$response = wp_remote_get($url, array('sslverify' => false));
|
82 |
+
$content = wp_remote_retrieve_body($response);
|
83 |
+
$http_code = wp_remote_retrieve_response_code($response);
|
84 |
+
} else {
|
85 |
+
$ch = curl_init($url);
|
86 |
+
curl_setopt($ch, CURLOPT_HEADER, FALSE);
|
87 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
88 |
+
// For https connections, we do not require SSL verification
|
89 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
90 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
|
91 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
|
92 |
+
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
|
93 |
+
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
|
94 |
+
$content = curl_exec($ch);
|
95 |
+
$error = curl_error($ch);
|
96 |
+
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
97 |
+
curl_close($ch);
|
98 |
+
}
|
99 |
+
if ($http_code >= 200 && $http_code < 400) {
|
100 |
+
$this->code = $content;
|
101 |
+
} else {
|
102 |
+
if (empty($this->code)) {
|
103 |
+
// If code is also given, just use that
|
104 |
+
$this->error("The provided URL ('$url') could not be accessed locally or remotely.");
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
$this->needs_load = FALSE;
|
109 |
+
}
|
110 |
+
|
111 |
+
/* Central point of access for all other functions to update code. */
|
112 |
+
private function process($highlight = TRUE) {
|
113 |
+
$tmr = new CrayonTimer();
|
114 |
+
$this->runtime = NULL;
|
115 |
+
if ($this->needs_load) {
|
116 |
+
$tmr->start();
|
117 |
+
$this->load();
|
118 |
+
$this->runtime[CRAYON_LOAD_TIME] = $tmr->stop();
|
119 |
+
}
|
120 |
+
if (!empty($this->error) || empty($this->code)) {
|
121 |
+
// Disable highlighting for errors and empty code
|
122 |
+
return;
|
123 |
+
}
|
124 |
+
// Build the syntax regex, elements and regex are passed by reference
|
125 |
+
if ($this->needs_parse) {
|
126 |
+
$tmr->start();
|
127 |
+
if (empty($this->language)) {
|
128 |
+
$this->language($this->setting_val(CrayonSettings::FALLBACK_LANG));
|
129 |
+
}
|
130 |
+
|
131 |
+
if ( $this->language != NULL && !$this->language->is_default() && !$this->language->is_parsed()) {
|
132 |
+
CrayonParser::parse($this->language()->id());
|
133 |
+
}
|
134 |
+
$this->needs_parse = FALSE;
|
135 |
+
$this->runtime[CRAYON_PARSE_TIME] = $tmr->stop();
|
136 |
+
}
|
137 |
+
if ($this->needs_format) {
|
138 |
+
$tmr->start();
|
139 |
+
try {
|
140 |
+
// Format the code with the generated regex and elements
|
141 |
+
$this->formatted_code = CrayonFormatter::format_code($this->code, $this->language, $highlight, $this);
|
142 |
+
} catch (Exception $e) {
|
143 |
+
$this->error($e->message());
|
144 |
+
return;
|
145 |
+
}
|
146 |
+
$this->needs_format = FALSE;
|
147 |
+
$this->runtime[CRAYON_FORMAT_TIME] = $tmr->stop();
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
/* Sends the code to the formatter for printing. Apart from the getters and setters, this is
|
152 |
+
the only other function accessible outside this class. $show_lines can also be a string. */
|
153 |
+
function output($highlight = TRUE, $show_lines = TRUE, $print = TRUE) {
|
154 |
+
$this->process($highlight);
|
155 |
+
if (empty($this->error)) {
|
156 |
+
// If no errors have occured, print the formatted code
|
157 |
+
$ret = CrayonFormatter::print_code($this, $this->formatted_code, $show_lines, $print);
|
158 |
+
} else {
|
159 |
+
$ret = CrayonFormatter::print_error($this, $this->error, /*'ERROR'*/'', $print);
|
160 |
+
}
|
161 |
+
// Reset the error message at the end of the print session
|
162 |
+
$this->error = '';
|
163 |
+
// If $print = FALSE, $ret will contain the output
|
164 |
+
return $ret;
|
165 |
+
}
|
166 |
+
|
167 |
+
// Getters and Setters ====================================================
|
168 |
+
function code($code = NULL) {
|
169 |
+
if ($code === NULL) {
|
170 |
+
return $this->code;
|
171 |
+
} else {
|
172 |
+
// Trim whitespace
|
173 |
+
if ($this->setting_val(CrayonSettings::TRIM_WHITESPACE)) {
|
174 |
+
$code = preg_replace("#(?:^\\s*\\r?\\n)|(?:\\r?\\n\\s*$)#", '', $code);
|
175 |
+
}
|
176 |
+
$this->code = $code;
|
177 |
+
$this->needs_load = FALSE; // No need to load, code provided
|
178 |
+
$this->needs_format = TRUE;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
function language($id = NULL) {
|
183 |
+
if ($id === NULL || !is_string($id)) {
|
184 |
+
return $this->language;
|
185 |
+
}
|
186 |
+
|
187 |
+
if ( ($lang = CrayonResources::langs()->get($id)) != FALSE ) {
|
188 |
+
// Set the language if it exists
|
189 |
+
$this->language = $lang;
|
190 |
+
} else {
|
191 |
+
// Attempt to detect the language
|
192 |
+
if (!empty($id)) {
|
193 |
+
$this->log("The language '$id' could not be loaded.");
|
194 |
+
}
|
195 |
+
$this->language = CrayonResources::langs()->detect($this->url, $this->setting_val(CrayonSettings::FALLBACK_LANG));
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
function url($url = NULL) {
|
200 |
+
if (CrayonUtil::str($this->url, $url)) {
|
201 |
+
$this->needs_load = TRUE;
|
202 |
+
} else {
|
203 |
+
return $this->url;
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
function title($title = NULL) {
|
208 |
+
if (!CrayonUtil::str($this->title, $title)) {
|
209 |
+
return $this->title;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
function line_count($line_count = NULL) {
|
214 |
+
if (!CrayonUtil::num($this->line_count, $line_count)) {
|
215 |
+
return $this->line_count;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
function marked($str = NULL) {
|
220 |
+
if ($str === NULL) {
|
221 |
+
return $this->marked_lines;
|
222 |
+
}
|
223 |
+
// If only an int is given
|
224 |
+
if (is_int($str)) {
|
225 |
+
$array = array($str);
|
226 |
+
return CrayonUtil::arr($this->marked_lines, $array);
|
227 |
+
}
|
228 |
+
// A string with ints separated by commas, can also contain ranges
|
229 |
+
$array = CrayonUtil::trim_e($str);
|
230 |
+
$array = array_unique($array);
|
231 |
+
$lines = array();
|
232 |
+
foreach ($array as $line) {
|
233 |
+
// Check for ranges
|
234 |
+
if (strpos($line, '-')) {
|
235 |
+
$ranges = CrayonUtil::range_str($str);
|
236 |
+
$lines = array_merge($lines, $ranges);
|
237 |
+
} else {
|
238 |
+
// Otherwise check the string for a number
|
239 |
+
$line = CrayonUtil::clean_int($line);
|
240 |
+
if ($line !== FALSE) {
|
241 |
+
$lines[] = $line;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
245 |
+
return CrayonUtil::arr($this->marked_lines, $lines);
|
246 |
+
}
|
247 |
+
|
248 |
+
function log($var) {
|
249 |
+
if ($this->setting_val(CrayonSettings::ERROR_LOG)) {
|
250 |
+
CrayonLog::log($var);
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
function error($string = NULL) {
|
255 |
+
if (!$string) {
|
256 |
+
return $this->error;
|
257 |
+
}
|
258 |
+
$this->error .= $string;
|
259 |
+
$this->log($string);
|
260 |
+
// Add the error string and ensure no further processing occurs
|
261 |
+
$this->needs_load = FALSE;
|
262 |
+
$this->needs_parse = FALSE;
|
263 |
+
$this->needs_format = FALSE;
|
264 |
+
}
|
265 |
+
|
266 |
+
// Set and retreive settings
|
267 |
+
function settings($mixed = NULL) {
|
268 |
+
if ($this->settings == NULL) {
|
269 |
+
$this->settings = CrayonGlobalSettings::get_obj();
|
270 |
+
}
|
271 |
+
|
272 |
+
if ($mixed === NULL) {
|
273 |
+
return $this->settings;
|
274 |
+
} else if (is_string($mixed)) {
|
275 |
+
return $this->settings->get($mixed);
|
276 |
+
} else if (is_array($mixed)) {
|
277 |
+
$this->settings->set($mixed);
|
278 |
+
return TRUE;
|
279 |
+
}
|
280 |
+
return FALSE;
|
281 |
+
}
|
282 |
+
|
283 |
+
/* Retrieve a single setting's value for use in the formatter. By default, on failure it will
|
284 |
+
* return TRUE to ensure FALSE is only sent when a setting is found. This prevents a fake
|
285 |
+
* FALSE when the formatter checks for a positive setting (Show/Enable) and fails. When a
|
286 |
+
* negative setting is needed (Hide/Disable), $default_return should be set to FALSE. */
|
287 |
+
function setting_val($name = NULL, $default_return = TRUE) {
|
288 |
+
if (is_string($name) && $setting = $this->settings($name)) {
|
289 |
+
return $setting->value();
|
290 |
+
} else {
|
291 |
+
// Name not valid
|
292 |
+
return (is_bool($default_return) ? $default_return : TRUE);
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
// Used to find current index in dropdown setting
|
297 |
+
function setting_index($name = NULL) {
|
298 |
+
$setting = $this->settings($name);
|
299 |
+
if (is_string($name) && $setting->is_array()) {
|
300 |
+
return $setting->index();
|
301 |
+
} else {
|
302 |
+
// Returns -1 to avoid accidentally selecting an item in a dropdown
|
303 |
+
return CrayonSettings::INVALID;
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
function formatted_code() {
|
308 |
+
return $this->formatted_code;
|
309 |
+
}
|
310 |
+
|
311 |
+
function runtime() {
|
312 |
+
return $this->runtime;
|
313 |
+
}
|
314 |
+
}
|
315 |
+
?>
|
crayon_langs.class.php
ADDED
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_RESOURCE_PHP);
|
4 |
+
|
5 |
+
/* Manages languages once they are loaded. The parser directly loads them, saves them here. */
|
6 |
+
class CrayonLangs extends CrayonResourceCollection {
|
7 |
+
// Properties and Constants ===============================================
|
8 |
+
// CSS classes for known elements
|
9 |
+
private static $known_elements = array('COMMENT' => 'c', 'STRING' => 's', 'KEYWORD' => 'k',
|
10 |
+
'STATEMENT' => 'st', 'RESERVED' => 'r', 'TYPE' => 't', 'MODIFIER' => 'm', 'IDENTIFIER' => 'i',
|
11 |
+
'ENTITY' => 'e', 'VARIABLE' => 'v', 'CONSTANT' => 'cn', 'OPERATOR' => 'o', 'SYMBOL' => 'sy',
|
12 |
+
'NOTATION' => 'n', 'FADED' => 'f', CrayonParser::HTML_CHAR => 'h');
|
13 |
+
const DEFAULT_LANG = 'default';
|
14 |
+
const DEFAULT_LANG_NAME = 'Default';
|
15 |
+
|
16 |
+
// Methods ================================================================
|
17 |
+
public function __construct() {
|
18 |
+
$this->set_default(self::DEFAULT_LANG, self::DEFAULT_LANG_NAME);
|
19 |
+
$this->directory(CRAYON_LANG_PATH);
|
20 |
+
}
|
21 |
+
|
22 |
+
// XXX Override
|
23 |
+
public function path($id) {
|
24 |
+
return CRAYON_LANG_PATH . $id . crayon_slash() . "$id.txt";
|
25 |
+
}
|
26 |
+
|
27 |
+
// XXX Override
|
28 |
+
public function load_process() {
|
29 |
+
parent::load_process();
|
30 |
+
$this->load_exts();
|
31 |
+
}
|
32 |
+
|
33 |
+
// XXX Override
|
34 |
+
public function resource_instance($id, $name = NULL) {
|
35 |
+
return new CrayonLang($id, $name);
|
36 |
+
}
|
37 |
+
|
38 |
+
// XXX Override
|
39 |
+
public function add_default() {
|
40 |
+
$result = parent::add_default();
|
41 |
+
if ($this->is_state_loading() && !$result) {
|
42 |
+
// Default not added, must already be loaded, ready to parse
|
43 |
+
CrayonParser::parse(self::DEFAULT_LANG);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
/* Attempts to detect the language based on extension, otherwise falls back to fallback language given.
|
48 |
+
* Returns a CrayonLang object. */
|
49 |
+
public function detect($path, $fallback_id = NULL) {
|
50 |
+
$this->load();
|
51 |
+
extract(pathinfo($path));
|
52 |
+
|
53 |
+
// If fallback id if given
|
54 |
+
if ($fallback_id == NULL) {
|
55 |
+
// Otherwise use global fallback
|
56 |
+
$fallback_id = CrayonGlobalSettings::get(CrayonSettings::FALLBACK_LANG);
|
57 |
+
}
|
58 |
+
// Attempt to use fallback
|
59 |
+
$fallback = $this->get($fallback_id);
|
60 |
+
// Use extension before trying fallback
|
61 |
+
$extension = isset($extension) ? $extension : '';
|
62 |
+
|
63 |
+
if ( !empty($extension) && ($lang = $this->ext($extension)) || ($lang = $this->get($extension)) ) {
|
64 |
+
// If extension is found, attempt to find a language for it.
|
65 |
+
// If that fails, attempt to load a language with the same id as the extension.
|
66 |
+
return $lang;
|
67 |
+
} else if ($fallback != NULL || $fallback = $this->get_default()) {
|
68 |
+
// Resort to fallback if loaded, or fallback to default
|
69 |
+
return $fallback;
|
70 |
+
} else {
|
71 |
+
// No language found
|
72 |
+
return NULL;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
/* Load all extensions and add them into each language. */
|
77 |
+
private function load_exts() {
|
78 |
+
// Load only once
|
79 |
+
if (!$this->is_state_loading()) {
|
80 |
+
return;
|
81 |
+
}
|
82 |
+
if ( ($lines = CrayonUtil::lines(CRAYON_LANG_EXT, 'lwc')) !== FALSE) {
|
83 |
+
foreach ($lines as $line) {
|
84 |
+
preg_match('#^[\t ]*([^\r\n\t ]+)[\t ]+([^\r\n]+)#', $line, $matches);
|
85 |
+
if (count($matches) == 3 && $lang = $this->get($matches[1])) {
|
86 |
+
// Add the extension if the language exists
|
87 |
+
$matches[2] = str_replace('.', '', $matches[2]);
|
88 |
+
$exts = explode(' ', $matches[2]);
|
89 |
+
foreach ($exts as $ext) {
|
90 |
+
$lang->ext($ext);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
+
} else {
|
95 |
+
CrayonLog::syslog('Could not load extensions file');
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/* Returns the CrayonLang for the given extension */
|
100 |
+
public function ext($ext) {
|
101 |
+
$this->load();
|
102 |
+
foreach ($this->get() as $lang) {
|
103 |
+
if ($lang->has_ext($ext)) {
|
104 |
+
return $lang;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
return FALSE;
|
108 |
+
}
|
109 |
+
|
110 |
+
/* Return the array of valid elements or a particular element value */
|
111 |
+
public static function known_elements($name = NULL) {
|
112 |
+
if ($name === NULL) {
|
113 |
+
return self::$known_elements;
|
114 |
+
} else if (is_string($name) && array_key_exists($name, self::$known_elements)) {
|
115 |
+
return self::$known_elements[$name];
|
116 |
+
} else {
|
117 |
+
return FALSE;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/* Verify an element is valid */
|
122 |
+
public static function is_known_element($name) {
|
123 |
+
return self::known_elements($name) !== FALSE;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function is_loaded($id) {
|
127 |
+
if (is_string($id)) {
|
128 |
+
return array_key_exists($id, $this->get());
|
129 |
+
}
|
130 |
+
return FALSE;
|
131 |
+
}
|
132 |
+
|
133 |
+
public function is_parsed($id = NULL) {
|
134 |
+
if ($id === NULL) {
|
135 |
+
// Determine if all langs are successfully parsed
|
136 |
+
foreach ($this->get() as $lang) {
|
137 |
+
if ($lang->state() != CrayonLang::PARSED_SUCCESS) {
|
138 |
+
return FALSE;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
return TRUE;
|
142 |
+
} else if (($lang = $this->get($id)) != FALSE) {
|
143 |
+
return $lang->is_parsed();
|
144 |
+
}
|
145 |
+
return FALSE;
|
146 |
+
}
|
147 |
+
|
148 |
+
public function is_default($id) {
|
149 |
+
if (($lang = $this->get($id)) != FALSE) {
|
150 |
+
return $lang->is_default();
|
151 |
+
}
|
152 |
+
return FALSE;
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
/* Individual language. */
|
157 |
+
class CrayonLang extends CrayonVersionResource {
|
158 |
+
private $ext = array();
|
159 |
+
// Associative array of CrayonElement objects
|
160 |
+
private $elements = array();
|
161 |
+
//private $regex = '';
|
162 |
+
private $state = self::UNPARSED;
|
163 |
+
private $modes = array();
|
164 |
+
const PARSED_ERRORS = -1;
|
165 |
+
const UNPARSED = 0;
|
166 |
+
const PARSED_SUCCESS = 1;
|
167 |
+
|
168 |
+
function __construct($id, $name = NULL) {
|
169 |
+
parent::__construct($id, $name);
|
170 |
+
$this->modes = CrayonParser::modes();
|
171 |
+
}
|
172 |
+
|
173 |
+
function ext($ext = NULL) {
|
174 |
+
if ($ext === NULL) {
|
175 |
+
return $this->ext;
|
176 |
+
} else if (is_string($ext) && !empty($ext) && !in_array($ext, $this->ext)) {
|
177 |
+
$this->ext[] = $ext;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
function has_ext($ext) {
|
182 |
+
return is_string($ext) && in_array($ext, $this->ext);
|
183 |
+
}
|
184 |
+
|
185 |
+
function regex($element = NULL) {
|
186 |
+
if ($element == NULL) {
|
187 |
+
$regexes = array();
|
188 |
+
foreach ($this->elements as $element) {
|
189 |
+
$regexes[] = $element->regex();
|
190 |
+
}
|
191 |
+
return '#' . '(?:(' . implode(')|(', array_values($regexes)) . '))' . '#' .
|
192 |
+
($this->mode(CrayonParser::CASE_INSENSITIVE) ? 'i' : '') .
|
193 |
+
($this->mode(CrayonParser::MULTI_LINE) ? 'm' : '') .
|
194 |
+
($this->mode(CrayonParser::SINGLE_LINE) ? 's' : '');
|
195 |
+
} else if (is_string($element) && array_key_exists($element, $this->elements)) {
|
196 |
+
return $this->elements[$element]->regex();
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
// Retrieve by element name or set by CrayonElement
|
201 |
+
function element($name, $element = NULL) {
|
202 |
+
if (is_string($name)) {
|
203 |
+
$name = trim(strtoupper($name));
|
204 |
+
if (array_key_exists($name, $this->elements) && $element === NULL) {
|
205 |
+
return $this->elements[$name];
|
206 |
+
} else if (@get_class($element) == CRAYON_ELEMENT_CLASS) {
|
207 |
+
$this->elements[$name] = $element;
|
208 |
+
}
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
function elements() {
|
213 |
+
return $this->elements;
|
214 |
+
}
|
215 |
+
|
216 |
+
function mode($name = NULL, $value = NULL) {
|
217 |
+
if (is_string($name) && CrayonParser::is_mode($name)) {
|
218 |
+
$name = trim(strtoupper($name));
|
219 |
+
if ($value == NULL && array_key_exists($name, $this->modes)) {
|
220 |
+
return $this->modes[$name];
|
221 |
+
} else if (is_string($value)) {
|
222 |
+
if (CrayonUtil::str_equal_array(trim($value), array('ON', 'YES', '1'))) {
|
223 |
+
$this->modes[$name] = TRUE;
|
224 |
+
} else if (CrayonUtil::str_equal_array(trim($value), array('OFF', 'NO', '0'))) {
|
225 |
+
$this->modes[$name] = FALSE;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
} else {
|
229 |
+
return $this->modes;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
function state($state = NULL) {
|
234 |
+
if ($state === NULL) {
|
235 |
+
return $this->state;
|
236 |
+
} else if (is_int($state)) {
|
237 |
+
if ($state < 0) {
|
238 |
+
$this->state = self::PARSED_ERRORS;
|
239 |
+
} else if ($state > 0) {
|
240 |
+
$this->state = self::PARSED_SUCCESS;
|
241 |
+
} else if ($state == 0) {
|
242 |
+
$this->state = self::UNPARSED;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
function state_info() {
|
248 |
+
switch ($this->state) {
|
249 |
+
case self::PARSED_ERRORS :
|
250 |
+
return 'Parsed With Errors';
|
251 |
+
case self::PARSED_SUCCESS :
|
252 |
+
return 'Successfully Parsed';
|
253 |
+
case self::UNPARSED :
|
254 |
+
return 'Not Parsed';
|
255 |
+
default :
|
256 |
+
return 'Undetermined';
|
257 |
+
}
|
258 |
+
}
|
259 |
+
|
260 |
+
function is_parsed() {
|
261 |
+
return ($this->state != self::UNPARSED);
|
262 |
+
}
|
263 |
+
|
264 |
+
function is_default() {
|
265 |
+
return $this->id() == CrayonLangs::DEFAULT_LANG;
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
class CrayonElement {
|
270 |
+
// The pure regex syntax without any modifiers or delimiters
|
271 |
+
private $name = '';
|
272 |
+
private $css = '';
|
273 |
+
private $regex = '';
|
274 |
+
private $fallback = '';
|
275 |
+
private $path = '';
|
276 |
+
|
277 |
+
function __construct($name, $path, $regex = '') {
|
278 |
+
$this->name($name);
|
279 |
+
$this->path($path);
|
280 |
+
$this->regex($regex);
|
281 |
+
}
|
282 |
+
|
283 |
+
function __toString() {
|
284 |
+
return $this->regex();
|
285 |
+
}
|
286 |
+
|
287 |
+
function name($name = NULL) {
|
288 |
+
if ($name == NULL) {
|
289 |
+
return $this->name;
|
290 |
+
} else if (is_string($name)) {
|
291 |
+
$name = trim(strtoupper($name));
|
292 |
+
if (CrayonLangs::is_known_element($name)) {
|
293 |
+
// If known element, set CSS to known class
|
294 |
+
$this->css(CrayonLangs::known_elements($name));
|
295 |
+
}
|
296 |
+
$this->name = $name;
|
297 |
+
}
|
298 |
+
}
|
299 |
+
|
300 |
+
function regex($regex = NULL) {
|
301 |
+
if ($regex == NULL) {
|
302 |
+
return $this->regex;
|
303 |
+
} else if (is_string($regex)) {
|
304 |
+
if (($result = CrayonParser::validate_regex($regex, $this)) !== FALSE) {
|
305 |
+
$this->regex = $result;
|
306 |
+
} else {
|
307 |
+
return FALSE;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
}
|
311 |
+
|
312 |
+
// Expects: 'class1 class2 class3'
|
313 |
+
function css($css = NULL) {
|
314 |
+
if ($css == NULL) {
|
315 |
+
return $this->css;
|
316 |
+
} else if (is_string($css)) {
|
317 |
+
$this->css = CrayonParser::validate_css($css);
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
function fallback($fallback = NULL) {
|
322 |
+
if ($fallback == NULL) {
|
323 |
+
return $this->fallback;
|
324 |
+
} else if (is_string($fallback) && CrayonLangs::is_known_element($fallback)) {
|
325 |
+
$this->fallback = $fallback;
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
function path($path = NULL) {
|
330 |
+
if ($path == NULL) {
|
331 |
+
return $this->path;
|
332 |
+
} else if (is_string($path) && @file_exists($path)) {
|
333 |
+
$this->path = $path;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
|
338 |
+
?>
|
crayon_parser.class.php
ADDED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_LANGS_PHP);
|
4 |
+
|
5 |
+
/* Manages parsing the syntax for any given language, constructing the regex, and validating the
|
6 |
+
elements. */
|
7 |
+
class CrayonParser {
|
8 |
+
// Properties and Constants ===============================================
|
9 |
+
const CASE_INSENSITIVE = 'CASE_INSENSITIVE';
|
10 |
+
const MULTI_LINE = 'MULTI_LINE';
|
11 |
+
const SINGLE_LINE = 'SINGLE_LINE';
|
12 |
+
const NO_END_TAG = '(?![^<]*>)';
|
13 |
+
const HTML_CHAR = 'HTML_CHAR';
|
14 |
+
const HTML_CHAR_REGEX = '<|>|(&([\w-]+);?)|[ \t]*';
|
15 |
+
|
16 |
+
private static $modes = array(self::CASE_INSENSITIVE => TRUE, self::MULTI_LINE => TRUE, self::SINGLE_LINE => TRUE);
|
17 |
+
|
18 |
+
// Methods ================================================================
|
19 |
+
private function __construct() {}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Parse all languages stored in CrayonLangs.
|
23 |
+
* Avoid using this unless you must list the details in language files for all languages.
|
24 |
+
* @return array Array of all loaded CrayonLangs.
|
25 |
+
*/
|
26 |
+
public static function parse_all() {
|
27 |
+
$langs = CrayonResources::langs()->get();
|
28 |
+
if (empty($langs)) {
|
29 |
+
return FALSE;
|
30 |
+
}
|
31 |
+
foreach ($langs as $lang) {
|
32 |
+
self::parse($lang->id());
|
33 |
+
}
|
34 |
+
return $langs;
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Read a syntax file and parse the regex rules within it, this may require several other
|
38 |
+
files containing lists of keywords and such to be read. Updates the parsed elements and
|
39 |
+
regex in the CrayonLang with the given $id. */
|
40 |
+
public static function parse($id) {
|
41 |
+
// Verify the language is loaded and has not been parsed before
|
42 |
+
if ( !($lang = CrayonResources::langs()->get($id)) ) {
|
43 |
+
CrayonLog::syslog("The language with id '$id' was not loaded and could not be parsed.");
|
44 |
+
return FALSE;
|
45 |
+
} else if ($lang->is_parsed()) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
// Read language file
|
49 |
+
$path = CrayonResources::langs()->path($id);
|
50 |
+
if ( ($file = CrayonUtil::lines($path, 'wcs')) === FALSE ) {
|
51 |
+
return FALSE;
|
52 |
+
}
|
53 |
+
|
54 |
+
// Extract the language name
|
55 |
+
$name_pattern = '#^[ \t]*name[ \t]+([^\r\n]+)[ \t]*#mi';
|
56 |
+
preg_match($name_pattern, $file, $name);
|
57 |
+
if (count($name) > 1) {
|
58 |
+
$name = $name[1];
|
59 |
+
$lang->name($name);
|
60 |
+
$file = preg_replace($name_pattern, '', $file);
|
61 |
+
} else {
|
62 |
+
$name = $lang->id();
|
63 |
+
}
|
64 |
+
|
65 |
+
// Extract the language version
|
66 |
+
$version_pattern = '#^[ \t]*version[ \t]+([^\r\n]+)[ \t]*#mi';
|
67 |
+
preg_match($version_pattern, $file, $version);
|
68 |
+
if (count($version) > 1) {
|
69 |
+
$version = $version[1];
|
70 |
+
$lang->version($version);
|
71 |
+
$file = preg_replace($version_pattern, '', $file);
|
72 |
+
}
|
73 |
+
|
74 |
+
// Extract the modes
|
75 |
+
$mode_pattern = '#^[ \t]*(' . implode('|', array_keys(self::$modes)) . ')[ \t]+(?:=[ \t]*)?([^\r\n]+)[ \t]*#mi';
|
76 |
+
preg_match_all($mode_pattern, $file, $mode_matches);
|
77 |
+
if (count($mode_matches) == 3) {
|
78 |
+
for ($i = 0; $i < count($mode_matches[0]); $i++) {
|
79 |
+
$lang->mode($mode_matches[1][$i], $mode_matches[2][$i]);
|
80 |
+
}
|
81 |
+
$file = preg_replace($mode_pattern, '', $file);
|
82 |
+
}
|
83 |
+
|
84 |
+
// Extract elements, classes and regex
|
85 |
+
$pattern = '#^[ \t]*([\w:]+)[ \t]+(?:\[([\w\t ]*)\][ \t]+)?([^\r\n]+)[ \t]*#m';
|
86 |
+
preg_match_all($pattern, $file, $matches);
|
87 |
+
|
88 |
+
if (!empty($matches[0])) {
|
89 |
+
$elements = $matches[1];
|
90 |
+
$classes = $matches[2];
|
91 |
+
$regexes = $matches[3];
|
92 |
+
} else {
|
93 |
+
CrayonLog::syslog("No regex patterns and/or elements were parsed from language file at '$path'.");
|
94 |
+
}
|
95 |
+
|
96 |
+
// Remember state in case we encounter catchable exceptions
|
97 |
+
$error = FALSE;
|
98 |
+
for ($i = 0; $i < count($matches[0]); $i++) {
|
99 |
+
// References
|
100 |
+
$name = &$elements[$i];
|
101 |
+
$class = &$classes[$i];
|
102 |
+
$regex = &$regexes[$i];
|
103 |
+
$name = trim(strtoupper($name));
|
104 |
+
// Ensure both the element and regex are valid
|
105 |
+
if (empty($name) || empty($regex)) {
|
106 |
+
CrayonLog::syslog("Element(s) and/or regex(es) are missing in '$path'.");
|
107 |
+
$error = TRUE;
|
108 |
+
continue;
|
109 |
+
}
|
110 |
+
// Look for fallback element
|
111 |
+
$pieces = explode(':', $name);
|
112 |
+
if (count($pieces) == 2) {
|
113 |
+
$name = $pieces[0];
|
114 |
+
$fallback = $pieces[1];
|
115 |
+
} else if (count($pieces) == 1) {
|
116 |
+
$name = $pieces[0];
|
117 |
+
$fallback = '';
|
118 |
+
} else {
|
119 |
+
CrayonLog::syslog("Too many colons found in element name '$name' in '$path'");
|
120 |
+
$error = TRUE;
|
121 |
+
continue;
|
122 |
+
}
|
123 |
+
// Create a new CrayonElement
|
124 |
+
$element = new CrayonElement($name, $path);
|
125 |
+
$element->fallback($fallback);
|
126 |
+
if (!empty($class)) {
|
127 |
+
// Avoid setting known css to blank
|
128 |
+
$element->css($class);
|
129 |
+
}
|
130 |
+
if ($element->regex($regex) === FALSE) {
|
131 |
+
$error = TRUE;
|
132 |
+
continue;
|
133 |
+
}
|
134 |
+
// Add the regex to the element
|
135 |
+
$lang->element($name, $element);
|
136 |
+
$state = $error ? CrayonLang::PARSED_ERRORS : CrayonLang::PARSED_SUCCESS;
|
137 |
+
$lang->state($state);
|
138 |
+
}
|
139 |
+
|
140 |
+
/* Prevents < > and other html entities from being printed as is, which could lead to actual html tags
|
141 |
+
* from the printed code appearing on the page - not good. This can also act to color any HTML entities
|
142 |
+
* that are not picked up by previously defined elements.
|
143 |
+
*/
|
144 |
+
$html = new CrayonElement(self::HTML_CHAR, $path, self::HTML_CHAR_REGEX);
|
145 |
+
$lang->element(self::HTML_CHAR, $html);
|
146 |
+
}
|
147 |
+
|
148 |
+
// Validates regex and accesses data stored in a CrayonElement
|
149 |
+
public static function validate_regex($regex, $element) {
|
150 |
+
if (is_string($regex) && @get_class($element) == CRAYON_ELEMENT_CLASS) {
|
151 |
+
// If the (?alt) tag has been used, insert the file into the regex
|
152 |
+
$file = self::regex_match('#\(\?alt:(.+?)\)#', $regex);
|
153 |
+
if ( count($file) == 2 ) {
|
154 |
+
// Element 0 has full match, 1 has captured groups
|
155 |
+
for ($i = 0; $i < count($file[1]); $i++) {
|
156 |
+
$file_lines = CrayonUtil::lines(dirname($element->path()) . crayon_slash() . $file[1][$i], 'rcwh');
|
157 |
+
if ($file_lines !== FALSE) {
|
158 |
+
$file_lines = implode('|', $file_lines);
|
159 |
+
$regex = str_replace($file[0][$i], "(?:$file_lines)", $regex);
|
160 |
+
} else {
|
161 |
+
CrayonLog::syslog("Parsing of '{$element->path()}' failed, an (?alt) tag failed for the element '{$element->name()}'" );
|
162 |
+
return FALSE;
|
163 |
+
}
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
// If the (?default:element) function is used, replace the regex with the default, if exists
|
168 |
+
$def = self::regex_match('#\(\?default(?:\:(\w+))?\)#', $regex);
|
169 |
+
if ( count($def) == 2 ) {
|
170 |
+
// Load default language
|
171 |
+
$default = CrayonResources::langs()->get(CrayonLangs::DEFAULT_LANG);
|
172 |
+
// If default has not been loaded, we can't use it, skip the element
|
173 |
+
if (!$default) {
|
174 |
+
CrayonLog::syslog(
|
175 |
+
"Could not use default regex in the element '{$element->name()}' in '{$element->path()}'");
|
176 |
+
return FALSE;
|
177 |
+
}
|
178 |
+
for ($i = 0; $i < count($def[1]); $i++) {
|
179 |
+
// If an element has been provided
|
180 |
+
$element_name = ( !empty($def[1][$i]) ) ? $def[1][$i] : $element->name();
|
181 |
+
if (($default_element = $default->element($element_name)) != FALSE) {
|
182 |
+
$regex = str_replace($def[0][$i], '(?:' . $default_element->regex() .')', $regex);
|
183 |
+
} else {
|
184 |
+
CrayonLog::syslog("The language at '{$element->path()}' referred to the Default Language regex for element '{$element->name()}', which did not exist.");
|
185 |
+
return FALSE;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
// If the (?html) tag is used, escape characters in html (<, > and &)
|
191 |
+
$html = self::regex_match('#\(\?html:(.+?)\)#', $regex);
|
192 |
+
if ( count($html) == 2 ) {
|
193 |
+
for ($i = 0; $i < count($html[1]); $i++) {
|
194 |
+
$regex = str_replace($html[0][$i], htmlentities($html[1][$i]), $regex);
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
// Ensure all parenthesis are atomic to avoid conflicting with element matches
|
199 |
+
$regex = preg_replace('#(?<!\\\\)\((?!\?)#', '(?:', $regex);
|
200 |
+
|
201 |
+
// Escape #, this is our delimiter
|
202 |
+
$regex = CrayonUtil::esc_hash($regex);
|
203 |
+
|
204 |
+
// Test if regex is valid
|
205 |
+
if (@preg_match("#$regex#", '') === FALSE) {
|
206 |
+
CrayonLog::syslog("The regex for the element '{$element->name()}' in '{$element->path()}' is not valid.");
|
207 |
+
return FALSE;
|
208 |
+
}
|
209 |
+
|
210 |
+
return $regex;
|
211 |
+
} else {
|
212 |
+
return '';
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
public static function validate_css($css) {
|
217 |
+
if (is_string($css)) {
|
218 |
+
// Remove dots in CSS class and convert to lowercase
|
219 |
+
$css = str_replace('.', '', $css);
|
220 |
+
$css = strtolower($css);
|
221 |
+
$css = explode(' ', $css);
|
222 |
+
$css_str = '';
|
223 |
+
foreach ($css as $c) {
|
224 |
+
if (!empty($c)) {
|
225 |
+
$css_str .= $c . ' ';
|
226 |
+
}
|
227 |
+
}
|
228 |
+
return $css_str;
|
229 |
+
} else {
|
230 |
+
return '';
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
public static function regex_match($pattern, $subject) {
|
235 |
+
if (preg_match_all($pattern, $subject, $matches)) {
|
236 |
+
return $matches;
|
237 |
+
}
|
238 |
+
return array();
|
239 |
+
}
|
240 |
+
|
241 |
+
public static function modes() {
|
242 |
+
return self::$modes;
|
243 |
+
}
|
244 |
+
|
245 |
+
public static function is_mode($name) {
|
246 |
+
return is_string($name) && array_key_exists($name, self::$modes);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
?>
|
crayon_resource.class.php
ADDED
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_LANGS_PHP);
|
4 |
+
require_once (CRAYON_THEMES_PHP);
|
5 |
+
require_once (CRAYON_FONTS_PHP);
|
6 |
+
|
7 |
+
class CrayonResources {
|
8 |
+
private static $langs = NULL;
|
9 |
+
private static $themes = NULL;
|
10 |
+
private static $fonts = NULL;
|
11 |
+
|
12 |
+
private function __construct() {}
|
13 |
+
|
14 |
+
private static function init() {
|
15 |
+
if (self::$langs == NULL) {
|
16 |
+
self::$langs = new CrayonLangs();
|
17 |
+
}
|
18 |
+
if (self::$themes == NULL) {
|
19 |
+
self::$themes = new CrayonThemes();
|
20 |
+
}
|
21 |
+
if (self::$fonts == NULL) {
|
22 |
+
self::$fonts = new CrayonFonts();
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
public static function langs() {
|
27 |
+
self::init();
|
28 |
+
return self::$langs;
|
29 |
+
}
|
30 |
+
|
31 |
+
public static function themes() {
|
32 |
+
self::init();
|
33 |
+
return self::$themes;
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function fonts() {
|
37 |
+
self::init();
|
38 |
+
return self::$fonts;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
class CrayonResourceCollection {
|
43 |
+
// Properties and Constants ===============================================
|
44 |
+
|
45 |
+
// Loaded resources
|
46 |
+
|
47 |
+
private $collection = array();
|
48 |
+
// Loading state
|
49 |
+
|
50 |
+
private $state = self::UNLOADED;
|
51 |
+
// Directory containing resources
|
52 |
+
|
53 |
+
private $dir = '';
|
54 |
+
private $default_id = '';
|
55 |
+
private $default_name = '';
|
56 |
+
const UNLOADED = -1;
|
57 |
+
const LOADING = 0;
|
58 |
+
const LOADED = 1;
|
59 |
+
|
60 |
+
// Methods ================================================================
|
61 |
+
|
62 |
+
/* Override in subclasses. Returns the absolute path for a given resource. Does not check for its existence. */
|
63 |
+
public function path($id) {
|
64 |
+
return '';
|
65 |
+
}
|
66 |
+
|
67 |
+
/* Verifies a language exists. */
|
68 |
+
public function exists($id) {
|
69 |
+
return file_exists($this->path($id));
|
70 |
+
}
|
71 |
+
|
72 |
+
/* Load all the available languages. Doesn't parse them for their names and regex. */
|
73 |
+
public function load() {
|
74 |
+
// Load only once
|
75 |
+
|
76 |
+
if (!$this->is_state_unloaded()) {
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
$this->state = self::LOADING;
|
80 |
+
$this->load_process();
|
81 |
+
$this->state = self::LOADED;
|
82 |
+
}
|
83 |
+
|
84 |
+
public function load_resources() {
|
85 |
+
// Load only once
|
86 |
+
|
87 |
+
if (!$this->is_state_loading()) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
try {
|
91 |
+
// Look in directory for resources
|
92 |
+
|
93 |
+
if (!file_exists($this->dir)) {
|
94 |
+
CrayonLog::syslog('The resource directory is missing, should be at \'' . $this->dir . '\'.');
|
95 |
+
} else if (($handle = @opendir($this->dir)) != FALSE) {
|
96 |
+
// Loop over directory contents
|
97 |
+
|
98 |
+
while (($file = readdir($handle)) !== FALSE) {
|
99 |
+
if ($file != "." && $file != "..") {
|
100 |
+
// Check if $file is directory, remove extension when checking for existence.
|
101 |
+
|
102 |
+
if (!is_dir($this->dir . $file)) {
|
103 |
+
$file = CrayonUtil::path_rem_ext($file);
|
104 |
+
}
|
105 |
+
if ($this->exists($file)) {
|
106 |
+
$this->add($file, $this->resource_instance($file));
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
closedir($handle);
|
111 |
+
}
|
112 |
+
} catch (Exception $e) {
|
113 |
+
CrayonLog::syslog('An error occured when trying to load resources: ' . $e->getFile() . $e->getLine());
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
/* Override in subclasses. */
|
118 |
+
public function load_process() {
|
119 |
+
if (!$this->is_state_loading()) {
|
120 |
+
return;
|
121 |
+
}
|
122 |
+
$this->load_resources();
|
123 |
+
$this->add_default();
|
124 |
+
}
|
125 |
+
|
126 |
+
/* Override in subclasses */
|
127 |
+
public function add_default() {
|
128 |
+
if (!$this->is_state_loading()) {
|
129 |
+
return FALSE;
|
130 |
+
} else if (!$this->is_loaded($this->default_id)) {
|
131 |
+
CrayonLog::syslog('The default resource could not be loaded from \'' . $this->dir . '\'.');
|
132 |
+
// Add the default, but it will not be functionable
|
133 |
+
|
134 |
+
$default = $this->resource_instance($this->default_id, $this->default_name);
|
135 |
+
$this->add($this->default_id, $default);
|
136 |
+
return TRUE;
|
137 |
+
}
|
138 |
+
return FALSE;
|
139 |
+
}
|
140 |
+
|
141 |
+
/* Returns the default resource */
|
142 |
+
public function set_default($id, $name) {
|
143 |
+
$this->default_id = $id;
|
144 |
+
$this->default_name = $name;
|
145 |
+
}
|
146 |
+
|
147 |
+
/* Returns the default resource */
|
148 |
+
public function get_default() {
|
149 |
+
return $this->get($this->default_id);
|
150 |
+
}
|
151 |
+
|
152 |
+
/* Override in subclasses */
|
153 |
+
public function resource_instance($id, $name = NULL) {
|
154 |
+
return new CrayonUsedResource($id, $name);
|
155 |
+
}
|
156 |
+
|
157 |
+
public function add($name, $object) {
|
158 |
+
if (is_string($name) && !empty($name)) {
|
159 |
+
$this->collection[strtolower(trim($name))] = $object;
|
160 |
+
asort($this->collection);
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
public function remove($name) {
|
165 |
+
if (is_string($name) && !empty($name) && array_key_exists($name, $this->collection)) {
|
166 |
+
unset($this->collection[$name]);
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
public function remove_all() {
|
171 |
+
$this->collection = array();
|
172 |
+
}
|
173 |
+
|
174 |
+
/* Returns the resource for the given id or NULL if it can't be found */
|
175 |
+
public function get($id = NULL) {
|
176 |
+
$this->load();
|
177 |
+
if ($id === NULL) {
|
178 |
+
return $this->collection;
|
179 |
+
} else if (is_string($id) && ($id = strtolower(trim($id))) !== FALSE && $this->is_loaded($id)) {
|
180 |
+
return $this->collection[$id];
|
181 |
+
}
|
182 |
+
return NULL;
|
183 |
+
}
|
184 |
+
|
185 |
+
public function is_loaded($id) {
|
186 |
+
if (is_string($id)) {
|
187 |
+
return array_key_exists($id, $this->collection);
|
188 |
+
}
|
189 |
+
return FALSE;
|
190 |
+
}
|
191 |
+
|
192 |
+
public function get_state() {
|
193 |
+
return $this->state;
|
194 |
+
}
|
195 |
+
|
196 |
+
public function is_state_loaded() {
|
197 |
+
return $this->state == self::LOADED;
|
198 |
+
}
|
199 |
+
|
200 |
+
public function is_state_loading() {
|
201 |
+
return $this->state == self::LOADING;
|
202 |
+
}
|
203 |
+
|
204 |
+
public function is_state_unloaded() {
|
205 |
+
return $this->state == self::UNLOADED;
|
206 |
+
}
|
207 |
+
|
208 |
+
public function directory($dir = NULL) {
|
209 |
+
$dir = CrayonUtil::path_slash($dir);
|
210 |
+
if (!CrayonUtil::str($this->dir, $dir, FALSE)) {
|
211 |
+
return $this->dir;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
class CrayonUsedResourceCollection extends CrayonResourceCollection {
|
217 |
+
|
218 |
+
// Checks if any of the themes are being used
|
219 |
+
|
220 |
+
public function is_used($id = NULL) {
|
221 |
+
if ($id === NULL) {
|
222 |
+
foreach ($this->get() as $resource) {
|
223 |
+
if ($resource->used()) {
|
224 |
+
return TRUE;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
return FALSE;
|
228 |
+
} else {
|
229 |
+
$resource = $this->get($id);
|
230 |
+
if (!$resource) {
|
231 |
+
return FALSE;
|
232 |
+
} else {
|
233 |
+
return $resource->used();
|
234 |
+
}
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
class CrayonResource {
|
240 |
+
private $id = '';
|
241 |
+
private $name = '';
|
242 |
+
private $used = FALSE;
|
243 |
+
|
244 |
+
function __construct($id, $name = NULL) {
|
245 |
+
CrayonUtil::str($this->id, $id);
|
246 |
+
( empty($name) ) ? $this->name(CrayonUtil::ucwords($this->id)) : $this->name($name);
|
247 |
+
}
|
248 |
+
|
249 |
+
function __tostring() {
|
250 |
+
return $this->name;
|
251 |
+
}
|
252 |
+
|
253 |
+
function id() {
|
254 |
+
return $this->id;
|
255 |
+
}
|
256 |
+
|
257 |
+
function name($name = NULL) {
|
258 |
+
if (!CrayonUtil::str($this->name, $name, FALSE)) {
|
259 |
+
return $this->name;
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
function used($used = NULL) {
|
264 |
+
if ($used === NULL) {
|
265 |
+
return $this->used;
|
266 |
+
} else {
|
267 |
+
$this->used = ($used ? TRUE : FALSE);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
/* Keeps track of usage */
|
273 |
+
class CrayonUsedResource extends CrayonResource {
|
274 |
+
private $used = FALSE;
|
275 |
+
|
276 |
+
function __construct($id, $name = NULL) {
|
277 |
+
parent::__construct($id, $name);
|
278 |
+
}
|
279 |
+
|
280 |
+
function used($used = NULL) {
|
281 |
+
if ($used === NULL) {
|
282 |
+
return $this->used;
|
283 |
+
} else {
|
284 |
+
$this->used = ($used ? TRUE : FALSE);
|
285 |
+
}
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
/* Adds version */
|
290 |
+
class CrayonVersionResource extends CrayonResource {
|
291 |
+
private $version = '';
|
292 |
+
|
293 |
+
function __construct($id, $name = NULL, $version = NULL) {
|
294 |
+
parent::__construct($id, $name);
|
295 |
+
$this->version($version);
|
296 |
+
}
|
297 |
+
|
298 |
+
function version($version = NULL) {
|
299 |
+
if ($version === NULL) {
|
300 |
+
return $this->version;
|
301 |
+
} else if (is_string($version)) {
|
302 |
+
$this->version = $version;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
?>
|
crayon_settings.class.php
ADDED
@@ -0,0 +1,604 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_PARSER_PHP);
|
4 |
+
require_once (CRAYON_THEMES_PHP);
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Stores CrayonSetting objects.
|
8 |
+
* Each Crayon instance stores an instance of this class containing its specific settings.
|
9 |
+
*/
|
10 |
+
class CrayonSettings {
|
11 |
+
// Properties and Constants ===============================================
|
12 |
+
const INVALID = -1; // Used for invalid dropdown index
|
13 |
+
// Plugin data
|
14 |
+
const VERSION = 'version';
|
15 |
+
|
16 |
+
// Global names for settings
|
17 |
+
const THEME = 'theme';
|
18 |
+
const FONT = 'font';
|
19 |
+
const FONT_SIZE_ENABLE = 'font-size-enable';
|
20 |
+
const FONT_SIZE = 'font-size';
|
21 |
+
const PREVIEW = 'preview';
|
22 |
+
const HEIGHT_SET = 'height-set';
|
23 |
+
const HEIGHT_MODE = 'height-mode';
|
24 |
+
const HEIGHT = 'height';
|
25 |
+
const HEIGHT_UNIT = 'height-unit';
|
26 |
+
const WIDTH_SET = 'width-set';
|
27 |
+
const WIDTH_MODE = 'width-mode';
|
28 |
+
const WIDTH = 'width';
|
29 |
+
const WIDTH_UNIT = 'width-unit';
|
30 |
+
const TOP_SET = 'top-set';
|
31 |
+
const TOP_MARGIN = 'top-margin';
|
32 |
+
const LEFT_SET = 'left-set';
|
33 |
+
const LEFT_MARGIN = 'left-margin';
|
34 |
+
const BOTTOM_SET = 'bottom-set';
|
35 |
+
const BOTTOM_MARGIN = 'bottom-margin';
|
36 |
+
const RIGHT_SET = 'right-set';
|
37 |
+
const RIGHT_MARGIN = 'right-margin';
|
38 |
+
const H_ALIGN = 'h-align';
|
39 |
+
const FLOAT_ENABLE = 'float-enable';
|
40 |
+
const TOOLBAR = 'toolbar';
|
41 |
+
const TOOLBAR_OVERLAY = 'toolbar-overlay';
|
42 |
+
const TOOLBAR_HIDE = 'toolbar-hide';
|
43 |
+
const TOOLBAR_DELAY = 'toolbar-delay';
|
44 |
+
const SHOW_LANG = 'show-lang';
|
45 |
+
const SHOW_TITLE = 'show-title';
|
46 |
+
const STRIPED = 'striped';
|
47 |
+
const MARKING = 'marking';
|
48 |
+
const NUMS = 'nums';
|
49 |
+
const NUMS_TOGGLE = 'nums-toggle';
|
50 |
+
const TRIM_WHITESPACE = 'trim-whitespace';
|
51 |
+
const TAB_SIZE = 'tab-size';
|
52 |
+
const FALLBACK_LANG = 'fallback-lang';
|
53 |
+
const LOCAL_PATH = 'local-path';
|
54 |
+
const SCROLL = 'scroll';
|
55 |
+
const PLAIN = 'plain';
|
56 |
+
const SHOW_PLAIN = 'show-plain';
|
57 |
+
const DISABLE_RUNTIME = 'runtime';
|
58 |
+
const EXP_SCROLL = 'exp-scroll';
|
59 |
+
const TOUCHSCREEN = 'touchscreen';
|
60 |
+
const DISABLE_ANIM = 'disable-anim';
|
61 |
+
const ERROR_LOG = 'error-log';
|
62 |
+
const ERROR_LOG_SYS = 'error-log-sys';
|
63 |
+
const ERROR_MSG_SHOW = 'error-msg-show';
|
64 |
+
const ERROR_MSG = 'error-msg';
|
65 |
+
const HIDE_HELP = 'hide-help';
|
66 |
+
|
67 |
+
// The current settings, should be loaded with default if none exists
|
68 |
+
private $settings = array();
|
69 |
+
|
70 |
+
// The settings with default values
|
71 |
+
private static $default = NULL;
|
72 |
+
|
73 |
+
function __construct() {
|
74 |
+
$this->init();
|
75 |
+
}
|
76 |
+
|
77 |
+
function copy() {
|
78 |
+
$settings = new CrayonSettings();
|
79 |
+
foreach ($this->settings as $setting) {
|
80 |
+
$settings->set($setting); // Overuse of set?
|
81 |
+
}
|
82 |
+
return $settings;
|
83 |
+
}
|
84 |
+
|
85 |
+
// Methods ================================================================
|
86 |
+
|
87 |
+
private function init() {
|
88 |
+
$settings = array(
|
89 |
+
new CrayonSetting(self::VERSION, CRAYON_VERSION, NULL, TRUE),
|
90 |
+
|
91 |
+
new CrayonSetting(self::THEME, CrayonThemes::DEFAULT_THEME),
|
92 |
+
new CrayonSetting(self::FONT, CrayonFonts::DEFAULT_FONT),
|
93 |
+
new CrayonSetting(self::FONT_SIZE_ENABLE, FALSE),
|
94 |
+
new CrayonSetting(self::FONT_SIZE, 12),
|
95 |
+
new CrayonSetting(self::PREVIEW, TRUE),
|
96 |
+
new CrayonSetting(self::HEIGHT_SET, FALSE),
|
97 |
+
new CrayonSetting(self::HEIGHT_MODE, array('Max', 'Min', 'Static')),
|
98 |
+
new CrayonSetting(self::HEIGHT, '500'),
|
99 |
+
new CrayonSetting(self::HEIGHT_UNIT, array('Pixels', 'Percent')),
|
100 |
+
new CrayonSetting(self::WIDTH_SET, FALSE),
|
101 |
+
new CrayonSetting(self::WIDTH_MODE, array('Max', 'Min', 'Static')),
|
102 |
+
new CrayonSetting(self::WIDTH, '500'),
|
103 |
+
new CrayonSetting(self::WIDTH_UNIT, array('Pixels', 'Percent')),
|
104 |
+
new CrayonSetting(self::TOP_SET, TRUE),
|
105 |
+
new CrayonSetting(self::TOP_MARGIN, 12),
|
106 |
+
new CrayonSetting(self::BOTTOM_SET, TRUE),
|
107 |
+
new CrayonSetting(self::BOTTOM_MARGIN, 12),
|
108 |
+
new CrayonSetting(self::LEFT_SET, FALSE),
|
109 |
+
new CrayonSetting(self::LEFT_MARGIN, 12),
|
110 |
+
new CrayonSetting(self::RIGHT_SET, FALSE),
|
111 |
+
new CrayonSetting(self::RIGHT_MARGIN, 12),
|
112 |
+
new CrayonSetting(self::H_ALIGN, array('None', 'Left', 'Center', 'Right')),
|
113 |
+
new CrayonSetting(self::FLOAT_ENABLE, FALSE),
|
114 |
+
new CrayonSetting(self::TOOLBAR, array('On MouseOver', 'Always', 'Never')),
|
115 |
+
new CrayonSetting(self::TOOLBAR_OVERLAY, TRUE),
|
116 |
+
new CrayonSetting(self::TOOLBAR_HIDE, TRUE),
|
117 |
+
new CrayonSetting(self::TOOLBAR_DELAY, TRUE),
|
118 |
+
new CrayonSetting(self::SHOW_LANG, array('When Found', 'Always', 'Never')),
|
119 |
+
new CrayonSetting(self::SHOW_TITLE, TRUE),
|
120 |
+
new CrayonSetting(self::STRIPED, TRUE),
|
121 |
+
new CrayonSetting(self::MARKING, TRUE),
|
122 |
+
new CrayonSetting(self::NUMS, TRUE),
|
123 |
+
new CrayonSetting(self::NUMS_TOGGLE, TRUE),
|
124 |
+
new CrayonSetting(self::TRIM_WHITESPACE, TRUE),
|
125 |
+
new CrayonSetting(self::TAB_SIZE, 4),
|
126 |
+
new CrayonSetting(self::FALLBACK_LANG, CrayonLangs::DEFAULT_LANG),
|
127 |
+
new CrayonSetting(self::LOCAL_PATH, ''),
|
128 |
+
new CrayonSetting(self::SCROLL, array('On MouseOver', 'Always')),
|
129 |
+
new CrayonSetting(self::PLAIN, TRUE),
|
130 |
+
new CrayonSetting(self::SHOW_PLAIN,
|
131 |
+
array('On Double Click', 'On Single Click', 'On MouseOver', 'Only Using Toggle')),
|
132 |
+
new CrayonSetting(self::DISABLE_ANIM, FALSE),
|
133 |
+
new CrayonSetting(self::TOUCHSCREEN, TRUE),
|
134 |
+
new CrayonSetting(self::DISABLE_RUNTIME, FALSE),
|
135 |
+
new CrayonSetting(self::EXP_SCROLL, FALSE),
|
136 |
+
new CrayonSetting(self::ERROR_LOG, TRUE),
|
137 |
+
new CrayonSetting(self::ERROR_LOG_SYS, TRUE),
|
138 |
+
new CrayonSetting(self::ERROR_MSG_SHOW, TRUE),
|
139 |
+
new CrayonSetting(self::ERROR_MSG, 'An error has occurred. Please try again later.'),
|
140 |
+
new CrayonSetting(self::HIDE_HELP, FALSE)
|
141 |
+
);
|
142 |
+
$this->set($settings);
|
143 |
+
}
|
144 |
+
|
145 |
+
// Getter and Setter ======================================================
|
146 |
+
|
147 |
+
// TODO this needs simplification
|
148 |
+
function set($name, $value = NULL, $replace = FALSE) {
|
149 |
+
// Set associative array of settings
|
150 |
+
if (is_array($name)) {
|
151 |
+
$keys = array_keys($name);
|
152 |
+
foreach ($keys as $key) {
|
153 |
+
if ( is_string($key) ) {
|
154 |
+
// Associative value
|
155 |
+
$this->set($key, $name[$key], $replace);
|
156 |
+
} else if ( is_int($key) ) {
|
157 |
+
$setting = $name[$key];
|
158 |
+
$this->set($setting, NULL, $replace);
|
159 |
+
}
|
160 |
+
}
|
161 |
+
} else if ( get_class($name) == CRAYON_SETTING_CLASS ) {
|
162 |
+
$setting = $name; // Semantics
|
163 |
+
if ( $replace || !$this->is_setting($setting->name()) ) {
|
164 |
+
// Replace/Create
|
165 |
+
$this->settings[$setting->name()] = $setting->copy();
|
166 |
+
} else {
|
167 |
+
// Update
|
168 |
+
if ( $setting->is_array() ) {
|
169 |
+
$this->settings[$setting->name()]->index($setting->index());
|
170 |
+
} else {
|
171 |
+
$this->settings[$setting->name()]->value($setting->value());
|
172 |
+
}
|
173 |
+
}
|
174 |
+
} else if (is_string($name) && !empty($name) && $value !== NULL) {
|
175 |
+
$value = CrayonSettings::validate($name, $value);
|
176 |
+
if ($replace || !$this->is_setting($name)) {
|
177 |
+
// Replace/Create
|
178 |
+
$this->settings[$name] = new CrayonSetting($name, $value);
|
179 |
+
} else {
|
180 |
+
// Update
|
181 |
+
$this->settings[$name]->value($value);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
function get($name = NULL) {
|
187 |
+
if ($name === NULL) {
|
188 |
+
$copy = array();
|
189 |
+
foreach ($this->settings as $name=>$setting) {
|
190 |
+
$copy[$name] = $setting->copy(); // Deep copy
|
191 |
+
}
|
192 |
+
return $copy;
|
193 |
+
} else if (is_string($name)) {
|
194 |
+
if ($this->is_setting($name)) {
|
195 |
+
return $this->settings[$name];
|
196 |
+
}
|
197 |
+
}
|
198 |
+
return FALSE;
|
199 |
+
}
|
200 |
+
|
201 |
+
function get_array() {
|
202 |
+
$array = array();
|
203 |
+
foreach ($this->settings as $setting) {
|
204 |
+
$array[$setting->name()] = $setting->value();
|
205 |
+
}
|
206 |
+
return $array;
|
207 |
+
}
|
208 |
+
|
209 |
+
function is_setting($name) {
|
210 |
+
return ( is_string($name) && array_key_exists($name, $this->settings) );
|
211 |
+
}
|
212 |
+
|
213 |
+
/* Gets default settings, either as associative array of name=>value or CrayonSetting
|
214 |
+
objects */
|
215 |
+
public static function get_defaults($name = NULL, $objects = TRUE) {
|
216 |
+
if (self::$default === NULL) {
|
217 |
+
self::$default = new CrayonSettings();
|
218 |
+
}
|
219 |
+
if ($name === NULL) {
|
220 |
+
// Get all settings
|
221 |
+
if ($objects) {
|
222 |
+
// Return array of objects
|
223 |
+
return self::$default->get();
|
224 |
+
} else {
|
225 |
+
// Return associative array of name=>value
|
226 |
+
$settings = self::$default->get();
|
227 |
+
$defaults = array();
|
228 |
+
foreach ($settings as $setting) {
|
229 |
+
$defaults[$setting->name()] = $setting->value();
|
230 |
+
}
|
231 |
+
return $defaults;
|
232 |
+
}
|
233 |
+
} else {
|
234 |
+
// Return specific setting
|
235 |
+
if ($objects) {
|
236 |
+
return self::$default->get($name);
|
237 |
+
} else {
|
238 |
+
return self::$default->get($name)->value();
|
239 |
+
}
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
public static function get_defaults_array() {
|
244 |
+
return self::get_defaults(NULL, FALSE);
|
245 |
+
}
|
246 |
+
|
247 |
+
// Validation =============================================================
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Validates settings coming from an HTML form and also for internal use.
|
251 |
+
* This is used when saving form an HTML form to the db, and also when reading from the db
|
252 |
+
* back into the global settings.
|
253 |
+
* @param string $name
|
254 |
+
* @param mixed $value
|
255 |
+
*/
|
256 |
+
public static function validate($name, $value) {
|
257 |
+
if (!is_string($name)) {
|
258 |
+
return '';
|
259 |
+
}
|
260 |
+
// Type-cast to correct value for known settings
|
261 |
+
if (($setting = CrayonGlobalSettings::get($name)) != FALSE) {
|
262 |
+
// Booleans settings that are sent as string are allowed to have "false" == false
|
263 |
+
if (is_string($value) && is_bool($setting->def())) {
|
264 |
+
$value = trim(str_replace(array('no', 'false'), '0', $value));
|
265 |
+
}
|
266 |
+
// Ensure we don't cast integer settings to 0 because $value doesn't have any numbers in it
|
267 |
+
if (is_string($value) && is_int($setting->def())) {
|
268 |
+
// Only occurs when saving from the form ($_POST values are strings)
|
269 |
+
if ($value == '' || ($cleaned = CrayonUtil::clean_int($value, FALSE)) == '') {
|
270 |
+
// The value sent has no integers, change to default
|
271 |
+
$value = $setting->def();
|
272 |
+
} else {
|
273 |
+
// Cleaned value is int
|
274 |
+
$value = $cleaned;
|
275 |
+
}
|
276 |
+
$value = intval($value);
|
277 |
+
// Cast all other settings as usual
|
278 |
+
} else if (!settype($value, $setting->type())) {
|
279 |
+
// If we can't cast, then use default value
|
280 |
+
if ($setting->is_array()) {
|
281 |
+
$value = 0; // default index
|
282 |
+
} else {
|
283 |
+
$value = $setting->def();
|
284 |
+
}
|
285 |
+
}
|
286 |
+
} else {
|
287 |
+
// If setting not found, remove value
|
288 |
+
return '';
|
289 |
+
}
|
290 |
+
// Validations
|
291 |
+
switch ($name) {
|
292 |
+
case CrayonSettings::LOCAL_PATH:
|
293 |
+
$path = parse_url($value, PHP_URL_PATH);
|
294 |
+
// Remove all spaces, prefixed and trailing forward slashes
|
295 |
+
$path = preg_replace('#^/*|/*$|\s*#', '', $path);
|
296 |
+
// Replace backslashes
|
297 |
+
$path = preg_replace('#\\\\#', '/', $path);
|
298 |
+
// Append trailing forward slash
|
299 |
+
if (!empty($path)) {
|
300 |
+
$path .= '/';
|
301 |
+
}
|
302 |
+
return $path;
|
303 |
+
case CrayonSettings::TAB_SIZE:
|
304 |
+
$value = abs($value);
|
305 |
+
break;
|
306 |
+
case CrayonSettings::THEME:
|
307 |
+
$value = strtolower($value);
|
308 |
+
// XXX validate settings here
|
309 |
+
}
|
310 |
+
|
311 |
+
// If no validation occurs, return value
|
312 |
+
return $value;
|
313 |
+
}
|
314 |
+
|
315 |
+
// Takes an associative array of "smart settings" and regular settings. Smart settings can be used
|
316 |
+
// to configure regular settings quickly.
|
317 |
+
// E.g. 'max_height="20px"' will set 'height="20"', 'height_mode="0", height_unit="0"'
|
318 |
+
public static function smart_settings($settings) {
|
319 |
+
if (!is_array($settings)) {
|
320 |
+
return FALSE;
|
321 |
+
}
|
322 |
+
|
323 |
+
// If a setting is given, it is automatically enabled
|
324 |
+
foreach ($settings as $name=>$value) {
|
325 |
+
if ($name == 'min-height' || $name == 'max-height' || $name == 'height') {
|
326 |
+
self::smart_hw($name, CrayonSettings::HEIGHT_SET, CrayonSettings::HEIGHT_MODE, CrayonSettings::HEIGHT_UNIT, $settings);
|
327 |
+
} else if ($name == 'min-width' || $name == 'max-width' || $name == 'width') {
|
328 |
+
self::smart_hw($name, CrayonSettings::WIDTH_SET, CrayonSettings::WIDTH_MODE, CrayonSettings::WIDTH_UNIT, $settings);
|
329 |
+
} else if ($name == CrayonSettings::FONT_SIZE) {
|
330 |
+
$settings[CrayonSettings::FONT_SIZE_ENABLE] = TRUE;
|
331 |
+
} else if ($name == CrayonSettings::TOP_MARGIN) {
|
332 |
+
$settings[CrayonSettings::TOP_SET] = TRUE;
|
333 |
+
} else if ($name == CrayonSettings::LEFT_MARGIN) {
|
334 |
+
$settings[CrayonSettings::LEFT_SET] = TRUE;
|
335 |
+
} else if ($name == CrayonSettings::BOTTOM_MARGIN) {
|
336 |
+
$settings[CrayonSettings::BOTTOM_SET] = TRUE;
|
337 |
+
} else if ($name == CrayonSettings::RIGHT_MARGIN) {
|
338 |
+
$settings[CrayonSettings::RIGHT_SET] = TRUE;
|
339 |
+
} else if ($name == CrayonSettings::H_ALIGN) {
|
340 |
+
$settings[CrayonSettings::FLOAT_ENABLE] = TRUE;
|
341 |
+
} else if ($name == CrayonSettings::H_ALIGN) {
|
342 |
+
$settings[CrayonSettings::FLOAT_ENABLE] = TRUE;
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
return $settings;
|
347 |
+
}
|
348 |
+
|
349 |
+
// Used for height and width smart settings, I couldn't bear to copy paste code twice...
|
350 |
+
private static function smart_hw($name, $set, $mode, $unit, &$settings) {
|
351 |
+
if (!is_string($name) || !is_string($set) || !is_string($mode) || !is_string($unit) || !is_array($settings)) {
|
352 |
+
return;
|
353 |
+
}
|
354 |
+
$settings[$set] = TRUE;
|
355 |
+
if ( strpos($name, 'max-') !== FALSE ) {
|
356 |
+
$settings[$mode] = 0;
|
357 |
+
} else if ( strpos($name, 'min-') !== FALSE ) {
|
358 |
+
$settings[$mode] = 1;
|
359 |
+
} else {
|
360 |
+
$settings[$mode] = 2;
|
361 |
+
}
|
362 |
+
preg_match('#(\d+)\s*([^\s]*)#', $settings[$name], $match);
|
363 |
+
if ( count($match) == 3 ) {
|
364 |
+
$name = str_replace(array('max-', 'min-'), '', $name);
|
365 |
+
$settings[$name] = $match[1];
|
366 |
+
switch (strtolower($match[2])) {
|
367 |
+
case 'px':
|
368 |
+
$settings[$unit] = 0;
|
369 |
+
break;
|
370 |
+
case '%':
|
371 |
+
$settings[$unit] = 1;
|
372 |
+
break;
|
373 |
+
}
|
374 |
+
}
|
375 |
+
}
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* Stores global/static copy of CrayonSettings loaded from db.
|
380 |
+
* These settings can be overriden by individual Crayons.
|
381 |
+
* Also manages global site settings and paths.
|
382 |
+
*/
|
383 |
+
class CrayonGlobalSettings {
|
384 |
+
// The global settings stored as a CrayonSettings object.
|
385 |
+
private static $global = NULL;
|
386 |
+
/* These are used to load local files reliably and prevent scripts like PHP from executing
|
387 |
+
when attempting to load their code. */
|
388 |
+
// The URL of the site (eg. http://localhost/example/)
|
389 |
+
private static $site_http = '';
|
390 |
+
// The absolute root directory of the site (eg. /User/example/)
|
391 |
+
private static $site_path = '';
|
392 |
+
// The absolute root directory of the plugins (eg. /User/example/plugins)
|
393 |
+
private static $plugin_path = '';
|
394 |
+
private function __construct() {}
|
395 |
+
|
396 |
+
private static function init() {
|
397 |
+
if (self::$global === NULL) {
|
398 |
+
self::$global = new CrayonSettings();
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
public static function get($name = NULL) {
|
403 |
+
self::init();
|
404 |
+
return self::$global->get($name);
|
405 |
+
}
|
406 |
+
|
407 |
+
public static function get_array() {
|
408 |
+
self::init();
|
409 |
+
return self::$global->get_array();
|
410 |
+
}
|
411 |
+
|
412 |
+
public static function get_obj() {
|
413 |
+
self::init();
|
414 |
+
return self::$global->copy();
|
415 |
+
}
|
416 |
+
|
417 |
+
public static function val($name = NULL) {
|
418 |
+
self::init();
|
419 |
+
if (($setting = self::get($name)) != FALSE) {
|
420 |
+
return $setting->value();
|
421 |
+
} else {
|
422 |
+
return NULL;
|
423 |
+
}
|
424 |
+
}
|
425 |
+
|
426 |
+
public static function set($name, $value = NULL, $replace = FALSE) {
|
427 |
+
self::init();
|
428 |
+
self::$global->set($name, $value, $replace);
|
429 |
+
}
|
430 |
+
|
431 |
+
public static function site_http($site_http = NULL) {
|
432 |
+
if (!CrayonUtil::str(self::$site_http, CrayonUtil::url_slash($site_http))) {
|
433 |
+
return self::$site_http;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
public static function site_path($site_path = NULL) {
|
438 |
+
if ($site_path === NULL) {
|
439 |
+
return self::$site_path;
|
440 |
+
} else {
|
441 |
+
self::$site_path = CrayonUtil::url_slash($site_path);
|
442 |
+
}
|
443 |
+
}
|
444 |
+
|
445 |
+
public static function plugin_path($plugin_path = NULL) {
|
446 |
+
if ($plugin_path === NULL) {
|
447 |
+
return self::$plugin_path;
|
448 |
+
} else {
|
449 |
+
self::$plugin_path = CrayonUtil::url_slash($plugin_path);
|
450 |
+
}
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Individual setting.
|
456 |
+
* Can store boolean, string, dropdown (with array of strings), etc.
|
457 |
+
*/
|
458 |
+
class CrayonSetting {
|
459 |
+
private $name = '';
|
460 |
+
/* The type of variables that can be set as the value.
|
461 |
+
* For dropdown settings, value is int, even though value() will return a string. */
|
462 |
+
private $type = NULL;
|
463 |
+
private $default = NULL; // stores string array for dropdown settings
|
464 |
+
|
465 |
+
private $value = NULL; // stores index int for dropdown settings
|
466 |
+
|
467 |
+
private $is_array = FALSE; // only TRUE for dropdown settings
|
468 |
+
private $locked = FALSE;
|
469 |
+
|
470 |
+
|
471 |
+
public function __construct($name, $default = '', $value = NULL, $locked = NULL) {
|
472 |
+
$this->name($name);
|
473 |
+
if ($default !== NULL) {
|
474 |
+
$this->def($default); // Perform first to set type
|
475 |
+
|
476 |
+
}
|
477 |
+
if ($value !== NULL) {
|
478 |
+
$this->value($value);
|
479 |
+
}
|
480 |
+
if ($locked !== NULL) {
|
481 |
+
$this->locked($locked);
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
+
function __tostring() {
|
486 |
+
return $this->name;
|
487 |
+
}
|
488 |
+
|
489 |
+
function copy() {
|
490 |
+
return new CrayonSetting($this->name, $this->default, $this->value);
|
491 |
+
}
|
492 |
+
|
493 |
+
function name($name = NULL) {
|
494 |
+
if (!CrayonUtil::str($this->name, $name)) {
|
495 |
+
return $this->name;
|
496 |
+
}
|
497 |
+
}
|
498 |
+
|
499 |
+
function type() {
|
500 |
+
return $this->type;
|
501 |
+
}
|
502 |
+
|
503 |
+
function is_array() {
|
504 |
+
return $this->is_array;
|
505 |
+
}
|
506 |
+
|
507 |
+
function locked($locked = NULL) {
|
508 |
+
if ($locked === NULL) {
|
509 |
+
return $this->locked;
|
510 |
+
} else {
|
511 |
+
$this->locked = ($locked == TRUE);
|
512 |
+
}
|
513 |
+
}
|
514 |
+
|
515 |
+
/**
|
516 |
+
|
517 |
+
* Sets/gets value;
|
518 |
+
* Value is index (int) in default value (array) for dropdown settings.
|
519 |
+
* value($value) is alias for index($index) if dropdown setting.
|
520 |
+
* value() returns string value at current index for dropdown settings.
|
521 |
+
* @param $value
|
522 |
+
*/
|
523 |
+
function value($value = NULL) {
|
524 |
+
if ($value === NULL) {
|
525 |
+
if ($this->is_array) {
|
526 |
+
return $this->default[$this->value]; // value at index
|
527 |
+
} else if ($this->value !== NULL) {
|
528 |
+
return $this->value;
|
529 |
+
} else {
|
530 |
+
return $this->default;
|
531 |
+
}
|
532 |
+
} else {
|
533 |
+
if ($this->is_array) {
|
534 |
+
$this->index($value); // $value is index
|
535 |
+
} else {
|
536 |
+
settype($value, $this->type); // Type case
|
537 |
+
$this->value = $value;
|
538 |
+
}
|
539 |
+
}
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Sets/gets default value.
|
544 |
+
* For dropdown settings, default value is array of all possible value strings.
|
545 |
+
* @param $default
|
546 |
+
*/
|
547 |
+
function def($default = NULL) {
|
548 |
+
// Only allow default to be set once
|
549 |
+
|
550 |
+
if ($this->type === NULL && $default !== NULL) {
|
551 |
+
// For dropdown settings
|
552 |
+
|
553 |
+
if (is_array($default)) { // The only time we don't use $this->is_array
|
554 |
+
|
555 |
+
// If empty, set to blank array
|
556 |
+
|
557 |
+
if (empty($default)) {
|
558 |
+
$default = array('');
|
559 |
+
} else {
|
560 |
+
// Ensure all values are unique strings
|
561 |
+
|
562 |
+
$default = CrayonUtil::array_unique_str($default);
|
563 |
+
}
|
564 |
+
$this->value = 0; // initial index
|
565 |
+
|
566 |
+
$this->is_array = TRUE;
|
567 |
+
$this->type = gettype(0); // Type is int (index)
|
568 |
+
|
569 |
+
} else {
|
570 |
+
$this->is_array = FALSE;
|
571 |
+
$this->type = gettype($default);
|
572 |
+
}
|
573 |
+
$this->default = $default;
|
574 |
+
} else {
|
575 |
+
return $this->default;
|
576 |
+
}
|
577 |
+
}
|
578 |
+
|
579 |
+
/**
|
580 |
+
* Sets/gets index.
|
581 |
+
* @param int|string $index
|
582 |
+
* @return FALSE if not dropdown setting
|
583 |
+
*/
|
584 |
+
function index($index = NULL) {
|
585 |
+
if (!$this->is_array) {
|
586 |
+
return FALSE;
|
587 |
+
} else if ($index === NULL) {
|
588 |
+
return $this->value; // return current index
|
589 |
+
} else {
|
590 |
+
if (!is_int($index)) {
|
591 |
+
// Ensure $value is int for index
|
592 |
+
$index = intval($index);
|
593 |
+
}
|
594 |
+
// Validate index
|
595 |
+
if ($index < 0 || $index > count($this->default) - 1) {
|
596 |
+
$index = 0;
|
597 |
+
}
|
598 |
+
$this->value = $index;
|
599 |
+
}
|
600 |
+
}
|
601 |
+
|
602 |
+
}
|
603 |
+
|
604 |
+
?>
|
crayon_settings_wp.class.php
ADDED
@@ -0,0 +1,543 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_LANGS_PHP);
|
4 |
+
require_once (CRAYON_THEMES_PHP);
|
5 |
+
require_once (CRAYON_FONTS_PHP);
|
6 |
+
require_once (CRAYON_SETTINGS_PHP);
|
7 |
+
|
8 |
+
/* Manages global settings within WP and integrates them with CrayonSettings.
|
9 |
+
CrayonHighlighter and any non-WP classes will only use CrayonSettings to separate
|
10 |
+
the implementation of global settings and ensure any system can use them. */
|
11 |
+
class CrayonSettingsWP {
|
12 |
+
// Properties and Constants ===============================================
|
13 |
+
|
14 |
+
// A copy of the current options in db
|
15 |
+
private static $options = NULL;
|
16 |
+
private static $plugin_hook = '';
|
17 |
+
|
18 |
+
const SETTINGS = 'crayon_fields';
|
19 |
+
const FIELDS = 'crayon_settings';
|
20 |
+
const OPTIONS = 'crayon_options';
|
21 |
+
const GENERAL = 'crayon_general';
|
22 |
+
const DEBUG = 'crayon_debug';
|
23 |
+
const ABOUT = 'crayon_about';
|
24 |
+
|
25 |
+
// Used on submit
|
26 |
+
const LOG_CLEAR = 'log_clear';
|
27 |
+
const LOG_EMAIL_ADMIN = 'log_email_admin';
|
28 |
+
const LOG_EMAIL_DEV = 'log_email_dev';
|
29 |
+
|
30 |
+
private function __construct() {}
|
31 |
+
|
32 |
+
// Methods ================================================================
|
33 |
+
|
34 |
+
public static function admin_load() {
|
35 |
+
$page = add_options_page('Crayon Syntax Highlighter Settings', 'Crayon', 'manage_options', 'crayon_settings', 'CrayonSettingsWP::settings');
|
36 |
+
self::$plugin_hook = $page;
|
37 |
+
add_action("admin_print_scripts-$page", 'CrayonSettingsWP::admin_scripts');
|
38 |
+
add_action("admin_print_styles-$page", 'CrayonSettingsWP::admin_styles');
|
39 |
+
// Register settings, second argument is option name stored in db
|
40 |
+
register_setting(self::FIELDS, self::OPTIONS, 'CrayonSettingsWP::settings_validate');
|
41 |
+
add_action("admin_head-$page", 'CrayonSettingsWP::admin_init');
|
42 |
+
add_filter('contextual_help', 'CrayonSettingsWP::cont_help', 10, 3);
|
43 |
+
}
|
44 |
+
|
45 |
+
public static function admin_styles() {
|
46 |
+
wp_enqueue_style('crayon_admin_style', plugins_url(CRAYON_STYLE_ADMIN, __FILE__), array(), CRAYON_VERSION);
|
47 |
+
}
|
48 |
+
|
49 |
+
public static function admin_scripts() {
|
50 |
+
wp_enqueue_script('crayon_jquery', plugins_url(CRAYON_JQUERY, __FILE__), array(), CRAYON_VERSION);
|
51 |
+
wp_enqueue_script('crayon_admin_js', plugins_url(CRAYON_JS_ADMIN, __FILE__), array('crayon_jquery'), CRAYON_VERSION);
|
52 |
+
wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('crayon_jquery'), CRAYON_VERSION);
|
53 |
+
}
|
54 |
+
|
55 |
+
public static function settings() {
|
56 |
+
if (!current_user_can('manage_options')) {
|
57 |
+
wp_die(__('You do not have sufficient permissions to access this page.'));
|
58 |
+
}
|
59 |
+
?>
|
60 |
+
|
61 |
+
<div class="wrap">
|
62 |
+
<div id="icon-options-general" class="icon32"><br>
|
63 |
+
</div>
|
64 |
+
<h2>Crayon Syntax Highlighter Settings</h2>
|
65 |
+
<?php self::help(); ?>
|
66 |
+
<form action="options.php" method="post"><?php
|
67 |
+
settings_fields(self::FIELDS);
|
68 |
+
?>
|
69 |
+
|
70 |
+
<?php
|
71 |
+
do_settings_sections(self::SETTINGS);
|
72 |
+
?>
|
73 |
+
|
74 |
+
<p class="submit"><input type="submit" name="submit" id="submit"
|
75 |
+
class="button-primary" value="<?php
|
76 |
+
_e('Save Changes');
|
77 |
+
?>"> <input type="submit"
|
78 |
+
name="<?php
|
79 |
+
echo self::OPTIONS;
|
80 |
+
?>[reset]" id="reset"
|
81 |
+
class="button-primary" value="<?php
|
82 |
+
_e('Reset Settings');
|
83 |
+
?>"></p>
|
84 |
+
</form>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<?php
|
88 |
+
}
|
89 |
+
|
90 |
+
// Load the global settings and update them from the db
|
91 |
+
public static function load_settings() {
|
92 |
+
if (self::$options !== NULL) {
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
|
96 |
+
// Load settings from db
|
97 |
+
if (!(self::$options = get_option(self::OPTIONS))) {
|
98 |
+
self::$options = CrayonSettings::get_defaults_array();
|
99 |
+
update_option(self::OPTIONS, self::$options);
|
100 |
+
}
|
101 |
+
|
102 |
+
// Initialise default global settings and update them from db
|
103 |
+
CrayonGlobalSettings::set(self::$options);
|
104 |
+
|
105 |
+
// Load all available languages and themes
|
106 |
+
CrayonResources::langs()->load();
|
107 |
+
CrayonResources::themes()->load();
|
108 |
+
|
109 |
+
// For local file loading
|
110 |
+
// This is used to decouple WP functions from internal Crayon classes
|
111 |
+
CrayonGlobalSettings::site_http(home_url());
|
112 |
+
CrayonGlobalSettings::site_path(ABSPATH);
|
113 |
+
CrayonGlobalSettings::plugin_path(plugins_url('', __FILE__));
|
114 |
+
|
115 |
+
// Ensure all missing settings in db are replaced by default values
|
116 |
+
$changed = FALSE;
|
117 |
+
foreach (CrayonSettings::get_defaults_array() as $name => $value) {
|
118 |
+
// Add missing settings
|
119 |
+
if (!array_key_exists($name, self::$options)) {
|
120 |
+
self::$options[$name] = $value;
|
121 |
+
$changed = TRUE;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
// A setting was missing, update options
|
125 |
+
if ($changed) {
|
126 |
+
update_option(self::OPTIONS, self::$options);
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
// Saves settings from CrayonGlobalSettings to the db
|
131 |
+
public static function save_settings() {
|
132 |
+
update_option(self::OPTIONS, CrayonGlobalSettings::get_array());
|
133 |
+
}
|
134 |
+
|
135 |
+
public static function wp_root_path() {
|
136 |
+
return preg_replace('#wp\-content.*#', '', CRAYON_ROOT_PATH);
|
137 |
+
}
|
138 |
+
|
139 |
+
public static function wp_load_path() {
|
140 |
+
return self::wp_root_path() . 'wp-load.php';
|
141 |
+
}
|
142 |
+
|
143 |
+
public static function admin_init() {
|
144 |
+
// Load default settings if they don't exist
|
145 |
+
|
146 |
+
self::load_settings();
|
147 |
+
// General
|
148 |
+
|
149 |
+
self::add_section(self::GENERAL, 'General');
|
150 |
+
self::add_field(self::GENERAL, 'Theme', 'themes');
|
151 |
+
self::add_field(self::GENERAL, 'Font', 'fonts');
|
152 |
+
self::add_field(self::GENERAL, 'Metrics', 'metrics');
|
153 |
+
self::add_field(self::GENERAL, 'Toolbar', 'toolbar');
|
154 |
+
self::add_field(self::GENERAL, 'Lines', 'lines');
|
155 |
+
self::add_field(self::GENERAL, 'Code', 'code');
|
156 |
+
self::add_field(self::GENERAL, 'Languages', 'langs');
|
157 |
+
self::add_field(self::GENERAL, 'Files', 'files');
|
158 |
+
self::add_field(self::GENERAL, 'Misc', 'misc');
|
159 |
+
// Debug
|
160 |
+
|
161 |
+
self::add_section(self::DEBUG, 'Debug');
|
162 |
+
self::add_field(self::DEBUG, 'Errors', 'errors');
|
163 |
+
self::add_field(self::DEBUG, 'Log', 'log');
|
164 |
+
// ABOUT
|
165 |
+
|
166 |
+
self::add_section(self::ABOUT, 'About');
|
167 |
+
$image = '<div id="crayon-logo">
|
168 |
+
|
169 |
+
<img src="' . plugins_url(CRAYON_LOGO, __FILE__) . '" /><br/></div>';
|
170 |
+
self::add_field(self::ABOUT, $image, 'info');
|
171 |
+
}
|
172 |
+
|
173 |
+
// Wrapper functions
|
174 |
+
|
175 |
+
private static function add_section($name, $title, $callback = NULL) {
|
176 |
+
$callback = (empty($callback) ? 'blank' : $callback);
|
177 |
+
add_settings_section($name, $title, 'CrayonSettingsWP::' . $callback, self::SETTINGS);
|
178 |
+
}
|
179 |
+
|
180 |
+
private static function add_field($section, $title, $callback, $args = array()) {
|
181 |
+
$unique = preg_replace('#\\s#', '_', strtolower($title));
|
182 |
+
add_settings_field($unique, $title, 'CrayonSettingsWP::' . $callback, self::SETTINGS, $section, $args);
|
183 |
+
}
|
184 |
+
|
185 |
+
// Validates all the settings passed from the form in $inputs
|
186 |
+
|
187 |
+
public static function settings_validate($inputs) {
|
188 |
+
// When reset button is pressed, remove settings so default loads next time
|
189 |
+
if (array_key_exists('reset', $inputs)) {
|
190 |
+
// Hide the help so we don't annoy them
|
191 |
+
return array();
|
192 |
+
}
|
193 |
+
// Clear the log if needed
|
194 |
+
if (array_key_exists(self::LOG_CLEAR, $_POST)) {
|
195 |
+
CrayonLog::clear();
|
196 |
+
}
|
197 |
+
// Send to admin
|
198 |
+
if (array_key_exists(self::LOG_EMAIL_ADMIN, $_POST)) {
|
199 |
+
CrayonLog::email(get_bloginfo('admin_email'));
|
200 |
+
}
|
201 |
+
// Send to developer
|
202 |
+
if (array_key_exists(self::LOG_EMAIL_DEV, $_POST)) {
|
203 |
+
CrayonLog::email(CRAYON_EMAIL);
|
204 |
+
}
|
205 |
+
|
206 |
+
// Validate inputs
|
207 |
+
foreach ($inputs as $input => $value) {
|
208 |
+
// Convert all array setting values to ints
|
209 |
+
$inputs[$input] = CrayonSettings::validate($input, $value);
|
210 |
+
}
|
211 |
+
|
212 |
+
// If settings don't exist in input, set them to default
|
213 |
+
$global_settings = CrayonSettings::get_defaults();
|
214 |
+
|
215 |
+
foreach ($global_settings as $setting) {
|
216 |
+
// If boolean setting is not in input, then it is set to FALSE in the form
|
217 |
+
if (!array_key_exists($setting->name(), $inputs)) {
|
218 |
+
// For booleans, set to FALSE (unchecked boxes are not sent as POST)
|
219 |
+
if (is_bool($setting->def())) {
|
220 |
+
$inputs[$setting->name()] = FALSE;
|
221 |
+
} else {
|
222 |
+
/* For array settings, set the input as the value, which by default is the
|
223 |
+
default index */
|
224 |
+
if (is_array($setting->def())) {
|
225 |
+
$inputs[$setting->name()] = $setting->value();
|
226 |
+
} else {
|
227 |
+
$inputs[$setting->name()] = $setting->def();
|
228 |
+
}
|
229 |
+
}
|
230 |
+
}
|
231 |
+
}
|
232 |
+
return $inputs;
|
233 |
+
}
|
234 |
+
|
235 |
+
// Section callback functions
|
236 |
+
|
237 |
+
public static function blank() {} // Used for required callbacks with blank content
|
238 |
+
|
239 |
+
// Input Drawing ==========================================================
|
240 |
+
|
241 |
+
// Used to read args and validate for input tags
|
242 |
+
private static function input($args) {
|
243 |
+
if (empty($args) || !is_array($args)) {
|
244 |
+
return FALSE;
|
245 |
+
}
|
246 |
+
extract($args);
|
247 |
+
$name = (!empty($name) ? $name : '');
|
248 |
+
$size = (!empty($size) && is_numeric($size) ? $size : 40);
|
249 |
+
$break = (!empty($break) && $break ? CRAYON_BR : '');
|
250 |
+
$margin = (!empty($margin) && $margin ? '20px' : 0);
|
251 |
+
// By default, inputs will trigger preview refresh
|
252 |
+
$preview = (!empty($preview) && !$preview ? 0 : 1);
|
253 |
+
//$options = get_option(self::OPTIONS);
|
254 |
+
if (!array_key_exists($name, self::$options)) {
|
255 |
+
return array();
|
256 |
+
}
|
257 |
+
return compact('name', 'size', 'break', 'margin', 'preview', 'options');
|
258 |
+
}
|
259 |
+
|
260 |
+
private static function textbox($args) {
|
261 |
+
if (!($args = self::input($args))) {
|
262 |
+
return;
|
263 |
+
}
|
264 |
+
$name = $size = $margin = $preview = $break = '';
|
265 |
+
extract($args);
|
266 |
+
echo '<input id="', $name, '" name="', self::OPTIONS, '[', $name, ']" size="', $size, '" type="text" value="',
|
267 |
+
self::$options[$name], '" style="margin-left: ', $margin, '" crayon-preview="', ($preview ? 1 : 0), '" />', $break;
|
268 |
+
}
|
269 |
+
|
270 |
+
private static function checkbox($args, $line_break = TRUE, $preview = TRUE) {
|
271 |
+
if (empty($args) || !is_array($args) || count($args) != 2) {
|
272 |
+
return;
|
273 |
+
}
|
274 |
+
$name = $args[0];
|
275 |
+
$text = $args[1];
|
276 |
+
$checked = (!array_key_exists($name, self::$options)) ? '' : checked(TRUE, self::$options[$name], FALSE);
|
277 |
+
echo '<input id="', $name, '" name="', self::OPTIONS, '[', $name, ']" type="checkbox" value="1"', $checked,
|
278 |
+
' crayon-preview="', ($preview ? 1 : 0), '" /> ', '<span>', $text, '</span>', ($line_break ? CRAYON_BR : '');
|
279 |
+
}
|
280 |
+
|
281 |
+
// Draws a dropdown by loading the default value (an array) from a setting
|
282 |
+
private static function dropdown($name, $line_break = TRUE, $preview = TRUE) {
|
283 |
+
if (!array_key_exists($name, self::$options)) {
|
284 |
+
return;
|
285 |
+
}
|
286 |
+
$opts = CrayonGlobalSettings::get($name)->def();
|
287 |
+
if (is_array($opts)) {
|
288 |
+
echo '<select id="', $name, '" name="', self::OPTIONS, '[', $name, ']" crayon-preview="', ($preview ? 1 : 0), '">';
|
289 |
+
for ($i = 0; $i < count($opts); $i++) {
|
290 |
+
echo '<option value="', $i,'" ', selected(self::$options[$name], $i), '>', $opts[$i], '</option>';
|
291 |
+
}
|
292 |
+
echo '</select>', ($line_break ? CRAYON_BR : '');
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
// General Fields =========================================================
|
297 |
+
public static function help() {
|
298 |
+
if (CrayonGlobalSettings::val(CrayonSettings::HIDE_HELP)) {
|
299 |
+
return;
|
300 |
+
}
|
301 |
+
$url = plugins_url(CRAYON_AJAX_PHP, __FILE__) . '?' . CrayonSettings::HIDE_HELP . '=1';
|
302 |
+
$web = CRAYON_WEBSITE;
|
303 |
+
echo <<<EOT
|
304 |
+
<div id="crayon-help" class="updated settings-error crayon-help">
|
305 |
+
<span><strong>Howdy, coder!</strong> Thanks for using Crayon. Use <strong>help</strong> on the top-right to learn how to use the shortcode and basic features, or check out my <a href="#info">Twitter & Email</a>. For online help and info, visit <a target="_blank" href="{$web}">here</a>.</span>
|
306 |
+
<a class="crayon-help-close" href="#" url="{$url}">X</a>
|
307 |
+
</div>
|
308 |
+
EOT;
|
309 |
+
}
|
310 |
+
|
311 |
+
public static function cont_help($contextual_help, $screen_id, $screen) {
|
312 |
+
if ($screen_id == self::$plugin_hook) {
|
313 |
+
if ( ($contextual_help = @file_get_contents(CRAYON_HELP_FILE)) !== FALSE) {
|
314 |
+
$contextual_help = str_replace('{PLUGIN}', CrayonGlobalSettings::plugin_path(), $contextual_help);
|
315 |
+
} else {
|
316 |
+
$contextual_help = 'Help failed to load... Try <a href="#info">these</a> instead.';
|
317 |
+
}
|
318 |
+
}
|
319 |
+
return $contextual_help;
|
320 |
+
}
|
321 |
+
|
322 |
+
public static function metrics() {
|
323 |
+
self::checkbox(array(CrayonSettings::HEIGHT_SET, '<span class="crayon-span-50">Height: </span>'), FALSE);
|
324 |
+
self::dropdown(CrayonSettings::HEIGHT_MODE, FALSE);
|
325 |
+
echo ' ';
|
326 |
+
self::textbox(array('name' => CrayonSettings::HEIGHT, 'size' => 8));
|
327 |
+
echo ' ';
|
328 |
+
self::dropdown(CrayonSettings::HEIGHT_UNIT);
|
329 |
+
self::checkbox(array(CrayonSettings::WIDTH_SET, '<span class="crayon-span-50">Width: </span>'), FALSE);
|
330 |
+
self::dropdown(CrayonSettings::WIDTH_MODE, FALSE);
|
331 |
+
echo ' ';
|
332 |
+
self::textbox(array('name' => CrayonSettings::WIDTH, 'size' => 8));
|
333 |
+
echo ' ';
|
334 |
+
self::dropdown(CrayonSettings::WIDTH_UNIT);
|
335 |
+
$text = array('Top' => array(CrayonSettings::TOP_SET, CrayonSettings::TOP_MARGIN),
|
336 |
+
'Bottom' => array(CrayonSettings::BOTTOM_SET, CrayonSettings::BOTTOM_MARGIN),
|
337 |
+
'Left' => array(CrayonSettings::LEFT_SET, CrayonSettings::LEFT_MARGIN),
|
338 |
+
'Right' => array(CrayonSettings::RIGHT_SET, CrayonSettings::RIGHT_MARGIN));
|
339 |
+
foreach ($text as $p => $s) {
|
340 |
+
$set = $s[0];
|
341 |
+
$margin = $s[1];
|
342 |
+
$preview = ($p == 'Left' || $p == 'Right');
|
343 |
+
self::checkbox(array($set, '<span class="crayon-span-110">' . $p . ' Margin: </span>'), FALSE, $preview);
|
344 |
+
echo ' ';
|
345 |
+
self::textbox(array('name' => $margin, 'size' => 8, 'preview' => FALSE));
|
346 |
+
echo '<span class="crayon-span-margin">Pixels</span>', CRAYON_BR;
|
347 |
+
}
|
348 |
+
echo '<span class="crayon-span" style="min-width: 135px;">Horizontal Alignment: </span>';
|
349 |
+
self::dropdown(CrayonSettings::H_ALIGN);
|
350 |
+
echo '<div id="crayon-float">';
|
351 |
+
self::checkbox(array(CrayonSettings::FLOAT_ENABLE, 'Allow floating elements to surround Crayon'), FALSE, FALSE);
|
352 |
+
echo '</div>';
|
353 |
+
}
|
354 |
+
|
355 |
+
public static function toolbar() {
|
356 |
+
echo 'Display the Toolbar: ';
|
357 |
+
self::dropdown(CrayonSettings::TOOLBAR);
|
358 |
+
echo '<div id="' . CrayonSettings::TOOLBAR_OVERLAY . '">';
|
359 |
+
self::checkbox(array(CrayonSettings::TOOLBAR_OVERLAY, 'Overlay the toolbar on code rather than push it down when possible'));
|
360 |
+
self::checkbox(array(CrayonSettings::TOOLBAR_HIDE, 'Toggle the toolbar on single click when it is overlayed'));
|
361 |
+
self::checkbox(array(CrayonSettings::TOOLBAR_DELAY, 'Delay hiding the toolbar on MouseOut'));
|
362 |
+
echo '</div>';
|
363 |
+
self::checkbox(array(CrayonSettings::SHOW_TITLE, 'Display the title when provided'));
|
364 |
+
echo 'Display the language: ';
|
365 |
+
self::dropdown(CrayonSettings::SHOW_LANG);
|
366 |
+
}
|
367 |
+
|
368 |
+
public static function lines() {
|
369 |
+
self::checkbox(array(CrayonSettings::STRIPED, 'Display striped code lines'));
|
370 |
+
self::checkbox(array(CrayonSettings::MARKING, 'Enable line marking for important lines'));
|
371 |
+
self::checkbox(array(CrayonSettings::NUMS, 'Display line numbers by default'));
|
372 |
+
self::checkbox(array(CrayonSettings::NUMS_TOGGLE, 'Enable line number toggling'));
|
373 |
+
}
|
374 |
+
|
375 |
+
public static function langs() {
|
376 |
+
echo '<a name="langs"></a>';
|
377 |
+
// Specialised dropdown for languages
|
378 |
+
if (array_key_exists(CrayonSettings::FALLBACK_LANG, self::$options)) {
|
379 |
+
if (($langs = CrayonParser::parse_all()) != FALSE) {
|
380 |
+
$name = CrayonSettings::FALLBACK_LANG;
|
381 |
+
echo 'When no language is provided, use the fallback: ', '<select id="', $name, '" name="', self::OPTIONS,
|
382 |
+
'[', $name, ']" crayon-preview="1">';
|
383 |
+
foreach ($langs as $lang) {
|
384 |
+
|
385 |
+
$title = $lang->name() . ' [' . $lang->id() . ']';
|
386 |
+
echo '<option value="', $lang->id(), '" ', selected(self::$options[CrayonSettings::FALLBACK_LANG],
|
387 |
+
$lang->id()), '>', $title, '</option>';
|
388 |
+
}
|
389 |
+
// Information about parsing
|
390 |
+
$parsed = CrayonResources::langs()->is_parsed();
|
391 |
+
echo '</select>', CRAYON_BR, ($parsed ? '' : '<span class="crayon-error">'),
|
392 |
+
CrayonUtil::spnum(count($langs), 'language has', 'languages have'), ' been detected. Parsing was ',
|
393 |
+
($parsed ? 'successful' : 'unsuccessful'), '. ', ($parsed ? '' : '</span>');
|
394 |
+
// Check if fallback from db is loaded
|
395 |
+
$db_fallback = self::$options[CrayonSettings::FALLBACK_LANG]; // Fallback name from db
|
396 |
+
|
397 |
+
if (!CrayonResources::langs()->is_loaded($db_fallback) || !CrayonResources::langs()->exists($db_fallback)) {
|
398 |
+
echo '<br/><span class="crayon-error">The selected language with id "', $db_fallback,
|
399 |
+
'" could not be loaded. </span>';
|
400 |
+
}
|
401 |
+
// Language parsing info
|
402 |
+
echo '<a href="#" id="show-lang" onclick="show_langs(\'', plugins_url(CRAYON_LIST_LANGS_PHP, __FILE__),
|
403 |
+
'\'); return false;">Show Languages</a>', '<div id="lang-info"></div>';
|
404 |
+
} else {
|
405 |
+
echo 'No languages could be parsed.';
|
406 |
+
}
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
public static function themes() {
|
411 |
+
$db_theme = self::$options[CrayonSettings::THEME]; // Theme name from db
|
412 |
+
if (!array_key_exists(CrayonSettings::THEME, self::$options)) {
|
413 |
+
$db_theme = '';
|
414 |
+
}
|
415 |
+
$name = CrayonSettings::THEME;
|
416 |
+
$themes = CrayonResources::themes()->get();
|
417 |
+
echo '<select id="', $name, '" name="', self::OPTIONS, '[', $name, ']" crayon-preview="1">';
|
418 |
+
foreach ($themes as $theme) {
|
419 |
+
$title = $theme->name();
|
420 |
+
echo '<option value="', $theme->id(), '" ', selected($db_theme, $theme->id()), '>', $title, '</option>';
|
421 |
+
}
|
422 |
+
echo '</select><span class="crayon-span-10"></span>';
|
423 |
+
// Preview checkbox
|
424 |
+
self::checkbox(array(CrayonSettings::PREVIEW, 'Enable Live Preview'), TRUE, FALSE);
|
425 |
+
// Check if theme from db is loaded
|
426 |
+
if (!CrayonResources::themes()->is_loaded($db_theme) || !CrayonResources::themes()->exists($db_theme)) {
|
427 |
+
echo '<span class="crayon-error">The selected theme with id "', $db_theme, '" could not be loaded.</span>';
|
428 |
+
}
|
429 |
+
echo '<div id="crayon-preview" url="', plugins_url(CRAYON_PREVIEW_PHP, __FILE__), '"></div>';
|
430 |
+
}
|
431 |
+
|
432 |
+
public static function fonts() {
|
433 |
+
$db_font = self::$options[CrayonSettings::FONT]; // Theme name from db
|
434 |
+
if (!array_key_exists(CrayonSettings::FONT, self::$options)) {
|
435 |
+
$db_font = '';
|
436 |
+
}
|
437 |
+
$name = CrayonSettings::FONT;
|
438 |
+
$fonts = CrayonResources::fonts()->get();
|
439 |
+
echo '<select id="', $name, '" name="', self::OPTIONS, '[', $name, ']" crayon-preview="1">';
|
440 |
+
foreach ($fonts as $font) {
|
441 |
+
$title = $font->name();
|
442 |
+
echo '<option value="', $font->id(), '" ', selected($db_font, $font->id()), '>', $title, '</option>';
|
443 |
+
}
|
444 |
+
echo '</select><span class="crayon-span-10"></span>';
|
445 |
+
self::checkbox(array(CrayonSettings::FONT_SIZE_ENABLE, 'Custom Font Size: '), FALSE);
|
446 |
+
self::textbox(array('name' => CrayonSettings::FONT_SIZE, 'size' => 2));
|
447 |
+
echo '<span class="crayon-span-margin">Pixels</span></br>';
|
448 |
+
if ($db_font != CrayonFonts::DEFAULT_FONT && (!CrayonResources::fonts()->is_loaded($db_font) ||
|
449 |
+
!CrayonResources::fonts()->exists($db_font))) {
|
450 |
+
// Default font doesn't actually exist as a file, it means do not override default theme font
|
451 |
+
echo '<span class="crayon-error">The selected font with id "', $db_font, '" could not be loaded.</span>';
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
public static function code() {
|
456 |
+
self::checkbox(array(CrayonSettings::PLAIN, 'Enable plain code view and display: '), FALSE);
|
457 |
+
self::dropdown(CrayonSettings::SHOW_PLAIN);
|
458 |
+
echo 'Display scrollbars (when needed): ';
|
459 |
+
self::dropdown(CrayonSettings::SCROLL);
|
460 |
+
echo 'Tab size in spaces: ';
|
461 |
+
self::textbox(array('name' => CrayonSettings::TAB_SIZE, 'size' => 2, 'break' => TRUE));
|
462 |
+
self::checkbox(array(CrayonSettings::TRIM_WHITESPACE, 'Remove whitespace surrounding the shortcode content'));
|
463 |
+
}
|
464 |
+
|
465 |
+
public static function files() {
|
466 |
+
echo '<a name="files"></a>';
|
467 |
+
echo 'When loading local files and a relative path is given for the URL, use the absolute path: ',
|
468 |
+
'<div style="margin-left: 20px">', home_url(), '/';
|
469 |
+
self::textbox(array('name' => CrayonSettings::LOCAL_PATH));
|
470 |
+
echo '</div>Followed by your relative URL.';
|
471 |
+
}
|
472 |
+
|
473 |
+
public static function misc() {
|
474 |
+
self::checkbox(array(CrayonSettings::TOUCHSCREEN, 'Disable mouse gestures for touchscreen devices (eg. MouseOver)'));
|
475 |
+
self::checkbox(array(CrayonSettings::DISABLE_ANIM, 'Disable animations'));
|
476 |
+
self::checkbox(array(CrayonSettings::DISABLE_RUNTIME, 'Disable runtime stats'));
|
477 |
+
//self::checkbox(array(CrayonSettings::EXP_SCROLL, 'Use experimental CSS3 scrollbars (visible only in Chrome and Safari for now)'));
|
478 |
+
}
|
479 |
+
|
480 |
+
// Debug Fields ===========================================================
|
481 |
+
|
482 |
+
public static function errors() {
|
483 |
+
self::checkbox(array(CrayonSettings::ERROR_LOG, 'Log errors for individual Crayons'));
|
484 |
+
self::checkbox(array(CrayonSettings::ERROR_LOG_SYS, 'Log system-wide errors'));
|
485 |
+
//self::checkbox( array(CrayonSettings::ERROR_LOG_WARNING, 'Log system-wide warnings & notices') );
|
486 |
+
|
487 |
+
self::checkbox(array(CrayonSettings::ERROR_MSG_SHOW, 'Display custom message for errors'));
|
488 |
+
self::textbox(array('name' => CrayonSettings::ERROR_MSG, 'size' => 60, 'margin' => TRUE));
|
489 |
+
}
|
490 |
+
|
491 |
+
public static function log() {
|
492 |
+
$log = CrayonLog::log();
|
493 |
+
touch(CRAYON_LOG_FILE);
|
494 |
+
$exists = file_exists(CRAYON_LOG_FILE);
|
495 |
+
$writable = is_writable(CRAYON_LOG_FILE);
|
496 |
+
if (!empty($log)) {
|
497 |
+
echo '<div id="crayon-log-wrapper">', '<div id="crayon-log"><div id="crayon-log-text">', $log,
|
498 |
+
'</div></div>', '<div id="crayon-log-controls">',
|
499 |
+
'<input type="button" id="crayon-log-toggle" class="button-secondary" value="Show Log"> ',
|
500 |
+
'<input type="submit" id="crayon-log-clear" name="', self::LOG_CLEAR ,
|
501 |
+
'" class="button-secondary" value="Clear Log"> ', '<input type="submit" id="crayon-log-email" name="',
|
502 |
+
self::LOG_EMAIL_ADMIN . '" class="button-secondary" value="Email Admin"> ',
|
503 |
+
'<input type="submit" id="crayon-log-email" name="', self::LOG_EMAIL_DEV,
|
504 |
+
'" class="button-secondary" value="Email Developer"> ', '</div>', '</div>';
|
505 |
+
}
|
506 |
+
echo '<span', (!empty($log)) ? ' class="crayon-span"' : '', '>', (empty($log)) ? 'The log is currently empty. ' : '',
|
507 |
+
'The log file ', ($exists) ? 'exists' : 'doesn\'t exist', ' and is ', ($writable) ? 'writable' : 'not writable', '.</span>';
|
508 |
+
}
|
509 |
+
|
510 |
+
// About Fields ===========================================================
|
511 |
+
|
512 |
+
public static function info() {
|
513 |
+
echo '<a name="info"></a>';
|
514 |
+
$version = '<b>Version:</b> ' . CRAYON_VERSION . '<span class="crayon-span" style="width: 40px"></span>';
|
515 |
+
$date = '<b>Build Date:</b> ' . CRAYON_DATE;
|
516 |
+
$developer = '<b>Developer:</b> ' . CRAYON_AUTHOR;
|
517 |
+
$links = '<a id="twitter-icon" href="' . CRAYON_TWITTER . '" target="_blank"></a>
|
518 |
+
<a id="gmail-icon" href="mailto:' . CRAYON_EMAIL . '" target="_blank"></a>';
|
519 |
+
echo <<<EOT
|
520 |
+
<table id="crayon-info" border="0">
|
521 |
+
<tr>
|
522 |
+
<td>{$version}</td>
|
523 |
+
<td>{$date}</td>
|
524 |
+
</tr>
|
525 |
+
<tr>
|
526 |
+
<td>{$developer}</td>
|
527 |
+
<td></td>
|
528 |
+
</tr>
|
529 |
+
<tr>
|
530 |
+
<td colspan="2" style="text-align: centera;">{$links}</td>
|
531 |
+
</tr>
|
532 |
+
</table>
|
533 |
+
|
534 |
+
EOT;
|
535 |
+
}
|
536 |
+
}
|
537 |
+
// Add the settings menus
|
538 |
+
|
539 |
+
if (defined('ABSPATH') && is_admin()) {
|
540 |
+
add_action('admin_menu', 'CrayonSettingsWP::admin_load');
|
541 |
+
}
|
542 |
+
|
543 |
+
?>
|
crayon_themes.class.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('global.php');
|
3 |
+
require_once (CRAYON_RESOURCE_PHP);
|
4 |
+
|
5 |
+
/* Manages themes once they are loaded. */
|
6 |
+
class CrayonThemes extends CrayonResourceCollection {
|
7 |
+
// Properties and Constants ===============================================
|
8 |
+
|
9 |
+
const DEFAULT_THEME = 'classic';
|
10 |
+
const DEFAULT_THEME_NAME = 'Classic';
|
11 |
+
|
12 |
+
// Methods ================================================================
|
13 |
+
|
14 |
+
function __construct() {
|
15 |
+
$this->directory ( CRAYON_THEME_PATH );
|
16 |
+
$this->set_default ( self::DEFAULT_THEME, self::DEFAULT_THEME_NAME );
|
17 |
+
}
|
18 |
+
|
19 |
+
// XXX Override
|
20 |
+
|
21 |
+
public function path($id) {
|
22 |
+
return CRAYON_THEME_PATH . $id . crayon_slash () . "$id.css";
|
23 |
+
}
|
24 |
+
}
|
25 |
+
?>
|
crayon_wp.class.php
ADDED
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Crayon Syntax Highlighter
|
4 |
+
Plugin URI: http://ak.net84.net/
|
5 |
+
Description: Supports multiple languages, themes, highlighting from a URL, local file or post text. <a href="options-general.php?page=crayon_settings">View Settings.</a>
|
6 |
+
Version: 1.0
|
7 |
+
Author: Aram Kocharyan
|
8 |
+
Author URI: http://ak.net84.net/
|
9 |
+
License: GPL2
|
10 |
+
Copyright 2011 Aram Kocharyan (email : akarmenia@gmail.com)
|
11 |
+
This program is free software; you can redistribute it and/or modify
|
12 |
+
it under the terms of the GNU General Public License, version 2, as
|
13 |
+
published by the Free Software Foundation.
|
14 |
+
|
15 |
+
This program is distributed in the hope that it will be useful,
|
16 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
+
GNU General Public License for more details.
|
19 |
+
|
20 |
+
You should have received a copy of the GNU General Public License
|
21 |
+
along with this program; if not, write to the Free Software
|
22 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
23 |
+
*/
|
24 |
+
require_once ('global.php');
|
25 |
+
require_once (CRAYON_HIGHLIGHTER_PHP);
|
26 |
+
require_once ('crayon_settings_wp.class.php');
|
27 |
+
|
28 |
+
/* The plugin class that manages all other classes and integrates Crayon with WP */
|
29 |
+
class CrayonWP {
|
30 |
+
// Properties and Constants ===============================================
|
31 |
+
|
32 |
+
// Associative array, keys are post IDs as strings and values are number of crayons parsed as ints
|
33 |
+
private static $post_queue = array();
|
34 |
+
// Whether we have added styles and scripts
|
35 |
+
private static $included = FALSE;
|
36 |
+
|
37 |
+
// Used to detect the shortcode
|
38 |
+
const REGEX_CLOSED = '(?:\[[\t ]*crayon\b([^\]]*)/[\t ]*\])'; // [crayon atts="" /]
|
39 |
+
const REGEX_TAG = '(?:\[[\t ]*crayon\b([^\]]*)\]\r?\n?(.*?)\r?\n?\[[\t ]*/[\t ]*crayon\b[^\]]*\])'; // [crayon atts="" /] ... [/crayon]
|
40 |
+
|
41 |
+
const REGEX_CLOSED_NO_CAPTURE = '(?:\[[\t ]*crayon\b[^\]]*/[\t ]*\])';
|
42 |
+
const REGEX_TAG_NO_CAPTURE = '(?:\[[\t ]*crayon\b[^\]]*\]\r?\n?.*?\r?\n?\[[\t ]*/[\t ]*crayon\b[^\]]*\])';
|
43 |
+
|
44 |
+
// Methods ================================================================
|
45 |
+
|
46 |
+
private function __construct() {}
|
47 |
+
|
48 |
+
public static function regex() {
|
49 |
+
return '#(?<!\$)(?:'. self::REGEX_CLOSED .'|'. self::REGEX_TAG .')(?!\$)#s';
|
50 |
+
}
|
51 |
+
|
52 |
+
public static function regex_no_capture() {
|
53 |
+
return '#(?<!\$)(?:'. self::REGEX_CLOSED_NO_CAPTURE .'|'. self::REGEX_TAG_NO_CAPTURE .')(?!\$)#s';
|
54 |
+
}
|
55 |
+
|
56 |
+
public static function regex_ignore() {
|
57 |
+
return '#(?:\$('. self::REGEX_CLOSED_NO_CAPTURE .')\$?)|'. '(?:\$(\[[\t ]*crayon\b))|(?:(\[[\t ]*/[\t ]*crayon\b[^\]]*\])\$)' .'#s';
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Adds the actual Crayon instance, should only be called by add_shortcode()
|
62 |
+
*/
|
63 |
+
private static function shortcode($atts, $content = NULL) {
|
64 |
+
CrayonSettingsWP::load_settings(); // Run first to ensure global settings loaded
|
65 |
+
|
66 |
+
// Load attributes from shortcode
|
67 |
+
$allowed_atts = array('url' => NULL, 'lang' => NULL, 'title' => NULL, 'mark' => NULL);
|
68 |
+
$filtered_atts = shortcode_atts($allowed_atts, $atts);
|
69 |
+
|
70 |
+
// Clean attributes
|
71 |
+
$keys = array_keys($filtered_atts);
|
72 |
+
for ($i = 0; $i < count($keys); $i++) {
|
73 |
+
$key = $keys[$i];
|
74 |
+
$filtered_atts[$key] = trim(strip_tags($filtered_atts[$key]));
|
75 |
+
}
|
76 |
+
|
77 |
+
// Contains all other attributes not found in allowed, used to override global settings
|
78 |
+
$extra_attr = array();
|
79 |
+
if (!empty($atts)) {
|
80 |
+
$extra_attr = array_diff_key($atts, $allowed_atts);
|
81 |
+
$extra_attr = CrayonSettings::smart_settings($extra_attr);
|
82 |
+
}
|
83 |
+
$lang = $title = $mark = '';
|
84 |
+
extract($filtered_atts);
|
85 |
+
|
86 |
+
$crayon = self::instance($extra_attr);
|
87 |
+
|
88 |
+
// Set URL
|
89 |
+
$url = isset($url) ? $url : '';
|
90 |
+
if (!empty($url)) {
|
91 |
+
$crayon->url($url);
|
92 |
+
}
|
93 |
+
if (!empty($content)) {
|
94 |
+
|
95 |
+
$crayon->code($content);
|
96 |
+
}
|
97 |
+
// Set attributes, should be set after URL to allow language auto detection
|
98 |
+
$crayon->language($lang);
|
99 |
+
$crayon->title($title);
|
100 |
+
$crayon->marked($mark);
|
101 |
+
return $crayon->output($highlight = true, $nums = true, $print = false);
|
102 |
+
}
|
103 |
+
|
104 |
+
/* Returns Crayon instance */
|
105 |
+
public static function instance($extra_attr = array()) {
|
106 |
+
// Create Crayon
|
107 |
+
$crayon = new CrayonHighlighter();
|
108 |
+
/* Load settings and merge shortcode attributes which will override any existing.
|
109 |
+
* Stores the other shortcode attributes as settings in the crayon. */
|
110 |
+
if (!empty($extra_attr)) {
|
111 |
+
$crayon->settings($extra_attr);
|
112 |
+
}
|
113 |
+
return $crayon;
|
114 |
+
}
|
115 |
+
|
116 |
+
/* Enqueue styles and scripts only if shortcode is used */
|
117 |
+
public static function the_posts($posts) {
|
118 |
+
if (empty($posts)) {
|
119 |
+
return $posts;
|
120 |
+
}
|
121 |
+
|
122 |
+
// Whether to enqueue syles/scripts
|
123 |
+
$enqueue = FALSE;
|
124 |
+
|
125 |
+
// Search for shortcode
|
126 |
+
foreach ($posts as $post) {
|
127 |
+
// Only include if a post exists with Crayon tag
|
128 |
+
preg_match_all(self::regex(), $post->post_content, $matches);
|
129 |
+
|
130 |
+
if ( count($matches[0]) != 0 ) {
|
131 |
+
// Crayons found!
|
132 |
+
$full_matches = $matches[1];
|
133 |
+
$closed_atts = $matches[1];
|
134 |
+
$open_atts = $matches[2];
|
135 |
+
$contents = $matches[3];
|
136 |
+
// Make sure we enqueue the styles/scripts
|
137 |
+
$enqueue = TRUE;
|
138 |
+
|
139 |
+
for ($i = 0; $i < count($full_matches); $i++) {
|
140 |
+
if ( !empty($closed_atts[$i]) ) {
|
141 |
+
$atts = $closed_atts[$i];
|
142 |
+
} else if ( !empty($open_atts[$i]) ) {
|
143 |
+
$atts = $open_atts[$i];
|
144 |
+
} else {
|
145 |
+
$atts = '';
|
146 |
+
}
|
147 |
+
|
148 |
+
// Capture attributes
|
149 |
+
preg_match_all('#([^="\'\s]+)[\t ]*=[\t ]*("|\')([^"]+)\2#', $atts, $att_matches);
|
150 |
+
$atts_array = array();
|
151 |
+
|
152 |
+
if ( count($att_matches[0]) != 0 ) {
|
153 |
+
for ($j = 0; $j < count($att_matches[1]); $j++) {
|
154 |
+
$atts_array[trim($att_matches[1][$j])] = trim($att_matches[3][$j]);
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
// Add array of atts and content to post queue with key as post ID
|
159 |
+
self::$post_queue[strval($post->ID)][] = array($post->ID, $atts_array, $contents[$i], $i);
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
if (!is_admin() && $enqueue && !self::$included) {
|
165 |
+
self::enqueue_resources();
|
166 |
+
}
|
167 |
+
|
168 |
+
return $posts;
|
169 |
+
}
|
170 |
+
|
171 |
+
private static function enqueue_resources() {
|
172 |
+
wp_enqueue_style('crayon-style', plugins_url(CRAYON_STYLE, __FILE__), array(), CRAYON_VERSION);
|
173 |
+
wp_enqueue_script('crayon-jquery', plugins_url(CRAYON_JQUERY, __FILE__), array(), CRAYON_VERSION);
|
174 |
+
wp_enqueue_script('crayon-js', plugins_url(CRAYON_JS, __FILE__), array('crayon-jquery'), CRAYON_VERSION);
|
175 |
+
self::$included = TRUE;
|
176 |
+
}
|
177 |
+
|
178 |
+
public static function the_content($the_content) {
|
179 |
+
global $post;
|
180 |
+
// Go through queued posts and find crayons
|
181 |
+
$post_id = strval($post->ID);
|
182 |
+
// Find if this post has Crayons
|
183 |
+
if ( array_key_exists($post_id, self::$post_queue) ) {
|
184 |
+
// Loop through Crayons
|
185 |
+
$post_in_queue = self::$post_queue[$post_id];
|
186 |
+
foreach ($post_in_queue as $p) {
|
187 |
+
$atts = $p[1];
|
188 |
+
$content = $p[2];
|
189 |
+
// Remove '$' from $[crayon]...[/crayon]$ contained within [crayon] tag content
|
190 |
+
$content = self::crayon_remove_ignore($content);
|
191 |
+
// Apply shortcode to the content
|
192 |
+
$crayon = self::shortcode($atts, $content);
|
193 |
+
$the_content = preg_replace(self::regex_no_capture(), $crayon, $the_content, 1);
|
194 |
+
}
|
195 |
+
}
|
196 |
+
// Remove '$' from $[crayon]...[/crayon]$ in post body
|
197 |
+
// XXX Do this after applying shortcode to avoid matching
|
198 |
+
$the_content = self::crayon_remove_ignore($the_content);
|
199 |
+
return $the_content;
|
200 |
+
}
|
201 |
+
|
202 |
+
// Check if the $[crayon]...[/crayon]$ notation has been used to ignore [crayon] tags within posts
|
203 |
+
public static function crayon_remove_ignore($the_content) {
|
204 |
+
$the_content = preg_replace('#\$('. self::REGEX_CLOSED_NO_CAPTURE .')\$?#', '$1', $the_content);
|
205 |
+
$the_content = preg_replace('#\$(\[[\t ]*crayon\b)#', '$1', $the_content);
|
206 |
+
$the_content = preg_replace('#(\[[\t ]*/[\t ]*crayon\b[^\]]*\])\$#', '$1', $the_content);
|
207 |
+
return $the_content;
|
208 |
+
}
|
209 |
+
|
210 |
+
public static function install() {
|
211 |
+
|
212 |
+
}
|
213 |
+
|
214 |
+
public static function uninstall() {
|
215 |
+
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
// Only if WP is loaded
|
220 |
+
if (defined('ABSPATH')) {
|
221 |
+
register_activation_hook(__FILE__, 'CrayonWP::install');
|
222 |
+
register_deactivation_hook(__FILE__, 'CrayonWP::uninstall');
|
223 |
+
// Filters and Actions
|
224 |
+
|
225 |
+
add_filter('the_posts', 'CrayonWP::the_posts');
|
226 |
+
add_filter('the_content', 'CrayonWP::the_content');
|
227 |
+
}
|
228 |
+
?>
|
css/admin_style.css
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#crayon-log-wrapper {
|
2 |
+
/*width: 100%;*/
|
3 |
+
}
|
4 |
+
|
5 |
+
#crayon-log {
|
6 |
+
display: none;
|
7 |
+
max-height: 200px;
|
8 |
+
/*width: 100%;
|
9 |
+
/*resize: vertical;*/
|
10 |
+
border-color: #DFDFDF;
|
11 |
+
background-color: white;
|
12 |
+
border-width: 1px;
|
13 |
+
border-style: solid;
|
14 |
+
border-radius: 4px;
|
15 |
+
-moz-border-radius: 4px;
|
16 |
+
-webkit-border-radius: 4px;
|
17 |
+
margin: 1px;
|
18 |
+
padding: 3px;
|
19 |
+
overflow: auto;
|
20 |
+
white-space: pre;
|
21 |
+
margin-bottom: 5px;
|
22 |
+
}
|
23 |
+
|
24 |
+
.crayon-span,.crayon-span-10,.crayon-span-50,.crayon-span-100,.crayon-span-110
|
25 |
+
{
|
26 |
+
line-height: 24px;
|
27 |
+
display: inline-block;
|
28 |
+
}
|
29 |
+
|
30 |
+
.crayon-span-10 {
|
31 |
+
min-width: 10px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.crayon-span-50 {
|
35 |
+
min-width: 50px;
|
36 |
+
}
|
37 |
+
|
38 |
+
.crayon-span-100 {
|
39 |
+
min-width: 100px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.crayon-span-110 {
|
43 |
+
min-width: 117px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.crayon-span-margin {
|
47 |
+
margin-left: 5px;
|
48 |
+
}
|
49 |
+
|
50 |
+
#height_mode, #width_mode {
|
51 |
+
min-width: 65px;
|
52 |
+
}
|
53 |
+
|
54 |
+
.crayon-error {
|
55 |
+
color: #F00;
|
56 |
+
}
|
57 |
+
|
58 |
+
.crayon-success {
|
59 |
+
color: #00F;
|
60 |
+
}
|
61 |
+
|
62 |
+
.crayon-warning {
|
63 |
+
color: #FF8000;
|
64 |
+
}
|
65 |
+
|
66 |
+
.crayon-help {
|
67 |
+
height: 30px;
|
68 |
+
}
|
69 |
+
|
70 |
+
.crayon-help .crayon-help-close,
|
71 |
+
.crayon-help .crayon-help-close:active,
|
72 |
+
.crayon-help .crayon-help-close:hover {
|
73 |
+
text-decoration: none;
|
74 |
+
float: right;
|
75 |
+
color: #000;
|
76 |
+
}
|
77 |
+
|
78 |
+
.crayon-help span,
|
79 |
+
.crayon-help a {
|
80 |
+
margin: 0;
|
81 |
+
padding: 0;
|
82 |
+
font-size: 12px;
|
83 |
+
line-height: 30px;
|
84 |
+
}
|
85 |
+
|
86 |
+
#crayon-log-text {
|
87 |
+
font: 11px/13px Monaco, 'MonacoRegular', 'Courier New', monospace;
|
88 |
+
}
|
89 |
+
|
90 |
+
#crayon-log-controls {
|
91 |
+
float: left;
|
92 |
+
margin-right: 5px;
|
93 |
+
/*margin: 5px 0px;*/
|
94 |
+
}
|
95 |
+
|
96 |
+
.crayon-table {
|
97 |
+
border: 1px solid #999;
|
98 |
+
padding: 0;
|
99 |
+
margin: 0;
|
100 |
+
margin-top: 12px;
|
101 |
+
}
|
102 |
+
|
103 |
+
.crayon-table td {
|
104 |
+
vertical-align: top;
|
105 |
+
border-bottom: 1px solid #AAA;
|
106 |
+
padding: 0px 6px;
|
107 |
+
margin: 0;
|
108 |
+
background: #EEE;
|
109 |
+
}
|
110 |
+
|
111 |
+
.crayon-table-light td {
|
112 |
+
background: #F8F8F8;
|
113 |
+
}
|
114 |
+
|
115 |
+
.crayon-table-header td {
|
116 |
+
font-weight: bold;
|
117 |
+
background: #CCC;
|
118 |
+
}
|
119 |
+
|
120 |
+
.crayon-table-last td,
|
121 |
+
.crayon-table tr:last-child td {
|
122 |
+
border: 0;
|
123 |
+
}
|
124 |
+
|
125 |
+
#lang-info {
|
126 |
+
display: none;
|
127 |
+
}
|
128 |
+
|
129 |
+
.crayon-table .not-parsed {
|
130 |
+
color: #F00;
|
131 |
+
}
|
132 |
+
|
133 |
+
.crayon-table .parsed-with-errors {
|
134 |
+
color: #FF9900;
|
135 |
+
}
|
136 |
+
|
137 |
+
.crayon-table .successfully-parsed {
|
138 |
+
color: #77A000;
|
139 |
+
}
|
140 |
+
|
141 |
+
#crayon-preview,
|
142 |
+
#crayon-log-wrapper {
|
143 |
+
padding: 5px;
|
144 |
+
width: 95%;
|
145 |
+
float: left;
|
146 |
+
clear: both;
|
147 |
+
}
|
148 |
+
|
149 |
+
#crayon-logo {
|
150 |
+
text-align: center;
|
151 |
+
}
|
152 |
+
|
153 |
+
#crayon-info,
|
154 |
+
#crayon-info td {
|
155 |
+
border: none;
|
156 |
+
padding: 0 5px;
|
157 |
+
margin: 0px;
|
158 |
+
}
|
159 |
+
|
160 |
+
#gmail-icon, #twitter-icon {
|
161 |
+
width: 24px;
|
162 |
+
height: 24px;
|
163 |
+
display: inline-block;
|
164 |
+
margin: 5px 5px 0 0;
|
165 |
+
}
|
166 |
+
|
167 |
+
#twitter-icon {
|
168 |
+
background: url(images/twitter.png);
|
169 |
+
}
|
170 |
+
|
171 |
+
#gmail-icon {
|
172 |
+
background: url(images/google.png);
|
173 |
+
}
|
css/fonts/monaco/monaco-webfont.eot
ADDED
Binary file
|
css/fonts/monaco/monaco-webfont.svg
ADDED
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>
|
5 |
+
This is a custom SVG webfont generated by Font Squirrel.
|
6 |
+
Copyright : 199091 Apple Computer Inc 199091 Type Solutions Inc 199091 The Font Bureau Inc
|
7 |
+
</metadata>
|
8 |
+
<defs>
|
9 |
+
<font id="webfontyFRf53FT" horiz-adv-x="1229" >
|
10 |
+
<font-face units-per-em="2048" ascent="1638" descent="-410" />
|
11 |
+
<missing-glyph horiz-adv-x="500" />
|
12 |
+
<glyph unicode=" " />
|
13 |
+
<glyph unicode="!" d="M529 442l-46 1110h248l-47 -1110h-155zM615 -47q-59 0 -101.5 42.5t-42.5 101.5t42.5 101t101.5 42q58 0 100.5 -41.5t42.5 -101.5t-43 -102t-100 -42z" />
|
14 |
+
<glyph unicode=""" d="M465 1055h-128l-64 559h249zM896 1055h-127l-57 559h244z" />
|
15 |
+
<glyph unicode="#" d="M71 419v140h196l110 411h-306v139h341l117 443h146l-117 -443h283l122 443h146l-120 -443h168v-139h-207l-109 -411h316v-140h-355l-114 -419h-148l116 419h-279l-110 -419h-148l111 419h-159zM414 559h280l113 411h-286z" />
|
16 |
+
<glyph unicode="$" d="M580 -155v157q-67 0 -139 7t-135 21.5t-145 51.5v192q66 -34 129.5 -58t134 -38t155.5 -20v557l-107 58q-304 163 -304 394q0 123 101 239.5t310 134.5v166h140v-166q118 0 279 -41v-173l-35 10q-151 42 -244 51v-544l112 -64q158 -91 216.5 -179t58.5 -187 q0 -89 -44.5 -172.5t-127.5 -143.5t-215 -83v-170h-140zM580 928v462q-101 -23 -155.5 -76t-54.5 -124q0 -67 46.5 -128.5t163.5 -133.5zM720 632v-460q109 39 147.5 95.5t38.5 126.5q0 68 -38 116.5t-148 121.5z" />
|
17 |
+
<glyph unicode="%" d="M314 1552q145 0 227.5 -108t82.5 -280q0 -173 -82.5 -280.5t-227.5 -107.5t-228 107.5t-83 280.5q0 172 83 280t228 108zM314 1427q-81 0 -118 -77.5t-37 -185.5q0 -109 37 -186.5t118 -77.5q80 0 117.5 77.5t37.5 186.5q0 108 -37.5 185.5t-117.5 77.5zM166 -47h-164 l1061 1645h165zM912 776q139 0 226 -104t87 -268q0 -189 -92 -296.5t-223 -107.5q-128 0 -217 102.5t-89 285.5q0 174 84 281t224 107zM915 652q-79 0 -117 -76t-38 -194q0 -131 46 -194.5t108 -63.5q66 0 111 69t45 199q0 102 -37.5 181t-117.5 79z" />
|
18 |
+
<glyph unicode="&" d="M881 130q-99 -104 -195.5 -140.5t-208.5 -36.5q-214 0 -344.5 121t-130.5 309q0 263 274 491q-82 103 -123.5 192.5t-41.5 166.5q0 93 49 181t135 136t190 48q138 0 231 -74t93 -212q0 -101 -56.5 -202t-234.5 -236l354 -436q15 50 19.5 82t7.5 117t3 105v49h186v-47 q0 -66 -14 -189.5t-84 -262.5l238 -292h-238zM421 992q101 71 160 155.5t59 152.5q0 65 -41.5 111.5t-129.5 46.5q-76 0 -124 -56t-48 -137q0 -45 12 -91.5t90 -151.5zM778 254l-405 498q-190 -164 -190 -354q0 -130 87 -210t211 -80q66 0 133 23t164 123z" />
|
19 |
+
<glyph unicode="'" d="M683 993h-134l-105 621h341z" />
|
20 |
+
<glyph unicode="(" d="M1072 -372q-277 17 -467 156.5t-303.5 376.5t-113.5 475t113.5 475t303.5 376.5t467 157.5v-156q-209 -19 -359.5 -140.5t-236.5 -309.5t-86 -403t86 -403t236.5 -309t359.5 -141v-155z" />
|
21 |
+
<glyph unicode=")" d="M157 1645q277 -18 467 -157.5t303.5 -376.5t113.5 -475t-113.5 -475t-303.5 -376.5t-467 -156.5v155q209 20 359.5 141t237 309t86.5 403t-86.5 403t-237 309.5t-359.5 140.5v156z" />
|
22 |
+
<glyph unicode="*" d="M519 659l21 347l-283 -190l-93 162l307 150l-307 152l93 159l283 -189l-21 348h188l-26 -348l289 189l94 -159l-308 -152l308 -150l-94 -162l-289 190l26 -347h-188z" />
|
23 |
+
<glyph unicode="+" d="M1157 621v-156h-465v-465h-156v465h-465v156h465v465h156v-465h465z" />
|
24 |
+
<glyph unicode="," d="M424 -434v124q72 19 109.5 54.5t60 90t22.5 131.5q-93 0 -137 52.5t-44 112.5q0 69 49 116.5t114 47.5q84 0 145 -72.5t61 -198.5q0 -110 -48 -207.5t-130.5 -166.5t-201.5 -84z" />
|
25 |
+
<glyph unicode="-" d="M227 551v155h776v-155h-776z" />
|
26 |
+
<glyph unicode="." d="M614 -47q-67 0 -115 48t-48 115q0 68 48.5 115.5t114.5 47.5t114.5 -47.5t48.5 -115.5q0 -67 -48 -115t-115 -48z" />
|
27 |
+
<glyph unicode="/" d="M216 -47h-183l987 1645h177z" />
|
28 |
+
<glyph unicode="0" d="M614 1598q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5zM311 444l537 841q-51 93 -110.5 125.5t-123.5 32.5q-167 0 -254 -185.5t-87 -470.5q0 -65 4 -140t34 -203zM915 1100l-533 -846 q43 -73 99 -109.5t125 -36.5q190 0 270 212.5t80 471.5q0 160 -41 308z" />
|
29 |
+
<glyph unicode="1" d="M568 155v1198q-84 -67 -163 -114t-217 -96v168q219 93 380 241h186v-1397h373v-155h-939v155h380z" />
|
30 |
+
<glyph unicode="2" d="M1088 0h-939v171q0 66 27 141.5t103 169.5t161 181l106 108q32 33 140 153t142.5 184t34.5 126q0 100 -80 154.5t-180 54.5q-57 0 -127.5 -13t-123.5 -30.5t-172 -71.5v165q126 60 252.5 82.5t208.5 22.5q121 0 222.5 -39.5t151 -122.5t49.5 -177q0 -105 -63.5 -215 t-239.5 -283l-114 -113l-96 -94q-91 -92 -147 -178t-62 -205h746v-171z" />
|
31 |
+
<glyph unicode="3" d="M145 28v196q229 -116 397 -116q154 0 254.5 93.5t100.5 240.5q0 148 -110.5 241t-375.5 93h-103v155h143q195 0 282 87.5t87 194.5q0 97 -71 163.5t-218 66.5q-165 0 -355 -93v177q190 71 348 71q283 0 390.5 -111.5t107.5 -254.5q0 -106 -57 -199t-210 -166 q135 -40 204 -98t104.5 -137t35.5 -177q0 -218 -161.5 -360t-417.5 -142q-74 0 -161.5 11t-213.5 64z" />
|
32 |
+
<glyph unicode="4" d="M707 0v434h-659v156l659 962h187v-962h287v-156h-287v-434h-187zM707 590v680l-461 -680h461z" />
|
33 |
+
<glyph unicode="5" d="M188 807v745h869v-179h-683v-380h32q335 0 516 -140t181 -377q0 -150 -73 -269t-206 -186.5t-283 -67.5t-384 73v203q85 -46 190 -75.5t194 -29.5t174 43t132 125.5t47 168.5q0 145 -128.5 245.5t-456.5 100.5h-121z" />
|
34 |
+
<glyph unicode="6" d="M292 728q72 107 178.5 174.5t234.5 67.5q121 0 229.5 -59t165.5 -164.5t57 -245.5q0 -221 -141.5 -384.5t-372.5 -163.5q-272 0 -406.5 227.5t-134.5 578.5q0 388 171 613.5t463 225.5q157 0 305 -46v-188q-166 79 -313 79q-208 0 -322 -191t-114 -484v-40zM657 108 q75 0 151 44.5t119.5 137t43.5 201.5q0 142 -73.5 233t-209.5 91q-141 0 -231.5 -105.5t-90.5 -256.5q0 -152 88.5 -248.5t202.5 -96.5z" />
|
35 |
+
<glyph unicode="7" d="M319 0v139q0 163 37 274t130 247t149 210l162 214l58 75q66 89 114 206h-805v187h985v-124q0 -74 -29.5 -137t-178.5 -269l-71 -98l-104 -146q-100 -141 -148 -225t-72.5 -175t-24.5 -239v-139h-202z" />
|
36 |
+
<glyph unicode="8" d="M459 837l-34 25q-71 50 -139 147.5t-68 214.5q0 155 122 264.5t310 109.5q115 0 207 -41.5t142 -122.5t50 -177q0 -66 -23 -127.5t-68.5 -122t-180.5 -170.5l84 -67q147 -120 198 -207t51 -195q0 -168 -122 -291.5t-366 -123.5q-245 0 -367 115.5t-122 286.5 q0 255 326 482zM650 932q141 107 176.5 179t35.5 134q0 75 -66 136.5t-170 61.5q-112 0 -170.5 -67t-58.5 -139q0 -70 49 -132t157 -139zM599 738q-264 -203 -264 -380q0 -105 87 -177t206 -72q109 0 195 69t86 172q0 101 -104.5 205t-145.5 136z" />
|
37 |
+
<glyph unicode="9" d="M936 824q-72 -107 -178.5 -174.5t-234.5 -67.5q-121 0 -229.5 58.5t-165.5 164.5t-57 246q0 220 141.5 383.5t372.5 163.5q272 0 406.5 -227.5t134.5 -578.5q0 -388 -171 -613.5t-463 -225.5q-157 0 -305 47v187q166 -78 313 -78q208 0 322 191t114 484v40zM571 1443 q-75 0 -151 -44.5t-119.5 -136.5t-43.5 -202q0 -141 73.5 -232t209.5 -91q141 0 231.5 105.5t90.5 255.5q0 152 -88.5 248.5t-202.5 96.5z" />
|
38 |
+
<glyph unicode=":" d="M614 -47q-67 0 -115 48t-48 115q0 68 48.5 115.5t114.5 47.5t114.5 -47.5t48.5 -115.5q0 -67 -48 -115t-115 -48zM614 822q-67 0 -115 48t-48 115q0 68 48.5 115.5t114.5 47.5t114.5 -47.5t48.5 -115.5q0 -67 -48 -115t-115 -48z" />
|
39 |
+
<glyph unicode=";" d="M424 -434v124q72 19 109.5 54.5t60 90t22.5 131.5q-93 0 -137 52.5t-44 112.5q0 69 49 116.5t114 47.5q84 0 145 -72.5t61 -198.5q0 -110 -48 -207.5t-130.5 -166.5t-201.5 -84zM598 822q-67 0 -115 48t-48 115q0 68 48.5 115.5t114.5 47.5t114.5 -47.5t48.5 -115.5 q0 -67 -48 -115t-115 -48z" />
|
40 |
+
<glyph unicode="<" d="M71 543l1086 543v-173l-742 -369l742 -373v-171z" />
|
41 |
+
<glyph unicode="=" d="M1157 791v-155h-1086v155h1086zM1157 442v-155h-1086v155h1086z" />
|
42 |
+
<glyph unicode=">" d="M1157 543l-1086 -543v173l743 369l-743 373v171z" />
|
43 |
+
<glyph unicode="?" d="M401 442v35q0 83 14 138.5t53.5 115t118.5 143.5l62 66q18 19 52 62l66 83q84 104 84 180q0 70 -60 124t-195 54q-87 0 -177.5 -23.5t-211.5 -91.5v180q185 90 387 90q224 0 341.5 -91.5t117.5 -237.5q0 -144 -152 -299l-66 -68l-78 -81l-71 -73q-39 -44 -69 -101 t-30 -159v-46h-186zM503 -47q-58 0 -100.5 42.5t-42.5 101.5t42.5 101t100.5 42q59 0 101.5 -41.5t42.5 -101.5t-43 -102t-101 -42z" />
|
44 |
+
<glyph unicode="@" d="M921 200v-157q-84 -55 -149 -72.5t-140 -17.5q-208 0 -340.5 101.5t-211 283t-78.5 443.5q0 364 167 590.5t451 226.5q281 0 444.5 -200t163.5 -526q0 -144 -42 -236.5t-111 -147t-167 -54.5q-76 0 -124 33.5t-72 154.5q-28 -65 -86 -126.5t-157 -61.5 q-103 0 -170.5 93.5t-67.5 229.5q0 167 96.5 310t348.5 143h191v-438q0 -87 6.5 -123.5t27 -55.5t44.5 -19q39 0 78.5 37.5t60 106t20.5 148.5q0 167 -61 324.5t-181 224.5t-251 67q-139 0 -244.5 -83.5t-173 -250.5t-67.5 -369q0 -203 67 -376t181 -253t254 -80 q159 0 293 130zM712 809v269h-36q-118 0 -170 -37t-82 -116t-30 -174q0 -77 24 -119t66 -42q59 0 120.5 68.5t107.5 150.5z" />
|
45 |
+
<glyph unicode="A" d="M227 0h-194l478 1552h205l481 -1552h-213l-106 341h-546zM380 496h453l-187 589l-44 156l-39 -156z" />
|
46 |
+
<glyph unicode="B" d="M172 0v1552h303q273 0 365.5 -41.5t138.5 -122.5t46 -185q0 -82 -27 -155.5t-80 -134t-154 -114.5q185 -74 250.5 -182t65.5 -216q0 -103 -55.5 -200t-155.5 -149t-320 -52h-377zM374 853h212q103 43 150.5 90.5t71 106t23.5 128.5q0 110 -64.5 164t-251.5 54h-141v-543z M374 155h191q160 0 236.5 75.5t76.5 181.5q0 78 -42 143.5t-130 104t-276 38.5h-56v-543z" />
|
47 |
+
<glyph unicode="C" d="M1088 18q-174 -65 -312 -65q-182 0 -335 97.5t-238 290t-85 435.5q0 241 84 433t237 291t337 99q138 0 312 -65v-184q-161 93 -320 93q-120 0 -219.5 -82t-160.5 -240.5t-61 -344.5q0 -189 63 -349t161 -239.5t217 -79.5q158 0 320 93v-183z" />
|
48 |
+
<glyph unicode="D" d="M155 0v1552h368q254 0 377.5 -88.5t185.5 -267.5t62 -424q0 -232 -65.5 -407.5t-185.5 -270t-374 -94.5h-368zM357 171h135q205 0 292.5 73t125 202.5t37.5 357.5q0 223 -44 343t-126 184.5t-269 64.5h-151v-1225z" />
|
49 |
+
<glyph unicode="E" d="M1041 171v-171h-838v1552h822v-156h-620v-527h558v-155h-558v-543h636z" />
|
50 |
+
<glyph unicode="F" d="M227 0v1552h853v-156h-651v-527h589v-155h-589v-714h-202z" />
|
51 |
+
<glyph unicode="G" d="M1088 1q-164 -48 -301 -48q-194 0 -345.5 96t-237.5 289.5t-86 437.5q0 241 84 433t237 291t336 99q138 0 312 -65v-184q-161 93 -320 93q-120 0 -219.5 -82t-160 -240.5t-60.5 -346.5q0 -252 115 -459t363 -207q32 0 81 5v500h-155v155h357v-767z" />
|
52 |
+
<glyph unicode="H" d="M126 0v1552h202v-668h574v668h201v-1552h-201v729h-574v-729h-202z" />
|
53 |
+
<glyph unicode="I" d="M172 0v155h341v1241h-341v156h884v-156h-341v-1241h341v-155h-884z" />
|
54 |
+
<glyph unicode="J" d="M110 34v190q218 -115 365 -115q77 0 140.5 30t101 100.5t37.5 301.5v855h-349v156h551v-1016q0 -248 -56.5 -357t-158.5 -167.5t-261 -58.5q-178 0 -370 81z" />
|
55 |
+
<glyph unicode="K" d="M157 0v1552h202v-761l577 761h214l-557 -737l635 -815h-253l-616 791v-791h-202z" />
|
56 |
+
<glyph unicode="L" d="M1057 171v-171h-838v1552h202v-1381h636z" />
|
57 |
+
<glyph unicode="M" d="M219 0h-163v1552h203l358 -1022l358 1022h198v-1552h-186v989l5 136h-5l-44 -136l-240 -679h-202l-243 679l-39 136h-5l5 -136v-989z" />
|
58 |
+
<glyph unicode="N" d="M312 0h-186v1552h182l549 -1033l60 -154h5l-5 154v1033h186v-1552h-186l-534 1016l-75 163l4 -161v-1018z" />
|
59 |
+
<glyph unicode="O" d="M614 -47q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5zM614 109q146 0 243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5t-243.5 -165.5t-97.5 -501.5t97.5 -501.5t243.5 -165.5z" />
|
60 |
+
<glyph unicode="P" d="M378 566v-566h-202v1552h386q238 0 347 -53.5t167 -156.5t58 -230q0 -149 -78 -278t-217.5 -198.5t-378.5 -69.5h-82zM378 721h87q187 0 278 48.5t140 139.5t49 197q0 134 -87.5 212t-345.5 78h-121v-675z" />
|
61 |
+
<glyph unicode="Q" d="M746 -29q70 -116 125 -161t143 -67t195 -22h18v-155h-47q-193 0 -281 40t-166 123t-142 226q-183 20 -289.5 116t-168.5 297t-62 432q0 338 135 568t408 230q264 0 403.5 -222t139.5 -601q0 -180 -36.5 -344.5t-126 -289t-248.5 -170.5zM614 1443q-146 0 -243.5 -165.5 t-97.5 -501.5t97.5 -501.5t243.5 -165.5t243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5z" />
|
62 |
+
<glyph unicode="R" d="M351 659v-659h-202v1552h415q203 0 299 -41.5t148.5 -125.5t52.5 -181q0 -90 -35 -181t-96.5 -162.5t-177.5 -135.5l449 -725h-240l-411 659h-202zM351 815h283q95 52 141.5 106t70.5 115t24 122q0 109 -79.5 173.5t-288.5 64.5h-151v-581z" />
|
63 |
+
<glyph unicode="S" d="M157 33v190q240 -114 436 -114q82 0 157 31.5t113.5 90.5t38.5 128q0 81 -53 151.5t-199 155.5l-102 59l-103 59q-272 161 -272 400q0 175 121.5 294.5t379.5 119.5q166 0 321 -48v-173q-171 66 -333 66q-129 0 -208.5 -68t-79.5 -164q0 -95 61 -158t156 -116l78 -47 l97 -59l82 -48q255 -156 255 -392q0 -180 -131 -309t-420 -129q-92 0 -175.5 15.5t-219.5 64.5z" />
|
64 |
+
<glyph unicode="T" d="M513 0v1381h-465v171h1133v-171h-466v-1381h-202z" />
|
65 |
+
<glyph unicode="U" d="M126 1552h202v-1019q0 -201 33.5 -274.5t103 -112t154.5 -38.5q90 0 160.5 41.5t104 130t33.5 332.5v940h186v-1013q0 -217 -64.5 -339.5t-168.5 -184.5t-262 -62q-146 0 -257 54t-168 162t-57 390v993z" />
|
66 |
+
<glyph unicode="V" d="M1003 1552h194l-478 -1552h-205l-481 1552h213l337 -1084l44 -158l39 157z" />
|
67 |
+
<glyph unicode="W" d="M208 0l-180 1552h184l106 -945l14 -157h5l20 157l163 945h184l186 -983l19 -150h5l12 151l117 982h158l-188 -1552h-191l-200 1052l-21 158h-5l-19 -158l-180 -1052h-189z" />
|
68 |
+
<glyph unicode="X" d="M258 0h-210l454 811l-410 741h229l297 -535l304 535h211l-410 -726l458 -826h-233l-341 619z" />
|
69 |
+
<glyph unicode="Y" d="M514 0v718l-462 834h229l345 -616l344 616h207l-461 -834v-718h-202z" />
|
70 |
+
<glyph unicode="Z" d="M122 0v171l737 1225h-714v156h947v-156l-736 -1225h751v-171h-985z" />
|
71 |
+
<glyph unicode="[" d="M355 -372v2017h807v-156h-621v-1706h621v-155h-807z" />
|
72 |
+
<glyph unicode="\" d="M1014 -47l-981 1645h177l987 -1645h-183z" />
|
73 |
+
<glyph unicode="]" d="M874 1645v-2017h-807v155h621v1706h-621v156h807z" />
|
74 |
+
<glyph unicode="^" d="M614 1552l543 -1087h-171l-372 747l-372 -747h-171z" />
|
75 |
+
<glyph unicode="_" d="M71 -155v155h1086v-155h-1086z" />
|
76 |
+
<glyph unicode="`" d="M832 1288h-170l-342 326h216z" />
|
77 |
+
<glyph unicode="a" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237z" />
|
78 |
+
<glyph unicode="b" d="M327 866q86 140 205 211t219 71q140 0 252 -121t112 -367q0 -194 -74.5 -346.5t-198.5 -241t-307 -88.5q-52 0 -160 11q-16 2 -48 5h-186v1614h186v-748zM327 645v-479q101 -26 186 -26q169 0 284.5 132.5t115.5 362.5q0 167 -63 251t-143 84q-87 0 -191.5 -88 t-188.5 -237z" />
|
79 |
+
<glyph unicode="c" d="M1095 32q-187 -63 -356 -63q-168 0 -298.5 77.5t-203.5 210t-73 301.5q0 254 165.5 422t399.5 168q173 0 366 -65v-179q-195 89 -349 89q-102 0 -192 -50.5t-139 -157.5t-49 -220q0 -151 94.5 -288t296.5 -137q61 0 120 8.5t218 62.5v-179z" />
|
80 |
+
<glyph unicode="d" d="M901 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5v497h187v-1614h-187v251zM901 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5t142.5 -84.5q87 0 192 88 t188 237z" />
|
81 |
+
<glyph unicode="e" d="M1084 74q-223 -106 -422 -106q-151 0 -270 75t-190.5 214.5t-71.5 298.5q0 153 68 294t190 219.5t272 78.5q199 0 319.5 -142t120.5 -438v-40h-770q0 -116 48.5 -212t127.5 -144t180 -48q180 0 398 120v-170zM341 667h557v27q0 137 -67 218t-179 81q-113 0 -195.5 -82.5 t-115.5 -243.5z" />
|
82 |
+
<glyph unicode="f" d="M415 0v869h-248v155h248v52q0 221 50 327t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186z" />
|
83 |
+
<glyph unicode="g" d="M901 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-790q0 -282 -7.5 -344.5t-24.5 -126.5q-40 -149 -182.5 -235t-344.5 -86q-203 0 -411 104v188q79 -54 194.5 -95.5t223.5 -41.5 q85 0 161 27t123 78t64 118.5t17 179.5v158zM901 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5t142.5 -84.5q87 0 192 88t188 237z" />
|
84 |
+
<glyph unicode="h" d="M155 0v1614h186v-741q80 129 193 202t226 73q95 0 173.5 -48.5t109.5 -117.5q25 -53 34 -112.5t9 -245.5v-624h-186v647q0 161 -15.5 212.5t-57 84.5t-90.5 33q-98 0 -210.5 -93t-185.5 -233v-651h-186z" />
|
85 |
+
<glyph unicode="i" d="M468 0v962h-310v155h496v-962h311v-155h-497zM437 1520q0 63 43 94t81 31q39 0 82 -31t43 -94q0 -62 -43 -93t-82 -31q-38 0 -81 31t-43 93z" />
|
86 |
+
<glyph unicode="j" d="M172 -438v174q156 -46 263 -46q93 0 158 32.5t101.5 109.5t36.5 268v862h-474v155h660v-982q0 -284 -67 -394.5t-162 -158.5t-260 -48q-119 0 -256 28zM700 1520q0 63 42.5 94t81.5 31t81.5 -31t42.5 -94q0 -62 -42.5 -93t-81.5 -31t-81.5 31t-42.5 93z" />
|
87 |
+
<glyph unicode="k" d="M205 0v1614h186v-1014l537 517h248l-536 -517l550 -600h-256l-543 600v-600h-186z" />
|
88 |
+
<glyph unicode="l" d="M455 0v1458h-334v156h520v-1459h349v-155h-535z" />
|
89 |
+
<glyph unicode="m" d="M71 0v1117h163v-256q77 163 143.5 225t134.5 62q81 0 130.5 -63.5t49.5 -180.5v-60q33 102 79.5 165.5t96.5 101t115 37.5q72 0 123 -61t51 -243v-844h-163v763q0 94 -6 128.5t-24 52.5t-39 18q-52 0 -111.5 -79.5t-121.5 -263.5v-619h-156v762q0 148 -29 174t-52 26 q-51 0 -109.5 -89t-111.5 -228v-645h-163z" />
|
90 |
+
<glyph unicode="n" d="M155 0v1117h186v-244q80 129 193 202t226 73q99 0 180 -52.5t113.5 -137.5t32.5 -334v-624h-186v647q0 161 -15.5 212.5t-57 84.5t-90.5 33q-98 0 -210.5 -93t-185.5 -233v-651h-186z" />
|
91 |
+
<glyph unicode="o" d="M615 -31q-240 0 -384 167.5t-144 422.5t144 422t384 167q239 0 383 -167t144 -422t-144 -422.5t-383 -167.5zM615 124q149 0 237 116t88 319q0 202 -88 318t-237 116q-150 0 -238 -116t-88 -318q0 -203 88 -319t238 -116z" />
|
92 |
+
<glyph unicode="p" d="M327 866q86 140 205 211t219 71q140 0 252 -121t112 -367q0 -194 -74.5 -346.5t-198.5 -241t-307 -88.5q-52 0 -160 11q-16 2 -48 5v-434h-186v1551h186v-251zM327 645v-479q101 -26 186 -26q169 0 284.5 132.5t115.5 362.5q0 167 -63 251t-143 84q-87 0 -191.5 -88 t-188.5 -237z" />
|
93 |
+
<glyph unicode="q" d="M901 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-1551h-187v685zM901 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5t142.5 -84.5q87 0 192 88 t188 237z" />
|
94 |
+
<glyph unicode="r" d="M250 0v1117h186v-244q87 138 199.5 206.5t250.5 68.5q101 0 202 -31v-403h-179v255q-47 8 -74 8q-104 0 -204 -82t-195 -246v-649h-186z" />
|
95 |
+
<glyph unicode="s" d="M168 59v197q112 -73 237 -102.5t212 -29.5q141 0 203 45.5t62 113.5q0 45 -29 77t-144 79l-64 26l-129 51q-208 81 -262.5 149.5t-54.5 166.5q0 138 106.5 227t345.5 89q179 0 339 -52v-169q-184 66 -346 66q-118 0 -184.5 -41.5t-66.5 -103.5q0 -60 57.5 -96t186.5 -83 l126 -46q173 -63 243 -137t70 -185q0 -145 -111.5 -238.5t-356.5 -93.5q-214 0 -440 90z" />
|
96 |
+
<glyph unicode="t" d="M1089 45q-131 -55 -190 -65.5t-114 -10.5q-117 0 -214 45t-146.5 133t-49.5 272v450h-279v155h279v450h186v-450h497v-155h-497v-447q0 -135 32 -190.5t85.5 -81.5t126.5 -26q135 0 284 85v-164z" />
|
97 |
+
<glyph unicode="u" d="M1074 1117v-1117h-186v245q-90 -138 -200 -207t-220 -69q-98 0 -179.5 52.5t-113.5 138t-32 333.5v624h186v-647q0 -161 15.5 -212.5t57 -84.5t89.5 -33q98 0 210.5 92.5t186.5 233.5v651h186z" />
|
98 |
+
<glyph unicode="v" d="M518 0l-485 1117h204l383 -884l391 884h186l-489 -1117h-190z" />
|
99 |
+
<glyph unicode="w" d="M202 0l-182 1117h173l106 -680l28 -158l27 158l178 680h167l201 -680l35 -158l23 158l107 680h143l-181 -1117h-174l-214 719l-34 158h-5l-31 -157l-186 -720h-181z" />
|
100 |
+
<glyph unicode="x" d="M271 0h-215l439 585l-410 532h238l291 -375l283 375h211l-388 -514l461 -603h-239l-340 445z" />
|
101 |
+
<glyph unicode="y" d="M566 45l-516 1072h205l411 -838l344 838h187l-433 -1038q-137 -329 -260.5 -437t-319.5 -108q-85 0 -152 15v164q77 -24 147 -24q90 0 160 35t128 124t82 154z" />
|
102 |
+
<glyph unicode="z" d="M133 0v171l685 791h-669v155h915v-155l-690 -791h713v-171h-954z" />
|
103 |
+
<glyph unicode="{" d="M547 636q93 -49 136.5 -96t65 -96.5t21.5 -113.5q0 -57 -20 -149l-25 -114q-20 -93 -20 -138q0 -61 47.5 -103.5t195.5 -42.5h155v-155h-157q-274 0 -353 88t-79 199q0 59 15 127l18 80l17 87l12 53q7 37 7 72q0 93 -62.5 159t-220.5 66h-89v155h89q156 0 219.5 65 t63.5 162q0 36 -7 70l-12 52l-17 87l-18 80q-15 69 -15 128q0 110 79 198.5t353 88.5h157v-156h-155q-147 0 -195 -42.5t-48 -104.5q0 -44 20 -137l25 -114q20 -92 20 -149q0 -64 -21.5 -113.5t-65 -96.5t-136.5 -96z" />
|
104 |
+
<glyph unicode="|" d="M533 -47v1645h163v-1645h-163z" />
|
105 |
+
<glyph unicode="}" d="M682 636q-93 49 -136.5 96t-64.5 96.5t-21 113.5q0 57 19 149l25 114q20 93 20 138q0 61 -47.5 103.5t-195.5 42.5h-155v156h157q274 0 353.5 -88.5t79.5 -198.5q0 -60 -16 -128l-18 -80l-17 -87l-12 -52q-7 -38 -7 -73q0 -92 62.5 -158t220.5 -66h89v-155h-89 q-156 0 -219.5 -65.5t-63.5 -162.5q0 -35 7 -69l12 -53l17 -87l18 -80q16 -69 16 -128q0 -111 -79.5 -198.5t-353.5 -87.5h-157v155h155q148 0 195.5 42.5t47.5 104.5q0 44 -20 137l-25 114q-19 92 -19 149q0 64 21 113.5t64.5 96.5t136.5 96z" />
|
106 |
+
<glyph unicode="~" d="M56 403v18q0 131 77.5 227.5t208.5 96.5q33 0 64.5 -6.5t71.5 -22t120 -60.5l121 -67q111 -61 181 -61q74 0 109.5 53.5t35.5 116.5v16h128v-16q0 -167 -94.5 -246.5t-200.5 -79.5q-99 0 -262 93l-102 59q-116 66 -187 66q-40 0 -74.5 -21t-55.5 -67t-21 -81v-18h-120z " />
|
107 |
+
<glyph unicode=" " />
|
108 |
+
<glyph unicode="¡" d="M700 659l46 -1109h-248l47 1109h155zM615 1148q56 0 99.5 -43t43.5 -100q0 -58 -43.5 -101t-99.5 -43q-57 0 -100.5 43t-43.5 101q0 57 43.5 100t100.5 43z" />
|
109 |
+
<glyph unicode="¢" d="M607 -155v346q-149 18 -255.5 96t-170 200.5t-63.5 278.5t59 277t163.5 201t266.5 109v354h155v-354q166 -19 287 -56v-179q-36 21 -80 37t-93 29t-114 19v-866q80 9 123 21t130 52q12 6 34 16v-180q-149 -49 -287 -55v-346h-155zM607 345v850q-154 -48 -220.5 -165 t-66.5 -265q0 -126 60 -249.5t227 -170.5z" />
|
110 |
+
<glyph unicode="£" d="M141 0v171q93 21 136.5 62.5t66 121t22.5 202.5v211h-225v155h225v69q0 266 51 380t145 170t225 56q124 0 262 -58v-180q-158 83 -284 83q-57 0 -109.5 -37.5t-78 -114.5t-25.5 -289v-79h326v-155h-326v-117q0 -187 -22 -284.5t-128 -195.5h709v-171h-970z" />
|
111 |
+
<glyph unicode="¤" d="M1042 1381l115 -101l-184 -212q73 -102 89 -164.5t16 -129.5q0 -68 -16 -131.5t-89 -165.5l184 -211l-115 -95l-185 206q-91 -48 -142.5 -57.5t-100.5 -9.5t-100.5 9.5t-142.5 57.5l-185 -206l-115 95l184 211q-73 102 -89 165.5t-16 131.5q0 67 16 129.5t89 164.5 l-184 212l115 101l185 -211q88 54 143.5 62.5t99.5 8.5t99.5 -8.5t143.5 -62.5zM614 465q119 0 213.5 86.5t94.5 218.5q0 86 -41.5 160.5t-116.5 115t-150 40.5t-150 -40.5t-116.5 -115t-41.5 -160.5q0 -132 94.5 -218.5t213.5 -86.5z" />
|
112 |
+
<glyph unicode="¥" d="M522 0v248h-326v140h326v194h-326v139h317l-461 831h205l367 -642l368 642h185l-469 -831h318v-139h-318v-194h318v-140h-318v-248h-186z" />
|
113 |
+
<glyph unicode="§" d="M149 -301v201q102 -55 218.5 -86t210.5 -31q149 0 228.5 61t79.5 131q0 58 -39.5 101.5t-170.5 117.5l-147 83q-196 110 -276.5 209t-80.5 208q0 163 145 296q-64 48 -96.5 109.5t-32.5 136.5q0 97 55.5 180t156.5 132.5t258 49.5q148 0 337 -57v-178q-61 32 -164.5 56 t-181.5 24q-136 0 -198 -54t-62 -120q0 -35 17.5 -66t52.5 -59q69 -55 126 -89l63 -35l149 -88q193 -114 249.5 -200.5t56.5 -190.5q0 -164 -144 -297q92 -76 110.5 -136t18.5 -106q0 -94 -66.5 -187.5t-178.5 -140t-272 -46.5q-220 0 -422 71zM833 319q100 80 100 186 q0 72 -64.5 140.5t-148.5 116.5l-94 53l-184 105q-58 -66 -71 -106.5t-13 -77.5q0 -81 55 -143.5t253 -176.5z" />
|
114 |
+
<glyph unicode="¨" d="M397 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM832 1288q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
115 |
+
<glyph unicode="©" d="M615 -47q-194 0 -323 101t-209.5 291t-80.5 431q0 232 74.5 418t206 295t332.5 109q194 0 323.5 -102t209.5 -291t80 -429q0 -241 -80.5 -431t-209.5 -291t-323 -101zM615 78q128 0 240 80.5t180.5 252.5t68.5 365q0 192 -69 365t-181 253t-239 80q-130 0 -243.5 -83.5 t-179.5 -255t-66 -359.5q0 -195 70 -369t181 -251.5t238 -77.5zM894 433v-152q-90 -33 -214 -33q-131 0 -232.5 70.5t-161 190t-59.5 266.5q0 146 57.5 269t151 191t229.5 68q102 0 229 -32v-159q-38 12 -83 20t-79.5 12.5t-57.5 4.5q-127 0 -201.5 -103t-74.5 -273 q0 -187 87.5 -286t214.5 -99q82 0 194 45z" />
|
116 |
+
<glyph unicode="ª" d="M840 1060q-58 -76 -155 -122t-184 -46q-112 0 -201 73.5t-89 224.5q0 118 58.5 209.5t157 145t247.5 53.5q45 0 129 -5l36 -3h140v-476q0 -49 5.5 -94.5t41.5 -111.5h-155q-20 58 -31 152zM839 1208l-1 255q-78 11 -147 11q-136 0 -230.5 -72t-94.5 -201q0 -89 50 -133 t118 -44q72 0 159 52t146 132z" />
|
117 |
+
<glyph unicode="«" d="M626 481v155l384 419l113 -109l-312 -387l312 -399l-113 -98zM153 481v155l384 419l112 -109l-311 -387l311 -399l-112 -98z" />
|
118 |
+
<glyph unicode="¬" d="M1157 621v-466h-155v310h-931v156h1086z" />
|
119 |
+
<glyph unicode="­" d="M227 551v155h776v-155h-776z" />
|
120 |
+
<glyph unicode="®" d="M615 -47q-194 0 -323 101t-209.5 291t-80.5 431q0 232 74.5 418t206 295t332.5 109q194 0 323.5 -102t209.5 -291t80 -429q0 -241 -80.5 -431t-209.5 -291t-323 -101zM615 78q128 0 240 80.5t180.5 252.5t68.5 365q0 192 -69 365t-181 253t-239 80q-130 0 -243.5 -83.5 t-179.5 -255t-66 -359.5q0 -195 70 -369t181 -251.5t238 -77.5zM494 718v-379h-139v914h220q176 0 238.5 -64.5t62.5 -146.5q0 -75 -42 -151.5t-132 -127.5l236 -424h-166l-196 379h-82zM494 829h116q64 36 95.5 82.5t31.5 104.5q0 59 -41.5 93t-156.5 34h-45v-314z" />
|
121 |
+
<glyph unicode="¯" d="M335 1288v124h559v-124h-559z" />
|
122 |
+
<glyph unicode="°" d="M615 1055q-114 0 -193 80.5t-79 190.5q0 113 80.5 192.5t191.5 79.5t191 -79.5t80 -192.5q0 -110 -79 -190.5t-192 -80.5zM615 1148q75 0 126.5 54t51.5 124q0 73 -52.5 126t-125.5 53q-74 0 -126.5 -53t-52.5 -126q0 -70 51.5 -124t127.5 -54z" />
|
123 |
+
<glyph unicode="±" d="M1157 931v-155h-465v-466h-156v466h-465v155h465v465h156v-465h465zM1157 155v-155h-1086v155h1086z" />
|
124 |
+
<glyph unicode="²" d="M1088 0h-939v171q0 66 27 141.5t103 169.5t161 181l106 108q32 33 140 153t142.5 184t34.5 126q0 100 -80 154.5t-180 54.5q-57 0 -127.5 -13t-123.5 -30.5t-172 -71.5v165q126 60 252.5 82.5t208.5 22.5q121 0 222.5 -39.5t151 -122.5t49.5 -177q0 -105 -63.5 -215 t-239.5 -283l-114 -113l-96 -94q-91 -92 -147 -178t-62 -205h746v-171z" />
|
125 |
+
<glyph unicode="³" d="M145 28v196q229 -116 397 -116q154 0 254.5 93.5t100.5 240.5q0 148 -110.5 241t-375.5 93h-103v155h143q195 0 282 87.5t87 194.5q0 97 -71 163.5t-218 66.5q-165 0 -355 -93v177q190 71 348 71q283 0 390.5 -111.5t107.5 -254.5q0 -106 -57 -199t-210 -166 q135 -40 204 -98t104.5 -137t35.5 -177q0 -218 -161.5 -360t-417.5 -142q-74 0 -161.5 11t-213.5 64z" />
|
126 |
+
<glyph unicode="´" d="M320 1288l296 326h216l-342 -326h-170z" />
|
127 |
+
<glyph unicode="µ" d="M1076 1117v-1117h-186v242q-76 -142 -175 -207.5t-196 -65.5q-34 0 -71.5 8t-65.5 20.5t-74 49.5v-419h-186v1489h186v-649q0 -189 59 -263t147 -74t170.5 65.5t205.5 261.5v659h186z" />
|
128 |
+
<glyph unicode="¶" d="M552 -372v1055q-235 24 -350 150.5t-115 290.5q0 112 56 215t156.5 158t344.5 55h537v-156h-163v-1768h-155v1768h-155v-1768h-156z" />
|
129 |
+
<glyph unicode="¸" d="M685 0l-73 -131q107 -21 140 -65.5t33 -92.5q0 -55 -44 -100.5t-138 -45.5q-83 0 -159 28v89q58 -31 119 -31q35 0 63 21t28 44q0 68 -186 87l109 197h108z" />
|
130 |
+
<glyph unicode="¹" d="M568 155v1198q-84 -67 -163 -114t-217 -96v168q219 93 380 241h186v-1397h373v-155h-939v155h380z" />
|
131 |
+
<glyph unicode="º" d="M614 884q-218 0 -326 107t-108 250q0 144 108 250.5t326 106.5q219 0 327 -106.5t108 -250.5q0 -143 -108 -250t-327 -107zM614 1008q124 0 202 60t78 173t-78 173t-202 60q-123 0 -201 -60t-78 -173t78 -173t201 -60z" />
|
132 |
+
<glyph unicode="»" d="M602 636v-155l-383 -419l-113 109l312 388l-312 398l113 98zM1076 636v-155l-384 -419l-113 109l312 388l-312 398l113 98z" />
|
133 |
+
<glyph unicode="¼" horiz-adv-x="3687" d="M3165 0v434h-659v156l659 962h187v-962h287v-156h-287v-434h-187zM3165 590v680l-461 -680h461zM1395 -47h-164l1061 1645h165zM568 155v1198q-84 -67 -163 -114t-217 -96v168q219 93 380 241h186v-1397h373v-155h-939v155h380z" />
|
134 |
+
<glyph unicode="½" horiz-adv-x="3687" d="M3546 0h-939v171q0 66 27 141.5t103 169.5t161 181l106 108q32 33 140 153t142.5 184t34.5 126q0 100 -80 154.5t-180 54.5q-57 0 -127.5 -13t-123.5 -30.5t-172 -71.5v165q126 60 252.5 82.5t208.5 22.5q121 0 222.5 -39.5t151 -122.5t49.5 -177q0 -105 -63.5 -215 t-239.5 -283l-114 -113l-96 -94q-91 -92 -147 -178t-62 -205h746v-171zM1395 -47h-164l1061 1645h165zM568 155v1198q-84 -67 -163 -114t-217 -96v168q219 93 380 241h186v-1397h373v-155h-939v155h380z" />
|
135 |
+
<glyph unicode="¾" horiz-adv-x="3687" d="M3165 0v434h-659v156l659 962h187v-962h287v-156h-287v-434h-187zM3165 590v680l-461 -680h461zM1395 -47h-164l1061 1645h165zM145 28v196q229 -116 397 -116q154 0 254.5 93.5t100.5 240.5q0 148 -110.5 241t-375.5 93h-103v155h143q195 0 282 87.5t87 194.5 q0 97 -71 163.5t-218 66.5q-165 0 -355 -93v177q190 71 348 71q283 0 390.5 -111.5t107.5 -254.5q0 -106 -57 -199t-210 -166q135 -40 204 -98t104.5 -137t35.5 -177q0 -218 -161.5 -360t-417.5 -142q-74 0 -161.5 11t-213.5 64z" />
|
136 |
+
<glyph unicode="¿" d="M828 659v-35q0 -82 -14 -137.5t-54 -115t-119 -143.5l-62 -67q-17 -18 -52 -61l-66 -83q-83 -104 -83 -180q0 -70 60 -124t194 -54q87 0 178 23t212 91v-179q-186 -91 -388 -91q-224 0 -341 92t-117 237q0 144 151 300l67 68l77 80l72 73q39 45 68.5 101.5t29.5 158.5v46 h187zM725 853q-59 0 -101 42.5t-42 101.5t42 101t101 42q58 0 101 -41.5t43 -101.5t-43 -102t-101 -42z" />
|
137 |
+
<glyph unicode="À" d="M227 0h-194l478 1552h205l481 -1552h-213l-106 341h-546zM380 496h453l-187 589l-44 156l-39 -156zM869 1722h-170l-342 326h216z" />
|
138 |
+
<glyph unicode="Á" d="M227 0h-194l478 1552h205l481 -1552h-213l-106 341h-546zM380 496h453l-187 589l-44 156l-39 -156zM357 1722l296 326h216l-342 -326h-170z" />
|
139 |
+
<glyph unicode="Â" d="M227 0h-194l478 1552h205l481 -1552h-213l-106 341h-546zM380 496h453l-187 589l-44 156l-39 -156zM615 1890l-140 -168h-155l233 326h124l233 -326h-156z" />
|
140 |
+
<glyph unicode="Ã" d="M227 0h-194l478 1552h205l481 -1552h-213l-106 341h-546zM380 496h453l-187 589l-44 156l-39 -156zM422 1722h-125q0 132 51.5 194t129.5 62q62 0 126 -40l42 -25q83 -52 116 -52q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28l-24 17 q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
141 |
+
<glyph unicode="Ä" d="M227 0h-194l478 1552h205l481 -1552h-213l-106 341h-546zM380 496h453l-187 589l-44 156l-39 -156zM397 1722q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM832 1722q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z " />
|
142 |
+
<glyph unicode="Å" d="M716 1552l481 -1552h-213l-106 341h-546l-105 -341h-194l478 1552q-42 31 -63 69.5t-21 85.5q0 75 54.5 130.5t131.5 55.5t131.5 -55t54.5 -131q0 -46 -20.5 -85t-62.5 -70zM380 496h453l-187 589l-44 156l-39 -156zM520 1707q0 -38 27.5 -65.5t65.5 -27.5t65.5 27.5 t27.5 65.5t-27.5 65.5t-65.5 27.5t-65.5 -28t-27.5 -65z" />
|
143 |
+
<glyph unicode="Æ" d="M638 0v372h-314l-152 -372h-170l636 1552h543v-156h-357v-535h342v-155h-342v-535h357v-171h-543zM381 512h257v622z" />
|
144 |
+
<glyph unicode="Ç" d="M1088 1534v-184q-161 93 -320 93q-120 0 -219.5 -82t-160.5 -240.5t-61 -344.5q0 -189 63 -349t161 -239.5t217 -79.5q158 0 320 93v-183q-128 -46 -192 -56.5t-144 -10.5l-45 -82q107 -21 140 -65.5t33 -92.5q0 -55 -44 -100.5t-138 -45.5q-83 0 -159 28v89 q58 -31 119 -31q35 0 63 21t28 44q0 68 -186 87l88 160q-194 49 -309.5 164.5t-169.5 269t-54 357.5q0 403 187.5 624t470.5 221q138 0 312 -65z" />
|
145 |
+
<glyph unicode="È" d="M1041 171v-171h-838v1552h822v-156h-620v-527h558v-155h-558v-543h636zM879 1722h-170l-342 326h216z" />
|
146 |
+
<glyph unicode="É" d="M1041 171v-171h-838v1552h822v-156h-620v-527h558v-155h-558v-543h636zM367 1722l296 326h216l-342 -326h-170z" />
|
147 |
+
<glyph unicode="Ê" d="M1041 171v-171h-838v1552h822v-156h-620v-527h558v-155h-558v-543h636zM615 1890l-140 -168h-155l233 326h124l233 -326h-156z" />
|
148 |
+
<glyph unicode="Ë" d="M1041 171v-171h-838v1552h822v-156h-620v-527h558v-155h-558v-543h636zM405 1722q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM840 1722q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
149 |
+
<glyph unicode="Ì" d="M172 0v155h341v1241h-341v156h884v-156h-341v-1241h341v-155h-884zM871 1722h-170l-342 326h216z" />
|
150 |
+
<glyph unicode="Í" d="M172 0v155h341v1241h-341v156h884v-156h-341v-1241h341v-155h-884zM359 1722l296 326h216l-342 -326h-170z" />
|
151 |
+
<glyph unicode="Î" d="M172 0v155h341v1241h-341v156h884v-156h-341v-1241h341v-155h-884zM615 1890l-140 -168h-155l233 326h124l233 -326h-156z" />
|
152 |
+
<glyph unicode="Ï" d="M172 0v155h341v1241h-341v156h884v-156h-341v-1241h341v-155h-884zM397 1722q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM832 1722q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
153 |
+
<glyph unicode="Ñ" d="M312 0h-186v1552h182l549 -1033l60 -154h5l-5 154v1033h186v-1552h-186l-534 1016l-75 163l4 -161v-1018zM422 1722h-125q0 132 51.5 194t129.5 62q62 0 126 -40l42 -25q83 -52 116 -52q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28 l-24 17q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
154 |
+
<glyph unicode="Ò" d="M614 -47q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5zM614 109q146 0 243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5t-243.5 -165.5t-97.5 -501.5t97.5 -501.5t243.5 -165.5z M871 1722h-170l-342 326h216z" />
|
155 |
+
<glyph unicode="Ó" d="M614 -47q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5zM614 109q146 0 243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5t-243.5 -165.5t-97.5 -501.5t97.5 -501.5t243.5 -165.5z M359 1722l296 326h216l-342 -326h-170z" />
|
156 |
+
<glyph unicode="Ô" d="M614 -47q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5zM614 109q146 0 243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5t-243.5 -165.5t-97.5 -501.5t97.5 -501.5t243.5 -165.5z M615 1890l-140 -168h-155l233 326h124l233 -326h-156z" />
|
157 |
+
<glyph unicode="Õ" d="M614 -47q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5zM614 109q146 0 243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5t-243.5 -165.5t-97.5 -501.5t97.5 -501.5t243.5 -165.5z M414 1722h-125q0 132 51.5 194t129.5 62q62 0 126 -40l42 -25q83 -52 116 -52q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28l-24 17q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
158 |
+
<glyph unicode="Ö" d="M614 -47q-264 0 -403.5 222.5t-139.5 600.5q0 377 139.5 599.5t403.5 222.5q265 0 404 -222.5t139 -599.5q0 -378 -139 -600.5t-404 -222.5zM614 109q146 0 243.5 165.5t97.5 501.5t-97.5 501.5t-243.5 165.5t-243.5 -165.5t-97.5 -501.5t97.5 -501.5t243.5 -165.5z M397 1722q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM832 1722q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
159 |
+
<glyph unicode="Ø" d="M209 -109h-138l148 276q-63 100 -90 189.5t-42.5 198.5t-15.5 230q0 398 147.5 605.5t390.5 207.5q54 0 111.5 -11.5t102.5 -30.5t108 -68l93 172h133l-142 -273q61 -103 87 -185t40.5 -201.5t14.5 -235.5q0 -249 -66.5 -436t-180 -281.5t-306.5 -94.5q-82 0 -143.5 19 t-154.5 97zM321 360l525 969q-62 73 -119.5 93.5t-112.5 20.5q-154 0 -247.5 -174.5t-93.5 -479.5q0 -48 3 -146q3 -99 11.5 -150t33.5 -133zM911 1195l-521 -970q53 -66 108.5 -91t110.5 -25q174 0 260 184.5t86 483.5q0 52 -3 138t-10.5 140.5t-30.5 139.5z" />
|
160 |
+
<glyph unicode="Ù" d="M126 1552h202v-1019q0 -201 33.5 -274.5t103 -112t154.5 -38.5q90 0 160.5 41.5t104 130t33.5 332.5v940h186v-1013q0 -217 -64.5 -339.5t-168.5 -184.5t-262 -62q-146 0 -257 54t-168 162t-57 390v993zM871 1722h-170l-342 326h216z" />
|
161 |
+
<glyph unicode="Ú" d="M126 1552h202v-1019q0 -201 33.5 -274.5t103 -112t154.5 -38.5q90 0 160.5 41.5t104 130t33.5 332.5v940h186v-1013q0 -217 -64.5 -339.5t-168.5 -184.5t-262 -62q-146 0 -257 54t-168 162t-57 390v993zM359 1722l296 326h216l-342 -326h-170z" />
|
162 |
+
<glyph unicode="Û" d="M126 1552h202v-1019q0 -201 33.5 -274.5t103 -112t154.5 -38.5q90 0 160.5 41.5t104 130t33.5 332.5v940h186v-1013q0 -217 -64.5 -339.5t-168.5 -184.5t-262 -62q-146 0 -257 54t-168 162t-57 390v993zM615 1890l-140 -168h-155l233 326h124l233 -326h-156z" />
|
163 |
+
<glyph unicode="Ü" d="M126 1552h202v-1019q0 -201 33.5 -274.5t103 -112t154.5 -38.5q90 0 160.5 41.5t104 130t33.5 332.5v940h186v-1013q0 -217 -64.5 -339.5t-168.5 -184.5t-262 -62q-146 0 -257 54t-168 162t-57 390v993zM397 1722q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88 t-36.5 -88t-87.5 -36zM832 1722q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
164 |
+
<glyph unicode="Ý" d="M530 1720l296 326h216l-342 -326h-170zM514 0v718l-462 834h229l345 -616l344 616h207l-461 -834v-718h-202z" />
|
165 |
+
<glyph unicode="ß" d="M130 0v1122q0 198 57.5 303.5t161 162.5t249.5 57q191 0 276.5 -89.5t85.5 -187.5q0 -62 -35 -121.5t-138 -148.5l-68 -58q-20 -17 -60 -55.5t-40 -78.5q0 -28 12 -48t71 -63l64 -47l126 -87q106 -72 176.5 -157t70.5 -200q0 -146 -113 -240.5t-289 -94.5q-38 0 -91 3.5 t-82.5 7.5t-84.5 20v185q60 -26 102 -36.5t84 -17.5t70 -7q50 0 105 18t83.5 58.5t28.5 82.5q0 62 -48.5 122t-162.5 136l-120 80q-92 62 -144 121.5t-52 133.5q0 55 29.5 108t130.5 146l59 55q48 44 81 87.5t33 90.5q0 65 -62 95.5t-122 30.5q-69 0 -127.5 -33.5 t-94.5 -102t-36 -231.5v-1122h-186z" />
|
166 |
+
<glyph unicode="à" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237zM898 1288h-170l-342 326h216z" />
|
167 |
+
<glyph unicode="á" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237zM480 1288l296 326h216l-342 -326h-170z" />
|
168 |
+
<glyph unicode="â" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237zM703 1456l-140 -168h-155l233 326h124l233 -326h-156z" />
|
169 |
+
<glyph unicode="ã" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237zM457 1288h-125q0 132 51.5 194t129.5 62q62 0 126 -40l42 -25q83 -52 116 -52q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28l-24 17q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
170 |
+
<glyph unicode="ä" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237zM454 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM889 1288q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
171 |
+
<glyph unicode="å" d="M889 251q-85 -140 -204.5 -211t-219.5 -71q-140 0 -251.5 121t-111.5 367q0 194 74 346.5t198 241t307 88.5q53 0 160 -11q16 -2 48 -5h187v-789q0 -202 42 -328h-194q-22 92 -35 251zM889 472v479q-99 26 -184 26q-172 0 -286.5 -133t-114.5 -362q0 -166 62.5 -250.5 t142.5 -84.5q87 0 192 88t188 237zM657 1381q39 0 66 27.5t27 65.5t-27 65.5t-66 27.5q-38 0 -65.5 -27.5t-27.5 -65.5t27.5 -65.5t65.5 -27.5zM657 1288q-78 0 -132 56t-54 130q0 75 54.5 130.5t131.5 55.5q78 0 132 -55.5t54 -130.5q0 -74 -54 -130t-132 -56z" />
|
172 |
+
<glyph unicode="æ" d="M592 226q-52 -130 -120 -193.5t-132 -63.5q-112 0 -194 144t-82 370q0 200 55.5 349.5t148 232.5t198.5 83q35 0 74.5 -7.5t71 -19t79.5 -44.5q73 54 113 62.5t71 8.5q127 0 209 -113.5t82 -449.5v-50h-404v-83q0 -148 22.5 -208.5t64.5 -90t94 -29.5q101 0 223 79v-170 q-141 -64 -254 -64q-74 0 -136 25.5t-107.5 76.5t-76.5 155zM576 470v489q-24 17 -47 25.5t-45 8.5q-117 0 -175.5 -165t-58.5 -365q0 -118 33 -203q32 -82 80 -82h4q105 7 209 292zM762 667h217v32q0 176 -27 235t-79 59q-55 0 -83 -73.5t-28 -220.5v-32z" />
|
173 |
+
<glyph unicode="ç" d="M702 -131q108 -21 141 -65.5t33 -92.5q0 -55 -44.5 -100.5t-137.5 -45.5q-83 0 -159 28v89q58 -31 118 -31q36 0 63.5 21t27.5 44q0 68 -185 87l93 169q-165 28 -272 112t-161.5 196.5t-54.5 266.5q0 272 169 436.5t396 164.5q173 0 366 -65v-179q-195 89 -349 89 q-102 0 -192 -50.5t-139 -157.5t-49 -220q0 -151 94.5 -288t296.5 -137q61 0 120 8.5t218 62.5v-179q-156 -56 -338 -66z" />
|
174 |
+
<glyph unicode="è" d="M1084 74q-223 -106 -422 -106q-151 0 -270 75t-190.5 214.5t-71.5 298.5q0 153 68 294t190 219.5t272 78.5q199 0 319.5 -142t120.5 -438v-40h-770q0 -116 48.5 -212t127.5 -144t180 -48q180 0 398 120v-170zM341 667h557v27q0 137 -67 218t-179 81q-113 0 -195.5 -82.5 t-115.5 -243.5zM910 1288h-170l-342 326h216z" />
|
175 |
+
<glyph unicode="é" d="M1084 74q-223 -106 -422 -106q-151 0 -270 75t-190.5 214.5t-71.5 298.5q0 153 68 294t190 219.5t272 78.5q199 0 319.5 -142t120.5 -438v-40h-770q0 -116 48.5 -212t127.5 -144t180 -48q180 0 398 120v-170zM341 667h557v27q0 137 -67 218t-179 81q-113 0 -195.5 -82.5 t-115.5 -243.5zM445 1288l296 326h216l-342 -326h-170z" />
|
176 |
+
<glyph unicode="ê" d="M1084 74q-223 -106 -422 -106q-151 0 -270 75t-190.5 214.5t-71.5 298.5q0 153 68 294t190 219.5t272 78.5q199 0 319.5 -142t120.5 -438v-40h-770q0 -116 48.5 -212t127.5 -144t180 -48q180 0 398 120v-170zM341 667h557v27q0 137 -67 218t-179 81q-113 0 -195.5 -82.5 t-115.5 -243.5zM654 1456l-140 -168h-155l233 326h124l233 -326h-156z" />
|
177 |
+
<glyph unicode="ë" d="M1084 74q-223 -106 -422 -106q-151 0 -270 75t-190.5 214.5t-71.5 298.5q0 153 68 294t190 219.5t272 78.5q199 0 319.5 -142t120.5 -438v-40h-770q0 -116 48.5 -212t127.5 -144t180 -48q180 0 398 120v-170zM341 667h557v27q0 137 -67 218t-179 81q-113 0 -195.5 -82.5 t-115.5 -243.5zM450 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM885 1288q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
178 |
+
<glyph unicode="ì" d="M467 0v962h-310v155h496v-962h311v-155h-497zM816 1288h-170l-342 326h216z" />
|
179 |
+
<glyph unicode="í" d="M467 0v962h-310v155h496v-962h311v-155h-497zM304 1288l296 326h216l-342 -326h-170z" />
|
180 |
+
<glyph unicode="î" d="M467 0v962h-310v155h496v-962h311v-155h-497zM562 1456l-140 -168h-155l233 326h124l233 -326h-156z" />
|
181 |
+
<glyph unicode="ï" d="M467 0v962h-310v155h496v-962h311v-155h-497zM344 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM779 1288q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
182 |
+
<glyph unicode="ñ" d="M157 0v1117h186v-244q80 129 193 202t226 73q99 0 180 -52.5t113.5 -137.5t32.5 -334v-624h-186v647q0 161 -15.5 212.5t-57 84.5t-90.5 33q-98 0 -210.5 -93t-185.5 -233v-651h-186zM430 1288h-125q0 132 51.5 194t129.5 62q62 0 126 -40l42 -25q83 -52 116 -52 q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28l-24 17q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
183 |
+
<glyph unicode="ò" d="M615 -31q-240 0 -384 167.5t-144 422.5t144 422t384 167q239 0 383 -167t144 -422t-144 -422.5t-383 -167.5zM615 124q149 0 237 116t88 319q0 202 -88 318t-237 116q-150 0 -238 -116t-88 -318q0 -203 88 -319t238 -116zM871 1288h-170l-342 326h216z" />
|
184 |
+
<glyph unicode="ó" d="M615 -31q-240 0 -384 167.5t-144 422.5t144 422t384 167q239 0 383 -167t144 -422t-144 -422.5t-383 -167.5zM615 124q149 0 237 116t88 319q0 202 -88 318t-237 116q-150 0 -238 -116t-88 -318q0 -203 88 -319t238 -116zM359 1288l296 326h216l-342 -326h-170z" />
|
185 |
+
<glyph unicode="ô" d="M615 -31q-240 0 -384 167.5t-144 422.5t144 422t384 167q239 0 383 -167t144 -422t-144 -422.5t-383 -167.5zM615 124q149 0 237 116t88 319q0 202 -88 318t-237 116q-150 0 -238 -116t-88 -318q0 -203 88 -319t238 -116zM615 1456l-140 -168h-155l233 326h124l233 -326 h-156z" />
|
186 |
+
<glyph unicode="õ" d="M615 -31q-240 0 -384 167.5t-144 422.5t144 422t384 167q239 0 383 -167t144 -422t-144 -422.5t-383 -167.5zM615 124q149 0 237 116t88 319q0 202 -88 318t-237 116q-150 0 -238 -116t-88 -318q0 -203 88 -319t238 -116zM414 1288h-125q0 132 51.5 194t129.5 62 q62 0 126 -40l42 -25q83 -52 116 -52q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28l-24 17q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
187 |
+
<glyph unicode="ö" d="M615 -31q-240 0 -384 167.5t-144 422.5t144 422t384 167q239 0 383 -167t144 -422t-144 -422.5t-383 -167.5zM615 124q149 0 237 116t88 319q0 202 -88 318t-237 116q-150 0 -238 -116t-88 -318q0 -203 88 -319t238 -116zM397 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36 t87 -36t37 -88t-36.5 -88t-87.5 -36zM832 1288q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
188 |
+
<glyph unicode="÷" d="M614 776q-57 0 -100 43t-43 100q0 58 43 101t100 43t100.5 -43t43.5 -101q0 -57 -43.5 -100t-100.5 -43zM1157 621v-156h-1086v156h1086zM614 23q-57 0 -100 43t-43 101t43 100.5t100 42.5t100.5 -42.5t43.5 -100.5t-43.5 -101t-100.5 -43z" />
|
189 |
+
<glyph unicode="ø" d="M236 -93h-149l150 221q-150 189 -150 436q0 243 135 413.5t391 170.5q50 0 100 -7t89.5 -20t95.5 -46l94 135h150l-149 -215q149 -193 149 -436q0 -237 -132 -413.5t-396 -176.5q-63 0 -123.5 10.5t-158.5 64.5zM341 280l464 663q-89 50 -190 50q-159 0 -242.5 -115.5 t-83.5 -313.5q0 -150 52 -284zM889 845l-465 -668q96 -53 181 -53q183 0 259 122.5t76 307.5q0 160 -51 291z" />
|
190 |
+
<glyph unicode="ù" d="M1074 1117v-1117h-186v245q-90 -138 -200 -207t-220 -69q-98 0 -179.5 52.5t-113.5 138t-32 333.5v624h186v-647q0 -161 15.5 -212.5t57 -84.5t89.5 -33q98 0 210.5 92.5t186.5 233.5v651h186zM873 1288h-170l-342 326h216z" />
|
191 |
+
<glyph unicode="ú" d="M1074 1117v-1117h-186v245q-90 -138 -200 -207t-220 -69q-98 0 -179.5 52.5t-113.5 138t-32 333.5v624h186v-647q0 -161 15.5 -212.5t57 -84.5t89.5 -33q98 0 210.5 92.5t186.5 233.5v651h186zM406 1288l296 326h216l-342 -326h-170z" />
|
192 |
+
<glyph unicode="û" d="M1074 1117v-1117h-186v245q-90 -138 -200 -207t-220 -69q-98 0 -179.5 52.5t-113.5 138t-32 333.5v624h186v-647q0 -161 15.5 -212.5t57 -84.5t89.5 -33q98 0 210.5 92.5t186.5 233.5v651h186zM617 1456l-140 -168h-155l233 326h124l233 -326h-156z" />
|
193 |
+
<glyph unicode="ü" d="M1074 1117v-1117h-186v245q-90 -138 -200 -207t-220 -69q-98 0 -179.5 52.5t-113.5 138t-32 333.5v624h186v-647q0 -161 15.5 -212.5t57 -84.5t89.5 -33q98 0 210.5 92.5t186.5 233.5v651h186zM399 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88 t-87.5 -36zM834 1288q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
194 |
+
<glyph unicode="ý" d="M538 1270l296 326h216l-342 -326h-170zM566 45l-516 1072h205l411 -838l344 838h187l-433 -1038q-137 -329 -260.5 -437t-319.5 -108q-85 0 -152 15v164q77 -24 147 -24q90 0 160 35t128 124t82 154z" />
|
195 |
+
<glyph unicode="ÿ" d="M582 45l-516 1072h205l411 -838l344 838h187l-433 -1038q-137 -329 -260.5 -437t-319.5 -108q-85 0 -152 15v164q77 -24 147 -24q90 0 160 35t128 124t82 154zM444 1288q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM879 1288q-51 0 -88 36 t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
196 |
+
<glyph unicode="ı" d="M467 0v962h-310v155h496v-962h311v-155h-497z" />
|
197 |
+
<glyph unicode="Œ" d="M1184 0h-551v39q-68 -60 -103.5 -65.5t-53.5 -5.5q-115 0 -221.5 94t-162.5 293.5t-56 439.5q0 252 61.5 438.5t164.5 268t217 81.5q33 0 68 -10t86 -60v39h536v-156h-349v-535h333v-155h-333v-535h364v-171zM633 521v501q0 265 -37.5 335.5t-109.5 70.5 q-131 0 -189.5 -184.5t-58.5 -463.5q0 -248 55.5 -452t196.5 -204q70 0 106.5 70.5t36.5 326.5z" />
|
198 |
+
<glyph unicode="œ" d="M625 135q-59 -111 -124.5 -138.5t-119.5 -27.5q-88 0 -159 63t-113 208.5t-42 329.5q0 217 76.5 397.5t258.5 180.5q80 0 139 -41.5t98 -124.5q44 83 103 124.5t133 41.5q119 0 202.5 -112.5t83.5 -438.5v-62h-404v-61q0 -178 24.5 -236.5t67 -86t92.5 -27.5 q103 0 220 78v-173q-141 -60 -251 -60q-85 0 -155.5 32.5t-129.5 133.5zM571 493v102q0 127 -6.5 178t-24.5 101.5t-52 86.5q-32 32 -70 32h-6q-85 -5 -126 -129t-41 -320q0 -166 39.5 -293t131.5 -127q67 0 111 86t44 283zM757 667h218v33q0 185 -30 239t-77 54 q-48 0 -79.5 -69.5t-31.5 -222.5v-34z" />
|
199 |
+
<glyph unicode="Ÿ" d="M514 0v718l-462 834h229l345 -616l344 616h207l-461 -834v-718h-202zM397 1722q-51 0 -87.5 36t-36.5 88t37 88t87 36t87 -36t37 -88t-36.5 -88t-87.5 -36zM832 1722q-51 0 -88 36t-37 88t37.5 88t87.5 36t87 -36t37 -88t-37 -88t-87 -36z" />
|
200 |
+
<glyph unicode="ˆ" d="M615 1456l-140 -168h-155l233 326h124l233 -326h-156z" />
|
201 |
+
<glyph unicode="˚" d="M614 1381q39 0 66 27.5t27 65.5t-27 65.5t-66 27.5q-38 0 -65.5 -27.5t-27.5 -65.5t27.5 -65.5t65.5 -27.5zM614 1288q-78 0 -132 56t-54 130q0 75 54.5 130.5t131.5 55.5q78 0 132 -55.5t54 -130.5q0 -74 -54 -130t-132 -56z" />
|
202 |
+
<glyph unicode="˜" d="M414 1288h-125q0 132 51.5 194t129.5 62q62 0 126 -40l42 -25q83 -52 116 -52q60 0 60 117h127q-6 -102 -27 -149t-64.5 -77.5t-95.5 -30.5q-65 0 -141 49l-44 28l-24 17q-34 23 -65 23q-22 0 -44 -23t-22 -93z" />
|
203 |
+
<glyph unicode=" " horiz-adv-x="1024" />
|
204 |
+
<glyph unicode=" " horiz-adv-x="2048" />
|
205 |
+
<glyph unicode=" " horiz-adv-x="1024" />
|
206 |
+
<glyph unicode=" " horiz-adv-x="2048" />
|
207 |
+
<glyph unicode=" " horiz-adv-x="682" />
|
208 |
+
<glyph unicode=" " horiz-adv-x="512" />
|
209 |
+
<glyph unicode=" " horiz-adv-x="341" />
|
210 |
+
<glyph unicode=" " horiz-adv-x="341" />
|
211 |
+
<glyph unicode=" " horiz-adv-x="256" />
|
212 |
+
<glyph unicode=" " horiz-adv-x="409" />
|
213 |
+
<glyph unicode=" " horiz-adv-x="113" />
|
214 |
+
<glyph unicode="‐" d="M227 551v155h776v-155h-776z" />
|
215 |
+
<glyph unicode="‑" d="M227 551v155h776v-155h-776z" />
|
216 |
+
<glyph unicode="‒" d="M227 551v155h776v-155h-776z" />
|
217 |
+
<glyph unicode="–" d="M71 528v155h1086v-155h-1086z" />
|
218 |
+
<glyph unicode="—" d="M71 528v124h1086v-124h-1086z" />
|
219 |
+
<glyph unicode="‘" d="M804 1645v-125q-72 -19 -109.5 -54t-60 -89.5t-22.5 -132.5q93 0 137 -52.5t44 -111.5q0 -70 -49 -117.5t-114 -47.5q-84 0 -145 72.5t-61 198.5q0 111 48 208t130.5 166t201.5 85z" />
|
220 |
+
<glyph unicode="’" d="M424 915v125q72 19 109.5 54t60 89.5t22.5 132.5q-93 0 -137 52.5t-44 111.5q0 70 49 117.5t114 47.5q84 0 145 -72.5t61 -198.5q0 -111 -48 -208t-130.5 -166t-201.5 -85z" />
|
221 |
+
<glyph unicode="‚" d="M424 -434v124q72 19 109.5 54.5t57 82.5t25.5 139q-93 0 -137 52.5t-44 112.5q0 69 49 116.5t114 47.5q84 0 145 -72.5t61 -198.5q0 -110 -48 -207.5t-130.5 -166.5t-201.5 -84z" />
|
222 |
+
<glyph unicode="“" d="M1049 1645v-125q-72 -19 -109.5 -54t-60 -89.5t-22.5 -132.5q92 0 136.5 -52.5t44.5 -111.5q0 -70 -49 -117.5t-114 -47.5q-85 0 -145.5 72.5t-60.5 198.5q0 111 48 208t130.5 166t201.5 85zM560 1645v-125q-72 -19 -109.5 -54t-60 -89.5t-22.5 -132.5q93 0 137 -52.5 t44 -111.5q0 -70 -49 -117.5t-114 -47.5q-84 0 -145 72.5t-61 198.5q0 111 48 208t130.5 166t201.5 85z" />
|
223 |
+
<glyph unicode="”" d="M180 915v125q72 19 109.5 54t60 89.5t22.5 132.5q-93 0 -137 52.5t-44 111.5q0 70 49 117.5t114 47.5q84 0 145 -72.5t61 -198.5q0 -111 -48 -208t-130.5 -166t-201.5 -85zM669 915v125q71 19 109 54t60.5 89.5t22.5 132.5q-93 0 -137 52.5t-44 111.5q0 70 48.5 117.5 t113.5 47.5q85 0 146 -72.5t61 -198.5q0 -111 -48 -208t-130.5 -166t-201.5 -85z" />
|
224 |
+
<glyph unicode="„" d="M180 -434v124q72 19 109.5 54.5t57 82.5t25.5 139q-93 0 -137 52.5t-44 112.5q0 69 49 116.5t114 47.5q84 0 145 -72.5t61 -198.5q0 -110 -48 -207.5t-130.5 -166.5t-201.5 -84zM669 -434v124q71 19 109 54.5t57.5 82.5t25.5 139q-93 0 -137 52.5t-44 112.5 q0 69 48.5 116.5t113.5 47.5q85 0 146 -72.5t61 -198.5q0 -110 -48 -207.5t-130.5 -166.5t-201.5 -84z" />
|
225 |
+
<glyph unicode="•" d="M615 341q-113 0 -211 55t-157 155t-59 217q0 114 57 213.5t157 156.5t213 57q112 0 212 -57t157 -156.5t57 -213.5q0 -117 -59 -217t-157 -155t-210 -55z" />
|
226 |
+
<glyph unicode="…" d="M205 -47q-57 0 -100.5 43t-43.5 101t43.5 100.5t100.5 42.5q56 0 99.5 -42.5t43.5 -100.5t-43.5 -101t-99.5 -43zM614 -47q-57 0 -100 43t-43 101t43 100.5t100 42.5t100.5 -42.5t43.5 -100.5t-43.5 -101t-100.5 -43zM1024 -47q-57 0 -100.5 43t-43.5 101t43.5 100.5 t100.5 42.5t100 -42.5t43 -100.5t-43 -101t-100 -43z" />
|
227 |
+
<glyph unicode=" " horiz-adv-x="409" />
|
228 |
+
<glyph unicode="‹" d="M331 484v160l501 473l112 -118l-429 -438l429 -446l-112 -115z" />
|
229 |
+
<glyph unicode="›" d="M898 633v-160l-501 -473l-112 118l429 438l-429 446l112 115z" />
|
230 |
+
<glyph unicode="⁄" d="M166 -47h-164l1061 1645h165z" />
|
231 |
+
<glyph unicode=" " horiz-adv-x="512" />
|
232 |
+
<glyph unicode="™" d="M225 776v663h-223v113h575v-113h-224v-663h-128zM744 1254v-478h-106v776h125l170 -464l172 464h123v-776h-121v477l-121 -328h-119z" />
|
233 |
+
<glyph unicode="" horiz-adv-x="1115" d="M0 1115h1115v-1115h-1115v1115z" />
|
234 |
+
<glyph unicode="fi" horiz-adv-x="2458" d="M1697 0v962h-310v155h496v-962h311v-155h-497zM1666 1520q0 63 43 94t81 31q39 0 82 -31t43 -94q0 -62 -43 -93t-82 -31q-38 0 -81 31t-43 93zM415 0v869h-248v155h248v52q0 221 50 327t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33 t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186z" />
|
235 |
+
<glyph unicode="fl" horiz-adv-x="2458" d="M1684 0v1458h-334v156h520v-1459h349v-155h-535zM415 0v869h-248v155h248v52q0 221 50 327t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186z" />
|
236 |
+
<glyph unicode="ffi" horiz-adv-x="3687" d="M2926 0v962h-310v155h496v-962h311v-155h-497zM2895 1520q0 63 43 94t81 31q39 0 82 -31t43 -94q0 -62 -43 -93t-82 -31q-38 0 -81 31t-43 93zM1644 0v869h-248v155h248v52q0 221 50 327t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33 t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186zM415 0v869h-248v155h248v52q0 221 50 327t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186z" />
|
237 |
+
<glyph unicode="ffl" horiz-adv-x="3687" d="M2913 0v1458h-334v156h520v-1459h349v-155h-535zM1644 0v869h-248v155h248v52q0 221 50 327t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186zM415 0v869h-248v155h248v52q0 221 50 327 t154.5 174t276.5 68q130 0 264 -27v-177q-145 48 -257 48q-89 0 -157 -33t-106.5 -107.5t-38.5 -252.5v-72h443v-155h-443v-869h-186z" />
|
238 |
+
</font>
|
239 |
+
</defs></svg>
|
css/fonts/monaco/monaco-webfont.ttf
ADDED
Binary file
|
css/fonts/monaco/monaco-webfont.woff
ADDED
Binary file
|
css/fonts/monaco/monaco.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Generated by Font Squirrel (http://www.fontsquirrel.com) on February 17, 2011 */
|
2 |
+
|
3 |
+
@font-face {
|
4 |
+
font-family: 'MonacoRegular';
|
5 |
+
src: /* IE doesn't draw well */
|
6 |
+
/*url('monaco-webfont.eot?') format('eot'),*/
|
7 |
+
url('monaco-webfont.woff') format('woff'),
|
8 |
+
url('monaco-webfont.ttf') format('truetype'),
|
9 |
+
url('monaco-webfont.svg#webfontyFRf53FT') format('svg');
|
10 |
+
font-weight: normal;
|
11 |
+
font-style: normal;
|
12 |
+
|
13 |
+
}
|
css/images/crayon_logo.png
ADDED
Binary file
|
css/images/crayon_logo_square.png
ADDED
Binary file
|
css/images/facebook.png
ADDED
Binary file
|
css/images/google.png
ADDED
Binary file
|
css/images/thumb_horizontal.png
ADDED
Binary file
|
css/images/thumb_vertical.png
ADDED
Binary file
|
css/images/toolbar/nums_dark.png
ADDED
Binary file
|
css/images/toolbar/nums_light.png
ADDED
Binary file
|
css/images/toolbar/plain_dark.png
ADDED
Binary file
|
css/images/toolbar/plain_light.png
ADDED
Binary file
|
css/images/track_horizontal.png
ADDED
Binary file
|
css/images/track_vertical.png
ADDED
Binary file
|
css/images/twitter.png
ADDED
Binary file
|
css/scrollbar.css
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Scrollbars ====================== */
|
2 |
+
::-webkit-scrollbar {
|
3 |
+
width: 21px;
|
4 |
+
height: 21px;
|
5 |
+
}
|
6 |
+
|
7 |
+
/* Horizontal
|
8 |
+
/* The scrollbar slider */
|
9 |
+
::-webkit-scrollbar-thumb:horizontal {
|
10 |
+
-webkit-border-image: url(images/thumb_horizontal.png) 0 10;
|
11 |
+
border-color: transparent;
|
12 |
+
border-width: 0 10px;
|
13 |
+
min-width: 50px;
|
14 |
+
}
|
15 |
+
/* The scrollbar background */
|
16 |
+
::-webkit-scrollbar-track-piece:horizontal:increment,
|
17 |
+
::-webkit-scrollbar-track-piece:horizontal:decrement {
|
18 |
+
-webkit-border-image: url(images/track_horizontal.png) 0 10;
|
19 |
+
border-color: transparent;
|
20 |
+
}
|
21 |
+
::-webkit-scrollbar-track-piece:horizontal:decrement {
|
22 |
+
border-width: 0 0 0 10px;
|
23 |
+
}
|
24 |
+
::-webkit-scrollbar-track-piece:horizontal:increment {
|
25 |
+
border-width: 0 10px 0 0;
|
26 |
+
}
|
27 |
+
|
28 |
+
/* Vertical
|
29 |
+
/* The scrollbar slider */
|
30 |
+
::-webkit-scrollbar-thumb:vertical {
|
31 |
+
-webkit-border-image: url(images/thumb_vertical.png) 10 0;
|
32 |
+
border-color: transparent;
|
33 |
+
border-width: 10px 0;
|
34 |
+
min-height: 50px;
|
35 |
+
}
|
36 |
+
/* The scrollbar background */
|
37 |
+
::-webkit-scrollbar-track-piece:vertical:increment,
|
38 |
+
::-webkit-scrollbar-track-piece:vertical:decrement {
|
39 |
+
-webkit-border-image: url(images/track_vertical.png) 10 0;
|
40 |
+
border-color: transparent;
|
41 |
+
}
|
42 |
+
::-webkit-scrollbar-track-piece:vertical:decrement {
|
43 |
+
border-width: 10px 0 0 0;
|
44 |
+
}
|
45 |
+
::-webkit-scrollbar-track-piece:vertical:increment {
|
46 |
+
border-width: 0 0 10px 0;
|
47 |
+
}
|
48 |
+
/* End Scrollbars ================== */
|
css/style.css
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Crayon Syntax Highlighter Structure Style Sheet
|
3 |
+
|
4 |
+
- This style sheet is used to structure a Crayon's dimensions and visibility, but does not contain any details regarding
|
5 |
+
coloring etc.
|
6 |
+
- Attributes, where possible, are kept flexible such that Themes can customise them.
|
7 |
+
- Themes are used to add coloring to the Crayon and the syntax highlighting itself.
|
8 |
+
- Themes can be considered as layers on top of this style sheet.
|
9 |
+
- Several attributes are marked !important where they are required to remain unchanged by CSS precedence,
|
10 |
+
which may occur from conflicts with certain Wordpress Themes.
|
11 |
+
- The attributes in Themes are generally all marked !important to ensure styles are not altered by precedence.
|
12 |
+
*/
|
13 |
+
|
14 |
+
@import url('fonts/monaco/monaco.css');
|
15 |
+
|
16 |
+
/* General ========================= */
|
17 |
+
.crayon-syntax {
|
18 |
+
overflow: hidden !important;
|
19 |
+
position: relative !important;
|
20 |
+
}
|
21 |
+
|
22 |
+
.crayon-syntax div {
|
23 |
+
/* Need !important? */
|
24 |
+
background: none;
|
25 |
+
border: none;
|
26 |
+
padding: 0px;
|
27 |
+
margin: 0px;
|
28 |
+
}
|
29 |
+
|
30 |
+
.crayon-syntax .crayon-main,
|
31 |
+
.crayon-syntax .crayon-toolbar,
|
32 |
+
.crayon-syntax .crayon-plain,
|
33 |
+
.crayon-syntax .crayon-code {
|
34 |
+
/* Dimensions of code */
|
35 |
+
width: 100%;
|
36 |
+
}
|
37 |
+
|
38 |
+
.crayon-syntax .crayon-main,
|
39 |
+
.crayon-syntax .crayon-plain {
|
40 |
+
/* TODO a bug in IE8 causes max-height and overflow:auto to set max-height = height
|
41 |
+
http://edskes.net/ie8overflowandexpandingboxbugs.htm */
|
42 |
+
overflow: auto;
|
43 |
+
}
|
44 |
+
|
45 |
+
.crayon-syntax,
|
46 |
+
.crayon-syntax .crayon-main,
|
47 |
+
.crayon-syntax .crayon-plain,
|
48 |
+
.crayon-syntax .crayon-table {
|
49 |
+
padding: 0px;
|
50 |
+
margin: 0px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.crayon-syntax .crayon-table {
|
54 |
+
border: none !important;
|
55 |
+
background: none !important;
|
56 |
+
padding: 0px !important;
|
57 |
+
margin-top: 0px !important;
|
58 |
+
margin-right: 0px !important;
|
59 |
+
margin-bottom: 0px !important;
|
60 |
+
/* left margin needed for nums toggle */
|
61 |
+
}
|
62 |
+
|
63 |
+
.crayon-syntax td {
|
64 |
+
background: none !important;
|
65 |
+
vertical-align: top !important;
|
66 |
+
padding: 0px !important;
|
67 |
+
margin: 0px !important;
|
68 |
+
border: none !important;
|
69 |
+
}
|
70 |
+
|
71 |
+
.crayon-syntax .crayon-invisible {
|
72 |
+
display: none !important;
|
73 |
+
}
|
74 |
+
/* End General ===================== */
|
75 |
+
|
76 |
+
/* Line Numbers ==================== */
|
77 |
+
.crayon-syntax .crayon-num {
|
78 |
+
text-align: center;
|
79 |
+
padding: 0 5px;
|
80 |
+
margin: 0px;
|
81 |
+
}
|
82 |
+
/* End Line Numbers ================ */
|
83 |
+
|
84 |
+
/* Toolbar ========================= */
|
85 |
+
.crayon-syntax .crayon-toolbar {
|
86 |
+
position: relative;
|
87 |
+
overflow: hidden;
|
88 |
+
}
|
89 |
+
.crayon-syntax .crayon-toolbar,
|
90 |
+
.crayon-syntax .crayon-toolbar * {
|
91 |
+
height: 20px;
|
92 |
+
line-height: 20px;
|
93 |
+
padding: 0px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.crayon-syntax .crayon-toolbar span {
|
97 |
+
padding: 0 4px !important;
|
98 |
+
}
|
99 |
+
|
100 |
+
.crayon-syntax .crayon-toolbar a.crayon-button {
|
101 |
+
display: inline !important;
|
102 |
+
float: left !important;
|
103 |
+
min-width: 20px;
|
104 |
+
|
105 |
+
height: 16px;
|
106 |
+
line-height: 16px;
|
107 |
+
margin: 2px 2px !important;
|
108 |
+
border-radius: 5px;
|
109 |
+
-webkit-border-radius: 5px;
|
110 |
+
-moz-border-radius: 5px;
|
111 |
+
text-decoration: none;
|
112 |
+
}
|
113 |
+
|
114 |
+
/* Plain Button */
|
115 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button:link {
|
116 |
+
background-image: url('images/toolbar/plain_dark.png');
|
117 |
+
background-position: center;
|
118 |
+
background-repeat: no-repeat;
|
119 |
+
}
|
120 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button:hover,
|
121 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button.crayon-pressed {
|
122 |
+
background-image: url('images/toolbar/plain_light.png');
|
123 |
+
}
|
124 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button:active {
|
125 |
+
background-image: url('images/toolbar/plain_dark.png');
|
126 |
+
}
|
127 |
+
|
128 |
+
/* Nums Button */
|
129 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button:link {
|
130 |
+
background-image: url('images/toolbar/nums_dark.png');
|
131 |
+
background-position: center;
|
132 |
+
background-repeat: no-repeat;
|
133 |
+
}
|
134 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button:hover,
|
135 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button.crayon-pressed {
|
136 |
+
background-image: url('images/toolbar/nums_light.png');
|
137 |
+
}
|
138 |
+
.crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button:active {
|
139 |
+
background-image: url('images/toolbar/nums_dark.png');
|
140 |
+
}
|
141 |
+
|
142 |
+
.crayon-syntax .crayon-title {
|
143 |
+
float: left;
|
144 |
+
}
|
145 |
+
/* End Toolbar ===================== */
|
146 |
+
|
147 |
+
/* Code ============================ */
|
148 |
+
.crayon-syntax .crayon-pre,
|
149 |
+
.crayon-syntax pre {
|
150 |
+
white-space: pre;
|
151 |
+
margin: 0;
|
152 |
+
padding: 0;
|
153 |
+
overflow: visible;
|
154 |
+
background: none !important;
|
155 |
+
border: none !important;
|
156 |
+
}
|
157 |
+
|
158 |
+
.crayon-syntax .crayon-line {
|
159 |
+
padding: 0 5px;
|
160 |
+
}
|
161 |
+
|
162 |
+
/* Default Font */
|
163 |
+
.crayon-syntax * {
|
164 |
+
font-family: Monaco, 'MonacoRegular', 'Courier New', monospace;
|
165 |
+
font-size: 12px;
|
166 |
+
line-height: 16px;
|
167 |
+
}
|
168 |
+
.crayon-syntax .crayon-num,
|
169 |
+
.crayon-syntax .crayon-line {
|
170 |
+
height: 16px;
|
171 |
+
}
|
172 |
+
|
173 |
+
.crayon-syntax .crayon-plain {
|
174 |
+
padding: 0 5px;
|
175 |
+
display: none;
|
176 |
+
margin: 0px;
|
177 |
+
resize: none; /* vertical */
|
178 |
+
border: none;
|
179 |
+
box-sizing: border-box;
|
180 |
+
-webkit-box-sizing: border-box;
|
181 |
+
-moz-box-sizing: border-box;
|
182 |
+
box-shadow: none;
|
183 |
+
-webkit-box-shadow: none;
|
184 |
+
-moz-box-shadow: none;
|
185 |
+
overflow: auto;
|
186 |
+
/*white-space: pre-wrap;*/
|
187 |
+
white-space: pre;
|
188 |
+
color: #000;
|
189 |
+
background: #FFF;
|
190 |
+
resize: none;
|
191 |
+
}
|
192 |
+
/* End Code ======================== */
|
193 |
+
|
194 |
+
/* End AK Code Table ============================================= */
|
fonts/arial.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.crayon-font-arial * {
|
2 |
+
font-family: Arial, sans-serif !important;
|
3 |
+
}
|
fonts/courier new.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.crayon-font-courier-new * {
|
2 |
+
font-family: 'Courier New', monospace !important;
|
3 |
+
}
|
fonts/monaco.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import url('../css/fonts/monaco/monaco.css');
|
2 |
+
|
3 |
+
.crayon-font-monaco * {
|
4 |
+
font-family: Monaco, 'MonacoRegular', 'Courier New', monospace !important;
|
5 |
+
}
|
fonts/monospace.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.crayon-font-monospace * {
|
2 |
+
font-family: monospace !important;
|
3 |
+
}
|
fonts/tahoma.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.crayon-font-tahoma * {
|
2 |
+
font-family: Tahoma, Arial, sans !important;
|
3 |
+
}
|
fonts/times.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.crayon-font-times * {
|
2 |
+
font-family: Times New Roman, serif !important;
|
3 |
+
}
|
fonts/verdana.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
.crayon-font-verdana * {
|
2 |
+
font-family: Verdana, Arial, sans !important;
|
3 |
+
}
|
global.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Switches
|
4 |
+
define('CRAYON_DEBUG', FALSE); // Enable to show exceptions on screen
|
5 |
+
|
6 |
+
|
7 |
+
// Constants
|
8 |
+
|
9 |
+
$uid = CRAYON_DEBUG ? uniqid() : ''; // Prevent caching in debug mode
|
10 |
+
|
11 |
+
define('CRAYON_VERSION', '1.0.0' . $uid);
|
12 |
+
define('CRAYON_DATE', '10th August, 2011');
|
13 |
+
define('CRAYON_AUTHOR', 'Aram Kocharyan');
|
14 |
+
// TODO These will be changed once I set up a site for docs
|
15 |
+
define('CRAYON_WEBSITE', 'http://ak.net84.net/?go=crayon');
|
16 |
+
define('CRAYON_WEBSITE_DOCS', 'http://ak.net84.net/?go=crayondocs');
|
17 |
+
define('CRAYON_EMAIL', 'crayon.syntax@gmail.com');
|
18 |
+
define('CRAYON_TWITTER', 'http://twitter.com/crayonsyntax');
|
19 |
+
|
20 |
+
// XXX Used to name the class
|
21 |
+
|
22 |
+
define('CRAYON_HIGHLIGHTER', 'CrayonHighlighter');
|
23 |
+
define('CRAYON_ELEMENT_CLASS', 'CrayonElement');
|
24 |
+
define('CRAYON_SETTING_CLASS', 'CrayonSetting');
|
25 |
+
|
26 |
+
// Directories
|
27 |
+
|
28 |
+
define('CRAYON_DIR', basename(dirname(__FILE__)) . crayon_slash());
|
29 |
+
define('CRAYON_LANG_DIR', crayon_slash('langs'));
|
30 |
+
define('CRAYON_THEME_DIR', crayon_slash('themes'));
|
31 |
+
define('CRAYON_FONT_DIR', crayon_slash('fonts'));
|
32 |
+
define('CRAYON_UTIL_DIR', crayon_slash('util'));
|
33 |
+
define('CRAYON_CSS_DIR', crayon_slash('css'));
|
34 |
+
define('CRAYON_JS_DIR', crayon_slash('js'));
|
35 |
+
|
36 |
+
// Paths
|
37 |
+
|
38 |
+
define('CRAYON_ROOT_PATH', dirname(__FILE__) . crayon_slash());
|
39 |
+
define('CRAYON_LANG_PATH', CRAYON_ROOT_PATH . CRAYON_LANG_DIR);
|
40 |
+
define('CRAYON_THEME_PATH', CRAYON_ROOT_PATH . CRAYON_THEME_DIR);
|
41 |
+
define('CRAYON_FONT_PATH', CRAYON_ROOT_PATH . CRAYON_FONT_DIR);
|
42 |
+
define('CRAYON_UTIL_PATH', CRAYON_ROOT_PATH . CRAYON_UTIL_DIR);
|
43 |
+
|
44 |
+
// Files
|
45 |
+
|
46 |
+
define('CRAYON_LOG_FILE', CRAYON_ROOT_PATH . 'log.txt');
|
47 |
+
define('CRAYON_TOUCH_FILE', CRAYON_UTIL_PATH . 'touch.txt');
|
48 |
+
define('CRAYON_LOG_MAX_SIZE', 50000); // Bytes
|
49 |
+
|
50 |
+
define('CRAYON_LANG_EXT', CRAYON_LANG_PATH . 'extensions.txt');
|
51 |
+
define('CRAYON_HELP_FILE', CRAYON_UTIL_PATH . 'help.htm');
|
52 |
+
define('CRAYON_JQUERY', CRAYON_JS_DIR . 'jquery-1.5.min.js');
|
53 |
+
define('CRAYON_JS', CRAYON_JS_DIR . 'crayon.js');
|
54 |
+
define('CRAYON_JS_ADMIN', CRAYON_JS_DIR . 'crayon_admin.js');
|
55 |
+
define('CRAYON_STYLE', CRAYON_CSS_DIR . 'style.css');
|
56 |
+
define('CRAYON_STYLE_ADMIN', CRAYON_CSS_DIR . 'admin_style.css');
|
57 |
+
define('CRAYON_LOGO', CRAYON_CSS_DIR . 'images/crayon_logo.png');
|
58 |
+
|
59 |
+
// PHP Files
|
60 |
+
define('CRAYON_FORMATTER_PHP', CRAYON_ROOT_PATH . 'crayon_formatter.class.php');
|
61 |
+
define('CRAYON_HIGHLIGHTER_PHP', CRAYON_ROOT_PATH . 'crayon_highlighter.class.php');
|
62 |
+
define('CRAYON_LANGS_PHP', CRAYON_ROOT_PATH . 'crayon_langs.class.php');
|
63 |
+
define('CRAYON_PARSER_PHP', CRAYON_ROOT_PATH . 'crayon_parser.class.php');
|
64 |
+
define('CRAYON_SETTINGS_PHP', CRAYON_ROOT_PATH . 'crayon_settings.class.php');
|
65 |
+
define('CRAYON_THEMES_PHP', CRAYON_ROOT_PATH . 'crayon_themes.class.php');
|
66 |
+
define('CRAYON_FONTS_PHP', CRAYON_ROOT_PATH . 'crayon_fonts.class.php');
|
67 |
+
define('CRAYON_RESOURCE_PHP', CRAYON_ROOT_PATH . 'crayon_resource.class.php');
|
68 |
+
define('CRAYON_UTIL_PHP', CRAYON_UTIL_DIR . 'crayon_util.class.php');
|
69 |
+
define('CRAYON_EXCEPTIONS_PHP', CRAYON_UTIL_DIR . 'exceptions.php');
|
70 |
+
define('CRAYON_TIMER_PHP', CRAYON_UTIL_DIR . 'crayon_timer.class.php');
|
71 |
+
define('CRAYON_LOG_PHP', CRAYON_UTIL_DIR . 'crayon_log.class.php');
|
72 |
+
define('CRAYON_LIST_LANGS_PHP', CRAYON_UTIL_DIR . 'list_langs.php');
|
73 |
+
define('CRAYON_PREVIEW_PHP', CRAYON_UTIL_DIR . 'preview.php');
|
74 |
+
define('CRAYON_AJAX_PHP', CRAYON_UTIL_DIR . 'ajax.php');
|
75 |
+
|
76 |
+
// Script time
|
77 |
+
|
78 |
+
define('CRAYON_LOAD_TIME', 'Load Time');
|
79 |
+
define('CRAYON_PARSE_TIME', 'Parse Time');
|
80 |
+
define('CRAYON_FORMAT_TIME', 'Format Time');
|
81 |
+
|
82 |
+
// Printing
|
83 |
+
|
84 |
+
define('CRAYON_BR', "<br />");
|
85 |
+
define('CRAYON_NL', "\r\n");
|
86 |
+
define('CRAYON_BL', CRAYON_BR . CRAYON_NL);
|
87 |
+
define('CRAYON_DASH', "==============================================================================");
|
88 |
+
define('CRAYON_LINE', "------------------------------------------------------------------------------");
|
89 |
+
|
90 |
+
// Load utilities
|
91 |
+
|
92 |
+
require_once (CRAYON_UTIL_PHP);
|
93 |
+
require_once (CRAYON_EXCEPTIONS_PHP);
|
94 |
+
require_once (CRAYON_TIMER_PHP);
|
95 |
+
require_once (CRAYON_LOG_PHP);
|
96 |
+
|
97 |
+
// Turn on the error & exception handlers
|
98 |
+
|
99 |
+
crayon_handler_on();
|
100 |
+
// Check current version from given file, not used, realised I was losing my mind
|
101 |
+
|
102 |
+
$crayon_version = NULL;
|
103 |
+
|
104 |
+
function crayon_version($file = NULL) {
|
105 |
+
global $crayon_version, $uid;
|
106 |
+
if ($file == NULL) {
|
107 |
+
// Return current version
|
108 |
+
|
109 |
+
if ($crayon_version == NULL) {
|
110 |
+
// Fallback to unknown version
|
111 |
+
|
112 |
+
$crayon_version = 'X' . $uid;
|
113 |
+
}
|
114 |
+
} else if (is_string($file) && file_exists($file)) {
|
115 |
+
// Extract version from file
|
116 |
+
|
117 |
+
$contents = @file_get_contents($file);
|
118 |
+
if ($contents !== FALSE) {
|
119 |
+
$pattern = '#<\\?php\\s*\\/\\*.*Version:\\s*([^\\s]*)\\r?\\n#smi';
|
120 |
+
preg_match($pattern, $contents, $match);
|
121 |
+
if (count($match) > 1) {
|
122 |
+
$crayon_version = $match[1] . $uid;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
return $crayon_version;
|
127 |
+
}
|
128 |
+
|
129 |
+
// Check for forwardslash/backslash in folder path to structure paths
|
130 |
+
|
131 |
+
$crayon_slash = NULL;
|
132 |
+
|
133 |
+
function crayon_slash($url = '') {
|
134 |
+
global $crayon_slash;
|
135 |
+
if ($crayon_slash == NULL) {
|
136 |
+
if (strpos(dirname(__FILE__), '\\')) {
|
137 |
+
$crayon_slash = '\\';
|
138 |
+
} else {
|
139 |
+
$crayon_slash = '/';
|
140 |
+
}
|
141 |
+
}
|
142 |
+
return $url . $crayon_slash;
|
143 |
+
}
|
144 |
+
|
145 |
+
?>
|
js/crayon.js
ADDED
@@ -0,0 +1,502 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--
|
2 |
+
// Crayon Syntax Highlighter JavaScript
|
3 |
+
|
4 |
+
// Contants
|
5 |
+
var ON = true;
|
6 |
+
var OFF = false;
|
7 |
+
var DEBUG = true;
|
8 |
+
|
9 |
+
function crayon_log(string) {
|
10 |
+
if (typeof console != 'undefined' && DEBUG) {
|
11 |
+
console.log(string);
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
// jQuery
|
16 |
+
|
17 |
+
jQuery.noConflict();
|
18 |
+
|
19 |
+
var PRESSED = 'crayon-pressed';
|
20 |
+
var UNPRESSED = '';
|
21 |
+
|
22 |
+
var CRAYON_SYNTAX = 'div.crayon-syntax';
|
23 |
+
var CRAYON_TOOLBAR = '.crayon-toolbar';
|
24 |
+
var CRAYON_PLAIN = '.crayon-plain';
|
25 |
+
var CRAYON_PLAIN_BUTTON = '.crayon-plain-button';
|
26 |
+
var CRAYON_MAIN = '.crayon-main';
|
27 |
+
var CRAYON_TABLE = '.crayon-table';
|
28 |
+
var CRAYON_CODE = '.crayon-code';
|
29 |
+
var CRAYON_NUMS = '.crayon-nums';
|
30 |
+
var CRAYON_NUMS_CONTENT = '.crayon-nums-content';
|
31 |
+
var CRAYON_NUMS_BUTTON = '.crayon-nums-button';
|
32 |
+
|
33 |
+
jQuery(document).ready(function() {
|
34 |
+
//crayon_log('crayon loaded');
|
35 |
+
init();
|
36 |
+
});
|
37 |
+
|
38 |
+
var crayon = new Object();
|
39 |
+
function init() {
|
40 |
+
if (typeof crayon == 'undefined') {
|
41 |
+
crayon = new Object();
|
42 |
+
}
|
43 |
+
|
44 |
+
jQuery(CRAYON_SYNTAX).each(function() {
|
45 |
+
var uid = jQuery(this).attr('id');
|
46 |
+
var toolbar = jQuery(this).find(CRAYON_TOOLBAR);
|
47 |
+
var plain = jQuery(this).find(CRAYON_PLAIN);
|
48 |
+
var plain_button = jQuery(this).find(CRAYON_PLAIN_BUTTON);
|
49 |
+
var main = jQuery(this).find(CRAYON_MAIN);
|
50 |
+
var table = jQuery(this).find(CRAYON_TABLE);
|
51 |
+
var code = jQuery(this).find(CRAYON_CODE);
|
52 |
+
var nums = jQuery(this).find(CRAYON_NUMS);
|
53 |
+
var nums_content = jQuery(this).find(CRAYON_NUMS_CONTENT);
|
54 |
+
var nums_button = jQuery(this).find(CRAYON_NUMS_BUTTON);
|
55 |
+
// Register the objects
|
56 |
+
make_uid(uid);
|
57 |
+
crayon[uid] = jQuery(this);
|
58 |
+
crayon[uid].toolbar = toolbar;
|
59 |
+
crayon[uid].plain = plain;
|
60 |
+
crayon[uid].plain_button = plain_button;
|
61 |
+
crayon[uid].main = main;
|
62 |
+
crayon[uid].table = table;
|
63 |
+
crayon[uid].code = code;
|
64 |
+
crayon[uid].nums = nums;
|
65 |
+
crayon[uid].nums_content = nums_content;
|
66 |
+
crayon[uid].nums_button = nums_button;
|
67 |
+
crayon[uid].nums_visible = true;
|
68 |
+
crayon[uid].plain_visible = false;
|
69 |
+
|
70 |
+
crayon[uid].toolbar_delay = false;
|
71 |
+
crayon[uid].time = 1;
|
72 |
+
|
73 |
+
// Set plain
|
74 |
+
jQuery(CRAYON_PLAIN).css('position', 'absolute');
|
75 |
+
jQuery(CRAYON_PLAIN).css('z-index', 0);
|
76 |
+
|
77 |
+
// Remember CSS dimensions
|
78 |
+
var main_style = crayon[uid].main.get(0).style;
|
79 |
+
crayon[uid].main_height = main_style.height;
|
80 |
+
crayon[uid].main_max_height = main_style.maxHeight;
|
81 |
+
crayon[uid].main_min_height = main_style.minHeight;
|
82 |
+
crayon[uid].main_width = main_style.width;
|
83 |
+
crayon[uid].main_max_width = main_style.maxWidth;
|
84 |
+
crayon[uid].main_min_width = main_style.minWidth;
|
85 |
+
|
86 |
+
var load_timer;
|
87 |
+
var last_num_width = nums.width();
|
88 |
+
var i = 0;
|
89 |
+
crayon[uid].loading = true;
|
90 |
+
crayon[uid].scroll_block_fix = false;
|
91 |
+
|
92 |
+
var load_func = function() {
|
93 |
+
if (main.height() < 30) {
|
94 |
+
crayon[uid].scroll_block_fix = true;
|
95 |
+
}
|
96 |
+
|
97 |
+
// If nums hidden by default
|
98 |
+
if (nums.filter('[settings~="hide"]').length != 0) {
|
99 |
+
nums_content.ready(function() {
|
100 |
+
toggle_nums(uid, true, true);
|
101 |
+
});
|
102 |
+
} else {
|
103 |
+
update_nums_button(uid);
|
104 |
+
}
|
105 |
+
|
106 |
+
// TODO If width has changed or timeout, stop timer
|
107 |
+
if (/*last_num_width != nums.width() ||*/ i == 5) {
|
108 |
+
clearInterval(load_timer);
|
109 |
+
crayon[uid].loading = false;
|
110 |
+
}
|
111 |
+
i++;
|
112 |
+
};
|
113 |
+
main.ready(function() {
|
114 |
+
load_timer = setInterval(load_func, 300);
|
115 |
+
});
|
116 |
+
|
117 |
+
// Used for toggling
|
118 |
+
main.css('position', 'relative');
|
119 |
+
main.css('z-index', 1);
|
120 |
+
|
121 |
+
plain.css('opacity', 0);
|
122 |
+
// Disable certain features for touchscreen devices
|
123 |
+
touchscreen = (jQuery(this).filter('[settings~="touchscreen"]').length != 0);
|
124 |
+
// If a toolbar with mouseover was found
|
125 |
+
if (toolbar.filter('[settings~="mouseover"]').length != 0 && !touchscreen) {
|
126 |
+
crayon[uid].toolbar_mouseover = true;
|
127 |
+
crayon.toolbar_neg_height = '-' + toolbar.height() + 'px';
|
128 |
+
toolbar.css('margin-top', crayon.toolbar_neg_height);
|
129 |
+
toolbar.hide();
|
130 |
+
// Overlay the toolbar if needed, only if doing so will not hide the
|
131 |
+
// whole code!
|
132 |
+
if (toolbar.filter('[settings~="overlay"]').length != 0
|
133 |
+
&& main.height() > toolbar.height() * 2) {
|
134 |
+
toolbar.css('position', 'absolute');
|
135 |
+
toolbar.css('z-index', 2);
|
136 |
+
// Hide on single click when overlayed
|
137 |
+
if (toolbar.filter('[settings~="hide"]').length != 0) {
|
138 |
+
main.click(function() { toolbar_toggle(uid, undefined, true); });
|
139 |
+
plain.click(function() { toolbar_toggle(uid, false, true); });
|
140 |
+
}
|
141 |
+
};
|
142 |
+
// Enable delay on mouseout
|
143 |
+
if (toolbar.filter('[settings~="delay"]').length != 0) {
|
144 |
+
crayon[uid].toolbar_delay = true;
|
145 |
+
}
|
146 |
+
// Use .hover() for chrome, but in firefox mouseover/mouseout worked best
|
147 |
+
jQuery(this).mouseenter(function() { toolbar_toggle(uid, true); })
|
148 |
+
.mouseleave(function() { toolbar_toggle(uid, false); });
|
149 |
+
|
150 |
+
} else if (touchscreen) {
|
151 |
+
toolbar.show();
|
152 |
+
}
|
153 |
+
// Plain show events
|
154 |
+
if (plain.length != 0 && !touchscreen) {
|
155 |
+
if (plain.filter('[settings~="dblclick"]').length != 0) {
|
156 |
+
main.dblclick(function() { toggle_plain(uid); });
|
157 |
+
} else if (plain.filter('[settings~="click"]').length != 0) {
|
158 |
+
main.click(function() { toggle_plain(uid); });
|
159 |
+
} else if (plain.filter('[settings~="mouseover"]').length != 0) {
|
160 |
+
jQuery(this).mouseenter(function() { toggle_plain(uid, true); })
|
161 |
+
.mouseleave(function() { toggle_plain(uid, false); });
|
162 |
+
nums_button.hide();
|
163 |
+
}
|
164 |
+
}
|
165 |
+
// Scrollbar show events
|
166 |
+
if (!touchscreen && jQuery(this).filter('[settings~="scroll-mouseover"]').length != 0) {
|
167 |
+
// Disable on touchscreen devices and when set to mouseover
|
168 |
+
main.css('overflow', 'hidden');
|
169 |
+
plain.css('overflow', 'hidden');
|
170 |
+
jQuery(this).mouseenter(function() { toggle_scroll(uid, true); })
|
171 |
+
.mouseleave(function() { toggle_scroll(uid, false); });
|
172 |
+
}
|
173 |
+
// Disable animations
|
174 |
+
if ( jQuery(this).filter('[settings~="disable-anim"]').length != 0 ) {
|
175 |
+
crayon[uid].time = 0;
|
176 |
+
}
|
177 |
+
});
|
178 |
+
}
|
179 |
+
|
180 |
+
function make_uid(uid) {
|
181 |
+
if (typeof crayon[uid] == 'undefined') {
|
182 |
+
crayon[uid] = jQuery('#'+uid);
|
183 |
+
//crayon_log('made ' + uid);
|
184 |
+
return true;
|
185 |
+
}
|
186 |
+
return false;
|
187 |
+
}
|
188 |
+
|
189 |
+
function toggle_plain(uid, hover) {
|
190 |
+
if (typeof crayon[uid] == 'undefined') {
|
191 |
+
return make_uid(uid);
|
192 |
+
}
|
193 |
+
|
194 |
+
var main = crayon[uid].main;
|
195 |
+
var plain = crayon[uid].plain;
|
196 |
+
var plain_button = crayon[uid].plain_button;
|
197 |
+
|
198 |
+
// Reconsile height
|
199 |
+
plain.height(main.height());
|
200 |
+
plain.width(main.width());
|
201 |
+
|
202 |
+
if ( (main.is(':animated') || plain.is(':animated')) && typeof hover == 'undefined' ) {
|
203 |
+
return;
|
204 |
+
}
|
205 |
+
|
206 |
+
var visible, hidden;
|
207 |
+
if (typeof hover != 'undefined') {
|
208 |
+
if (hover) {
|
209 |
+
visible = main;
|
210 |
+
hidden = plain;
|
211 |
+
} else {
|
212 |
+
visible = plain;
|
213 |
+
hidden = main;
|
214 |
+
}
|
215 |
+
} else {
|
216 |
+
if (main.css('z-index') == 1) {
|
217 |
+
visible = main;
|
218 |
+
hidden = plain;
|
219 |
+
crayon[uid].plain_visible = true;
|
220 |
+
} else {
|
221 |
+
visible = plain;
|
222 |
+
hidden = main;
|
223 |
+
crayon[uid].plain_visible = false;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
// Remember scroll positions of visible
|
228 |
+
crayon[uid].top = visible.scrollTop();
|
229 |
+
crayon[uid].left = visible.scrollLeft();
|
230 |
+
|
231 |
+
/* Used to detect a change in overflow when the mouse moves out
|
232 |
+
* of the Crayon. If it does, then overflow has already been changed,
|
233 |
+
* no need to revert it after toggling plain. */
|
234 |
+
crayon[uid].scroll_changed = false;
|
235 |
+
|
236 |
+
var vis_over = visible.css('overflow');
|
237 |
+
var hid_over = hidden.css('overflow');
|
238 |
+
|
239 |
+
// Hide scrollbars during toggle to avoid Chrome weird draw error
|
240 |
+
visible.css('overflow', 'hidden');
|
241 |
+
hidden.css('overflow', 'hidden');
|
242 |
+
|
243 |
+
fix_scroll_blank(uid);
|
244 |
+
|
245 |
+
// Show hidden, hide visible
|
246 |
+
visible.stop(true);
|
247 |
+
visible.fadeTo(animt(500, uid), 0,
|
248 |
+
function() {
|
249 |
+
visible.css('z-index', 0);
|
250 |
+
if (!crayon[uid].scroll_changed) {
|
251 |
+
visible.css('overflow', vis_over);
|
252 |
+
}
|
253 |
+
});
|
254 |
+
hidden.stop(true);
|
255 |
+
hidden.fadeTo(animt(500, uid), 1,
|
256 |
+
function() {
|
257 |
+
hidden.css('z-index', 1);
|
258 |
+
if (!crayon[uid].scroll_changed) {
|
259 |
+
hidden.css('overflow', hid_over);
|
260 |
+
}
|
261 |
+
|
262 |
+
// Refresh scrollbar draw
|
263 |
+
hidden.scrollTop(crayon[uid].top + 1);
|
264 |
+
hidden.scrollTop(crayon[uid].top);
|
265 |
+
hidden.scrollLeft(crayon[uid].left + 1);
|
266 |
+
hidden.scrollLeft(crayon[uid].left);
|
267 |
+
});
|
268 |
+
|
269 |
+
// Restore scroll positions to hidden
|
270 |
+
hidden.scrollTop(crayon[uid].top);
|
271 |
+
hidden.scrollLeft(crayon[uid].left);
|
272 |
+
|
273 |
+
update_plain_button(uid);
|
274 |
+
|
275 |
+
// Hide toolbar if possible
|
276 |
+
toolbar_toggle(uid, false);
|
277 |
+
}
|
278 |
+
|
279 |
+
function toggle_nums(uid, hide, instant) {
|
280 |
+
if (typeof crayon[uid] == 'undefined') {
|
281 |
+
return make_uid(uid);
|
282 |
+
}
|
283 |
+
|
284 |
+
if (crayon[uid].table.is(':animated')) {
|
285 |
+
return;
|
286 |
+
}
|
287 |
+
var nums_width = Math.round(crayon[uid].nums_content.width() + 1);
|
288 |
+
var neg_width = '-' + nums_width + 'px';
|
289 |
+
|
290 |
+
// Force hiding
|
291 |
+
var num_hidden;
|
292 |
+
if (typeof hide != 'undefined') {
|
293 |
+
num_hidden = false;
|
294 |
+
} else {
|
295 |
+
// Check hiding
|
296 |
+
num_hidden = (crayon[uid].table.css('margin-left') == neg_width);
|
297 |
+
}
|
298 |
+
|
299 |
+
var num_margin;
|
300 |
+
var table_width = crayon[uid].main.width();
|
301 |
+
if (num_hidden) {
|
302 |
+
// Show
|
303 |
+
num_margin = '0px';
|
304 |
+
crayon[uid].nums_visible = true;
|
305 |
+
} else {
|
306 |
+
// Hide
|
307 |
+
crayon[uid].table.css('margin-left', '0px');
|
308 |
+
crayon[uid].nums_visible = false;
|
309 |
+
num_margin = neg_width;
|
310 |
+
table_width += nums_width;
|
311 |
+
}
|
312 |
+
|
313 |
+
if (typeof instant != 'undefined') {
|
314 |
+
crayon[uid].table.css('margin-left', num_margin);
|
315 |
+
crayon[uid].table.width(table_width);
|
316 |
+
update_nums_button(uid);
|
317 |
+
return;
|
318 |
+
}
|
319 |
+
|
320 |
+
// Stop jerking animation from scrollbar appearing for a split second due to
|
321 |
+
// change in width. Prevents scrollbar disappearing if already visible.
|
322 |
+
h_scroll_visible = (crayon[uid].table.width() + px_to_int(crayon[uid].table.css('margin-left')) > crayon[uid].main.width());
|
323 |
+
v_scroll_visible = (crayon[uid].table.height() > crayon[uid].main.height());
|
324 |
+
if (!h_scroll_visible && !v_scroll_visible) {
|
325 |
+
crayon[uid].main.css('overflow', 'hidden');
|
326 |
+
}
|
327 |
+
crayon[uid].table.animate({
|
328 |
+
marginLeft: num_margin,
|
329 |
+
width: table_width
|
330 |
+
}, animt(200, uid), function() {
|
331 |
+
if (typeof crayon[uid] != 'undefined') {
|
332 |
+
update_nums_button(uid);
|
333 |
+
if (!h_scroll_visible && !v_scroll_visible) {
|
334 |
+
crayon[uid].main.css('overflow', 'auto');
|
335 |
+
}
|
336 |
+
}
|
337 |
+
});
|
338 |
+
}
|
339 |
+
|
340 |
+
// Convert '-10px' to -10
|
341 |
+
function px_to_int(pixels) {
|
342 |
+
if (typeof pixels != 'string') {
|
343 |
+
return 0;
|
344 |
+
}
|
345 |
+
var result = pixels.replace(/[^-0-9]/g, '');
|
346 |
+
if (result.length == 0) {
|
347 |
+
return 0;
|
348 |
+
} else {
|
349 |
+
return parseInt(result);
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
function update_nums_button(uid) {
|
354 |
+
if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].nums_visible == 'undefined') {
|
355 |
+
return;
|
356 |
+
}
|
357 |
+
if (crayon[uid].nums_visible) {
|
358 |
+
crayon[uid].nums_button.removeClass(UNPRESSED);
|
359 |
+
crayon[uid].nums_button.addClass(PRESSED);
|
360 |
+
} else {
|
361 |
+
// TODO doesn't work on iPhone
|
362 |
+
crayon[uid].nums_button.removeClass(PRESSED);
|
363 |
+
crayon[uid].nums_button.addClass(UNPRESSED);
|
364 |
+
}
|
365 |
+
}
|
366 |
+
|
367 |
+
function update_plain_button(uid) {
|
368 |
+
if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].plain_visible == 'undefined') {
|
369 |
+
return;
|
370 |
+
}
|
371 |
+
|
372 |
+
if (crayon[uid].plain_visible) {
|
373 |
+
crayon[uid].plain_button.removeClass(UNPRESSED);
|
374 |
+
crayon[uid].plain_button.addClass(PRESSED);
|
375 |
+
} else {
|
376 |
+
// TODO doesn't work on iPhone
|
377 |
+
crayon[uid].plain_button.removeClass(PRESSED);
|
378 |
+
crayon[uid].plain_button.addClass(UNPRESSED);
|
379 |
+
}
|
380 |
+
}
|
381 |
+
|
382 |
+
function toolbar_toggle(uid, show, instant) {
|
383 |
+
if (typeof crayon[uid] == 'undefined') {
|
384 |
+
return make_uid(uid);
|
385 |
+
} else if (!crayon[uid].toolbar_mouseover) {
|
386 |
+
return;
|
387 |
+
}
|
388 |
+
var toolbar = crayon[uid].toolbar;
|
389 |
+
var delay = crayon[uid].toolbar_delay;
|
390 |
+
if (typeof show == 'undefined') {
|
391 |
+
if (toolbar.css('margin-top') == crayon.toolbar_neg_height) {
|
392 |
+
show = true;
|
393 |
+
} else {
|
394 |
+
show = false;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
// Instant means no time delay for showing/hiding
|
398 |
+
if (typeof instant == 'undefined') {
|
399 |
+
instant = false;
|
400 |
+
}
|
401 |
+
toolbar.stop(true);
|
402 |
+
if (show == true) {
|
403 |
+
toolbar.show();
|
404 |
+
toolbar.animate({
|
405 |
+
marginTop: 0
|
406 |
+
}, animt(100, uid));
|
407 |
+
} else if (show == false) {
|
408 |
+
// Delay if fully visible
|
409 |
+
if (instant == false && toolbar.css('margin-top') == '0px' && delay) {
|
410 |
+
toolbar.delay(500);
|
411 |
+
}
|
412 |
+
toolbar.animate({
|
413 |
+
marginTop: crayon.toolbar_neg_height
|
414 |
+
}, animt(100, uid), function() {
|
415 |
+
toolbar.hide();
|
416 |
+
});
|
417 |
+
}
|
418 |
+
}
|
419 |
+
|
420 |
+
function toggle_scroll(uid, show) {
|
421 |
+
if (typeof crayon[uid] == 'undefined') {
|
422 |
+
return make_uid(uid);
|
423 |
+
}
|
424 |
+
if (typeof show == 'undefined' /*|| crayon[uid].loading*/) {
|
425 |
+
return;
|
426 |
+
}
|
427 |
+
|
428 |
+
var main = crayon[uid].main;
|
429 |
+
var plain = crayon[uid].plain;
|
430 |
+
|
431 |
+
if (show) {
|
432 |
+
main.css('overflow', 'auto');
|
433 |
+
plain.css('overflow', 'auto');
|
434 |
+
if (typeof crayon[uid].top != 'undefined') {
|
435 |
+
visible = (main.css('z-index') == 1 ? main : plain);
|
436 |
+
// Browser will not render until scrollbar moves, move it manually
|
437 |
+
visible.scrollTop(crayon[uid].top-1);
|
438 |
+
visible.scrollTop(crayon[uid].top);
|
439 |
+
visible.scrollLeft(crayon[uid].left-1);
|
440 |
+
visible.scrollLeft(crayon[uid].left);
|
441 |
+
}
|
442 |
+
if (!crayon[uid].scroll_block_fix) {
|
443 |
+
// Fix dimensions so scrollbars stay inside
|
444 |
+
main.css('height', main.height());
|
445 |
+
main.css('width', main.width());
|
446 |
+
} else {
|
447 |
+
// Relax dimensions so scrollbars are visible
|
448 |
+
main.css('height', '');
|
449 |
+
main.css('max-height', '');
|
450 |
+
main.css('min-height', '');
|
451 |
+
main.css('width', '');
|
452 |
+
}
|
453 |
+
} else {
|
454 |
+
visible = (main.css('z-index') == 1 ? main : plain);
|
455 |
+
crayon[uid].top = visible.scrollTop();
|
456 |
+
crayon[uid].left = visible.scrollLeft();
|
457 |
+
main.css('overflow', 'hidden');
|
458 |
+
plain.css('overflow', 'hidden');
|
459 |
+
if (!crayon[uid].scroll_block_fix) {
|
460 |
+
// Restore dimensions
|
461 |
+
main.css('height', crayon[uid].main_height);
|
462 |
+
main.css('max-height', crayon[uid].main_max_height);
|
463 |
+
main.css('min-height', crayon[uid].main_min_height);
|
464 |
+
main.css('width', crayon[uid].main_width);
|
465 |
+
}
|
466 |
+
}
|
467 |
+
// Register that overflow has changed
|
468 |
+
crayon[uid].scroll_changed = true;
|
469 |
+
fix_scroll_blank(uid);
|
470 |
+
}
|
471 |
+
|
472 |
+
/* Fix weird draw error, causes blank area to appear where scrollbar once was. */
|
473 |
+
function fix_scroll_blank(uid) {
|
474 |
+
if (typeof crayon[uid] == 'undefined') {
|
475 |
+
return make_uid(uid);
|
476 |
+
}
|
477 |
+
var width = crayon[uid].main.width();
|
478 |
+
crayon[uid].main.width(width);
|
479 |
+
crayon[uid].main.width(width - 1);
|
480 |
+
crayon[uid].main.width(width + 1);
|
481 |
+
crayon[uid].main.width(width);
|
482 |
+
}
|
483 |
+
|
484 |
+
function animt(x, uid) {
|
485 |
+
if (x == 'fast') {
|
486 |
+
x = 200;
|
487 |
+
} else if (x == 'slow') {
|
488 |
+
x = 600;
|
489 |
+
} else if (!isNumber(x)) {
|
490 |
+
x = parseInt(x);
|
491 |
+
if (isNaN(x)) {
|
492 |
+
return 0;
|
493 |
+
}
|
494 |
+
}
|
495 |
+
return x * crayon[uid].time;
|
496 |
+
}
|
497 |
+
|
498 |
+
function isNumber(x) {
|
499 |
+
return typeof x == 'number';
|
500 |
+
}
|
501 |
+
|
502 |
+
// -->
|
js/crayon_admin.js
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--
|
2 |
+
// Crayon Syntax Highlighter Admin JavaScript
|
3 |
+
|
4 |
+
var DEBUG = true;
|
5 |
+
|
6 |
+
// Disables $ for referencing jQuery
|
7 |
+
jQuery.noConflict();
|
8 |
+
|
9 |
+
function crayon_log(string) {
|
10 |
+
if (typeof console != 'undefined' && DEBUG) {
|
11 |
+
console.log(string);
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
// Not used, # is left unencoded
|
16 |
+
function crayon_escape(string) {
|
17 |
+
if (typeof encodeURIComponent == 'function') {
|
18 |
+
return encodeURIComponent(string);
|
19 |
+
} else if (typeof escape != 'function') {
|
20 |
+
return escape(string);
|
21 |
+
} else {
|
22 |
+
return string;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
jQuery(document).ready(function() {
|
27 |
+
crayon_log('admin loaded');
|
28 |
+
admin_init();
|
29 |
+
});
|
30 |
+
|
31 |
+
// Preview
|
32 |
+
var preview, preview_cbox, preview_url, preview_height, preview_timer, preview_delay_timer, preview_get;
|
33 |
+
// The DOM object ids that trigger a preview update
|
34 |
+
var preview_obj_names = [];
|
35 |
+
// The jQuery objects for these objects
|
36 |
+
var preview_objs = [];
|
37 |
+
var preview_last_values = [];
|
38 |
+
// Alignment
|
39 |
+
var align_drop, float;
|
40 |
+
// Toolbar
|
41 |
+
var overlay, toolbar;
|
42 |
+
// Error
|
43 |
+
var msg_cbox, msg;
|
44 |
+
// Log
|
45 |
+
var log_button, log_text, log;
|
46 |
+
|
47 |
+
function admin_init() {
|
48 |
+
// Help
|
49 |
+
help = jQuery('.crayon-help-close');
|
50 |
+
help.click(function() {
|
51 |
+
jQuery('.crayon-help').hide();
|
52 |
+
jQuery.get(help.attr('url'));
|
53 |
+
});
|
54 |
+
|
55 |
+
// Preview
|
56 |
+
preview = jQuery('#crayon-preview');
|
57 |
+
preview_url = preview.attr('url');
|
58 |
+
preview_cbox = jQuery('#preview');
|
59 |
+
preview_register();
|
60 |
+
preview.ready(function() {
|
61 |
+
preview_toggle();
|
62 |
+
});
|
63 |
+
preview_cbox.change(function() { preview_toggle(); });
|
64 |
+
|
65 |
+
// Alignment
|
66 |
+
align_drop = jQuery('#h_align');
|
67 |
+
float = jQuery('#crayon-float');
|
68 |
+
align_drop.change(function() { float_toggle(); });
|
69 |
+
align_drop.ready(function() { float_toggle(); });
|
70 |
+
|
71 |
+
// Custom Error
|
72 |
+
msg_cbox = jQuery('#error_msg_show');
|
73 |
+
msg = jQuery('#error_msg');
|
74 |
+
toggle_error();
|
75 |
+
msg_cbox.change(function() { toggle_error(); });
|
76 |
+
|
77 |
+
// Toolbar
|
78 |
+
overlay = jQuery('#toolbar_overlay');
|
79 |
+
toolbar = jQuery('#toolbar');
|
80 |
+
toggle_toolbar();
|
81 |
+
toolbar.change(function() { toggle_toolbar(); });
|
82 |
+
|
83 |
+
// Log
|
84 |
+
var show_log = 'Show Log';
|
85 |
+
var hide_log = 'Hide Log';
|
86 |
+
log_wrapper = jQuery('#crayon-log-wrapper');
|
87 |
+
log_button = jQuery('#crayon-log-toggle');
|
88 |
+
log_text = jQuery('#crayon-log-text');
|
89 |
+
clog = jQuery('#crayon-log');
|
90 |
+
log_button.val(show_log);
|
91 |
+
log_button.click(function() {
|
92 |
+
clog.width(log_wrapper.width());
|
93 |
+
clog.toggle();
|
94 |
+
// Scrolls content
|
95 |
+
clog.scrollTop(log_text.height());
|
96 |
+
var text = ( log_button.val() == show_log ? hide_log : show_log );
|
97 |
+
log_button.val(text);
|
98 |
+
});
|
99 |
+
}
|
100 |
+
|
101 |
+
/* Whenever a control changes preview */
|
102 |
+
function preview_update() {
|
103 |
+
//crayon_log('preview_update');
|
104 |
+
|
105 |
+
preview_get = '?';
|
106 |
+
var val = 0;
|
107 |
+
var obj;
|
108 |
+
for (i = 0; i < preview_obj_names.length; i++) {
|
109 |
+
obj = preview_objs[i];
|
110 |
+
if (obj.attr('type') == 'checkbox') {
|
111 |
+
val = bool_to_int(obj.attr('checked'));
|
112 |
+
} else {
|
113 |
+
val = obj.val();
|
114 |
+
}
|
115 |
+
preview_get += preview_obj_names[i] + '=' + crayon_escape(val) + "&";
|
116 |
+
}
|
117 |
+
|
118 |
+
// XXX Scroll to top of themes
|
119 |
+
// Disabled for now, too annoying
|
120 |
+
//var top = jQuery('a[name="crayon-theme"]');
|
121 |
+
//jQuery(window).scrollTop(top.position().top);
|
122 |
+
|
123 |
+
// Delay resize
|
124 |
+
preview.css('height', preview.height());
|
125 |
+
preview.css('overflow', 'hidden');
|
126 |
+
preview_timer = setInterval(function() {
|
127 |
+
preview.css('height', '');
|
128 |
+
preview.css('overflow', 'visible');
|
129 |
+
clearInterval(preview_timer);
|
130 |
+
}, 1000);
|
131 |
+
|
132 |
+
// Load Data
|
133 |
+
jQuery.get(preview_url + preview_get, function(data) {
|
134 |
+
preview.html(data);
|
135 |
+
});
|
136 |
+
}
|
137 |
+
|
138 |
+
function bool_to_int(bool) {
|
139 |
+
if (bool == true) {
|
140 |
+
return 1;
|
141 |
+
} else {
|
142 |
+
return 0;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
function preview_toggle() {
|
147 |
+
if ( preview_cbox.is(':checked') ) {
|
148 |
+
preview.show();
|
149 |
+
preview_update();
|
150 |
+
} else {
|
151 |
+
preview.hide();
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
function float_toggle() {
|
156 |
+
if ( align_drop.val() != 0 ) {
|
157 |
+
float.show();
|
158 |
+
} else {
|
159 |
+
float.hide();
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
// List of callbacks
|
164 |
+
var preview_callback;
|
165 |
+
var preview_txt_change;
|
166 |
+
var preview_txt_callback; // Only updates if text value changed
|
167 |
+
var preview_txt_callback_delayed;
|
168 |
+
//var height_set;
|
169 |
+
|
170 |
+
// Register all event handlers for preview objects
|
171 |
+
function preview_register() {
|
172 |
+
var obj;
|
173 |
+
preview_get = '?';
|
174 |
+
|
175 |
+
// Instant callback
|
176 |
+
preview_callback = function() {
|
177 |
+
preview_update();
|
178 |
+
}
|
179 |
+
|
180 |
+
// Checks if the text input is changed, if so, runs the callback with given event
|
181 |
+
preview_txt_change = function(callback, event) {
|
182 |
+
//crayon_log('checking if changed');
|
183 |
+
var obj = event.target;
|
184 |
+
var last = preview_last_values[obj.id];
|
185 |
+
//crayon_log('last' + preview_last_values[obj.id]);
|
186 |
+
|
187 |
+
if (obj.value != last) {
|
188 |
+
//crayon_log('changed');
|
189 |
+
// Update last value to current
|
190 |
+
preview_last_values[obj.id] = obj.value;
|
191 |
+
// Run callback with event
|
192 |
+
callback(event);
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
// Only updates when text is changed
|
197 |
+
preview_txt_callback = function(event) {
|
198 |
+
//crayon_log('txt callback');
|
199 |
+
preview_txt_change(preview_update, event);
|
200 |
+
}
|
201 |
+
|
202 |
+
// Only updates when text is changed, but callback
|
203 |
+
preview_txt_callback_delayed = function(event) {
|
204 |
+
//crayon_log('txt delayed');
|
205 |
+
|
206 |
+
preview_txt_change(function() {
|
207 |
+
clearInterval(preview_delay_timer);
|
208 |
+
preview_delay_timer = setInterval(function() {
|
209 |
+
//crayon_log('delayed update');
|
210 |
+
preview_update();
|
211 |
+
clearInterval(preview_delay_timer);
|
212 |
+
}, 500);
|
213 |
+
}, event);
|
214 |
+
}
|
215 |
+
|
216 |
+
// Retreive preview objects
|
217 |
+
jQuery('[crayon-preview="1"]').each(function(i) {
|
218 |
+
var obj = jQuery(this);
|
219 |
+
preview_obj_names[i] = obj.attr('id');
|
220 |
+
preview_objs[i] = obj;
|
221 |
+
// To capture key up events when typing
|
222 |
+
if (obj.attr('type') == 'text') {
|
223 |
+
preview_last_values[obj.attr('id')] = obj.val();
|
224 |
+
obj.bind('keyup', preview_txt_callback_delayed);
|
225 |
+
obj.change(preview_txt_callback);
|
226 |
+
} else {
|
227 |
+
// For all other objects
|
228 |
+
obj.change(preview_callback);
|
229 |
+
}
|
230 |
+
});
|
231 |
+
}
|
232 |
+
|
233 |
+
function toggle_error() {
|
234 |
+
if ( msg_cbox.is(':checked') ) {
|
235 |
+
msg.show();
|
236 |
+
} else {
|
237 |
+
msg.hide();
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
function toggle_toolbar() {
|
242 |
+
if ( toolbar.val() == 0 ) {
|
243 |
+
overlay.show();
|
244 |
+
} else {
|
245 |
+
overlay.hide();
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
function show_langs(url) {
|
250 |
+
jQuery('#show-lang').hide();
|
251 |
+
jQuery.get(url, function(data) {
|
252 |
+
jQuery('#lang-info').show();
|
253 |
+
jQuery('#lang-info').html(data);
|
254 |
+
});
|
255 |
+
}
|
256 |
+
|
257 |
+
//-->
|
js/jquery-1.5.min.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* jQuery JavaScript Library v1.5
|
3 |
+
* http://jquery.com/
|
4 |
+
*
|
5 |
+
* Copyright 2011, John Resig
|
6 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
7 |
+
* http://jquery.org/license
|
8 |
+
*
|
9 |
+
* Includes Sizzle.js
|
10 |
+
* http://sizzlejs.com/
|
11 |
+
* Copyright 2011, The Dojo Foundation
|
12 |
+
* Released under the MIT, BSD, and GPL Licenses.
|
13 |
+
*
|
14 |
+
* Date: Mon Jan 31 08:31:29 2011 -0500
|
15 |
+
*/
|
16 |
+
(function(a,b){function b$(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function bX(a){if(!bR[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bR[a]=c}return bR[a]}function bW(a,b){var c={};d.each(bV.concat.apply([],bV.slice(0,b)),function(){c[this]=a});return c}function bJ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f=a.converters,g,h=e.length,i,j=e[0],k,l,m,n,o;for(g=1;g<h;g++){k=j,j=e[g];if(j==="*")j=k;else if(k!=="*"&&k!==j){l=k+" "+j,m=f[l]||f["* "+j];if(!m){o=b;for(n in f){i=n.split(" ");if(i[0]===k||i[0]==="*"){o=f[i[1]+" "+j];if(o){n=f[n],n===!0?m=o:o===!0&&(m=n);break}}}}!m&&!o&&d.error("No conversion from "+l.replace(" "," to ")),m!==!0&&(c=m?m(c):o(n(c)))}}return c}function bI(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bH(a,b,c,e){d.isArray(b)&&b.length?d.each(b,function(b,f){c||bp.test(a)?e(a,f):bH(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)}):c||b==null||typeof b!=="object"?e(a,b):d.isArray(b)||d.isEmptyObject(b)?e(a,""):d.each(b,function(b,d){bH(a+"["+b+"]",d,c,e)})}function bG(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bD,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(g[l]?l=b:(c.dataTypes.unshift(l),l=bG(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bG(a,c,d,e,"*",g));return l}function bF(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bz),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bn(a,b,c){var e=b==="width"?bh:bi,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function _(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function $(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function Z(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h,g[h][i],g[h][i].data)}}}}function Y(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function O(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(J.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(q,"`").replace(r,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,p,q=[],r=[],s=d._data(this,u);typeof s==="function"&&(s=s.events);if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(o,"")===a.type?r.push(g.selector):t.splice(i--,1);f=d(a.target).closest(r,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&q.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=q.length;j<k;j++){f=q[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,p=f.handleObj.origHandler.apply(f.elem,arguments);if(p===!1||a.isPropagationStopped()){c=f.level,p===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,b,c){c[0].type=a;return d.event.handle.apply(b,c)}function w(){return!0}function v(){return!1}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");e.type="text/javascript",d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?D.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(d.isFunction(this.promise)?this.promise():this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),e;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a,c){if(a==null){if(e)return e;e=a={}}c=z.length;while(c--)a[z[c]]=b[z[c]];return a}}),b.then(c.cancel,b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){var b=arguments,c=b.length,e=c<=1&&a&&d.isFunction(a.promise)?a:d.Deferred(),f=e.promise(),g;c>1?(g=Array(c),d.each(b,function(a,b){d.when(b).then(function(b){g[a]=arguments.length>1?E.call(arguments,0):b,--c||e.resolveWith(f,g)},e.reject)})):e!==a&&e.resolve(a);return f},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return a.jQuery=a.$=d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option"));if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:b.getElementsByTagName("input")[0].value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,_scriptEval:null,noCloneEvent:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},g.disabled=!0,d.support.optDisabled=!h.disabled,d.support.scriptEval=function(){if(d.support._scriptEval===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();e.type="text/javascript";try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(d.support._scriptEval=!0,delete a[f]):d.support._scriptEval=!1,b.removeChild(e),b=e=f=null}return d.support._scriptEval};try{delete b.test}catch(i){d.support.deleteExpando=!1}b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function j(){d.support.noCloneEvent=!1,b.detachEvent("onclick",j)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var k=c.createDocumentFragment();k.appendChild(b.firstChild),d.support.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var l=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=l("submit"),d.support.changeBubbles=l("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!d.isEmptyObject(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={}),typeof c==="object"&&(f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c)),i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,i=g?b[d.expando]:d.expando;if(!h[i])return;if(c){var j=e?h[i][f]:h[i];if(j){delete j[c];if(!d.isEmptyObject(j))return}}if(e){delete h[i][f];if(!d.isEmptyObject(h[i]))return}var k=h[i][f];d.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},h[i][f]=k):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i<j;i++)h=g[i].name,h.indexOf("data-")===0&&(h=h.substr(5),f(this[0],h,e[h]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=f(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var g=/[\n\t\r]/g,h=/\s+/,i=/\r/g,j=/^(?:href|src|style)$/,k=/^(?:button|input)$/i,l=/^(?:button|input|object|select|textarea)$/i,m=/^a(?:rea)?$/i,n=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(h);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",i=f.className;for(var j=0,k=b.length;j<k;j++)g.indexOf(" "+b[j]+" ")<0&&(i+=" "+b[j]);f.className=d.trim(i)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(h);for(var e=0,f=this.length;e<f;e++){var i=this[e];if(i.nodeType===1&&i.className)if(a){var j=(" "+i.className+" ").replace(g," ");for(var k=0,l=c.length;k<l;k++)j=j.replace(" "+c[k]+" "," ");i.className=d.trim(j)}else i.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,i=d(this),j=b,k=a.split(h);while(f=k[g++])j=e?j:!i.hasClass(f),i[j?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(g," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,j=c.type==="select-one";if(f<0)return null;for(var k=j?f:0,l=j?f+1:h.length;k<l;k++){var m=h[k];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(j)return a;g.push(a)}}return g}if(n.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(i,"")}return b}var o=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){o&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&n.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=j.test(c);if(c==="selected"&&!d.support.optSelected){var n=a.parentNode;n&&(n.selectedIndex,n.parentNode&&n.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&k.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:l.test(a.nodeName)||m.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var o=/\.(.*)$/,p=/^(?:textarea|input|select)$/i,q=/\./g,r=/ /g,s=/[^\w\s.|`]/g,t=function(a){return a.replace(s,"\\$&")},u="events";d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a);if(f===!1)f=v;else if(!f)return;var h,i;f.handler&&(h=f,f=h.handler),f.guid||(f.guid=d.guid++);var j=d._data(c);if(!j)return;var k=j[u],l=j.handle;typeof k==="function"?(l=k.handle,k=k.events):k||(c.nodeType||(j[u]=j=function(){}),j.events=k={}),l||(j.handle=l=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(l.elem,arguments):b}),l.elem=c,e=e.split(" ");var m,n=0,o;while(m=e[n++]){i=h?d.extend({},h):{handler:f,data:g},m.indexOf(".")>-1?(o=m.split("."),m=o.shift(),i.namespace=o.slice(0).sort().join(".")):(o=[],i.namespace=""),i.type=m,i.guid||(i.guid=f.guid);var p=k[m],q=d.event.special[m]||{};if(!p){p=k[m]=[];if(!q.setup||q.setup.call(c,g,o,l)===!1)c.addEventListener?c.addEventListener(m,l,!1):c.attachEvent&&c.attachEvent("on"+m,l)}q.add&&(q.add.call(c,i),i.handler.guid||(i.handler.guid=f.guid)),p.push(i),d.event.global[m]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),w=s&&s[u];if(!s||!w)return;typeof w==="function"&&(s=w,w=w.events),c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in w)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),t).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=w[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete w[h]}if(d.isEmptyObject(w)){var x=s.handle;x&&(x.elem=null),delete s.events,delete s.handle,typeof s==="function"?d.removeData(a,u,!0):d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=e.nodeType?d._data(e,"handle"):(d._data(e,u)||{}).handle;h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(o,""),n=d.nodeName(l,"a")&&m==="click",p=d.event.special[m]||{};if((!p._default||p._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,u),typeof i==="function"&&(i=i.events),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,F(a.origType,a.selector),d.extend({},a,{handler:E,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,F(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?w:v):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=w;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=w;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=w,this.stopPropagation()},isDefaultPrevented:v,isPropagationStopped:v,isImmediatePropagationStopped:v};var x=function(a){var b=a.relatedTarget;try{while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(c){}},y=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?y:x,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?y:x)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,c){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var c=a.target,e=c.type;if((e==="submit"||e==="image")&&d(c).closest("form").length){a.liveFired=b;return C("submit",this,arguments)}}),d.event.add(this,"keypress.specialSubmit",function(a){var c=a.target,e=c.type;if((e==="text"||e==="password")&&d(c).closest("form").length&&a.keyCode===13){a.liveFired=b;return C("submit",this,arguments)}});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var z,A=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(p.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f){a.type="change",a.liveFired=b;return d.event.trigger(a,arguments[1],c)}}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;if(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")return B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")return B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return p.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return p.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var D={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var p in a)n[c](p,e,a[p],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=o.exec(h),k="",j&&(k=j[0],h=h.replace(o,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(D[h]+k),h=h+k):h=(D[h]||h)+k;if(c==="live")for(var q=0,r=n.length;q<r;q++)d.event.add(n[q],"live."+F(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+F(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function s(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var j=d[g];if(j){var k=!1;j=j[a];while(j){if(j.sizcache===c){k=d[j.sizset];break}if(j.nodeType===1){f||(j.sizcache=c,j.sizset=g);if(typeof b!=="string"){if(j===b){k=!0;break}}else if(i.filter(b,[j]).length>0){k=j;break}}j=j[a]}d[g]=k}}}function r(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0;[0,0].sort(function(){h=!1;return 0});var i=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var l,m,o,p,q,r,s,u,v=!0,w=i.isXML(d),x=[],y=b;do{a.exec(""),l=a.exec(y);if(l){y=l[3],x.push(l[1]);if(l[2]){p=l[3];break}}}while(l);if(x.length>1&&k.exec(b))if(x.length===2&&j.relative[x[0]])m=t(x[0]+x[1],d);else{m=j.relative[x[0]]?[d]:i(x.shift(),d);while(x.length)b=x.shift(),j.relative[b]&&(b+=x.shift()),m=t(b,m)}else{!g&&x.length>1&&d.nodeType===9&&!w&&j.match.ID.test(x[0])&&!j.match.ID.test(x[x.length-1])&&(q=i.find(x.shift(),d,w),d=q.expr?i.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:n(g)}:i.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),m=q.expr?i.filter(q.expr,q.set):q.set,x.length>0?o=n(m):v=!1;while(x.length)r=x.pop(),s=r,j.relative[r]?s=x.pop():r="",s==null&&(s=d),j.relative[r](o,s,w)}else o=x=[]}o||(o=m),o||i.error(r||b);if(f.call(o)==="[object Array]")if(v)if(d&&d.nodeType===1)for(u=0;o[u]!=null;u++)o[u]&&(o[u]===!0||o[u].nodeType===1&&i.contains(d,o[u]))&&e.push(m[u]);else for(u=0;o[u]!=null;u++)o[u]&&o[u].nodeType===1&&e.push(m[u]);else e.push.apply(e,o);else n(o,e);p&&(i(p,h,e,g),i.uniqueSort(e));return e};i.uniqueSort=function(a){if(p){g=h,a.sort(p);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},i.matches=function(a,b){return i(a,null,null,b)},i.matchesSelector=function(a,b){return i(b,null,null,[a]).length>0},i.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=j.order.length;e<f;e++){var g,h=j.order[e];if(g=j.leftMatch[h].exec(a)){var i=g[1];g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(/\\/g,""),d=j.find[h](g,b,c);if(d!=null){a=a.replace(j.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},i.filter=function(a,c,d,e){var f,g,h=a,k=[],l=c,m=c&&c[0]&&i.isXML(c[0]);while(a&&c.length){for(var n in j.filter)if((f=j.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=j.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;l===k&&(k=[]);if(j.preFilter[n]){f=j.preFilter[n](f,l,d,k,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=l[s])!=null;s++)if(p){o=q(p,f,s,l);var t=e^!!o;d&&o!=null?t?g=!0:l[s]=!1:t&&(k.push(p),g=!0)}if(o!==b){d||(l=k),a=a.replace(j.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)i.error(a);else break;h=a}return l},i.error=function(a){throw"Syntax error, unrecognized expression: "+a};var j=i.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!/\W/.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&i.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!/\W/.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&i.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=s;typeof b==="string"&&!/\W/.test(b)&&(b=b.toLowerCase(),d=b,g=r),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=s;typeof b==="string"&&!/\W/.test(b)&&(b=b.toLowerCase(),d=b,g=r),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(/\\/g,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a,b){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||i.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&i.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(/\\/g,"");!f&&j.attrMap[g]&&(a[1]=j.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(/\\/g,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=i(b[3],null,null,c);else{var g=i.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(j.match.POS.test(b[0])||j.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!i(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=j.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||i.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,k=g.length;h<k;h++)if(g[h]===a)return!1;return!0}i.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=j.attrHandle[c]?j.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=j.setFilters[e];if(f)return f(a,c,b,d)}}},k=j.match.POS,l=function(a,b){return"\\"+(b-0+1)};for(var m in j.match)j.match[m]=new RegExp(j.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source),j.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[m].source.replace(/\\(\d+)/g,l));var n=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(o){n=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var p,q;c.documentElement.compareDocumentPosition?p=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(p=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return q(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return q(e[k],f[k]);return k===c?q(a,f[k],-1):q(e[k],b,1)},q=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),i.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=i.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(j.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},j.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(j.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(j.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=i,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){i=function(b,e,f,g){e=e||c;if(!g&&!i.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return n(e.getElementsByTagName(b),f);if(h[2]&&j.find.CLASS&&e.getElementsByClassName)return n(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return n([e.body],f);if(h&&h[3]){var k=e.getElementById(h[3]);if(!k||!k.parentNode)return n([],f);if(k.id===h[3])return n([k],f)}try{return n(e.querySelectorAll(b),f)}catch(l){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e.getAttribute("id"),o=m||d,p=e.parentNode,q=/^\s*[+~]/.test(b);m?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),q&&p&&(e=e.parentNode);try{if(!q||p)return n(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(r){}finally{m||e.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)i[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(i.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!i.isXML(a))try{if(d||!j.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return i(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;j.order.splice(1,0,"CLASS"),j.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?i.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?i.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:i.contains=function(){return!1},i.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var t=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=j.match.PSEUDO.exec(a))e+=c[0],a=a.replace(j.match.PSEUDO,"");a=j.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)i(a,f[g],d);return i.filter(e,d)};d.find=i,d.expr=i.selectors,d.expr[":"]=d.expr.filters,d.unique=i.uniqueSort,d.text=i.getText,d.isXMLDoc=i.isXML,d.contains=i.contains}();var G=/Until$/,H=/^(?:parents|prevUntil|prevAll)/,I=/,/,J=/^.[^:#\[\.,]*$/,K=Array.prototype.slice,L=d.expr.match.POS,M={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(O(this,a,!1),"not",a)},filter:function(a){return this.pushStack(O(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/<tbody/i,U=/<|&#?\w+;/,V=/<(?:script|object|embed|option|style)/i,W=/checked\s*(?:[^=]|=\s*.checked.)/i,X={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!0:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&W.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?Y(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,_)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!V.test(a[0])&&(d.support.checkClone||!W.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if(!d.support.noCloneEvent&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){f=a.getElementsByTagName("*"),g=e.getElementsByTagName("*");for(h=0;f[h];++h)$(f[h],g[h]);$(a,e)}if(b){Z(a,e);if(c&&"getElementsByTagName"in a){f=a.getElementsByTagName("*"),g=e.getElementsByTagName("*");if(f.length)for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1></$2>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var ba=/alpha\([^)]*\)/i,bb=/opacity=([^)]*)/,bc=/-([a-z])/ig,bd=/([A-Z])/g,be=/^-?\d+(?:px)?$/i,bf=/^-?\d/,bg={position:"absolute",visibility:"hidden",display:"block"},bh=["Left","Right"],bi=["Top","Bottom"],bj,bk,bl,bm=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bj(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bj)return bj(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bc,bm)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bn(a,b,e):d.swap(a,bg,function(){f=bn(a,b,e)});if(f<=0){f=bj(a,b,b),f==="0px"&&bl&&(f=bl(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!be.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=ba.test(f)?f.replace(ba,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bk=function(a,c,e){var f,g,h;e=e.replace(bd,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bl=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!be.test(d)&&bf.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bj=bk||bl,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bo=/%20/g,bp=/\[\]$/,bq=/\r?\n/g,br=/#.*$/,bs=/^(.*?):\s*(.*?)\r?$/mg,bt=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bu=/^(?:GET|HEAD)$/,bv=/^\/\//,bw=/\?/,bx=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,by=/^(?:select|textarea)/i,bz=/\s+/,bA=/([?&])_=[^&]*/,bB=/^(\w+:)\/\/([^\/?#:]+)(?::(\d+))?/,bC=d.fn.load,bD={},bE={};d.fn.extend({load:function(a,b,c){if(typeof a!=="string"&&bC)return bC.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";b&&(d.isFunction(b)?(c=b,b=null):typeof b==="object"&&(b=d.param(b,d.ajaxSettings.traditional),g="POST"));var h=this;d.ajax({url:a,type:g,dataType:"html",data:b,complete:function(a,b,e){e=a.responseText,a.isResolved()&&(a.done(function(a){e=a}),h.html(f?d("<div>").append(e.replace(bx,"")).find(f):e)),c&&h.each(c,[e,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||by.test(this.nodeName)||bt.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bq,"\r\n")}}):{name:b.name,value:c.replace(bq,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,b){d[b]=function(a,c,e,f){d.isFunction(c)&&(f=f||e,e=c,c=null);return d.ajax({type:b,url:a,data:c,success:e,dataType:f})}}),d.extend({getScript:function(a,b){return d.get(a,null,b,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a){d.extend(!0,d.ajaxSettings,a),a.context&&(d.ajaxSettings.context=a.context)},ajaxSettings:{url:location.href,global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bF(bD),ajaxTransport:bF(bE),ajax:function(a,e){function w(a,c,e,l){if(t!==2){t=2,p&&clearTimeout(p),o=b,m=l||"",v.readyState=a?4:0;var n,q,r,s=e?bI(f,v,e):b,u,w;if(a>=200&&a<300||a===304){if(f.ifModified){if(u=v.getResponseHeader("Last-Modified"))d.lastModified[f.url]=u;if(w=v.getResponseHeader("Etag"))d.etag[f.url]=w}if(a===304)c="notmodified",n=!0;else try{q=bJ(f,s),c="success",n=!0}catch(x){c="parsererror",r=x}}else r=c,a&&(c="error",a<0&&(a=0));v.status=a,v.statusText=c,n?i.resolveWith(g,[q,c,v]):i.rejectWith(g,[v,c,r]),v.statusCode(k),k=b,f.global&&h.trigger("ajax"+(n?"Success":"Error"),[v,f,n?q:r]),j.resolveWith(g,[v,c]),f.global&&(h.trigger("ajaxComplete",[v,f]),--d.active||d.event.trigger("ajaxStop"))}}typeof e!=="object"&&(e=a,a=b),e=e||{};var f=d.extend(!0,{},d.ajaxSettings,e),g=(f.context=("context"in e?e:d.ajaxSettings).context)||f,h=g===f?d.event:d(g),i=d.Deferred(),j=d._Deferred(),k=f.statusCode||{},l={},m,n,o,p,q=c.location,r=q.protocol||"http:",s,t=0,u,v={readyState:0,setRequestHeader:function(a,b){t===0&&(l[a.toLowerCase()]=b);return this},getAllResponseHeaders:function(){return t===2?m:null},getResponseHeader:function(a){var b;if(t===2){if(!n){n={};while(b=bs.exec(m))n[b[1].toLowerCase()]=b[2]}b=n[a.toLowerCase()]}return b||null},abort:function(a){a=a||"abort",o&&o.abort(a),w(0,a);return this}};i.promise(v),v.success=v.done,v.error=v.fail,v.complete=j.done,v.statusCode=function(a){if(a){var b;if(t<2)for(b in a)k[b]=[k[b],a[b]];else b=a[v.status],v.then(b,b)}return this},f.url=(""+(a||f.url)).replace(br,"").replace(bv,r+"//"),f.dataTypes=d.trim(f.dataType||"*").toLowerCase().split(bz),f.crossDomain||(s=bB.exec(f.url.toLowerCase()),f.crossDomain=s&&(s[1]!=r||s[2]!=q.hostname||(s[3]||(s[1]==="http:"?80:443))!=(q.port||(r==="http:"?80:443)))),f.data&&f.processData&&typeof f.data!=="string"&&(f.data=d.param(f.data,f.traditional)),bG(bD,f,e,v),f.type=f.type.toUpperCase(),f.hasContent=!bu.test(f.type),f.global&&d.active++===0&&d.event.trigger("ajaxStart");if(!f.hasContent){f.data&&(f.url+=(bw.test(f.url)?"&":"?")+f.data);if(f.cache===!1){var x=d.now(),y=f.url.replace(bA,"$1_="+x);f.url=y+(y===f.url?(bw.test(f.url)?"&":"?")+"_="+x:"")}}if(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)l["content-type"]=f.contentType;f.ifModified&&(d.lastModified[f.url]&&(l["if-modified-since"]=d.lastModified[f.url]),d.etag[f.url]&&(l["if-none-match"]=d.etag[f.url])),l.accept=f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+(f.dataTypes[0]!=="*"?", */*; q=0.01":""):f.accepts["*"];for(u in f.headers)l[u.toLowerCase()]=f.headers[u];if(!f.beforeSend||f.beforeSend.call(g,v,f)!==!1&&t!==2){for(u in {success:1,error:1,complete:1})v[u](f[u]);o=bG(bE,f,e,v);if(o){t=v.readyState=1,f.global&&h.trigger("ajaxSend",[v,f]),f.async&&f.timeout>0&&(p=setTimeout(function(){v.abort("timeout")},f.timeout));try{o.send(l,w)}catch(z){status<2?w(-1,z):d.error(z)}}else w(-1,"No Transport")}else w(0,"abort"),v=!1;return v},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery)d.each(a,function(){f(this.name,this.value)});else for(var g in a)bH(g,a[g],c,f);return e.join("&").replace(bo,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bK=d.now(),bL=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bK++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){e=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bL.test(b.url)||e&&bL.test(b.data))){var f,g=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2";b.jsonp!==!1&&(i=i.replace(bL,k),b.url===i&&(e&&(j=j.replace(bL,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},b.complete=[function(){a[g]=h;if(h)f&&d.isFunction(h)&&a[g](f[0]);else try{delete a[g]}catch(b){}},b.complete],b.converters["script json"]=function(){f||d.error(g+" was not called");return f[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript"},contents:{script:/javascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bM=d.now(),bN={},bO,bP;d.ajaxSettings.xhr=a.ActiveXObject?function(){if(a.location.protocol!=="file:")try{return new a.XMLHttpRequest}catch(b){}try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}:function(){return new a.XMLHttpRequest};try{bP=d.ajaxSettings.xhr()}catch(bQ){}d.support.ajax=!!bP,d.support.cors=bP&&"withCredentials"in bP,bP=b,d.support.ajax&&d.ajaxTransport(function(b){if(!b.crossDomain||d.support.cors){var c;return{send:function(e,f){bO||(bO=1,d(a).bind("unload",function(){d.each(bN,function(a,b){b.onreadystatechange&&b.onreadystatechange(1)})}));var g=b.xhr(),h;b.username?g.open(b.type,b.url,b.async,b.username,b.password):g.open(b.type,b.url,b.async),(!b.crossDomain||b.hasContent)&&!e["x-requested-with"]&&(e["x-requested-with"]="XMLHttpRequest");try{d.each(e,function(a,b){g.setRequestHeader(a,b)})}catch(i){}g.send(b.hasContent&&b.data||null),c=function(a,e){if(c&&(e||g.readyState===4)){c=0,h&&(g.onreadystatechange=d.noop,delete bN[h]);if(e)g.readyState!==4&&g.abort();else{var i=g.status,j,k=g.getAllResponseHeaders(),l={},m=g.responseXML;m&&m.documentElement&&(l.xml=m),l.text=g.responseText;try{j=g.statusText}catch(n){j=""}i=i===0?!b.crossDomain||j?k?304:0:302:i==1223?204:i,f(i,j,l,k)}}},b.async&&g.readyState!==4?(h=bM++,bN[h]=g,g.onreadystatechange=c):c()},abort:function(){c&&c(0,1)}}}});var bR={},bS=/^(?:toggle|show|hide)$/,bT=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,bU,bV=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(bW("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",bX(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(bW("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(bW("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=bX(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(bS.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=bT.exec(e),j=f.cur()||0;if(i){var k=parseFloat(i[2]),l=i[3]||"px";l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:bW("show",1),slideUp:bW("hide",1),slideToggle:bW("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(d.css(this.elem,this.prop));return a||0},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||"px",this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!bU&&(bU=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(bU),bU=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var bY=/^t(?:able|d|h)$/i,bZ=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=b$(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!bY.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=bZ.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!bZ.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=b$(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=b$(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}})})(window);
|
langs/c#/c#.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### C# LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME C#
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (?default)|(#.*?$)
|
9 |
+
STRING (?default)
|
10 |
+
|
11 |
+
STATEMENT \b(?alt:statement.txt)\b
|
12 |
+
RESERVED \b(?alt:reserved.txt)\b
|
13 |
+
TYPE \b(?alt:type.txt)\b
|
14 |
+
MODIFIER \b(?alt:modifier.txt)\b
|
15 |
+
|
16 |
+
ENTITY (?default)
|
17 |
+
VARIABLE (?default)
|
18 |
+
IDENTIFIER (?default)
|
19 |
+
CONSTANT (?default)
|
20 |
+
OPERATOR (?default)
|
21 |
+
SYMBOL (?default)
|
langs/c#/modifier.txt
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
protected
|
2 |
+
readonly
|
3 |
+
implicit
|
4 |
+
internal
|
5 |
+
abstract
|
6 |
+
volatile
|
7 |
+
explicit
|
8 |
+
override
|
9 |
+
private
|
10 |
+
virtual
|
11 |
+
unsafe
|
12 |
+
sealed
|
13 |
+
extern
|
14 |
+
public
|
15 |
+
extern
|
16 |
+
static
|
17 |
+
const
|
18 |
+
fixed
|
19 |
+
ref
|
langs/c#/reserved.txt
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
stackalloc
|
2 |
+
unchecked
|
3 |
+
delegate
|
4 |
+
explicit
|
5 |
+
checked
|
6 |
+
params
|
7 |
+
typeof
|
8 |
+
sizeof
|
9 |
+
event
|
10 |
+
this
|
11 |
+
base
|
12 |
+
new
|
langs/c#/statement.txt
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
continue
|
2 |
+
finally
|
3 |
+
foreach
|
4 |
+
default
|
5 |
+
switch
|
6 |
+
return
|
7 |
+
using
|
8 |
+
throw
|
9 |
+
break
|
10 |
+
catch
|
11 |
+
while
|
12 |
+
lock
|
13 |
+
case
|
14 |
+
goto
|
15 |
+
else
|
16 |
+
out
|
17 |
+
try
|
18 |
+
for
|
19 |
+
as
|
20 |
+
if
|
21 |
+
in
|
22 |
+
do
|
23 |
+
is
|
langs/c#/type.txt
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
interface
|
2 |
+
namespace
|
3 |
+
operator
|
4 |
+
decimal
|
5 |
+
struct
|
6 |
+
ushort
|
7 |
+
struct
|
8 |
+
object
|
9 |
+
double
|
10 |
+
string
|
11 |
+
ulong
|
12 |
+
sbyte
|
13 |
+
false
|
14 |
+
float
|
15 |
+
class
|
16 |
+
short
|
17 |
+
uint
|
18 |
+
null
|
19 |
+
bool
|
20 |
+
true
|
21 |
+
byte
|
22 |
+
char
|
23 |
+
void
|
24 |
+
long
|
25 |
+
enum
|
26 |
+
int
|
langs/c++/c++.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### C++ LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME C++
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (?default)|(#.*?$)
|
9 |
+
STRING (?default)
|
10 |
+
|
11 |
+
STATEMENT (?default)|\b(?alt:statement.txt)\b
|
12 |
+
RESERVED (?default)|\b(?alt:reserved.txt)\b
|
13 |
+
TYPE (?default)|\b(?alt:type.txt)\b
|
14 |
+
MODIFIER (?default)|\b(?alt:modifier.txt)\b
|
15 |
+
|
16 |
+
ENTITY (?default)
|
17 |
+
VARIABLE (?default)|(?default:identifier)(?=::)
|
18 |
+
IDENTIFIER (?default)
|
19 |
+
CONSTANT (?default)
|
20 |
+
OPERATOR (?default)
|
21 |
+
SYMBOL (?default)
|
langs/c++/modifier.txt
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__forceinline
|
2 |
+
__attribute__
|
3 |
+
__extension__
|
4 |
+
thread_local
|
5 |
+
__volatile__
|
6 |
+
__complex__
|
7 |
+
__abstract
|
8 |
+
__declspec
|
9 |
+
__property
|
10 |
+
__inline__
|
11 |
+
__restrict
|
12 |
+
selectany
|
13 |
+
__const__
|
14 |
+
__label__
|
15 |
+
volatile
|
16 |
+
register
|
17 |
+
__inline
|
18 |
+
noinline
|
19 |
+
property
|
20 |
+
register
|
21 |
+
__imag__
|
22 |
+
__real__
|
23 |
+
restrict
|
24 |
+
mutable
|
25 |
+
virtual
|
26 |
+
__cdecl
|
27 |
+
extern
|
28 |
+
inline
|
29 |
+
__pin
|
30 |
+
ref
|
langs/c++/reserved.txt
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__multiple_inheritance
|
2 |
+
__virtual_inheritance
|
3 |
+
__single_inheritance
|
4 |
+
reinterpret_cast
|
5 |
+
dynamic_cast
|
6 |
+
__identifier
|
7 |
+
static_cast
|
8 |
+
__unaligned
|
9 |
+
__alignof__
|
10 |
+
const_cast
|
11 |
+
__delegate
|
12 |
+
deprecated
|
13 |
+
__fastcall
|
14 |
+
__alignof
|
15 |
+
dllexport
|
16 |
+
dllimport
|
17 |
+
__stdcall
|
18 |
+
alignas
|
19 |
+
explicit
|
20 |
+
noexcept
|
21 |
+
typename
|
22 |
+
__assume
|
23 |
+
delegate
|
24 |
+
__except
|
25 |
+
initonly
|
26 |
+
noreturn
|
27 |
+
novtable
|
28 |
+
safecast
|
29 |
+
__sealed
|
30 |
+
__unhook
|
31 |
+
__uuidof
|
32 |
+
alignof
|
33 |
+
__based
|
34 |
+
__event
|
35 |
+
nothrow
|
36 |
+
__raise
|
37 |
+
__super
|
38 |
+
__align
|
39 |
+
__asm__
|
40 |
+
sizeof
|
41 |
+
export
|
42 |
+
typeid
|
43 |
+
__hook
|
44 |
+
__noop
|
45 |
+
sealed
|
46 |
+
compl
|
47 |
+
using
|
48 |
+
__asm
|
49 |
+
__box
|
50 |
+
event
|
51 |
+
naked
|
52 |
+
__asm
|
53 |
+
cout
|
54 |
+
uuid
|
55 |
+
asm
|
langs/c++/statement.txt
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__if_not_exists
|
2 |
+
static_assert
|
3 |
+
__if_exists
|
4 |
+
__try_cast
|
5 |
+
__finally
|
6 |
+
__finally
|
7 |
+
__except
|
8 |
+
__leave
|
9 |
+
and_eq
|
10 |
+
bitand
|
11 |
+
not_eq
|
12 |
+
xor_eq
|
13 |
+
bitor
|
14 |
+
or_eq
|
15 |
+
__try
|
16 |
+
__try
|
langs/c++/type.txt
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
uint_least16_t
|
2 |
+
uint_least32_t
|
3 |
+
interior_ptr
|
4 |
+
__interface
|
5 |
+
__signed__
|
6 |
+
_Imaginary
|
7 |
+
constexpr
|
8 |
+
friend_as
|
9 |
+
__wchar_t
|
10 |
+
decltype
|
11 |
+
char16_t
|
12 |
+
char32_t
|
13 |
+
operator
|
14 |
+
template
|
15 |
+
template
|
16 |
+
_Complex
|
17 |
+
nullptr
|
18 |
+
wchar_t
|
19 |
+
generic
|
20 |
+
__int16
|
21 |
+
__int32
|
22 |
+
__int64
|
23 |
+
literal
|
24 |
+
__m128d
|
25 |
+
__m128i
|
26 |
+
nullptr
|
27 |
+
__value
|
28 |
+
wchar_t
|
29 |
+
friend
|
30 |
+
struct
|
31 |
+
__int8
|
32 |
+
__m128
|
33 |
+
__nogc
|
34 |
+
thread
|
35 |
+
union
|
36 |
+
gcnew
|
37 |
+
__m64
|
38 |
+
value
|
39 |
+
__w64
|
40 |
+
_Bool
|
41 |
+
enum
|
42 |
+
__gc
|
langs/c/c.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### C LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME C
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (?default)|(#.*?$)
|
9 |
+
STRING (?default)
|
10 |
+
|
11 |
+
STATEMENT (?default)
|
12 |
+
RESERVED (?default)|\b(?alt:reserved.txt)\b
|
13 |
+
TYPE (?default)|\b(?alt:type.txt)\b
|
14 |
+
MODIFIER (?default)|\b(?alt:modifier.txt)\b
|
15 |
+
|
16 |
+
ENTITY (?default)
|
17 |
+
VARIABLE (?default)
|
18 |
+
IDENTIFIER (?default)
|
19 |
+
CONSTANT (?default)
|
20 |
+
OPERATOR (?default)
|
21 |
+
SYMBOL (?default)
|
langs/c/modifier.txt
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
transparent_union
|
2 |
+
__extension__
|
3 |
+
__attribute__
|
4 |
+
__volatile__
|
5 |
+
__complex__
|
6 |
+
__inline__
|
7 |
+
__restrict
|
8 |
+
__signed__
|
9 |
+
deprecated
|
10 |
+
__const__
|
11 |
+
__label__
|
12 |
+
extension
|
13 |
+
attribute
|
14 |
+
may_alias
|
15 |
+
volatile
|
16 |
+
restrict
|
17 |
+
register
|
18 |
+
volatile
|
19 |
+
__imag__
|
20 |
+
__real__
|
21 |
+
restrict
|
22 |
+
nocommon
|
23 |
+
complex
|
24 |
+
aligned
|
25 |
+
section
|
26 |
+
cleanup
|
27 |
+
inline
|
28 |
+
signed
|
29 |
+
extern
|
30 |
+
packed
|
31 |
+
unused
|
32 |
+
const
|
33 |
+
label
|
34 |
+
imag
|
35 |
+
real
|
36 |
+
mode
|
langs/c/reserved.txt
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__builtin_types_compatible_p
|
2 |
+
__builtin_return_address
|
3 |
+
constructor, destructor
|
4 |
+
__builtin_frame_address
|
5 |
+
no_instrument_function
|
6 |
+
__builtin_choose_expr
|
7 |
+
__builtin_constant_p
|
8 |
+
__builtin_apply_args
|
9 |
+
__builtin_prefetch
|
10 |
+
regparm, stkparm
|
11 |
+
__builtin_expect
|
12 |
+
__builtin_return
|
13 |
+
__builtin_apply
|
14 |
+
always_inline
|
15 |
+
__alignof__
|
16 |
+
format_arg
|
17 |
+
deprecated
|
18 |
+
interrupt
|
19 |
+
__FILE__
|
20 |
+
__LINE__
|
21 |
+
__func__
|
22 |
+
noreturn
|
23 |
+
noinline
|
24 |
+
__asm__
|
25 |
+
__align
|
26 |
+
__align
|
27 |
+
fortran
|
28 |
+
alignof
|
29 |
+
section
|
30 |
+
nonnull
|
31 |
+
nothrow
|
32 |
+
sprintf
|
33 |
+
sizeof
|
34 |
+
pascal
|
35 |
+
typeof
|
36 |
+
format
|
37 |
+
unused
|
38 |
+
malloc
|
39 |
+
printf
|
40 |
+
malloc
|
41 |
+
__asm
|
42 |
+
__asm
|
43 |
+
cdecl
|
44 |
+
const
|
45 |
+
alias
|
46 |
+
auto
|
47 |
+
near
|
48 |
+
huge
|
49 |
+
pure
|
50 |
+
used
|
51 |
+
asm
|
52 |
+
far
|
langs/c/type.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_Imaginary
|
2 |
+
_Complex
|
3 |
+
intmax_t
|
4 |
+
struct
|
5 |
+
union
|
6 |
+
_Bool
|
langs/css/css.txt
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### CSS LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME CSS
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (/\*.*?\*/)
|
9 |
+
STRING (?default)
|
10 |
+
NOTATION \@[\w-]+
|
11 |
+
|
12 |
+
SELECTOR:KEYWORD (\.|\#|\b)[A-Za-z_][\w-]*\b(?=[^;}]*{)
|
13 |
+
PROPERTY:ENTITY \b[A-Za-z_][\w-]*(?=\s*:)
|
14 |
+
IMP:CONSTANT !important
|
15 |
+
VALUE:IDENTIFIER (?<=:)[\s\w-]+(?=[^;{:]*;)
|
16 |
+
SYMBOL (?default)
|
langs/default/default.txt
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### DEFAULT LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME Default
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (/\*.*?\*/)|(//.*?$)
|
9 |
+
STRING ((?<!\\)".*?(?<!\\)")|((?<!\\)'.*?(?<!\\)')
|
10 |
+
|
11 |
+
STATEMENT \b(?alt:statement.txt)\b
|
12 |
+
RESERVED \b(?alt:reserved.txt)\b
|
13 |
+
TYPE \b(?alt:type.txt)\b
|
14 |
+
MODIFIER \b(?alt:modifier.txt)\b
|
15 |
+
|
16 |
+
ENTITY (\b[a-z_]\w*\b(?=\s*\([^\)]*\)))|((\b[a-z_]\w*\b)(?=[^};\)]*{))
|
17 |
+
VARIABLE \b[A-Za-z_]\w*(?=\s*[\.;\[])
|
18 |
+
IDENTIFIER \b[A-Za-z_]\w*\b
|
19 |
+
CONSTANT (?<!\w)\.?[0-9][\w]*
|
20 |
+
OPERATOR (?alt:operator.txt)
|
21 |
+
SYMBOL &[^;]*;|[^\w\s\d]
|
22 |
+
|
langs/default/modifier.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
protected
|
2 |
+
abstract
|
3 |
+
property
|
4 |
+
private
|
5 |
+
global
|
6 |
+
public
|
7 |
+
static
|
8 |
+
native
|
9 |
+
const
|
10 |
+
final
|
langs/default/operator.txt
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Grouped operators
|
2 |
+
=&
|
3 |
+
<<<
|
4 |
+
>>>
|
5 |
+
<<
|
6 |
+
>>
|
7 |
+
<<=
|
8 |
+
=>>
|
9 |
+
!==
|
10 |
+
!=
|
11 |
+
^=
|
12 |
+
*=
|
13 |
+
&=
|
14 |
+
%=
|
15 |
+
|=
|
16 |
+
/=
|
17 |
+
===
|
18 |
+
==
|
19 |
+
<>
|
20 |
+
->
|
21 |
+
<=
|
22 |
+
>=
|
23 |
+
++
|
24 |
+
--
|
25 |
+
&&
|
26 |
+
||
|
27 |
+
::
|
28 |
+
|
29 |
+
# Single operators
|
30 |
+
\#
|
31 |
+
+
|
32 |
+
-
|
33 |
+
*
|
34 |
+
/
|
35 |
+
%
|
36 |
+
=
|
37 |
+
&
|
38 |
+
|
|
39 |
+
^
|
40 |
+
~
|
41 |
+
!
|
42 |
+
<
|
43 |
+
>
|
44 |
+
:
|
langs/default/reserved.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
implements
|
2 |
+
instanceof
|
3 |
+
declare
|
4 |
+
default
|
5 |
+
extends
|
6 |
+
typedef
|
7 |
+
parent
|
8 |
+
super
|
9 |
+
child
|
10 |
+
clone
|
11 |
+
self
|
12 |
+
this
|
13 |
+
new
|
langs/default/statement.txt
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
enddeclare
|
2 |
+
endforeach
|
3 |
+
endswitch
|
4 |
+
continue
|
5 |
+
endwhile
|
6 |
+
foreach
|
7 |
+
finally
|
8 |
+
default
|
9 |
+
elseif
|
10 |
+
endfor
|
11 |
+
return
|
12 |
+
switch
|
13 |
+
assert
|
14 |
+
break
|
15 |
+
catch
|
16 |
+
endif
|
17 |
+
throw
|
18 |
+
while
|
19 |
+
case
|
20 |
+
else
|
21 |
+
goto
|
22 |
+
each
|
23 |
+
and
|
24 |
+
for
|
25 |
+
try
|
26 |
+
use
|
27 |
+
xor
|
28 |
+
and
|
29 |
+
not
|
30 |
+
end
|
31 |
+
as
|
32 |
+
do
|
33 |
+
if
|
34 |
+
or
|
35 |
+
in
|
36 |
+
is
|
37 |
+
to
|
langs/default/type.txt
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cfunction
|
2 |
+
interface
|
3 |
+
namespace
|
4 |
+
function
|
5 |
+
unsigned
|
6 |
+
boolean
|
7 |
+
integer
|
8 |
+
package
|
9 |
+
double
|
10 |
+
string
|
11 |
+
signed
|
12 |
+
object
|
13 |
+
class
|
14 |
+
array
|
15 |
+
float
|
16 |
+
short
|
17 |
+
false
|
18 |
+
char
|
19 |
+
long
|
20 |
+
void
|
21 |
+
long
|
22 |
+
byte
|
23 |
+
bool
|
24 |
+
null
|
25 |
+
true
|
26 |
+
enum
|
27 |
+
var
|
28 |
+
int
|
langs/extensions.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file contains all the extensions mapped to their language IDs (folder names)
|
2 |
+
# Languages where names and extensions are the same do not need to be listed Eg PHP
|
3 |
+
# Languages that appear first in this list and share extensions will be given precedence
|
4 |
+
|
5 |
+
# Format: ID EXTENSION1 EXTENSION2
|
6 |
+
|
7 |
+
c# cs
|
8 |
+
c++ h hh hpp hxx h++ cc cpp cxx c++
|
9 |
+
html html htm xhtml xhtm xml xsd
|
10 |
+
java java class jar
|
11 |
+
objc m
|
12 |
+
python py pyw pyc pyo pyd
|
13 |
+
vb cs vbs
|
langs/html/html.txt
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### HTML LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME HTML
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT \<!--.*?--\>
|
9 |
+
ATT_STR:STRING (((?<!\\)".*?(?<!\\)")|((?<!\\)'.*?(?<!\\)'))(?=[^\<]*\>)
|
10 |
+
NOTATION <!.*?>
|
11 |
+
|
12 |
+
TAG_OPEN:KEYWORD </?\s*\w+(?=[^\>\<]*\>)
|
13 |
+
TAG_CLOSE:KEYWORD /?>
|
14 |
+
ATTR:ENTITY \w+(?=\s*=)(?=[^\<]*\>)
|
15 |
+
TEXT:IDENTIFIER (?<=\>)[^\<\>]*(?=\<)
|
16 |
+
SYMBOL (?default)
|
17 |
+
OTHER:CONSTANT (?default:identifier)
|
langs/java/java.txt
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### JAVA LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME Java
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (?default)
|
9 |
+
STRING (?default)
|
10 |
+
|
11 |
+
NOTATION \@[\w-]+
|
12 |
+
STATEMENT (?default)
|
13 |
+
RESERVED (?default)|\b(?alt:reserved.txt)\b
|
14 |
+
TYPE (?default)
|
15 |
+
MODIFIER (?default)|\b(?alt:modifier.txt)\b
|
16 |
+
|
17 |
+
ENTITY (?default)
|
18 |
+
VARIABLE (?default)
|
19 |
+
GENERIC:ENTITY <\w+>
|
20 |
+
IDENTIFIER (?default)
|
21 |
+
CONSTANT (?default)
|
22 |
+
OPERATOR (?default)
|
23 |
+
SYMBOL (?default)
|
langs/java/modifier.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
synchronized
|
2 |
+
transient
|
3 |
+
strictfp
|
4 |
+
volatile
|
5 |
+
throws
|
langs/java/reserved.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
import
|
langs/js/js.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### JAVASCRIPT LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME JavaScript
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (?default)
|
9 |
+
STRING (?default)
|
10 |
+
|
11 |
+
STATEMENT (?default)
|
12 |
+
RESERVED (?default)|\b(?-i:(?alt:reserved.txt))\b
|
13 |
+
TYPE (?default)
|
14 |
+
MODIFIER (?default)
|
15 |
+
|
16 |
+
ENTITY (?default)
|
17 |
+
VARIABLE (?default)
|
18 |
+
IDENTIFIER (?default)
|
19 |
+
CONSTANT (?default)
|
20 |
+
OPERATOR (?default)
|
21 |
+
SYMBOL (?default)
|
langs/js/reserved.txt
ADDED
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
captureEvents
|
2 |
+
clearInterval
|
3 |
+
releaseEvents
|
4 |
+
defaultStatus
|
5 |
+
clearTimeout
|
6 |
+
outerHeight
|
7 |
+
locationbar
|
8 |
+
pageXoffset
|
9 |
+
setInterval
|
10 |
+
pageYoffset
|
11 |
+
personalbar
|
12 |
+
innerHeight
|
13 |
+
constructor
|
14 |
+
JavaPackage
|
15 |
+
onMousedown
|
16 |
+
onMouseover
|
17 |
+
onMousemove
|
18 |
+
FileUpload
|
19 |
+
outerWidth
|
20 |
+
setTimeout
|
21 |
+
parseFloat
|
22 |
+
innerWidth
|
23 |
+
routeEvent
|
24 |
+
JavaObject
|
25 |
+
scrollbars
|
26 |
+
onDblClick
|
27 |
+
onKeypress
|
28 |
+
onMouseout
|
29 |
+
arguments
|
30 |
+
statusbar
|
31 |
+
navigator
|
32 |
+
Navigator
|
33 |
+
prototype
|
34 |
+
JavaArray
|
35 |
+
JavaClass
|
36 |
+
onKeydown
|
37 |
+
onMouseup
|
38 |
+
debugger
|
39 |
+
scrollTo
|
40 |
+
location
|
41 |
+
Location
|
42 |
+
Packages
|
43 |
+
MimeType
|
44 |
+
parseInt
|
45 |
+
getClass
|
46 |
+
Password
|
47 |
+
navigate
|
48 |
+
Checkbox
|
49 |
+
Textarea
|
50 |
+
Infinity
|
51 |
+
netscape
|
52 |
+
toString
|
53 |
+
isFinite
|
54 |
+
unescape
|
55 |
+
resizeBy
|
56 |
+
resizeTo
|
57 |
+
document
|
58 |
+
onUnload
|
59 |
+
Document
|
60 |
+
scrollBy
|
61 |
+
onChange
|
62 |
+
onSelect
|
63 |
+
onSubmit
|
64 |
+
onUnload
|
65 |
+
menubar
|
66 |
+
history
|
67 |
+
History
|
68 |
+
toolbar
|
69 |
+
confirm
|
70 |
+
onError
|
71 |
+
untaint
|
72 |
+
onFocus
|
73 |
+
unwatch
|
74 |
+
valueOf
|
75 |
+
Element
|
76 |
+
onClick
|
77 |
+
onFocus
|
78 |
+
onKeyup
|
79 |
+
onReset
|
80 |
+
Anchor
|
81 |
+
Select
|
82 |
+
assign
|
83 |
+
status
|
84 |
+
frames
|
85 |
+
moveBy
|
86 |
+
Button
|
87 |
+
moveTo
|
88 |
+
callee
|
89 |
+
Hidden
|
90 |
+
Submit
|
91 |
+
caller
|
92 |
+
Plugin
|
93 |
+
prompt
|
94 |
+
Number
|
95 |
+
closed
|
96 |
+
RegExp
|
97 |
+
onBlur
|
98 |
+
onLoad
|
99 |
+
scroll
|
100 |
+
typeof
|
101 |
+
window
|
102 |
+
opener
|
103 |
+
escape
|
104 |
+
length
|
105 |
+
Option
|
106 |
+
onBlur
|
107 |
+
onLoad
|
108 |
+
alert
|
109 |
+
focus
|
110 |
+
Frame
|
111 |
+
print
|
112 |
+
taint
|
113 |
+
Image
|
114 |
+
Radio
|
115 |
+
close
|
116 |
+
isNan
|
117 |
+
Reset
|
118 |
+
watch
|
119 |
+
eval
|
120 |
+
Link
|
121 |
+
Area
|
122 |
+
find
|
123 |
+
Form
|
124 |
+
Math
|
125 |
+
blur
|
126 |
+
stop
|
127 |
+
home
|
128 |
+
Text
|
129 |
+
Date
|
130 |
+
java
|
131 |
+
open
|
132 |
+
name
|
133 |
+
NaN
|
134 |
+
sun
|
135 |
+
ref
|
136 |
+
top
|
langs/objc/constant.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
false
|
2 |
+
true
|
3 |
+
YES
|
4 |
+
NO
|
langs/objc/modifier.txt
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
volatile
|
2 |
+
nonatomic
|
3 |
+
register
|
4 |
+
restrict
|
5 |
+
default
|
6 |
+
bycopy
|
7 |
+
oneway
|
8 |
+
atomic
|
9 |
+
extern
|
10 |
+
inline
|
11 |
+
static
|
12 |
+
const
|
13 |
+
inout
|
14 |
+
byref
|
15 |
+
out
|
16 |
+
in
|
langs/objc/modifier_at.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
@synchronized
|
2 |
+
@protected
|
3 |
+
@private
|
4 |
+
@public
|
langs/objc/objc.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### OBJECTIVE-C LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME Objective-C
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT (?default)|(#.*?$)
|
9 |
+
STRING (@?(?<!\\)".*?(?<!\\)")|((?<!\\)'.*?(?<!\\)')
|
10 |
+
|
11 |
+
STATEMENT (?alt:statement_at.txt)\b|\b(?alt:statement.txt)\b
|
12 |
+
RESERVED (?alt:reserved_at.txt)\b|\b(?alt:reserved.txt)\b
|
13 |
+
TYPE \b(?alt:type.txt)\b
|
14 |
+
MODIFIER (?alt:modifier_at.txt)\b|\b(?alt:modifier.txt)\b
|
15 |
+
|
16 |
+
ENTITY (?default)|(?-i:NS[\w]+)
|
17 |
+
VARIABLE (?default)|(\*\w+)
|
18 |
+
IDENTIFIER (?default)
|
19 |
+
CONSTANT (?default)|\b(?alt:constant.txt)\b
|
20 |
+
OPERATOR (?default)
|
21 |
+
SYMBOL (?default)
|
langs/objc/reserved.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
autorelease
|
2 |
+
release
|
3 |
+
typedef
|
4 |
+
retain
|
5 |
+
sizeof
|
6 |
+
alloc
|
7 |
+
super
|
8 |
+
self
|
langs/objc/reserved_at.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@encode
|
langs/objc/statement.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
continue
|
2 |
+
return
|
3 |
+
switch
|
4 |
+
break
|
5 |
+
while
|
6 |
+
case
|
7 |
+
else
|
8 |
+
goto
|
9 |
+
do
|
10 |
+
if
|
langs/objc/statement_at.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@implementation
|
2 |
+
@synthesize
|
3 |
+
@interface
|
4 |
+
@protocol
|
5 |
+
@selector
|
6 |
+
@property
|
7 |
+
@finally
|
8 |
+
@dynamic
|
9 |
+
@throw
|
10 |
+
@catch
|
11 |
+
@class
|
12 |
+
@try
|
13 |
+
@end
|
langs/objc/type.txt
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
_Imaginery
|
2 |
+
Protocol
|
3 |
+
unsigned
|
4 |
+
_Complex
|
5 |
+
double
|
6 |
+
struct
|
7 |
+
signed
|
8 |
+
short
|
9 |
+
float
|
10 |
+
_Bool
|
11 |
+
Class
|
12 |
+
union
|
13 |
+
char
|
14 |
+
long
|
15 |
+
NULL
|
16 |
+
BOOL
|
17 |
+
enum
|
18 |
+
void
|
19 |
+
int
|
20 |
+
nil
|
21 |
+
SEL
|
22 |
+
id
|
langs/php/compile.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__NAMESPACE__
|
2 |
+
__METHOD__
|
3 |
+
__FUNCTION__
|
4 |
+
__LINE__
|
5 |
+
__FILE__
|
6 |
+
__DIR__
|
7 |
+
__CLASS__
|
langs/php/construct.txt
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
unset
|
2 |
+
print
|
3 |
+
return
|
4 |
+
require_once
|
5 |
+
require
|
6 |
+
list
|
7 |
+
isset
|
8 |
+
include_once
|
9 |
+
include
|
10 |
+
eval
|
11 |
+
exit
|
12 |
+
empty
|
13 |
+
echo
|
14 |
+
die
|
langs/php/php.txt
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### PHP LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME PHP
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
FADED (.+(?=<\?php|<\?))|((?<=\?>).+)
|
9 |
+
|
10 |
+
COMMENT (?default)|(\#.*?$)
|
11 |
+
STRING (?default)|(<<<EOT.*?^EOT)
|
12 |
+
|
13 |
+
PHP_TAG:KEYWORD <\?php|<\?|\?>
|
14 |
+
CONSTRUCT:KEYWORD \b(?alt:construct.txt)\b
|
15 |
+
STATEMENT (?default)
|
16 |
+
RESERVED (?default)
|
17 |
+
TYPE (?default)
|
18 |
+
MODIFIER (?default)
|
19 |
+
COMPILE:KEYWORD \b(?alt:compile.txt)\b
|
20 |
+
|
21 |
+
RES_CONST:ENTITY \b(?alt:reserved.txt)\b
|
22 |
+
ENTITY (?default)|\b[a-z_]\w*::
|
23 |
+
VARIABLE \$[a-z_]\w*\b
|
24 |
+
IDENTIFIER \b[a-z_]\w*\b\s*(?=\([^\)]*\))
|
25 |
+
CONSTANT \b[a-z_]\w*\b
|
26 |
+
OPERATOR (?default)
|
27 |
+
SYMBOL (?default)
|
langs/php/reserved.txt
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# http://www.php.net/manual/en/reserved.constants.php
|
2 |
+
__COMPILER_HALT_OFFSET__
|
3 |
+
YESSTR
|
4 |
+
YESEXPR
|
5 |
+
T_FMT_AMPM
|
6 |
+
T_FMT
|
7 |
+
THOUSEP
|
8 |
+
THOUSANDS_SEP
|
9 |
+
STR_PAD_RIGHT
|
10 |
+
STR_PAD_LEFT
|
11 |
+
STR_PAD_BOTH
|
12 |
+
SORT_STRING
|
13 |
+
SORT_REGULAR
|
14 |
+
SORT_NUMERIC
|
15 |
+
SORT_DESC
|
16 |
+
SORT_ASC
|
17 |
+
SEEK_SET
|
18 |
+
SEEK_END
|
19 |
+
SEEK_CUR
|
20 |
+
RADIXCHAR
|
21 |
+
P_SIGN_POSN
|
22 |
+
P_SEP_BY_SPACE
|
23 |
+
P_CS_PRECEDES
|
24 |
+
POSITIVE_SIGN
|
25 |
+
PM_STR
|
26 |
+
PHP_ZTS
|
27 |
+
PHP_WINDOWS_VERSION_SUITEMASK
|
28 |
+
PHP_WINDOWS_VERSION_SP_MINOR
|
29 |
+
PHP_WINDOWS_VERSION_SP_MAJOR
|
30 |
+
PHP_WINDOWS_VERSION_PRODUCTTYPE
|
31 |
+
PHP_WINDOWS_VERSION_PLATFORM
|
32 |
+
PHP_WINDOWS_VERSION_MINOR
|
33 |
+
PHP_WINDOWS_VERSION_MAJOR
|
34 |
+
PHP_WINDOWS_VERSION_BUILD
|
35 |
+
PHP_WINDOWS_NT_WORKSTATION
|
36 |
+
PHP_WINDOWS_NT_SERVER
|
37 |
+
PHP_WINDOWS_NT_DOMAIN_CONTROLLER
|
38 |
+
PHP_VERSION_ID
|
39 |
+
PHP_VERSION
|
40 |
+
PHP_SYSCONFDIR
|
41 |
+
PHP_SHLIB_SUFFIX
|
42 |
+
PHP_SAPI
|
43 |
+
PHP_RELEASE_VERSION
|
44 |
+
PHP_PREFIX
|
45 |
+
PHP_OUTPUT_HANDLER_START
|
46 |
+
PHP_OUTPUT_HANDLER_END
|
47 |
+
PHP_OUTPUT_HANDLER_CONT
|
48 |
+
PHP_OS
|
49 |
+
PHP_MINOR_VERSION
|
50 |
+
PHP_MAXPATHLEN
|
51 |
+
PHP_MAJOR_VERSION
|
52 |
+
PHP_LOCALSTATEDIR
|
53 |
+
PHP_LIBDIR
|
54 |
+
PHP_INT_SIZE
|
55 |
+
PHP_INT_MAX
|
56 |
+
PHP_EXTRA_VERSION
|
57 |
+
PHP_EXTENSION_DIR
|
58 |
+
PHP_EOL
|
59 |
+
PHP_DEBUG
|
60 |
+
PHP_DATADIR
|
61 |
+
PHP_CONFIG_FILE_SCAN_DIR
|
62 |
+
PHP_CONFIG_FILE_PATH
|
63 |
+
PHP_BINDIR
|
64 |
+
PEAR_INSTALL_DIR
|
65 |
+
PEAR_EXTENSION_DIR
|
66 |
+
PATH_SEPARATOR
|
67 |
+
PATHINFO_EXTENSION
|
68 |
+
PATHINFO_DIRNAME
|
69 |
+
PATHINFO_BASENAME
|
70 |
+
N_SIGN_POSN
|
71 |
+
N_SEP_BY_SPACE
|
72 |
+
N_CS_PRECEDES
|
73 |
+
NOSTR
|
74 |
+
NOEXPR
|
75 |
+
NEGATIVE_SIGN
|
76 |
+
M_SQRT2
|
77 |
+
M_SQRT1_2
|
78 |
+
M_PI_4
|
79 |
+
M_PI_2
|
80 |
+
M_PI
|
81 |
+
M_LOG2E
|
82 |
+
M_LOG10E
|
83 |
+
M_LN2
|
84 |
+
M_LN10
|
85 |
+
M_E
|
86 |
+
M_2_SQRTPI
|
87 |
+
M_2_PI
|
88 |
+
M_1_PI
|
89 |
+
MON_THOUSANDS_SEP
|
90 |
+
MON_GROUPING
|
91 |
+
MON_DECIMAL_POINT
|
92 |
+
MON_9
|
93 |
+
MON_8
|
94 |
+
MON_7
|
95 |
+
MON_6
|
96 |
+
MON_5
|
97 |
+
MON_4
|
98 |
+
MON_3
|
99 |
+
MON_2
|
100 |
+
MON_12
|
101 |
+
MON_11
|
102 |
+
MON_10
|
103 |
+
MON_1
|
104 |
+
LOG_WARNING
|
105 |
+
LOG_UUCP
|
106 |
+
LOG_USER
|
107 |
+
LOG_SYSLOG
|
108 |
+
LOG_PID
|
109 |
+
LOG_PERROR
|
110 |
+
LOG_ODELAY
|
111 |
+
LOG_NOWAIT
|
112 |
+
LOG_NOTICE
|
113 |
+
LOG_NEWS
|
114 |
+
LOG_NDELAY
|
115 |
+
LOG_MAIL
|
116 |
+
LOG_LPR
|
117 |
+
LOG_LOCAL7
|
118 |
+
LOG_LOCAL6
|
119 |
+
LOG_LOCAL5
|
120 |
+
LOG_LOCAL4
|
121 |
+
LOG_LOCAL3
|
122 |
+
LOG_LOCAL2
|
123 |
+
LOG_LOCAL1
|
124 |
+
LOG_LOCAL0
|
125 |
+
LOG_KERN
|
126 |
+
LOG_INFO
|
127 |
+
LOG_ERR
|
128 |
+
LOG_EMERG
|
129 |
+
LOG_DEBUG
|
130 |
+
LOG_DAEMON
|
131 |
+
LOG_CRON
|
132 |
+
LOG_CRIT
|
133 |
+
LOG_CONS
|
134 |
+
LOG_AUTHPRIV
|
135 |
+
LOG_AUTH
|
136 |
+
LOG_ALERT
|
137 |
+
LOCK_UN
|
138 |
+
LOCK_SH
|
139 |
+
LOCK_NB
|
140 |
+
LOCK_EX
|
141 |
+
LC_TIME
|
142 |
+
LC_NUMERIC
|
143 |
+
LC_MONETARY
|
144 |
+
LC_MESSAGES
|
145 |
+
LC_CTYPE
|
146 |
+
LC_COLLATE
|
147 |
+
LC_ALL
|
148 |
+
INT_FRAC_DIGITS
|
149 |
+
INT_CURR_SYMBOL
|
150 |
+
INI_USER
|
151 |
+
INI_SYSTEM
|
152 |
+
INI_PERDIR
|
153 |
+
INI_ALL
|
154 |
+
INFO_VARIABLES
|
155 |
+
INFO_MODULES
|
156 |
+
INFO_LICENSE
|
157 |
+
INFO_GENERAL
|
158 |
+
INFO_ENVIRONMENT
|
159 |
+
INFO_CREDITS
|
160 |
+
INFO_CONFIGURATION
|
161 |
+
INFO_ALL
|
162 |
+
HTML_SPECIALCHARS
|
163 |
+
HTML_ENTITIES
|
164 |
+
GROUPING
|
165 |
+
FRAC_DIGITS
|
166 |
+
E_WARNING
|
167 |
+
E_USER_WARNING
|
168 |
+
E_USER_NOTICE
|
169 |
+
E_USER_ERROR
|
170 |
+
E_USER_DEPRECATED
|
171 |
+
E_STRICT
|
172 |
+
E_PARSE
|
173 |
+
E_NOTICE
|
174 |
+
E_ERROR
|
175 |
+
E_DEPRECATED
|
176 |
+
E_CORE_WARNING
|
177 |
+
E_CORE_ERROR
|
178 |
+
E_COMPILE_WARNING
|
179 |
+
E_COMPILE_ERROR
|
180 |
+
E_ALL
|
181 |
+
EXTR_SKIP
|
182 |
+
EXTR_PREFIX_SAME
|
183 |
+
EXTR_PREFIX_INVALID
|
184 |
+
EXTR_PREFIX_IF_EXISTS
|
185 |
+
EXTR_PREFIX_ALL
|
186 |
+
EXTR_OVERWRITE
|
187 |
+
EXTR_IF_EXISTS
|
188 |
+
ERA_YEAR
|
189 |
+
ERA_T_FMT
|
190 |
+
ERA_D_T_FMT
|
191 |
+
ERA_D_FMT
|
192 |
+
ERA
|
193 |
+
ENT_QUOTES
|
194 |
+
ENT_NOQUOTES
|
195 |
+
ENT_COMPAT
|
196 |
+
D_T_FMT
|
197 |
+
D_FMT
|
198 |
+
DIRECTORY_SEPARATOR
|
199 |
+
DEFAULT_INCLUDE_PATH
|
200 |
+
DECIMAL_POINT
|
201 |
+
DAY_7
|
202 |
+
DAY_6
|
203 |
+
DAY_5
|
204 |
+
DAY_4
|
205 |
+
DAY_3
|
206 |
+
DAY_2
|
207 |
+
DAY_1
|
208 |
+
CURRENCY_SYMBOL
|
209 |
+
CRYPT_STD_DES
|
210 |
+
CRYPT_SALT_LENGTH
|
211 |
+
CRYPT_MD5
|
212 |
+
CRYPT_EXT_DES
|
213 |
+
CRYPT_BLOWFISH
|
214 |
+
CRNCYSTR
|
215 |
+
CREDITS_SAPI
|
216 |
+
CREDITS_QA
|
217 |
+
CREDITS_MODULES
|
218 |
+
CREDITS_GROUP
|
219 |
+
CREDITS_GENERAL
|
220 |
+
CREDITS_FULLPAGE
|
221 |
+
CREDITS_DOCS
|
222 |
+
CREDITS_ALL
|
223 |
+
COUNT_RECURSIVE
|
224 |
+
COUNT_NORMAL
|
225 |
+
CONNECTION_TIMEOUT
|
226 |
+
CONNECTION_NORMAL
|
227 |
+
CONNECTION_ABORTED
|
228 |
+
CODESET
|
229 |
+
CHAR_MAX
|
230 |
+
CASE_UPPER
|
231 |
+
CASE_LOWER
|
232 |
+
ASSERT_WARNING
|
233 |
+
ASSERT_QUIET_EVAL
|
234 |
+
ASSERT_CALLBACK
|
235 |
+
ASSERT_BAIL
|
236 |
+
ASSERT_ACTIVE
|
237 |
+
AM_STR
|
238 |
+
ALT_DIGITS
|
239 |
+
ABMON_9
|
240 |
+
ABMON_8
|
241 |
+
ABMON_7
|
242 |
+
ABMON_6
|
243 |
+
ABMON_5
|
244 |
+
ABMON_4
|
245 |
+
ABMON_3
|
246 |
+
ABMON_2
|
247 |
+
ABMON_12
|
248 |
+
ABMON_11
|
249 |
+
ABMON_10
|
250 |
+
ABMON_1
|
251 |
+
ABDAY_7
|
252 |
+
ABDAY_6
|
253 |
+
ABDAY_5
|
254 |
+
ABDAY_4
|
255 |
+
ABDAY_3
|
256 |
+
ABDAY_2
|
257 |
+
ABDAY_1
|
langs/python/exception.txt
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
PendingDeprecationWarning
|
2 |
+
UnicodeTranslateError
|
3 |
+
NotImplementedError
|
4 |
+
FloatingPointError
|
5 |
+
UnicodeDecodeError
|
6 |
+
UnicodeEncodeError
|
7 |
+
DeprecationWarning
|
8 |
+
KeyboardInterrupt
|
9 |
+
ZeroDivisionError
|
10 |
+
UnboundLocalError
|
11 |
+
EnvironmentError
|
12 |
+
IndentationError
|
13 |
+
ArithmeticError
|
14 |
+
AssertionError
|
15 |
+
AttributeError
|
16 |
+
ReferenceError
|
17 |
+
RuntimeWarning
|
18 |
+
UnicodeWarning
|
19 |
+
BaseException
|
20 |
+
GeneratorExit
|
21 |
+
StopIteration
|
22 |
+
StandardError
|
23 |
+
OverflowError
|
24 |
+
SyntaxWarning
|
25 |
+
FutureWarning
|
26 |
+
ImportWarning
|
27 |
+
WindowsError
|
28 |
+
RuntimeError
|
29 |
+
UnicodeError
|
30 |
+
BytesWarning
|
31 |
+
BufferError
|
32 |
+
ImportError
|
33 |
+
LookupError
|
34 |
+
MemoryError
|
35 |
+
SyntaxError
|
36 |
+
SystemError
|
37 |
+
UserWarning
|
38 |
+
SystemExit
|
39 |
+
IndexError
|
40 |
+
ValueError
|
41 |
+
Exception
|
42 |
+
NameError
|
43 |
+
TypeError
|
44 |
+
VMSError
|
45 |
+
EOFError
|
46 |
+
KeyError
|
47 |
+
TabError
|
48 |
+
IOError
|
49 |
+
OSError
|
50 |
+
Warning
|
langs/python/function.txt
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
staticmethod
|
2 |
+
classmethod
|
3 |
+
isinstance
|
4 |
+
basestring
|
5 |
+
issubclass
|
6 |
+
memoryview
|
7 |
+
__import__
|
8 |
+
enumerate
|
9 |
+
bytearray
|
10 |
+
raw_input
|
11 |
+
frozenset
|
12 |
+
execfile
|
13 |
+
property
|
14 |
+
callable
|
15 |
+
reversed
|
16 |
+
unicode
|
17 |
+
getattr
|
18 |
+
globals
|
19 |
+
compile
|
20 |
+
hasattr
|
21 |
+
complex
|
22 |
+
delattr
|
23 |
+
setattr
|
24 |
+
divmod
|
25 |
+
filter
|
26 |
+
unichr
|
27 |
+
format
|
28 |
+
locals
|
29 |
+
reduce
|
30 |
+
reload
|
31 |
+
xrange
|
32 |
+
buffer
|
33 |
+
object
|
34 |
+
coerce
|
35 |
+
sorted
|
36 |
+
intern
|
37 |
+
input
|
38 |
+
print
|
39 |
+
super
|
40 |
+
tuple
|
41 |
+
range
|
42 |
+
float
|
43 |
+
round
|
44 |
+
apply
|
45 |
+
slice
|
46 |
+
open
|
47 |
+
eval
|
48 |
+
file
|
49 |
+
iter
|
50 |
+
bool
|
51 |
+
type
|
52 |
+
list
|
53 |
+
long
|
54 |
+
vars
|
55 |
+
repr
|
56 |
+
hash
|
57 |
+
help
|
58 |
+
next
|
59 |
+
dict
|
60 |
+
abs
|
61 |
+
all
|
62 |
+
int
|
63 |
+
ord
|
64 |
+
str
|
65 |
+
any
|
66 |
+
pow
|
67 |
+
sum
|
68 |
+
bin
|
69 |
+
len
|
70 |
+
chr
|
71 |
+
map
|
72 |
+
cmp
|
73 |
+
max
|
74 |
+
zip
|
75 |
+
min
|
76 |
+
set
|
77 |
+
hex
|
78 |
+
dir
|
79 |
+
oct
|
80 |
+
id
|
langs/python/modifier.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
global
|
langs/python/module.txt
ADDED
@@ -0,0 +1,432 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
distutils.command.install_headers
|
2 |
+
distutils.command.install_scripts
|
3 |
+
distutils.command.bdist_packager
|
4 |
+
distutils.command.bdist_wininst
|
5 |
+
distutils.command.build_scripts
|
6 |
+
distutils.command.install_data
|
7 |
+
distutils.command.install_lib
|
8 |
+
distutils.command.bdist_dumb
|
9 |
+
distutils.command.build_clib
|
10 |
+
multiprocessing.sharedctypes
|
11 |
+
distutils.command.bdist_msi
|
12 |
+
distutils.command.bdist_rpm
|
13 |
+
distutils.command.build_ext
|
14 |
+
distutils.command.build_py
|
15 |
+
distutils.command.register
|
16 |
+
multiprocessing.connection
|
17 |
+
distutils.command.install
|
18 |
+
distutils.cygwinccompiler
|
19 |
+
distutils.command.config
|
20 |
+
multiprocessing.managers
|
21 |
+
distutils.command.bdist
|
22 |
+
distutils.command.build
|
23 |
+
distutils.command.check
|
24 |
+
distutils.command.clean
|
25 |
+
distutils.command.sdist
|
26 |
+
distutils.unixccompiler
|
27 |
+
Carbon.ControlAccessor
|
28 |
+
Carbon.IBCarbonRuntime
|
29 |
+
distutils.archive_util
|
30 |
+
distutils.bcppcompiler
|
31 |
+
distutils.emxccompiler
|
32 |
+
distutils.fancy_getopt
|
33 |
+
distutils.msvccompiler
|
34 |
+
Carbon.LaunchServices
|
35 |
+
multiprocessing.dummy
|
36 |
+
wsgiref.simple_server
|
37 |
+
xml.etree.ElementTree
|
38 |
+
Carbon.CoreFounation
|
39 |
+
multiprocessing.pool
|
40 |
+
Carbon.CarbonEvents
|
41 |
+
Carbon.CoreGraphics
|
42 |
+
distutils.ccompiler
|
43 |
+
distutils.extension
|
44 |
+
distutils.file_util
|
45 |
+
distutils.sysconfig
|
46 |
+
distutils.text_file
|
47 |
+
encodings.utf_8_sig
|
48 |
+
Carbon.QDOffscreen
|
49 |
+
distutils.dep_util
|
50 |
+
distutils.dir_util
|
51 |
+
distutils.filelist
|
52 |
+
SimpleXMLRPCServer
|
53 |
+
Carbon.Appearance
|
54 |
+
Carbon.Components
|
55 |
+
Carbon.MediaDescr
|
56 |
+
distutils.command
|
57 |
+
distutils.version
|
58 |
+
test.test_support
|
59 |
+
xml.parsers.expat
|
60 |
+
xml.sax.xmlreader
|
61 |
+
Carbon.CarbonEvt
|
62 |
+
Carbon.Dragconst
|
63 |
+
Carbon.QuickDraw
|
64 |
+
Carbon.QuickTime
|
65 |
+
Carbon.Resources
|
66 |
+
compiler.visitor
|
67 |
+
distutils.errors
|
68 |
+
logging.handlers
|
69 |
+
SimpleHTTPServer
|
70 |
+
wsgiref.handlers
|
71 |
+
wsgiref.validate
|
72 |
+
xml.sax.saxutils
|
73 |
+
Carbon.Controls
|
74 |
+
Carbon.IBCarbon
|
75 |
+
Carbon.OSAconst
|
76 |
+
Carbon.TextEdit
|
77 |
+
distutils.debug
|
78 |
+
distutils.spawn
|
79 |
+
DocXMLRPCServer
|
80 |
+
dummy_threading
|
81 |
+
email.generator
|
82 |
+
email.iterators
|
83 |
+
future_builtins
|
84 |
+
multiprocessing
|
85 |
+
wsgiref.headers
|
86 |
+
xml.dom.minidom
|
87 |
+
xml.dom.pulldom
|
88 |
+
xml.sax.handler
|
89 |
+
BaseHTTPServer
|
90 |
+
Carbon.Dialogs
|
91 |
+
Carbon.Folders
|
92 |
+
Carbon.MacHelp
|
93 |
+
Carbon.Windows
|
94 |
+
curses.textpad
|
95 |
+
distutils.core
|
96 |
+
distutils.dist
|
97 |
+
distutils.util
|
98 |
+
email.encoders
|
99 |
+
encodings.idna
|
100 |
+
gensuitemodule
|
101 |
+
htmlentitydefs
|
102 |
+
logging.config
|
103 |
+
Carbon.Events
|
104 |
+
Carbon.Folder
|
105 |
+
Carbon.Launch
|
106 |
+
Carbon.Qdoffs
|
107 |
+
CGIHTTPServer
|
108 |
+
distutils.cmd
|
109 |
+
distutils.log
|
110 |
+
email.charset
|
111 |
+
email.message
|
112 |
+
hotshot.stats
|
113 |
+
PixMapWrapper
|
114 |
+
Carbon.Files
|
115 |
+
Carbon.Fonts
|
116 |
+
Carbon.Icons
|
117 |
+
Carbon.Lists
|
118 |
+
Carbon.Menus
|
119 |
+
Carbon.Scrap
|
120 |
+
Carbon.Sound
|
121 |
+
compiler.ast
|
122 |
+
ConfigParser
|
123 |
+
curses.ascii
|
124 |
+
curses.panel
|
125 |
+
dummy_thread
|
126 |
+
email.errors
|
127 |
+
email.header
|
128 |
+
email.parser
|
129 |
+
modulefinder
|
130 |
+
ScrolledText
|
131 |
+
SocketServer
|
132 |
+
wsgiref.util
|
133 |
+
__builtin__
|
134 |
+
applesingle
|
135 |
+
Carbon.Drag
|
136 |
+
Carbon.File
|
137 |
+
Carbon.Help
|
138 |
+
Carbon.Icns
|
139 |
+
Carbon.List
|
140 |
+
Carbon.Menu
|
141 |
+
Carbon.Mlte
|
142 |
+
collections
|
143 |
+
ColorPicker
|
144 |
+
EasyDialogs
|
145 |
+
email.utils
|
146 |
+
findertools
|
147 |
+
macresource
|
148 |
+
MiniAEFrame
|
149 |
+
ossaudiodev
|
150 |
+
pickletools
|
151 |
+
rlcompleter
|
152 |
+
robotparser
|
153 |
+
sunaudiodev
|
154 |
+
SUNAUDIODEV
|
155 |
+
unicodedata
|
156 |
+
videoreader
|
157 |
+
__future__
|
158 |
+
buildtools
|
159 |
+
Carbon.App
|
160 |
+
Carbon.Ctl
|
161 |
+
Carbon.Dlg
|
162 |
+
Carbon.Evt
|
163 |
+
Carbon.OSA
|
164 |
+
Carbon.Res
|
165 |
+
Carbon.Snd
|
166 |
+
Carbon.Win
|
167 |
+
compileall
|
168 |
+
contextlib
|
169 |
+
email.mime
|
170 |
+
exceptions
|
171 |
+
HTMLParser
|
172 |
+
macostools
|
173 |
+
MimeWriter
|
174 |
+
py_compile
|
175 |
+
stringprep
|
176 |
+
subprocess
|
177 |
+
UserString
|
178 |
+
webbrowser
|
179 |
+
Carbon.AE
|
180 |
+
Carbon.AH
|
181 |
+
Carbon.CF
|
182 |
+
Carbon.CG
|
183 |
+
Carbon.Cm
|
184 |
+
Carbon.Fm
|
185 |
+
Carbon.Qd
|
186 |
+
Carbon.Qt
|
187 |
+
Carbon.TE
|
188 |
+
cookielib
|
189 |
+
cStringIO
|
190 |
+
distutils
|
191 |
+
encodings
|
192 |
+
fileinput
|
193 |
+
formatter
|
194 |
+
fractions
|
195 |
+
FrameWork
|
196 |
+
functools
|
197 |
+
importlib
|
198 |
+
itertools
|
199 |
+
linecache
|
200 |
+
macerrors
|
201 |
+
mimetools
|
202 |
+
mimetypes
|
203 |
+
multifile
|
204 |
+
posixfile
|
205 |
+
sysconfig
|
206 |
+
telnetlib
|
207 |
+
threading
|
208 |
+
traceback
|
209 |
+
xmlrpclib
|
210 |
+
zipimport
|
211 |
+
__main__
|
212 |
+
argparse
|
213 |
+
asynchat
|
214 |
+
asyncore
|
215 |
+
binascii
|
216 |
+
calendar
|
217 |
+
colorsys
|
218 |
+
commands
|
219 |
+
compiler
|
220 |
+
copy_reg
|
221 |
+
cProfile
|
222 |
+
datetime
|
223 |
+
dircache
|
224 |
+
fpformat
|
225 |
+
operator
|
226 |
+
optparse
|
227 |
+
platform
|
228 |
+
plistlib
|
229 |
+
readline
|
230 |
+
resource
|
231 |
+
StringIO
|
232 |
+
symtable
|
233 |
+
tabnanny
|
234 |
+
tempfile
|
235 |
+
textwrap
|
236 |
+
tokenize
|
237 |
+
unittest
|
238 |
+
urlparse
|
239 |
+
UserDict
|
240 |
+
UserList
|
241 |
+
warnings
|
242 |
+
winsound
|
243 |
+
_winreg
|
244 |
+
aetools
|
245 |
+
aetypes
|
246 |
+
audioop
|
247 |
+
autoGIL
|
248 |
+
Bastion
|
249 |
+
cfmfile
|
250 |
+
cPickle
|
251 |
+
decimal
|
252 |
+
difflib
|
253 |
+
doctest
|
254 |
+
dumbdbm
|
255 |
+
filecmp
|
256 |
+
fnmatch
|
257 |
+
getpass
|
258 |
+
gettext
|
259 |
+
hashlib
|
260 |
+
hotshot
|
261 |
+
htmllib
|
262 |
+
httplib
|
263 |
+
imageop
|
264 |
+
imaplib
|
265 |
+
imgfile
|
266 |
+
imputil
|
267 |
+
inspect
|
268 |
+
keyword
|
269 |
+
lib2to3
|
270 |
+
logging
|
271 |
+
macpath
|
272 |
+
mailbox
|
273 |
+
mailcap
|
274 |
+
marshal
|
275 |
+
nntplib
|
276 |
+
numbers
|
277 |
+
os.path
|
278 |
+
pkgutil
|
279 |
+
profile
|
280 |
+
sgmllib
|
281 |
+
smtplib
|
282 |
+
sqlite3
|
283 |
+
statvfs
|
284 |
+
tarfile
|
285 |
+
termios
|
286 |
+
Tkinter
|
287 |
+
urllib2
|
288 |
+
weakref
|
289 |
+
whichdb
|
290 |
+
wsgiref
|
291 |
+
xml.dom
|
292 |
+
xml.sax
|
293 |
+
zipfile
|
294 |
+
aepack
|
295 |
+
anydbm
|
296 |
+
atexit
|
297 |
+
base64
|
298 |
+
binhex
|
299 |
+
bisect
|
300 |
+
Carbon
|
301 |
+
codecs
|
302 |
+
codeop
|
303 |
+
Cookie
|
304 |
+
ctypes
|
305 |
+
curses
|
306 |
+
dbhash
|
307 |
+
DEVICE
|
308 |
+
fpectl
|
309 |
+
ftplib
|
310 |
+
getopt
|
311 |
+
icopen
|
312 |
+
imghdr
|
313 |
+
locale
|
314 |
+
mimify
|
315 |
+
msilib
|
316 |
+
msvcrt
|
317 |
+
parser
|
318 |
+
pickle
|
319 |
+
popen2
|
320 |
+
poplib
|
321 |
+
pprint
|
322 |
+
pstats
|
323 |
+
pyclbr
|
324 |
+
quopri
|
325 |
+
random
|
326 |
+
rfc822
|
327 |
+
select
|
328 |
+
shelve
|
329 |
+
shutil
|
330 |
+
signal
|
331 |
+
sndhdr
|
332 |
+
socket
|
333 |
+
string
|
334 |
+
struct
|
335 |
+
symbol
|
336 |
+
syslog
|
337 |
+
thread
|
338 |
+
timeit
|
339 |
+
turtle
|
340 |
+
urllib
|
341 |
+
xdrlib
|
342 |
+
array
|
343 |
+
bsddb
|
344 |
+
cgitb
|
345 |
+
chunk
|
346 |
+
cmath
|
347 |
+
crypt
|
348 |
+
email
|
349 |
+
errno
|
350 |
+
fcntl
|
351 |
+
heapq
|
352 |
+
MacOS
|
353 |
+
mhlib
|
354 |
+
mutex
|
355 |
+
netrc
|
356 |
+
pipes
|
357 |
+
posix
|
358 |
+
pydoc
|
359 |
+
Queue
|
360 |
+
rexec
|
361 |
+
runpy
|
362 |
+
sched
|
363 |
+
shlex
|
364 |
+
smtpd
|
365 |
+
sunau
|
366 |
+
token
|
367 |
+
trace
|
368 |
+
types
|
369 |
+
aifc
|
370 |
+
code
|
371 |
+
copy
|
372 |
+
gdbm
|
373 |
+
glob
|
374 |
+
gzip
|
375 |
+
hmac
|
376 |
+
jpeg
|
377 |
+
json
|
378 |
+
math
|
379 |
+
mmap
|
380 |
+
repr
|
381 |
+
sets
|
382 |
+
site
|
383 |
+
spwd
|
384 |
+
stat
|
385 |
+
test
|
386 |
+
time
|
387 |
+
user
|
388 |
+
uuid
|
389 |
+
wave
|
390 |
+
zlib
|
391 |
+
abc
|
392 |
+
ast
|
393 |
+
bdb
|
394 |
+
bz2
|
395 |
+
cgi
|
396 |
+
cmd
|
397 |
+
csv
|
398 |
+
dbm
|
399 |
+
dis
|
400 |
+
flp
|
401 |
+
grp
|
402 |
+
imp
|
403 |
+
md5
|
404 |
+
Nav
|
405 |
+
new
|
406 |
+
nis
|
407 |
+
pdb
|
408 |
+
pty
|
409 |
+
pwd
|
410 |
+
sha
|
411 |
+
ssl
|
412 |
+
sys
|
413 |
+
Tix
|
414 |
+
ttk
|
415 |
+
tty
|
416 |
+
xml
|
417 |
+
al
|
418 |
+
AL
|
419 |
+
cd
|
420 |
+
dl
|
421 |
+
FL
|
422 |
+
fl
|
423 |
+
fm
|
424 |
+
gc
|
425 |
+
gl
|
426 |
+
GL
|
427 |
+
ic
|
428 |
+
io
|
429 |
+
os
|
430 |
+
re
|
431 |
+
uu
|
432 |
+
W
|
langs/python/python.txt
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### PYTHON LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
CASE_INSENSITIVE = ON
|
6 |
+
|
7 |
+
NAME Python
|
8 |
+
VERSION 1.0
|
9 |
+
|
10 |
+
COMMENT (#[^\r\n]*)
|
11 |
+
STRING (?default)
|
12 |
+
|
13 |
+
FUNCTION:KEYWORD \b(?alt:function.txt)\b
|
14 |
+
MODULE:KEYWORD \b(?alt:module.txt)\b
|
15 |
+
EXCEPTION:KEYWORD \b(?alt:exception.txt)\b
|
16 |
+
STATEMENT \b(?alt:statement.txt)\b
|
17 |
+
RESERVED \b(?alt:reserved.txt)\b
|
18 |
+
TYPE \b(?alt:type.txt)\b
|
19 |
+
MODIFIER \b(?alt:modifier.txt)\b
|
20 |
+
|
21 |
+
ENTITY (?default)
|
22 |
+
# TODO: capture variables like "return variable"
|
23 |
+
VARIABLE (?default)
|
24 |
+
IDENTIFIER (?default)
|
25 |
+
CONSTANT (?default)
|
26 |
+
OPERATOR (?default)
|
27 |
+
SYMBOL (?default)
|
langs/python/reserved.txt
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
NotImplemented
|
2 |
+
__builtin__
|
3 |
+
__future__
|
4 |
+
__debug__
|
5 |
+
copyright
|
6 |
+
__main__
|
7 |
+
Ellipsis
|
8 |
+
_winreg
|
9 |
+
license
|
10 |
+
credits
|
11 |
+
import
|
12 |
+
lambda
|
13 |
+
print
|
14 |
+
yield
|
15 |
+
pass
|
16 |
+
exec
|
17 |
+
del
|
18 |
+
def
|
langs/python/statement.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
continue
|
2 |
+
finally
|
3 |
+
assert
|
4 |
+
except
|
5 |
+
return
|
6 |
+
while
|
7 |
+
break
|
8 |
+
raise
|
9 |
+
from
|
10 |
+
elif
|
11 |
+
with
|
12 |
+
else
|
13 |
+
and
|
14 |
+
not
|
15 |
+
for
|
16 |
+
try
|
17 |
+
as
|
18 |
+
or
|
19 |
+
if
|
20 |
+
in
|
21 |
+
is
|
langs/python/type.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
None
|
2 |
+
class
|
3 |
+
False
|
4 |
+
True
|
langs/readme.txt
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
====================================================================================================
|
2 |
+
A QUICK HOW-TO ABOUT CRAYON LANGUAGE FILES v.1.0
|
3 |
+
For updated info, visit http://ak.net84.net/ or check out twitter.com/crayonsyntax
|
4 |
+
====================================================================================================
|
5 |
+
|
6 |
+
----------------------------------------------------------------------------------------------------
|
7 |
+
KNOWN ELEMENTS
|
8 |
+
----------------------------------------------------------------------------------------------------
|
9 |
+
These are known, recognised and highlighted by Crayon. You can defined others, but if you want to
|
10 |
+
highlight them, you must add your custom CSS class into a Theme file.
|
11 |
+
|
12 |
+
NAME CSS Class
|
13 |
+
-------------------------------------
|
14 |
+
COMMENT [c]
|
15 |
+
STRING [s]
|
16 |
+
|
17 |
+
KEYWORD [k]
|
18 |
+
STATEMENT [st]
|
19 |
+
RESERVED [r]
|
20 |
+
TYPE [t]
|
21 |
+
MODIFIER [m]
|
22 |
+
|
23 |
+
IDENTIFIER [i]
|
24 |
+
ENTITY [e]
|
25 |
+
VARIABLE [v]
|
26 |
+
|
27 |
+
CONSTANT [cn]
|
28 |
+
|
29 |
+
OPERATOR [o]
|
30 |
+
|
31 |
+
SYMBOL [sy]
|
32 |
+
|
33 |
+
NOTATION [n]
|
34 |
+
|
35 |
+
FADED [f]
|
36 |
+
|
37 |
+
HTML_CHAR [h]
|
38 |
+
|
39 |
+
Read more about these in the online documentation (see link above).
|
40 |
+
|
41 |
+
----------------------------------------------------------------------------------------------------
|
42 |
+
RULES
|
43 |
+
----------------------------------------------------------------------------------------------------
|
44 |
+
# Global
|
45 |
+
- Whitespace must be used to separate element names, css classes and regex
|
46 |
+
- Must be defined on a single line
|
47 |
+
# Elements
|
48 |
+
- Defined as ELEMENT_NAME [css] REGEX, in that order only
|
49 |
+
- Names cannot contain whitespace: [-_a-zA-Z]+[-_a-zA-Z0-9]*
|
50 |
+
- When defining an unknown element, you can specify a fallback with a colon:
|
51 |
+
e.g. MAGIC_WORD:KEYWORD [mg] \bmagic|words|here\b
|
52 |
+
- If the Theme doesn't support the '.mg' class, it will still highlight using the KEYWORD
|
53 |
+
class '.k'
|
54 |
+
- Add support for the '.mg' class by adding it at the bottom of the Theme CSS file, after
|
55 |
+
the fallback
|
56 |
+
- If duplicate exists, it replaces previous
|
57 |
+
# CSS
|
58 |
+
- CSS classes are defined in [square brackets], they are optional.
|
59 |
+
- No need to use '.' in class name. All characters are converted to lowercase and dots removed.
|
60 |
+
- If you use a space, then two classes are applied to the element matches.
|
61 |
+
e.g. [first second]
|
62 |
+
- If not specified, either default is used (if element is known), or element name is used
|
63 |
+
- Class can be applied to multiple elements
|
64 |
+
- Class should be valid: [-_a-zA-Z]+[-_a-zA-Z0-9]*
|
65 |
+
- If class is invalid, element is still parsed, error reported
|
66 |
+
# Regex
|
67 |
+
- Written as per normal, without delimiters or escaping
|
68 |
+
- Applied in the order they appear in the file
|
69 |
+
If language has reserved keywords, these should be higher than variables
|
70 |
+
- Whitespace around regex is ignored - only first character to last forms regex
|
71 |
+
- If single space is intended, use \s to avoid conflict with whitespace used for separation
|
72 |
+
e.g. TEST [t] \s\s\shello
|
73 |
+
# Comments
|
74 |
+
- can be added to this file using # // or /* */
|
75 |
+
- // # and /* must be the first non-whitespace characters on that line
|
76 |
+
- The */ must be on a line by itself
|
77 |
+
|
78 |
+
----------------------------------------------------------------------------------------------------
|
79 |
+
SPECIAL FUNCTIONS
|
80 |
+
----------------------------------------------------------------------------------------------------
|
81 |
+
- Written inside regex, replaced by their outputs when regex is parsed.
|
82 |
+
# (?alt:file.txt)
|
83 |
+
- Import lines from a file and separate with alternation
|
84 |
+
e.g. catdog|dog|cat
|
85 |
+
- File should list words from longest to shortest to avoid clashes
|
86 |
+
# (?default)
|
87 |
+
(?default:element_name)
|
88 |
+
- Substitute regex with Default language's regex for that element, or a specific element
|
89 |
+
given after a colon.
|
90 |
+
# (?html:somechars)
|
91 |
+
- Convert somechars to html entities
|
92 |
+
e.g. (?html:<>"'&) becomes <>"&
|
langs/vb/modifier.txt
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
NotInheritable
|
2 |
+
NotOverridable
|
3 |
+
WriteOnly
|
4 |
+
Assembly
|
5 |
+
Optional
|
6 |
+
Preserve
|
7 |
+
ReadOnly
|
8 |
+
Explicit
|
9 |
+
Shadows
|
10 |
+
Unicode
|
11 |
+
Default
|
12 |
+
Variant
|
13 |
+
Friend
|
14 |
+
Shared
|
15 |
+
ByRef
|
16 |
+
ByVal
|
17 |
+
Auto
|
18 |
+
Ansi
|
19 |
+
Lib
|
langs/vb/reserved.txt
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
RemoveHandler
|
2 |
+
MustOverride
|
3 |
+
MustInherit
|
4 |
+
Overridable
|
5 |
+
AddHandler
|
6 |
+
DirectCast
|
7 |
+
AddressOf
|
8 |
+
Overloads
|
9 |
+
Overrides
|
10 |
+
Delegate
|
11 |
+
Inherits
|
12 |
+
SyncLock
|
13 |
+
AndAlso
|
14 |
+
Declare
|
15 |
+
GetType
|
16 |
+
Handles
|
17 |
+
Handles
|
18 |
+
Imports
|
19 |
+
MyClass
|
20 |
+
Variant
|
21 |
+
MyBase
|
22 |
+
Option
|
23 |
+
TypeOf
|
24 |
+
Select
|
25 |
+
Erase
|
26 |
+
ReDim
|
27 |
+
Exit
|
28 |
+
Loop
|
29 |
+
Like
|
30 |
+
Next
|
31 |
+
Dim
|
32 |
+
Get
|
33 |
+
Let
|
34 |
+
Mod
|
35 |
+
New
|
36 |
+
Xor
|
37 |
+
Me
|
langs/vb/statement.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
RaiseEvent
|
2 |
+
WithEvents
|
3 |
+
Option
|
4 |
+
Resume
|
5 |
+
OrElse
|
6 |
+
GoSub
|
7 |
+
Until
|
8 |
+
Call
|
9 |
+
Step
|
10 |
+
Stop
|
11 |
+
When
|
12 |
+
With
|
13 |
+
End
|
langs/vb/type.txt
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#ExternalSource
|
2 |
+
ParamArray
|
3 |
+
Structure
|
4 |
+
Decimal
|
5 |
+
Nothing
|
6 |
+
CShort
|
7 |
+
Module
|
8 |
+
Single
|
9 |
+
#Const
|
10 |
+
Event
|
11 |
+
Alias
|
12 |
+
Class
|
13 |
+
CType
|
14 |
+
CBool
|
15 |
+
CByte
|
16 |
+
CChar
|
17 |
+
CDate
|
18 |
+
Error
|
19 |
+
CInt
|
20 |
+
CLng
|
21 |
+
CObj
|
22 |
+
CSng
|
23 |
+
CStr
|
24 |
+
Date
|
25 |
+
CDec
|
26 |
+
CDbl
|
27 |
+
Set
|
28 |
+
Sub
|
langs/vb/vb.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### VB LANGUAGE ###
|
2 |
+
|
3 |
+
# ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
|
4 |
+
|
5 |
+
NAME Visual Basic
|
6 |
+
VERSION 1.0
|
7 |
+
|
8 |
+
COMMENT ((?<=[\n\s])REM[\t ][^\r\n]*)|('[^\r\n]*)
|
9 |
+
STRING ((?<!\\)".*?(?<!\\)")
|
10 |
+
|
11 |
+
STATEMENT (?default)|\b(?alt:statement.txt)\b
|
12 |
+
RESERVED (?default)|\b(?alt:reserved.txt)\b
|
13 |
+
TYPE (?default)|\b(?alt:type.txt)\b
|
14 |
+
MODIFIER (?default)|\b(?alt:modifier.txt)\b
|
15 |
+
|
16 |
+
ENTITY (?default)
|
17 |
+
VARIABLE (?default)
|
18 |
+
IDENTIFIER (?default)
|
19 |
+
CONSTANT (?default)
|
20 |
+
OPERATOR (?default)
|
21 |
+
SYMBOL (?default)
|
log.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
==============================================================================
|
2 |
+
Crayon Syntax Highlighter Log Entry
|
3 |
+
==============================================================================
|
4 |
+
10:41:38 AM - 10 Aug 2011
|
5 |
+
string(106) "The provided URL ('/Users/Aram/Development/Web/crayon/fwfwewf') could not be accessed locally or remotely."
|
6 |
+
------------------------------------------------------------------------------
|
readme.txt
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: akarmenia
|
3 |
+
Donate link: http://ak.net84.net/
|
4 |
+
Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter
|
5 |
+
Requires at least: 3.0
|
6 |
+
Tested up to: 3.2.1
|
7 |
+
Stable tag: 1.0.0
|
8 |
+
|
9 |
+
Syntax Highlighter supporting multiple languages, themes, highlighting from a URL, local file or post text.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
A Syntax Highlighter built in PHP and jQuery that supports customizable languages and themes.
|
14 |
+
It can highlight from a URL, a local file or Wordpress post text. Crayon makes it easy to manage Language files and define
|
15 |
+
custom language elements with regular expressions.
|
16 |
+
It also supports some neat features like mobile/touchscreen device detection, mouse interactions, toggled plain code, toggled line numbers, tab sizes, error logging and file extension detection just to name a few.
|
17 |
+
|
18 |
+
== Installation ==
|
19 |
+
|
20 |
+
Download the .zip of the plugin and extract the contents. Upload it to the Wordpress plugin directory and activate the plugin.
|
21 |
+
You can change settings and view help under <strong>Settings > Crayon</strong> in the Wordpress Admin.
|
22 |
+
|
23 |
+
== Frequently Asked Questions ==
|
24 |
+
|
25 |
+
= How do I use this thing? =
|
26 |
+
|
27 |
+
<code>[crayon lang="php"] your code [/crayon]</code>
|
28 |
+
<code>[crayon url="http://example.com/code.txt" /]</code>
|
29 |
+
<code>[crayon url="/local-path-defined-in-settings/code.java" /]</code>
|
30 |
+
|
31 |
+
Please see the contextual help under <strong>Settings > Crayon</strong> for quick info about languages, themes, etc.
|
32 |
+
|
33 |
+
= I need help, now! =
|
34 |
+
|
35 |
+
Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
|
36 |
+
|
37 |
+
== Screenshots ==
|
38 |
+
|
39 |
+
Coming soon.
|
40 |
+
|
41 |
+
== Changelog ==
|
42 |
+
|
43 |
+
= 1.0 =
|
44 |
+
* Initial Release. Huzzah!
|
45 |
+
|
46 |
+
== Upgrade Notice ==
|
47 |
+
|
48 |
+
None yet.
|
themes/classic/classic.css
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Theme Name: Classic
|
3 |
+
Description: Clean, crisp and colorful.
|
4 |
+
Version: 1.0
|
5 |
+
Author: Aram Kocharyan
|
6 |
+
Author URI: http://ak.net84.net/
|
7 |
+
*/
|
8 |
+
|
9 |
+
/* Code Style ====================== */
|
10 |
+
.crayon-theme-classic {
|
11 |
+
border: 1px #999 solid !important;
|
12 |
+
text-shadow: none !important;
|
13 |
+
background: #fdfdfd !important;
|
14 |
+
}
|
15 |
+
|
16 |
+
/* Line Numbers */
|
17 |
+
.crayon-theme-classic .crayon-nums {
|
18 |
+
background: #dfefff !important;
|
19 |
+
color: #5499de !important;
|
20 |
+
border-right: 1px solid #b3d3f3 !important;
|
21 |
+
}
|
22 |
+
|
23 |
+
/* Selection */
|
24 |
+
.crayon-theme-classic .crayon-code::selection,
|
25 |
+
.crayon-theme-classic .crayon-code *::selection {
|
26 |
+
background: #ddeeff !important;
|
27 |
+
color: #316ba5 !important;
|
28 |
+
}
|
29 |
+
.crayon-theme-classic::selection,
|
30 |
+
.crayon-theme-classic .crayon-toolbar::selection,
|
31 |
+
.crayon-theme-classic .crayon-toolbar *::selection,
|
32 |
+
.crayon-theme-classic .crayon-nums::selection,
|
33 |
+
.crayon-theme-classic .crayon-nums *::selection {
|
34 |
+
background: transparent !important;
|
35 |
+
}
|
36 |
+
|
37 |
+
/* Striped Lines */
|
38 |
+
.crayon-theme-classic .crayon-striped-line {
|
39 |
+
background: #f7f7f7 !important;
|
40 |
+
border: 1px #CCC !important;
|
41 |
+
}
|
42 |
+
.crayon-theme-classic .crayon-striped-num {
|
43 |
+
background: #c8e1fa !important;
|
44 |
+
border: 1px #CCC !important;
|
45 |
+
color: #317cc5 !important;
|
46 |
+
}
|
47 |
+
|
48 |
+
/* Marked Lines */
|
49 |
+
.crayon-theme-classic .crayon-marked-line {
|
50 |
+
background: #fffee2 !important;
|
51 |
+
border: 1px #e9e579 !important;
|
52 |
+
}
|
53 |
+
.crayon-theme-classic .crayon-marked-num {
|
54 |
+
color: #1561ac !important;
|
55 |
+
background: #b3d3f4 !important;
|
56 |
+
border: 1px #5999d9 !important;
|
57 |
+
}
|
58 |
+
.crayon-theme-classic .crayon-marked-line.crayon-striped-line {
|
59 |
+
background: #faf8d1 !important;
|
60 |
+
}
|
61 |
+
.crayon-theme-classic .crayon-marked-num.crayon-striped-num {
|
62 |
+
background: #9ec5ec !important;
|
63 |
+
color: #105395 !important;
|
64 |
+
}
|
65 |
+
.crayon-theme-classic .crayon-marked-line.crayon-top,
|
66 |
+
.crayon-theme-classic .crayon-marked-num.crayon-top {
|
67 |
+
border-top-style: solid !important;
|
68 |
+
}
|
69 |
+
.crayon-theme-classic .crayon-marked-line.crayon-bottom,
|
70 |
+
.crayon-theme-classic .crayon-marked-num.crayon-bottom {
|
71 |
+
border-bottom-style: solid !important;
|
72 |
+
}
|
73 |
+
|
74 |
+
/* Toolbar */
|
75 |
+
.crayon-theme-classic .crayon-toolbar {
|
76 |
+
background: #DDD !important;
|
77 |
+
border-bottom: 1px #BBB solid !important;
|
78 |
+
}
|
79 |
+
.crayon-theme-classic .crayon-toolbar > div {
|
80 |
+
float: left !important;
|
81 |
+
}
|
82 |
+
.crayon-theme-classic .crayon-toolbar .crayon-tools {
|
83 |
+
float: right !important;
|
84 |
+
}
|
85 |
+
.crayon-theme-classic .crayon-title {
|
86 |
+
color: #333 !important;
|
87 |
+
}
|
88 |
+
.crayon-theme-classic .crayon-language {
|
89 |
+
color: #999 !important;
|
90 |
+
}
|
91 |
+
.crayon-theme-classic a.crayon-button:link {
|
92 |
+
background-color: #F2F2F2 !important;
|
93 |
+
color: #666 !important;
|
94 |
+
}
|
95 |
+
.crayon-theme-classic a.crayon-button:hover,
|
96 |
+
.crayon-theme-classic a.crayon-button.crayon-pressed {
|
97 |
+
background-color: #BBB !important;
|
98 |
+
color: #FFF !important;
|
99 |
+
}
|
100 |
+
.crayon-theme-classic a.crayon-button:active {
|
101 |
+
background-color: #F2F2F2 !important;
|
102 |
+
color: #666 !important;
|
103 |
+
}
|
104 |
+
/* End Code Style ================== */
|
105 |
+
|
106 |
+
/* Syntax Highlighting ============= */
|
107 |
+
.crayon-theme-classic .crayon-pre .c {
|
108 |
+
color: #ff8000 !important;
|
109 |
+
}
|
110 |
+
.crayon-theme-classic .crayon-pre .s {
|
111 |
+
color: #008000 !important;
|
112 |
+
}
|
113 |
+
.crayon-theme-classic .crayon-pre .k,
|
114 |
+
.crayon-theme-classic .crayon-pre .st,
|
115 |
+
.crayon-theme-classic .crayon-pre .r,
|
116 |
+
.crayon-theme-classic .crayon-pre .t,
|
117 |
+
.crayon-theme-classic .crayon-pre .m {
|
118 |
+
color: #800080 !important;
|
119 |
+
}
|
120 |
+
.crayon-theme-classic .crayon-pre .i {
|
121 |
+
color: #000 !important;
|
122 |
+
}
|
123 |
+
.crayon-theme-classic .crayon-pre .v {
|
124 |
+
color: #002D7A !important;
|
125 |
+
}
|
126 |
+
.crayon-theme-classic .crayon-pre .e {
|
127 |
+
color: #004ed0 !important;
|
128 |
+
}
|
129 |
+
.crayon-theme-classic .crayon-pre .cn {
|
130 |
+
color: #ce0000 !important;
|
131 |
+
}
|
132 |
+
.crayon-theme-classic .crayon-pre .o,
|
133 |
+
.crayon-theme-classic .crayon-pre .h {
|
134 |
+
color: #006fe0 !important;
|
135 |
+
}
|
136 |
+
.crayon-theme-classic .crayon-pre .sy {
|
137 |
+
color: #333 !important;
|
138 |
+
}
|
139 |
+
.crayon-theme-classic .crayon-pre .n {
|
140 |
+
color: #666 !important;
|
141 |
+
font-style: italic;
|
142 |
+
}
|
143 |
+
.crayon-theme-classic .crayon-pre .f {
|
144 |
+
color: #999 !important;
|
145 |
+
}
|
146 |
+
/* End Syntax Highlighting ========= */
|
147 |
+
|
148 |
+
/* End Classic Scheme ============================================ */
|
themes/twilight/twilight.css
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Theme Name: Twilight
|
3 |
+
Description: Dark and elegant.
|
4 |
+
Version: 1.0
|
5 |
+
Author: Aram Kocharyan
|
6 |
+
Author URI: http://ak.net84.net/
|
7 |
+
*/
|
8 |
+
|
9 |
+
/* Code Style ====================== */
|
10 |
+
.crayon-theme-twilight {
|
11 |
+
border: 1px #333 solid !important;
|
12 |
+
text-shadow: none !important;
|
13 |
+
background: #2d2d2d !important;
|
14 |
+
}
|
15 |
+
|
16 |
+
.crayon-theme-twilight span {
|
17 |
+
color: #999 !important;
|
18 |
+
}
|
19 |
+
|
20 |
+
/* Line Numbers */
|
21 |
+
.crayon-theme-twilight .crayon-nums {
|
22 |
+
border-right: 1px solid #333 !important;
|
23 |
+
color: #333 !important;
|
24 |
+
background: #909090 !important;
|
25 |
+
}
|
26 |
+
|
27 |
+
/* Selection */
|
28 |
+
.crayon-theme-twilight .crayon-code::selection,
|
29 |
+
.crayon-theme-twilight .crayon-code *::selection {
|
30 |
+
background: #ddeeff !important;
|
31 |
+
color: #316ba5 !important;
|
32 |
+
}
|
33 |
+
.crayon-theme-twilight::selection,
|
34 |
+
.crayon-theme-twilight .crayon-toolbar::selection,
|
35 |
+
.crayon-theme-twilight .crayon-toolbar *::selection,
|
36 |
+
.crayon-theme-twilight .crayon-nums::selection,
|
37 |
+
.crayon-theme-twilight .crayon-nums *::selection {
|
38 |
+
background: transparent !important;
|
39 |
+
}
|
40 |
+
|
41 |
+
/* Striped Lines */
|
42 |
+
.crayon-theme-twilight .crayon-striped-line {
|
43 |
+
background: #343434 !important;
|
44 |
+
border: 1px #171717 !important;
|
45 |
+
}
|
46 |
+
.crayon-theme-twilight .crayon-striped-num {
|
47 |
+
background: #aaa !important;
|
48 |
+
border: 1px #CCC !important;
|
49 |
+
color: #555 !important;
|
50 |
+
}
|
51 |
+
|
52 |
+
/* Marked Lines */
|
53 |
+
.crayon-theme-twilight .crayon-marked-line {
|
54 |
+
background: #484844 !important;
|
55 |
+
border: 1px #222 !important;
|
56 |
+
}
|
57 |
+
.crayon-theme-twilight .crayon-marked-num {
|
58 |
+
color: #555 !important;
|
59 |
+
background: #bbb !important;
|
60 |
+
border: 1px #777 !important;
|
61 |
+
}
|
62 |
+
.crayon-theme-twilight .crayon-marked-line.crayon-striped-line {
|
63 |
+
background: #51514d !important;
|
64 |
+
}
|
65 |
+
.crayon-theme-twilight .crayon-marked-num.crayon-striped-num {
|
66 |
+
background: #ccc !important;
|
67 |
+
color: #888 !important;
|
68 |
+
}
|
69 |
+
.crayon-theme-twilight .crayon-marked-line.crayon-top,
|
70 |
+
.crayon-theme-twilight .crayon-marked-num.crayon-top {
|
71 |
+
border-top-style: solid !important;
|
72 |
+
}
|
73 |
+
.crayon-theme-twilight .crayon-marked-line.crayon-bottom,
|
74 |
+
.crayon-theme-twilight .crayon-marked-num.crayon-bottom {
|
75 |
+
border-bottom-style: solid !important;
|
76 |
+
}
|
77 |
+
|
78 |
+
/* Toolbar */
|
79 |
+
.crayon-theme-twilight .crayon-toolbar {
|
80 |
+
background: #b2b2b2 !important;
|
81 |
+
border-bottom: 1px #666 solid !important;
|
82 |
+
}
|
83 |
+
.crayon-theme-twilight .crayon-toolbar > div {
|
84 |
+
float: left !important;
|
85 |
+
}
|
86 |
+
.crayon-theme-twilight .crayon-toolbar .crayon-tools {
|
87 |
+
float: right !important;
|
88 |
+
}
|
89 |
+
.crayon-theme-twilight .crayon-title {
|
90 |
+
color: #333 !important;
|
91 |
+
}
|
92 |
+
.crayon-theme-twilight .crayon-language {
|
93 |
+
color: #666 !important;
|
94 |
+
}
|
95 |
+
.crayon-theme-twilight a.crayon-button:link {
|
96 |
+
background-color: #ddd !important;
|
97 |
+
color: #666 !important;
|
98 |
+
}
|
99 |
+
.crayon-theme-twilight a.crayon-button:hover,
|
100 |
+
.crayon-theme-twilight a.crayon-button.crayon-pressed {
|
101 |
+
background-color: #777 !important;
|
102 |
+
color: #ccc !important;
|
103 |
+
}
|
104 |
+
.crayon-theme-twilight a.crayon-button:active {
|
105 |
+
background-color: #F2F2F2 !important;
|
106 |
+
color: #666 !important;
|
107 |
+
}
|
108 |
+
/* End Code Style ================== */
|
109 |
+
|
110 |
+
/* Syntax Highlighting ============= */
|
111 |
+
.crayon-theme-twilight .crayon-pre .c {
|
112 |
+
color: #7f7b80 !important;
|
113 |
+
}
|
114 |
+
.crayon-theme-twilight .crayon-pre .s {
|
115 |
+
color: #a0ab83 !important;
|
116 |
+
}
|
117 |
+
.crayon-theme-twilight .crayon-pre .k,
|
118 |
+
.crayon-theme-twilight .crayon-pre .st,
|
119 |
+
.crayon-theme-twilight .crayon-pre .r,
|
120 |
+
.crayon-theme-twilight .crayon-pre .t,
|
121 |
+
.crayon-theme-twilight .crayon-pre .m {
|
122 |
+
color: #d8b584 !important;
|
123 |
+
}
|
124 |
+
.crayon-theme-twilight .crayon-pre .i {
|
125 |
+
color: #fbefb1 !important;
|
126 |
+
}
|
127 |
+
.crayon-theme-twilight .crayon-pre .v {
|
128 |
+
color: #879ab2 !important;
|
129 |
+
}
|
130 |
+
.crayon-theme-twilight .crayon-pre .e {
|
131 |
+
color: #ad8258 !important;
|
132 |
+
}
|
133 |
+
.crayon-theme-twilight .crayon-pre .cn {
|
134 |
+
color: #db7e64 !important;
|
135 |
+
}
|
136 |
+
.crayon-theme-twilight .crayon-pre .o,
|
137 |
+
.crayon-theme-twilight .crayon-pre .h {
|
138 |
+
color: #ac99ab !important;
|
139 |
+
}
|
140 |
+
.crayon-theme-twilight .crayon-pre .sy {
|
141 |
+
color: #ac99ab !important;
|
142 |
+
}
|
143 |
+
.crayon-theme-twilight .crayon-pre .n {
|
144 |
+
color: #726e73 !important;
|
145 |
+
font-style: italic;
|
146 |
+
}
|
147 |
+
.crayon-theme-twilight .crayon-pre .f {
|
148 |
+
color: #595959 !important;
|
149 |
+
}
|
150 |
+
/* End Syntax Highlighting ========= */
|
151 |
+
|
152 |
+
/* End Classic Scheme ============================================ */
|
util/ajax.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once(dirname(dirname(__FILE__)) . '/crayon_wp.class.php');
|
4 |
+
require_once(CrayonSettingsWP::wp_load_path());
|
5 |
+
|
6 |
+
// Used to send requests to db from jQuery
|
7 |
+
|
8 |
+
if ( array_key_exists(CrayonSettings::HIDE_HELP, $_GET) && $_GET[CrayonSettings::HIDE_HELP] ) {
|
9 |
+
CrayonGlobalSettings::set(CrayonSettings::HIDE_HELP, TRUE);
|
10 |
+
CrayonSettingsWP::save_settings();
|
11 |
+
}
|
12 |
+
|
13 |
+
?>
|
util/crayon_log.class.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once (CRAYON_ROOT_PATH . 'crayon_settings.class.php');
|
3 |
+
|
4 |
+
/* Manages logging variable values to the log file. */
|
5 |
+
class CrayonLog {
|
6 |
+
private static $file = NULL;
|
7 |
+
|
8 |
+
// Logs a variable value to a log file
|
9 |
+
|
10 |
+
public static function log($var = NULL, $title = '') {
|
11 |
+
if ($var === NULL) {
|
12 |
+
// Return log
|
13 |
+
|
14 |
+
if (($log = CrayonUtil::file(CRAYON_LOG_FILE)) !== FALSE) {
|
15 |
+
return $log;
|
16 |
+
} else {
|
17 |
+
return '';
|
18 |
+
}
|
19 |
+
} else {
|
20 |
+
try {
|
21 |
+
if (self::$file == NULL) {
|
22 |
+
self::$file = fopen(CRAYON_LOG_FILE, 'a+'); // TODO why give warning?
|
23 |
+
|
24 |
+
if (self::$file) {
|
25 |
+
$header = CRAYON_DASH . CRAYON_NL . 'Crayon Syntax Highlighter Log Entry' . CRAYON_NL .
|
26 |
+
CRAYON_DASH . CRAYON_NL;
|
27 |
+
fwrite(self::$file, $header);
|
28 |
+
} else {
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
// Capture variable dump
|
33 |
+
|
34 |
+
ob_start();
|
35 |
+
var_dump($var);
|
36 |
+
$buffer = trim(strip_tags(ob_get_clean()));
|
37 |
+
// Remove stupid formatting from wampserver
|
38 |
+
|
39 |
+
$buffer = str_replace(''', '"', $buffer);
|
40 |
+
$title = (!empty($title) && is_string($title) ? "[$title] " : '');
|
41 |
+
// Remove absolute path to plugin directory from buffer
|
42 |
+
|
43 |
+
$buffer = CrayonUtil::path_rel($buffer);
|
44 |
+
$write = $title . date('g:i:s A - d M Y') . CRAYON_NL . $buffer . CRAYON_NL . CRAYON_LINE . CRAYON_NL;
|
45 |
+
// If we exceed max file size, truncate file first
|
46 |
+
|
47 |
+
if (filesize(CRAYON_LOG_FILE) + strlen($write) > CRAYON_LOG_MAX_SIZE) {
|
48 |
+
ftruncate(self::$file, 0);
|
49 |
+
fwrite(self::$file, 'The log has been truncated since it exceeded ' . CRAYON_LOG_MAX_SIZE .
|
50 |
+
' bytes.' . CRAYON_NL . CRAYON_LINE . CRAYON_NL);
|
51 |
+
}
|
52 |
+
clearstatcache();
|
53 |
+
fwrite(self::$file, $write, CRAYON_LOG_MAX_SIZE);
|
54 |
+
} catch (Exception $e) {
|
55 |
+
// Ignore fatal errors
|
56 |
+
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
// Logs system-wide only if global settings permit
|
62 |
+
|
63 |
+
public static function syslog($var = NULL, $title = '') {
|
64 |
+
if (CrayonGlobalSettings::val(CrayonSettings::ERROR_LOG_SYS)) {
|
65 |
+
$title = (empty($title)) ? 'SYSTEM ERROR' : $title;
|
66 |
+
self::log($var, $title);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
public static function clear() {
|
71 |
+
if (!@unlink(CRAYON_LOG_FILE)) {
|
72 |
+
// Will result in nothing if we can't log
|
73 |
+
|
74 |
+
self::log('The log could not be cleared', 'Log Clear');
|
75 |
+
}
|
76 |
+
self::$file = NULL; // Remove file handle
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
public static function email($to) {
|
81 |
+
if (($log_contents = CrayonUtil::file(CRAYON_LOG_FILE)) !== FALSE) {
|
82 |
+
$result = @mail($to, 'Crayon Syntax Highlighter Log', $log_contents);
|
83 |
+
self::log('The log was emailed to the admin.', 'Log Email');
|
84 |
+
} else {
|
85 |
+
// Will result in nothing if we can't email
|
86 |
+
|
87 |
+
self::log("The log could not be emailed to $to.", 'Log Email');
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
?>
|
util/crayon_timer.class.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* Used to measure execution time */
|
4 |
+
class CrayonTimer {
|
5 |
+
const NO_SET = -1;
|
6 |
+
private $start_time = self::NO_SET;
|
7 |
+
|
8 |
+
function __construct() {}
|
9 |
+
|
10 |
+
public function start() {
|
11 |
+
$this->start_time = microtime(true);
|
12 |
+
}
|
13 |
+
|
14 |
+
public function stop() {
|
15 |
+
if ($this->start_time != self::NO_SET) {
|
16 |
+
$end_time = microtime(true) - $this->start_time;
|
17 |
+
$this->start_time = self::NO_SET;
|
18 |
+
return $end_time;
|
19 |
+
} else {
|
20 |
+
return 0;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
}
|
24 |
+
?>
|
util/crayon_util.class.php
ADDED
@@ -0,0 +1,343 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* Common utility functions mainly for formatting, parsing etc. */
|
4 |
+
class CrayonUtil {
|
5 |
+
// Used to detect touchscreen devices
|
6 |
+
private static $touchscreen = NULL;
|
7 |
+
|
8 |
+
/* Return the lines inside a file as an array, options:
|
9 |
+
l - lowercase
|
10 |
+
w - remove whitespace
|
11 |
+
r - escape regex chars
|
12 |
+
c - remove comments
|
13 |
+
s - return as string */
|
14 |
+
public static function lines($path, $opts = NULL) {
|
15 |
+
if ( ($str = self::file($path)) === FALSE ) {
|
16 |
+
// Log failure, n = no log
|
17 |
+
if ( strpos($opts, 'n') === FALSE ) {
|
18 |
+
CrayonLog::syslog("Cannot read lines at '$path'.", "CrayonUtil::lines()");
|
19 |
+
}
|
20 |
+
return FALSE;
|
21 |
+
}
|
22 |
+
// Read the options
|
23 |
+
if (is_string($opts)) {
|
24 |
+
$lowercase = strpos($opts, 'l') !== FALSE;
|
25 |
+
$whitespace = strpos($opts, 'w') !== FALSE;
|
26 |
+
$escape_regex = strpos($opts, 'r') !== FALSE;
|
27 |
+
$clean_commments = strpos($opts, 'c') !== FALSE;
|
28 |
+
$return_string = strpos($opts, 's') !== FALSE;
|
29 |
+
$escape_hash = strpos($opts, 'h') !== FALSE;
|
30 |
+
} else {
|
31 |
+
$lowercase = $whitespace = $escape_regex = $clean_commments = $return_string = $escape_hash = FALSE;
|
32 |
+
}
|
33 |
+
// Remove comments
|
34 |
+
if ($clean_commments) {
|
35 |
+
$str = self::clean_comments($str);
|
36 |
+
}
|
37 |
+
|
38 |
+
// Convert to lowercase if needed
|
39 |
+
if ($lowercase) {
|
40 |
+
$str = strtolower($str);
|
41 |
+
}
|
42 |
+
/* Match all the content on non-empty lines, also remove any whitespace to the left and
|
43 |
+
right if needed */
|
44 |
+
if ($whitespace) {
|
45 |
+
$pattern = '[^\s]+(?:.*[^\s])?';
|
46 |
+
} else {
|
47 |
+
$pattern = '^(?:.*)?';
|
48 |
+
}
|
49 |
+
|
50 |
+
preg_match_all('|' . $pattern . '|m', $str, $matches);
|
51 |
+
$lines = $matches[0];
|
52 |
+
// Remove regex syntax and assume all characters are literal
|
53 |
+
if ($escape_regex) {
|
54 |
+
for ($i = 0; $i < count($lines); $i++) {
|
55 |
+
$lines[$i] = self::esc_regex($lines[$i]);
|
56 |
+
if ($escape_hash || true) {
|
57 |
+
// If we have used \#, then we don't want it to become \\#
|
58 |
+
$lines[$i] = preg_replace('|\\\\\\\\#|', '\#', $lines[$i]);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
// Return as string if needed
|
64 |
+
if ($return_string) {
|
65 |
+
// Add line breaks if they were stripped
|
66 |
+
$delimiter = '';
|
67 |
+
if ($whitespace) {
|
68 |
+
$delimiter = CRAYON_NL;
|
69 |
+
}
|
70 |
+
$lines = implode($lines, $delimiter);
|
71 |
+
}
|
72 |
+
|
73 |
+
return $lines;
|
74 |
+
}
|
75 |
+
|
76 |
+
// Returns the contents of a file
|
77 |
+
public static function file($path) {
|
78 |
+
if ( ($str = @file_get_contents($path)) === FALSE ) {
|
79 |
+
return FALSE;
|
80 |
+
} else {
|
81 |
+
return $str;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
// Detects if device is touchscreen or mobile
|
86 |
+
public static function is_touch() {
|
87 |
+
// Only detect once
|
88 |
+
if (self::$touchscreen !== NULL) {
|
89 |
+
return self::$touchscreen;
|
90 |
+
}
|
91 |
+
if ( ($devices = CrayonUtil::lines(CRAYON_TOUCH_FILE, 'lw')) !== FALSE ) {
|
92 |
+
// Create array of device strings from file
|
93 |
+
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
94 |
+
self::$touchscreen = (CrayonUtil::strposa($user_agent, $devices) !== FALSE);
|
95 |
+
return self::$touchscreen;
|
96 |
+
} else {
|
97 |
+
CrayonLog::syslog('Error occurred when trying to identify touchscreen devices');
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
// Removes duplicates in array, ensures they are all strings
|
102 |
+
public static function array_unique_str($array) {
|
103 |
+
if (!is_array($array) || empty($array)) {
|
104 |
+
return array();
|
105 |
+
}
|
106 |
+
for ($i = 0; $i < count($array); $i++) {
|
107 |
+
$array[$i] = strval($array[$i]);
|
108 |
+
}
|
109 |
+
return array_unique($array);
|
110 |
+
}
|
111 |
+
|
112 |
+
// Same as array_key_exists, but returns the key when exists, else FALSE;
|
113 |
+
public static function array_key_exists($key, $array) {
|
114 |
+
if (!is_array($array) || empty($array) || !is_string($key) || empty($key)) {
|
115 |
+
FALSE;
|
116 |
+
}
|
117 |
+
if ( array_key_exists($key, $array) ) {
|
118 |
+
return $array[$key];
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
// Performs explode() on a string with the given delimiter and trims all whitespace
|
123 |
+
public static function trim_e($str, $delimiter = ',') {
|
124 |
+
if (is_string($delimiter)) {
|
125 |
+
$str = trim(preg_replace('|\s*(?:' . preg_quote($delimiter) . ')\s*|', $delimiter, $str));
|
126 |
+
return explode($delimiter, $str);
|
127 |
+
}
|
128 |
+
return $str;
|
129 |
+
}
|
130 |
+
|
131 |
+
/* Creates an array of integers based on a given range string of format "int - int"
|
132 |
+
Eg. range_str('2 - 5'); */
|
133 |
+
public static function range_str($str) {
|
134 |
+
preg_match('#(\d+)\s*-\s*(\d+)#', $str, $matches);
|
135 |
+
if (count($matches) == 3) {
|
136 |
+
return range($matches[1], $matches[2]);
|
137 |
+
}
|
138 |
+
return FALSE;
|
139 |
+
}
|
140 |
+
|
141 |
+
// Sets a variable to a string if valid
|
142 |
+
public static function str(&$var, $str, $escape = TRUE) {
|
143 |
+
if (is_string($str)) {
|
144 |
+
$var = ($escape == TRUE ? htmlentities($str) : $str);
|
145 |
+
return TRUE;
|
146 |
+
}
|
147 |
+
return FALSE;
|
148 |
+
}
|
149 |
+
|
150 |
+
// Sets a variable to an int if valid
|
151 |
+
public static function num(&$var, $num) {
|
152 |
+
if (is_numeric($num)) {
|
153 |
+
$var = intval($num);
|
154 |
+
return TRUE;
|
155 |
+
}
|
156 |
+
return FALSE;
|
157 |
+
}
|
158 |
+
|
159 |
+
// Sets a variable to an array if valid
|
160 |
+
public static function arr(&$var, $array) {
|
161 |
+
if (is_array($array)) {
|
162 |
+
$var = $array;
|
163 |
+
return TRUE;
|
164 |
+
}
|
165 |
+
return FALSE;
|
166 |
+
}
|
167 |
+
|
168 |
+
// Thanks, http://www.php.net/manual/en/function.str-replace.php#102186
|
169 |
+
function str_replace_once($str_pattern, $str_replacement, $string){
|
170 |
+
if (strpos($string, $str_pattern) !== FALSE){
|
171 |
+
$occurrence = strpos($string, $str_pattern);
|
172 |
+
return substr_replace($string, $str_replacement, strpos($string, $str_pattern), strlen($str_pattern));
|
173 |
+
}
|
174 |
+
return $string;
|
175 |
+
}
|
176 |
+
|
177 |
+
// Removes non-numeric chars in string
|
178 |
+
public static function clean_int($str, $return_zero = TRUE) {
|
179 |
+
$str = preg_replace('#[^\d]#', '', $str);
|
180 |
+
if ($return_zero) {
|
181 |
+
// If '', then returns 0
|
182 |
+
return strval(intval($str));
|
183 |
+
} else {
|
184 |
+
// Might be ''
|
185 |
+
return $str;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
// Removes non-alphanumeric chars in string, replaces spaces with hypthen, makes lowercase
|
190 |
+
public static function clean_css_name($str) {
|
191 |
+
$str = preg_replace('#[^\w\s]#', '', $str);
|
192 |
+
$str = preg_replace('#\s+#', '-', $str);
|
193 |
+
return strtolower($str);
|
194 |
+
}
|
195 |
+
|
196 |
+
// Remove comments with /* */, // or #, if they occur before any other char on a line
|
197 |
+
public static function clean_comments($str) {
|
198 |
+
$comment_pattern = '#(?:^\s*/\*.*?^\s*\*/)|(?:^(?!\s*$)[\s]*(?://|\#)[^\r\n]*)#ms';
|
199 |
+
$str = preg_replace($comment_pattern, '', $str);
|
200 |
+
return $str;
|
201 |
+
}
|
202 |
+
|
203 |
+
// Convert to title case and replace underscores with spaces
|
204 |
+
public static function ucwords($str) {
|
205 |
+
$str = strval($str);
|
206 |
+
$str = str_replace('_', ' ', $str);
|
207 |
+
return ucwords($str);
|
208 |
+
}
|
209 |
+
|
210 |
+
// Escapes regex characters as literals
|
211 |
+
public static function esc_regex($regex) {
|
212 |
+
return /*htmlspecialchars(*/preg_quote($regex)/* , ENT_NOQUOTES)*/;
|
213 |
+
}
|
214 |
+
|
215 |
+
// Escapes regex characters as literals
|
216 |
+
public static function esc_hash($regex) {
|
217 |
+
if (is_string($regex)) {
|
218 |
+
return preg_replace('|(?<!\\\\)#|', '\#', $regex);
|
219 |
+
} else {
|
220 |
+
return FALSE;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
// Removes crayon plugin path from absolute path
|
225 |
+
public static function path_rel($url) {
|
226 |
+
if (is_string($url)) {
|
227 |
+
return str_replace(CRAYON_ROOT_PATH, crayon_slash(), $url);
|
228 |
+
}
|
229 |
+
return $url;
|
230 |
+
}
|
231 |
+
|
232 |
+
// Returns path according to detected use of forwardslash/backslash
|
233 |
+
public static function path($path, $detect) {
|
234 |
+
if (strpos($detect, '\\')) {
|
235 |
+
// Windows
|
236 |
+
$slash = '\\';
|
237 |
+
} else {
|
238 |
+
// UNIX
|
239 |
+
$slash = '/';
|
240 |
+
}
|
241 |
+
return str_replace(array('\\', '/'), $slash, $path);
|
242 |
+
}
|
243 |
+
|
244 |
+
// Returns path using forward slashes
|
245 |
+
public static function path_f_slash($url) {
|
246 |
+
return str_replace('\\', '/', $url);
|
247 |
+
}
|
248 |
+
|
249 |
+
// Append either forward slash or backslash based on environment to paths
|
250 |
+
public static function path_slash($path) {
|
251 |
+
$path = strval($path);
|
252 |
+
if (!empty($path) && !preg_match('#\\\\|/$#', $path)) {
|
253 |
+
$path .= crayon_slash();
|
254 |
+
}
|
255 |
+
return $path;
|
256 |
+
}
|
257 |
+
|
258 |
+
// Append a forward slash to a path if needed
|
259 |
+
public static function url_slash($url) {
|
260 |
+
$url = trim(strval($url));
|
261 |
+
if (!empty($url) && !preg_match('#(/|\\\\)$#', $url)) {
|
262 |
+
$url .= '/';
|
263 |
+
}
|
264 |
+
return $url;
|
265 |
+
}
|
266 |
+
|
267 |
+
// Removes extension from file path
|
268 |
+
public static function path_rem_ext($path) {
|
269 |
+
$path = strval($path);
|
270 |
+
return preg_replace('#\.\w+$#m', '', $path);
|
271 |
+
}
|
272 |
+
|
273 |
+
// strpos with an array of $needles
|
274 |
+
public static function strposa($haystack, $needles) {
|
275 |
+
if (is_array($needles)) {
|
276 |
+
foreach ($needles as $str) {
|
277 |
+
if (is_array($str)) {
|
278 |
+
$pos = CrayonUtil::strposa($haystack, $str);
|
279 |
+
} else {
|
280 |
+
$pos = strpos($haystack, $str);
|
281 |
+
}
|
282 |
+
if ($pos !== FALSE) {
|
283 |
+
return $pos;
|
284 |
+
}
|
285 |
+
}
|
286 |
+
return FALSE;
|
287 |
+
} else {
|
288 |
+
return strpos($haystack, $needles);
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
// tests if $needle is equal to any strings in $haystack
|
293 |
+
public static function str_equal_array($needle, $haystack, $case_insensitive = TRUE) {
|
294 |
+
if (!is_string($needle) || !is_array($haystack)) {
|
295 |
+
return FALSE;
|
296 |
+
}
|
297 |
+
if ($case_insensitive) {
|
298 |
+
$needle = strtolower($needle);
|
299 |
+
}
|
300 |
+
foreach ($haystack as $hay) {
|
301 |
+
if (!is_string($hay)) {
|
302 |
+
continue;
|
303 |
+
}
|
304 |
+
if ($case_insensitive) {
|
305 |
+
$hay = strtolower($hay);
|
306 |
+
}
|
307 |
+
if ($needle == $hay) {
|
308 |
+
return TRUE;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
return FALSE;
|
312 |
+
}
|
313 |
+
|
314 |
+
// Support for singular and plural string variations
|
315 |
+
public static function spnum($int, $singular, $plural = NULL) {
|
316 |
+
if (!is_int($int) || !is_string($singular)) {
|
317 |
+
$int = intval($int);
|
318 |
+
$singular = strval($singular);
|
319 |
+
}
|
320 |
+
if ($plural == NULL || !is_string($plural)) {
|
321 |
+
$plural = $singular . 's';
|
322 |
+
}
|
323 |
+
return $int . ' ' . (($int == 1) ? $singular : $plural);
|
324 |
+
}
|
325 |
+
|
326 |
+
// Turn boolean into Yes/No
|
327 |
+
public static function bool_yn($bool) {
|
328 |
+
return $bool ? 'Yes' : 'No';
|
329 |
+
}
|
330 |
+
|
331 |
+
// Decodes WP html entities
|
332 |
+
public static function html_entity_decode_wp($str) {
|
333 |
+
if (!is_string($str) || empty($str)) {
|
334 |
+
return $str;
|
335 |
+
}
|
336 |
+
// http://www.ascii.cl/htmlcodes.htm
|
337 |
+
$wp_entities = array('‘', '’', '‚', '“', '”');
|
338 |
+
$wp_replace = array('\'', '\'', ',', '"', '"');
|
339 |
+
$str = str_replace($wp_entities, $wp_replace, $str);
|
340 |
+
return $str;
|
341 |
+
}
|
342 |
+
}
|
343 |
+
?>
|
util/exceptions.php
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once ('crayon_util.class.php');
|
3 |
+
|
4 |
+
/* Custom exception that also logs exceptions */
|
5 |
+
class CrayonException extends Exception {
|
6 |
+
|
7 |
+
// message() function used to prevent HTML formatting inside returned messages
|
8 |
+
|
9 |
+
function message() {
|
10 |
+
return html_entity_decode($this->getMessage());
|
11 |
+
}
|
12 |
+
}
|
13 |
+
|
14 |
+
class CrayonErrorException extends ErrorException {
|
15 |
+
|
16 |
+
public function message() {
|
17 |
+
return crayon_exception_message($this); //htmlentities( $this->getMessage() );
|
18 |
+
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
function crayon_exception_message($exception) {
|
23 |
+
return html_entity_decode(CRAYON_NL . '[Line ' . $exception->getLine() . ', ' .
|
24 |
+
basename(CrayonUtil::path_rel($exception->getFile())) .
|
25 |
+
'] ' . CRAYON_NL . $exception->getMessage());
|
26 |
+
}
|
27 |
+
|
28 |
+
function crayon_exception_log($exception) {
|
29 |
+
$info = crayon_exception_info($exception);
|
30 |
+
// Log the exception
|
31 |
+
|
32 |
+
CrayonLog::syslog(strip_tags($info));
|
33 |
+
if (CRAYON_DEBUG) {
|
34 |
+
// Only print when debugging
|
35 |
+
|
36 |
+
echo $info;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
/* Custom handler for CrayonExceptions */
|
41 |
+
function crayon_exception_handler($exception) {
|
42 |
+
try {
|
43 |
+
crayon_exception_log($exception);
|
44 |
+
} catch (Exception $e) {
|
45 |
+
// An error within an error handler. Exception.
|
46 |
+
|
47 |
+
echo '<br/><b>Fatal Exception:</b> ', get_class($e),
|
48 |
+
' thrown within the exception handler.<br/><b>Message:</b> ',
|
49 |
+
$e->getMessage(), '<br/><b>Line:</b> ',
|
50 |
+
CrayonUtil::path_rel($e->getFile()), '<br/><b>Line:</b> ', $e->getLine();
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/* Prints exception info */
|
55 |
+
function crayon_exception_info($e, $return = TRUE) {
|
56 |
+
$print = '<br/><b>Uncaught ' . get_class($e) . ':</b> ' . $e->getMessage() . CRAYON_BL . '<b>File:</b> ' .
|
57 |
+
CrayonUtil::path_rel($e->getFile()) . CRAYON_BL . '<b>Line:</b> ' . $e->getLine() . CRAYON_BL . '<br/>';
|
58 |
+
if ($return) {
|
59 |
+
return $print;
|
60 |
+
} else {
|
61 |
+
echo $print;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
/* Some errors throw catchable exceptions, so we can handle them nicely */
|
66 |
+
function crayon_error_handler($errno, $errstr, $errfile, $errline) {
|
67 |
+
|
68 |
+
if (!(error_reporting() & $errno)) {
|
69 |
+
// This error code is not included in error_reporting
|
70 |
+
|
71 |
+
return;
|
72 |
+
}
|
73 |
+
$e = new CrayonErrorException($errstr, 0, $errno, $errfile, $errline);
|
74 |
+
if (in_array($errno, array(E_ERROR, E_USER_ERROR))) {
|
75 |
+
// Only throw an exception for fatal errors
|
76 |
+
|
77 |
+
throw $e;
|
78 |
+
} else {
|
79 |
+
|
80 |
+
// Treat all other errors as usual
|
81 |
+
|
82 |
+
return false;
|
83 |
+
}
|
84 |
+
// Don't execute PHP internal error handler
|
85 |
+
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
/* Records the old error handlers and reverts back to them when needed. */
|
89 |
+
$old_error_handler = null;
|
90 |
+
$old_exception_handler = null;
|
91 |
+
|
92 |
+
/* Turn on the custom handlers */
|
93 |
+
function crayon_handler_on() {
|
94 |
+
global $old_error_handler, $old_exception_handler;
|
95 |
+
$old_error_handler = set_error_handler('crayon_error_handler');
|
96 |
+
$old_exception_handler = set_exception_handler('crayon_exception_handler');
|
97 |
+
}
|
98 |
+
|
99 |
+
/* Turn off the custom handlers */
|
100 |
+
function crayon_handler_off() {
|
101 |
+
global $old_error_handler, $old_exception_handler;
|
102 |
+
if (!empty($old_error_handler)) {
|
103 |
+
set_error_handler($old_error_handler);
|
104 |
+
}
|
105 |
+
if (!empty($old_exception_handler)) {
|
106 |
+
set_exception_handler($old_exception_handler);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
?>
|
util/help.htm
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p><strong>Using the Shortcode</strong></p>
|
2 |
+
<p>Just add your code between <code>[crayon attributes] ... [/crayon]</code> in HTML view when editing posts. You can optionally provide the following <code>attributes</code>:</p>
|
3 |
+
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="crayon-table crayon-table-light">
|
4 |
+
<tr class="crayon-table-header" >
|
5 |
+
<td width="20">Attribute</td>
|
6 |
+
<td width="60%">Description</td>
|
7 |
+
<td width="30%">Example</td>
|
8 |
+
</tr>
|
9 |
+
<tr>
|
10 |
+
<td width="20">lang</td>
|
11 |
+
<td width="60%">Specify a Language ID, these are the folders in the <code>langs</code> directory and appears in the list of <a href="#langs">Languages</a>.</td>
|
12 |
+
<td width="30%"><code>lang="java"</code></td>
|
13 |
+
</tr>
|
14 |
+
<tr>
|
15 |
+
<td width="20">url</td>
|
16 |
+
<td width="60%">Load a file from the web or a local path. You give a relative local path instead of absolute (see <a href="#files">Files</a>). You can use a closed tag when giving a url: <code>[crayon url="java/code.java" /]</code>. For languages with defined extensions (see <a href="#langs" onclick="show_langs('http://localhost/crayon/wp-content/plugins/crayon/util/list_langs.php');">Languages</a>) you don't even need to provide the <code>lang</code> attribute, as this will be detected if your file ends with it, as in the example.</td>
|
17 |
+
<td width="30%">
|
18 |
+
<code>url="http://example.com/code.java"</code><br />
|
19 |
+
<code>url="java/code.java"</code></td>
|
20 |
+
</tr>
|
21 |
+
<tr>
|
22 |
+
<td width="20">title</td>
|
23 |
+
<td width="60%">Give a title for your code snippet. Appears in the toolbar.</td>
|
24 |
+
<td width="30%"><code>title="Sample"</code></td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<td width="20">mark</td>
|
28 |
+
<td width="60%">Mark some lines as important so they appear highlighted. You can specify single numbers, comma separted, a range, or a combination.</td>
|
29 |
+
<td width="30%"><code>mark="5-10,12"</code></td>
|
30 |
+
</tr>
|
31 |
+
</table>
|
32 |
+
<p>Crayon is versatile so you can override global settings for individual Crayons with attributes. Here are some examples:</p>
|
33 |
+
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="crayon-table crayon-table-light">
|
34 |
+
<tr class="crayon-table-header" >
|
35 |
+
<td width="20">Setting</td>
|
36 |
+
<td width="60%">Description</td>
|
37 |
+
<td width="30%">Example</td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td width="20">theme</td>
|
41 |
+
<td width="60%">Specify a Theme ID, these are the folders in the '\themes' directory.</td>
|
42 |
+
<td width="30%"><code>theme="twilight"</code></td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<td width="20">height</td>
|
46 |
+
<td width="60%">Set the height just like a css property, using 'height', 'max-height' or 'min-height'. You can also specify pixels or percentage, otherwise it will use global settings.</td>
|
47 |
+
<td width="30%"><code>min-height="100px"</code><br />
|
48 |
+
<code>width="50%"</code></td>
|
49 |
+
</tr>
|
50 |
+
<tr>
|
51 |
+
<td width="20">toolbar-hide</td>
|
52 |
+
<td width="60%">Show/hide the toolbar and controls.</td>
|
53 |
+
<td width="30%"><code>toolbar-hide="true"</code><br />
|
54 |
+
<code>toolbar-hide="false"</code></td>
|
55 |
+
</tr>
|
56 |
+
<tr>
|
57 |
+
<td width="20">nums</td>
|
58 |
+
<td width="60%">Show/hide line numbers.</td>
|
59 |
+
<td width="30%"><code>nums="false"</code></td>
|
60 |
+
</tr>
|
61 |
+
<tr>
|
62 |
+
<td width="20">font-size</td>
|
63 |
+
<td width="60%">Set the font size in pixels.</td>
|
64 |
+
<td width="30%"><code>font-size="20"</code></td>
|
65 |
+
</tr>
|
66 |
+
</table>
|
67 |
+
<p>Here's a simple example of attributes:</p>
|
68 |
+
<p><code>
|
69 |
+
[crayon lang="html" font-size="20" mark="1" width="200px"] <strong>This is great!</strong> [/crayon] </code></p>
|
70 |
+
<p>These are just a few examples. See the <a href="http://ak.net84.net/?go=crayondocs" target="_blank">online documentation</a> for the complete list and their uses. If you want to prevent the <code>[crayon]</code> shortcode from turning into a Crayon, use: <code>$[crayon]...[/crayon]$</code></p>
|
71 |
+
<p><strong>Themes</strong></p>
|
72 |
+
<p>Crayon comes with built-in Themes to style your code. You can learn how to create your own and download more from <a href="http://ak.net84.net/?go=crayonthemes" target="_blank">here</a>. Themes are structured <code>/themes/theme-name/theme-name.css</code>. If you know CSS, take a look at <code>/themes/default/default.css</code> to get an idea of how they work and how you can change/create them.</p>
|
73 |
+
<p><strong>Languages</strong></p>
|
74 |
+
<p>You can customize and create new languages and define how to capture each element (keywords, comments, strings, etc.) with regular expressions. Languages are structured <code>/langs/lang-name/lang-name.txt</code>. Take a look at <code>/langs/default/default.txt</code> and check out the neat regex of the default/generic language. I've also spent considerable time putting together a <a href="{PLUGIN}langs/readme.txt" target="_blank">quick guide</a> in <code>/langs/readme.txt</code> that will be added to the online docs. If your language is missing, send me an <a href="#info" target="_blank">email</a>. There will be more languages added over time, of course.</p>
|
75 |
+
<p><strong>Fonts</strong></p>
|
76 |
+
<p>You can define fonts and font-sizes within Themes, but you can also override the theme's font with those inside <code>/fonts/</code> and also provide @font-face fonts just like in themes - it's just CSS after all.</p>
|
util/list_langs.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once (dirname(dirname(__FILE__)) . '/global.php');
|
3 |
+
require_once (CRAYON_PARSER_PHP);
|
4 |
+
if (($langs = CrayonParser::parse_all()) != FALSE) {
|
5 |
+
echo '<table class="crayon-table" cellspacing="0" cellpadding="0"><tr class="crayon-table-header">',
|
6 |
+
'<td>ID</td><td>Name</td><td>Version</td><td>Mapped Extensions</td><td>State</td></tr>';
|
7 |
+
$keys = array_values($langs);
|
8 |
+
for ($i = 0; $i < count($langs); $i++) {
|
9 |
+
$lang = $keys[$i];
|
10 |
+
$tr = ($i == count($langs) - 1) ? 'crayon-table-last' : '';
|
11 |
+
echo '<tr class="', $tr, '">',
|
12 |
+
'<td>', $lang->id(), '</td>',
|
13 |
+
'<td>', $lang->name(), '</td>',
|
14 |
+
'<td>', $lang->version(), '</td>',
|
15 |
+
'<td>', implode(', ', $lang->ext()), '</td>',
|
16 |
+
'<td class="', CrayonUtil::clean_css_name($lang->state_info()), '">',
|
17 |
+
$lang->state_info(), '</td>',
|
18 |
+
|
19 |
+
'</tr>';
|
20 |
+
}
|
21 |
+
echo '</table><br/>Languages that have the same extension as their name don\'t need to explicitly map extensions.';
|
22 |
+
} else {
|
23 |
+
echo 'No languages could be found.';
|
24 |
+
}
|
25 |
+
?>
|
util/preview.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once (dirname(dirname(__FILE__)) . '/crayon_wp.class.php');
|
4 |
+
$remove = CrayonUtil::path('wp-content/plugins/' . CRAYON_DIR, CRAYON_DIR);
|
5 |
+
$wp_root_path = str_replace($remove, '', CRAYON_ROOT_PATH);
|
6 |
+
require_once ($wp_root_path . 'wp-load.php');
|
7 |
+
echo '<link rel="stylesheet" href="', plugins_url(CRAYON_STYLE, dirname(__FILE__)),
|
8 |
+
'?ver=', CRAYON_VERSION, '" type="text/css" media="all" />';
|
9 |
+
echo '<script type="text/javascript">init();</script>';
|
10 |
+
echo '<div id="content">';
|
11 |
+
CrayonSettingsWP::load_settings(); // Run first to ensure global settings loaded
|
12 |
+
|
13 |
+
$crayon = CrayonWP::instance();
|
14 |
+
|
15 |
+
// Load settings from GET and validate
|
16 |
+
foreach ($_GET as $key => $value) {
|
17 |
+
$_GET[$key] = CrayonSettings::validate($key, $value);
|
18 |
+
}
|
19 |
+
$crayon->settings($_GET);
|
20 |
+
$settings = array(CrayonSettings::TOP_SET => TRUE, CrayonSettings::TOP_MARGIN => 10,
|
21 |
+
CrayonSettings::BOTTOM_SET => FALSE, CrayonSettings::BOTTOM_MARGIN => 0);
|
22 |
+
$crayon->settings($settings);
|
23 |
+
|
24 |
+
$lang = $crayon->setting_val(CrayonSettings::FALLBACK_LANG);
|
25 |
+
|
26 |
+
$path = dirname(__FILE__) . crayon_slash() . 'sample' . crayon_slash() . $lang . '.txt';
|
27 |
+
if ($lang && @file_exists($path)) {
|
28 |
+
$crayon->url($path);
|
29 |
+
} else {
|
30 |
+
$code = <<<EOT
|
31 |
+
// A sample class
|
32 |
+
class Human {
|
33 |
+
private int age = 0;
|
34 |
+
public void birthday() {
|
35 |
+
age++;
|
36 |
+
print('Happy Birthday!');
|
37 |
+
}
|
38 |
+
}
|
39 |
+
EOT;
|
40 |
+
$crayon->code($code);
|
41 |
+
}
|
42 |
+
$crayon->title('Sample Code');
|
43 |
+
|
44 |
+
//$crayon->language('php');
|
45 |
+
$crayon->marked('5-7');
|
46 |
+
$crayon->output($highlight = true, $nums = true, $print = true);
|
47 |
+
echo '</div>';
|
48 |
+
echo 'Change the <a href="#langs">fallback language</a> to change the sample code. Lines 5-7 are marked.';
|
49 |
+
|
50 |
+
?>
|
util/sample/c#.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
using Functions;
|
2 |
+
class FunctionClient {
|
3 |
+
public static void Main(string[] args) {
|
4 |
+
Console.WriteLine("Function Client");
|
5 |
+
if ( args.Length == 0 ) {
|
6 |
+
Console.WriteLine("Usage: FunctionTest ... ");
|
7 |
+
return;
|
8 |
+
}
|
9 |
+
}
|
10 |
+
}
|
util/sample/c++.txt
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* basic elements */
|
2 |
+
html {
|
3 |
+
margin: 0;
|
4 |
+
padding: 0;
|
5 |
+
}
|
6 |
+
body {
|
7 |
+
font: 75% georgia, sans-serif;
|
8 |
+
line-height: 1.88889;
|
9 |
+
color: #555753;
|
10 |
+
background: #fff url(blossoms.jpg) no-repeat bottom right;
|
11 |
+
margin: 0;
|
12 |
+
padding: 0;
|
13 |
+
}
|
14 |
+
p {
|
15 |
+
margin-top: 0;
|
16 |
+
text-align: justify;
|
17 |
+
}
|
util/sample/c.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#include <stdio.h>
|
2 |
+
int main(void) {
|
3 |
+
int x;
|
4 |
+
x = 0;
|
5 |
+
set(&x, 42);
|
6 |
+
printf("%d %d", x);
|
7 |
+
return 0;
|
8 |
+
}
|
util/sample/css.txt
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import url('fonts/monaco/monaco.css');
|
2 |
+
|
3 |
+
/* General ========================= */
|
4 |
+
.crayon-syntax {
|
5 |
+
overflow: hidden !important;
|
6 |
+
position: relative !important;
|
7 |
+
}
|
8 |
+
|
9 |
+
.crayon-syntax .crayon-toolbar {
|
10 |
+
position: relative;
|
11 |
+
overflow: hidden;
|
12 |
+
}
|
util/sample/default.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// A sample class
|
2 |
+
class Human {
|
3 |
+
private int age = 0;
|
4 |
+
public void birthday() {
|
5 |
+
age++;
|
6 |
+
print('Happy Birthday!');
|
7 |
+
}
|
8 |
+
}
|
util/sample/html.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title>Hello HTML</title>
|
5 |
+
</head>
|
6 |
+
<body class="hello">
|
7 |
+
<!-- Howdy -->
|
8 |
+
<p style="font-size: 12px;">Hello World!</p>
|
9 |
+
</body>
|
10 |
+
</html>
|
util/sample/java.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// A sample class
|
2 |
+
class Human extends Mammal implements Humanoid {
|
3 |
+
private int age = 0;
|
4 |
+
public void birthday() {
|
5 |
+
age++;
|
6 |
+
System.out.println('Happy Birthday!');
|
7 |
+
}
|
8 |
+
}
|
util/sample/js.txt
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Convert '-10px' to -10
|
2 |
+
function px_to_int(pixels) {
|
3 |
+
if (typeof pixels != 'string') {
|
4 |
+
return 0;
|
5 |
+
}
|
6 |
+
var result = pixels.replace(/[^-0-9]/g, '');
|
7 |
+
if (result.length == 0) {
|
8 |
+
return 0;
|
9 |
+
} else {
|
10 |
+
return parseInt(result);
|
11 |
+
}
|
12 |
+
}
|
util/sample/objc.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#import <objc/Object.h>
|
2 |
+
@interface Forwarder : Object {
|
3 |
+
id recipient; // The object we want to forward the message to.
|
4 |
+
}
|
5 |
+
// Accessor methods.
|
6 |
+
- (id) recipient;
|
7 |
+
- (id) setRecipient:(id)_recipient;
|
8 |
+
@end
|
util/sample/php.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// A sample class
|
3 |
+
class Human {
|
4 |
+
$age = 0;
|
5 |
+
function birthday() {
|
6 |
+
$age++;
|
7 |
+
echo 'Happy Birthday!';
|
8 |
+
}
|
9 |
+
}
|
10 |
+
?>
|
util/sample/python.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Merge example
|
2 |
+
def mergeWithoutOverlap(oneDict, otherDict):
|
3 |
+
newDict = oneDict.copy()
|
4 |
+
for key in otherDict.keys():
|
5 |
+
if key in oneDict.keys():
|
6 |
+
raise ValueError, "the two dictionaries are sharing keys!"
|
7 |
+
newDict[key] = otherDict[key]
|
8 |
+
return newDict
|
9 |
+
|
util/sample/vb.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Option Explicit
|
2 |
+
Dim Count As Integer
|
3 |
+
Private Sub Form_Load()
|
4 |
+
Count = 0
|
5 |
+
Timer1.Interval = 1000 ' units of milliseconds
|
6 |
+
End Sub
|
7 |
+
Private Sub Timer1_Timer()
|
8 |
+
Count = Count + 1
|
9 |
+
lblCount.Caption = Count
|
10 |
+
End Sub
|
util/settings_list.txt
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
theme
|
2 |
+
font
|
3 |
+
font-size-enable
|
4 |
+
font-size
|
5 |
+
preview
|
6 |
+
height-set
|
7 |
+
height-mode
|
8 |
+
height
|
9 |
+
height-unit
|
10 |
+
width-set
|
11 |
+
width-mode
|
12 |
+
width
|
13 |
+
width-unit
|
14 |
+
top-set
|
15 |
+
top-margin
|
16 |
+
left-set
|
17 |
+
left-margin
|
18 |
+
bottom-set
|
19 |
+
bottom-margin
|
20 |
+
right-set
|
21 |
+
right-margin
|
22 |
+
h-align
|
23 |
+
float-enable
|
24 |
+
toolbar
|
25 |
+
toolbar-overlay
|
26 |
+
toolbar-hide
|
27 |
+
toolbar-delay
|
28 |
+
show-lang
|
29 |
+
show-title
|
30 |
+
striped
|
31 |
+
marking
|
32 |
+
nums
|
33 |
+
nums-toggle
|
34 |
+
trim-whitespace
|
35 |
+
tab-size
|
36 |
+
fallback-lang
|
37 |
+
local-path
|
38 |
+
scroll
|
39 |
+
plain
|
40 |
+
show-plain
|
41 |
+
runtime
|
42 |
+
exp-scroll
|
43 |
+
touchscreen
|
44 |
+
disable-anim
|
45 |
+
error-log
|
46 |
+
error-log-sys
|
47 |
+
error-msg-show
|
48 |
+
error-msg
|
util/touch.txt
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// List of mobile device strings to look for inside the user agent of browsers.
|
2 |
+
// This is used to disable mouseover triggered events and just show the content if possible.
|
3 |
+
Android
|
4 |
+
Mobile
|
5 |
+
Touch
|
6 |
+
Phone
|
7 |
+
Nokia
|
8 |
+
Motorola
|
9 |
+
HTC
|
10 |
+
Blackberry
|
11 |
+
Samsung
|
12 |
+
Ericsson
|
13 |
+
LGE
|
14 |
+
Palm
|
15 |
+
Kindle
|
16 |
+
iPhone
|
17 |
+
iPad
|
18 |
+
iPod
|