Crayon Syntax Highlighter - Version 1.15

Version Description

  • ADDED:
    • The settings page no longer searches through all posts looking for legacy tags until you hit a new "refresh" button. Refreshing will look through all posts for crayon tags, and also mark any that are legacy tags. The same process occurs on an individual basis when saving a post.
    • The settings page shows which posts contains legacy tags, and the buttons do not hide when showing the table.
    • Added theme information to the settings page
    • Improved version updating
    • Code in a new window loses size constraints
    • MS-DOS batch language (thanks to http://www.amigalog.com/?p=334)
    • Minor improvements
  • FIXED:
    • Fancybox issues have been fixed: http://ak.net84.net/crayon/initialising-fancybox-with-custom-objects/
    • max/min-height/width didn't work on Tag Editor
    • Width discrepancy before and after mouseover from 1px border
    • Before and after whitespace didn't display correctly
    • Code opened in a new window didn't display if the current wp theme css was included
    • IE 8 compatibility issues
    • Dropdown of languages in settings and Tag Editor are now sorted by name, not id
    • By default "Display the Tag Editor in any TinyMCE instances on the frontend" is disabled to reduce resources
    • Chinese translation updated
Download this release

Release Info

Developer akarmenia
Plugin Icon wp plugin Crayon Syntax Highlighter
Version 1.15
Comparing to
See all releases

Code changes from version 1.14 to 1.15

Files changed (54) hide show
  1. crayon_formatter.class.php +1 -13
  2. crayon_highlighter.class.php +15 -0
  3. crayon_langs.class.php +57 -36
  4. crayon_settings.class.php +4 -3
  5. crayon_settings_wp.class.php +280 -159
  6. crayon_wp.class.php +167 -142
  7. css/admin_style.css +16 -2
  8. global.php +4 -1
  9. js/crayon.js +803 -859
  10. js/crayon_admin.js +374 -374
  11. js/fancybox/fancybox_init.js +8 -0
  12. js/fancybox/jquery.fancybox.init.pack.js +14 -0
  13. js/fancybox/jquery.fancybox.pack.js +0 -44
  14. js/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  15. js/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  16. js/jquery-ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
  17. js/jquery-ui/images/ui-bg_highlight-soft_100_dbf1ff_1x100.png +0 -0
  18. js/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  19. js/jquery-ui/images/ui-bg_highlight-soft_60_dedede_1x100.png +0 -0
  20. js/jquery-ui/images/ui-bg_highlight-soft_65_f2f2f2_1x100.png +0 -0
  21. js/jquery-ui/images/ui-bg_highlight-soft_75_fefc95_1x100.png +0 -0
  22. js/jquery-ui/images/ui-bg_inset-soft_100_f2f2f2_1x100.png +0 -0
  23. js/jquery-ui/images/ui-icons_0879ef_256x240.png +0 -0
  24. js/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
  25. js/jquery-ui/images/ui-icons_228ef1_256x240.png +0 -0
  26. js/jquery-ui/images/ui-icons_474747_256x240.png +0 -0
  27. js/jquery-ui/images/ui-icons_616161_256x240.png +0 -0
  28. js/jquery-ui/images/ui-icons_ffd27a_256x240.png +0 -0
  29. js/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
  30. js/jquery-ui/jquery-ui.css +383 -0
  31. js/jquery-ui/jquery-ui.js +6 -0
  32. js/util.js +45 -0
  33. langs/applescript/.DS_Store +0 -0
  34. langs/batch/batch.txt +21 -0
  35. langs/batch/builtins.txt +75 -0
  36. langs/batch/keywords.txt +19 -0
  37. langs/delphi/.DS_Store +0 -0
  38. readme.txt +25 -6
  39. themes/ado/ado.css +1 -1
  40. themes/epicgeeks/epicgeeks.css +1 -1
  41. themes/neon/neon.css +5 -5
  42. themes/phiphou/phiphou.css +7 -8
  43. themes/solarized-dark/solarized-dark.css +182 -0
  44. trans/crayon-syntax-highlighter-zh_CN.mo +0 -0
  45. trans/crayon-syntax-highlighter-zh_CN.po +333 -234
  46. util/crayon_log.class.php +1 -1
  47. util/crayon_util.class.php +33 -2
  48. util/sample/batch.txt +11 -0
  49. util/tag-editor/crayon_tag_editor_wp.class.php +11 -12
  50. util/tag-editor/crayon_te.js +17 -49
  51. util/tag-editor/crayon_tinymce.js +1 -0
  52. util/theme-editor/theme_editor.js +31 -94
  53. util/theme-editor/theme_editor.php +17 -15
  54. util/theme-editor/theme_editor_content.php +67 -15
crayon_formatter.class.php CHANGED
@@ -27,9 +27,7 @@ class CrayonFormatter {
27
  public static function format_code($code, $language, $hl = NULL) {
28
  // Ensure the language is defined
29
  if ($language != NULL && $hl->is_highlighted) {
30
-
31
  $code = self::clean_code($code, FALSE, FALSE, FALSE, TRUE);
32
-
33
  /* Perform the replace on the code using the regex, pass the captured matches for
34
  formatting before they are replaced */
35
  try {
@@ -81,15 +79,6 @@ class CrayonFormatter {
81
  public static function print_code($hl, $code, $line_numbers = TRUE, $print = TRUE) {
82
  global $CRAYON_VERSION;
83
 
84
- $before = $hl->setting_val(CrayonSettings::WHITESPACE_BEFORE);
85
- if ($before > 0) {
86
- $code = str_repeat("\n", $before) . $code;
87
- }
88
- $after = $hl->setting_val(CrayonSettings::WHITESPACE_AFTER);
89
- if ($after > 0) {
90
- $code = $code . str_repeat("\n", $after);
91
- }
92
-
93
  // We can print either block or inline, inline is treated differently, factor out common stuff here
94
  $output = '';
95
  // Used for style tag
@@ -224,7 +213,6 @@ class CrayonFormatter {
224
  // Determine whether to print language
225
  $print_lang = '';
226
  // XXX Use for printing the regex
227
- // var_dump($hl->language()->regex()); exit;
228
  if ($hl->language()) {
229
  $lang = $hl->language()->name();
230
  switch ($hl->setting_index(CrayonSettings::SHOW_LANG)) {
@@ -317,7 +305,7 @@ class CrayonFormatter {
317
  $readonly = $touch ? '' : 'readonly';
318
  $print_plain = $print_plain_button = '';
319
  $textwrap = !$hl->setting_val(CrayonSettings::WRAP) ? 'wrap="off"' : '';
320
- $print_plain = '<textarea '.$textwrap.' class="crayon-plain print-no" data-settings="' . $plain_settings . '" '. $readonly .' style="' . $plain_style .' '. $font_style . '">' . self::clean_code($hl->code()) . '</textarea>';
321
  } else {
322
  $print_plain = $plain_settings = $plain_settings = '';
323
  }
27
  public static function format_code($code, $language, $hl = NULL) {
28
  // Ensure the language is defined
29
  if ($language != NULL && $hl->is_highlighted) {
 
30
  $code = self::clean_code($code, FALSE, FALSE, FALSE, TRUE);
 
31
  /* Perform the replace on the code using the regex, pass the captured matches for
32
  formatting before they are replaced */
33
  try {
79
  public static function print_code($hl, $code, $line_numbers = TRUE, $print = TRUE) {
80
  global $CRAYON_VERSION;
81
 
 
 
 
 
 
 
 
 
 
82
  // We can print either block or inline, inline is treated differently, factor out common stuff here
83
  $output = '';
84
  // Used for style tag
213
  // Determine whether to print language
214
  $print_lang = '';
215
  // XXX Use for printing the regex
 
216
  if ($hl->language()) {
217
  $lang = $hl->language()->name();
218
  switch ($hl->setting_index(CrayonSettings::SHOW_LANG)) {
305
  $readonly = $touch ? '' : 'readonly';
306
  $print_plain = $print_plain_button = '';
307
  $textwrap = !$hl->setting_val(CrayonSettings::WRAP) ? 'wrap="off"' : '';
308
+ $print_plain = '<textarea '.$textwrap.' class="crayon-plain print-no" data-settings="' . $plain_settings . '" '. $readonly .' style="' . $plain_style .' '. $font_style . '">' . "\n" . self::clean_code($hl->code()) . '</textarea>';
309
  } else {
310
  $print_plain = $plain_settings = $plain_settings = '';
311
  }
crayon_highlighter.class.php CHANGED
@@ -228,6 +228,21 @@ class CrayonHighlighter {
228
  if ($this->setting_val(CrayonSettings::TRIM_WHITESPACE)) {
229
  $code = preg_replace("#(?:^\\s*\\r?\\n)|(?:\\r?\\n\\s*$)#", '', $code);
230
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  if (!empty($code)) {
232
  $this->code = $code;
233
  // $this->needs_load = FALSE; // No need to load, code provided
228
  if ($this->setting_val(CrayonSettings::TRIM_WHITESPACE)) {
229
  $code = preg_replace("#(?:^\\s*\\r?\\n)|(?:\\r?\\n\\s*$)#", '', $code);
230
  }
231
+
232
+ // Add a \n to the end if one doesn't exist
233
+ if (preg_match('#(?<!\n)$#msi', $code)) {
234
+ $code .= "\n";
235
+ }
236
+
237
+ $before = $this->setting_val(CrayonSettings::WHITESPACE_BEFORE);
238
+ if ($before > 0) {
239
+ $code = str_repeat("\n", $before) . $code;
240
+ }
241
+ $after = $this->setting_val(CrayonSettings::WHITESPACE_AFTER);
242
+ if ($after > 0) {
243
+ $code = $code . str_repeat("\n", $after);
244
+ }
245
+
246
  if (!empty($code)) {
247
  $this->code = $code;
248
  // $this->needs_load = FALSE; // No need to load, code provided
crayon_langs.class.php CHANGED
@@ -3,7 +3,7 @@ require_once ('global.php');
3
  require_once (CRAYON_RESOURCE_PHP);
4
 
5
  class CrayonLangsResourceType {
6
- const EXTENSION = 0;
7
  const ALIAS = 1;
8
  const DELIMITER = 2;
9
  }
@@ -12,18 +12,18 @@ class CrayonLangsResourceType {
12
  class CrayonLangs extends CrayonResourceCollection {
13
  // Properties and Constants ===============================================
14
  // CSS classes for known elements
15
- private static $known_elements = array('COMMENT' => 'c', 'PREPROCESSOR' => 'p', 'STRING' => 's', 'KEYWORD' => 'k',
16
- 'STATEMENT' => 'st', 'RESERVED' => 'r', 'TYPE' => 't', 'TAG' => 'ta', 'MODIFIER' => 'm', 'IDENTIFIER' => 'i',
17
- 'ENTITY' => 'e', 'VARIABLE' => 'v', 'CONSTANT' => 'cn', 'OPERATOR' => 'o', 'SYMBOL' => 'sy',
18
  'NOTATION' => 'n', 'FADED' => 'f', CrayonParser::HTML_CHAR => 'h', CrayonParser::CRAYON_ELEMENT => 'crayon-internal-element');
19
  const DEFAULT_LANG = 'default';
20
  const DEFAULT_LANG_NAME = 'Default';
21
-
22
  const RESOURCE_TYPE = 'CrayonLangsResourceType';
23
-
24
  // Used to cache the objects, since they are unlikely to change during a single run
25
  private static $resource_cache = array();
26
-
27
  // Methods ================================================================
28
  public function __construct() {
29
  $this->set_default(self::DEFAULT_LANG, self::DEFAULT_LANG_NAME);
@@ -40,7 +40,7 @@ class CrayonLangs extends CrayonResourceCollection {
40
  parent::load_process();
41
  $this->load_exts();
42
  $this->load_aliases();
43
- $this->load_delimiters(); // TODO check for setting?
44
  }
45
 
46
  // XXX Override
@@ -62,7 +62,7 @@ class CrayonLangs extends CrayonResourceCollection {
62
  public function detect($path, $fallback_id = NULL) {
63
  $this->load();
64
  extract(pathinfo($path));
65
-
66
  // If fallback id if given
67
  if ($fallback_id == NULL) {
68
  // Otherwise use global fallback
@@ -72,7 +72,7 @@ class CrayonLangs extends CrayonResourceCollection {
72
  $fallback = $this->get($fallback_id);
73
  // Use extension before trying fallback
74
  $extension = isset($extension) ? $extension : '';
75
-
76
  if ( !empty($extension) && ($lang = $this->ext($extension)) || ($lang = $this->get($extension)) ) {
77
  // If extension is found, attempt to find a language for it.
78
  // If that fails, attempt to load a language with the same id as the extension.
@@ -99,10 +99,10 @@ class CrayonLangs extends CrayonResourceCollection {
99
  }
100
  }
101
  }
102
-
103
  /* Load all extensions and add them into each language. */
104
  private function load_aliases() {
105
- // Load only once
106
  if (!$this->is_state_loading()) {
107
  return;
108
  }
@@ -113,10 +113,10 @@ class CrayonLangs extends CrayonResourceCollection {
113
  }
114
  }
115
  }
116
-
117
  /* Load all extensions and add them into each language. */
118
  private function load_delimiters() {
119
- // Load only once
120
  if (!$this->is_state_loading()) {
121
  return;
122
  }
@@ -127,7 +127,7 @@ class CrayonLangs extends CrayonResourceCollection {
127
  }
128
  }
129
  }
130
-
131
  // Used to load aliases and extensions to languages
132
  private function load_attr_file($path) {
133
  if ( ($lines = CrayonUtil::lines($path, 'lwc')) !== FALSE) {
@@ -157,7 +157,7 @@ class CrayonLangs extends CrayonResourceCollection {
157
  }
158
  return FALSE;
159
  }
160
-
161
  /* Returns the CrayonLang for the given alias */
162
  public function alias($alias) {
163
  $this->load();
@@ -168,15 +168,15 @@ class CrayonLangs extends CrayonResourceCollection {
168
  }
169
  return FALSE;
170
  }
171
-
172
  /* Fetches a resource. Type is an int from CrayonLangsResourceType. */
173
  public function fetch($type, $reload = FALSE, $keep_empty_fetches = FALSE) {
174
  $this->load();
175
-
176
  if (!array_key_exists($type, self::$resource_cache) || $reload) {
177
  $fetches = array();
178
  foreach ($this->get() as $lang) {
179
-
180
  switch ($type) {
181
  case CrayonLangsResourceType::EXTENSION:
182
  $fetch = $lang->ext();
@@ -190,7 +190,7 @@ class CrayonLangs extends CrayonResourceCollection {
190
  default:
191
  return FALSE;
192
  }
193
-
194
  if ( !empty($fetch) || $keep_empty_fetches ) {
195
  $fetches[$lang->id()] = $fetch;
196
  }
@@ -199,19 +199,19 @@ class CrayonLangs extends CrayonResourceCollection {
199
  }
200
  return self::$resource_cache[$type];
201
  }
202
-
203
  public function extensions($reload = FALSE) {
204
  return $this->fetch(CrayonLangsResourceType::EXTENSION, $reload);
205
  }
206
-
207
  public function aliases($reload = FALSE) {
208
  return $this->fetch(CrayonLangsResourceType::ALIAS, $reload);
209
  }
210
-
211
  public function delimiters($reload = FALSE) {
212
  return $this->fetch(CrayonLangsResourceType::DELIMITER, $reload);
213
  }
214
-
215
  public function extensions_inverted($reload = FALSE) {
216
  $extensions = $this->extensions($reload);
217
  $inverted = array();
@@ -222,7 +222,7 @@ class CrayonLangs extends CrayonResourceCollection {
222
  }
223
  return $inverted;
224
  }
225
-
226
  public function ids_and_aliases($reload = FALSE) {
227
  $fetch = $this->fetch(CrayonLangsResourceType::ALIAS, $reload, TRUE);
228
  foreach ($fetch as $id=>$alias_array) {
@@ -230,8 +230,8 @@ class CrayonLangs extends CrayonResourceCollection {
230
  foreach ($alias_array as $alias) {
231
  $ids_and_aliases[] = $alias;
232
  }
233
- }
234
- return $ids_and_aliases;
235
  }
236
 
237
  /* Return the array of valid elements or a particular element value */
@@ -250,6 +250,27 @@ class CrayonLangs extends CrayonResourceCollection {
250
  return self::known_elements($name) !== FALSE;
251
  }
252
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  public function is_loaded($id) {
254
  if (is_string($id)) {
255
  return array_key_exists($id, $this->get());
@@ -313,11 +334,11 @@ class CrayonLang extends CrayonVersionResource {
313
  $this->ext[] = $ext;
314
  }
315
  }
316
-
317
  function has_ext($ext) {
318
  return is_string($ext) && in_array($ext, $this->ext);
319
  }
320
-
321
  function alias($alias = NULL) {
322
  if ($alias === NULL) {
323
  return $this->aliases;
@@ -330,22 +351,22 @@ class CrayonLang extends CrayonVersionResource {
330
  $this->aliases[] = $alias;
331
  }
332
  }
333
-
334
  function has_alias($alias) {
335
  return is_string($alias) && in_array($alias, $this->aliases);
336
  }
337
-
338
  function delimiter($delim = NULL) {
339
  if ($delim === NULL) {
340
  return $this->delimiters;
341
- // Convert to regex for capturing delimiters
342
  } else if (is_string($delim) && !empty($delim)) {
343
  $this->delimiters = '(?:'.$delim.')';
344
  } else if (is_array($delim) && !empty($delim)) {
345
  for ($i = 0; $i < count($delim); $i++) {
346
  $delim[$i] = CrayonUtil::esc_atomic($delim[$i]);
347
  }
348
-
349
  $this->delimiters = '(?:'.implode(')|(?:', $delim).')';
350
  }
351
  }
@@ -357,9 +378,9 @@ class CrayonLang extends CrayonVersionResource {
357
  $regexes[] = $element->regex();
358
  }
359
  return '#' . '(?:('. implode(')|(', array_values($regexes)) . '))' . '#' .
360
- ($this->mode(CrayonParser::CASE_INSENSITIVE) ? 'i' : '') .
361
- ($this->mode(CrayonParser::MULTI_LINE) ? 'm' : '') .
362
- ($this->mode(CrayonParser::SINGLE_LINE) ? 's' : '');
363
  } else if (is_string($element) && array_key_exists($element, $this->elements)) {
364
  return $this->elements[$element]->regex();
365
  }
3
  require_once (CRAYON_RESOURCE_PHP);
4
 
5
  class CrayonLangsResourceType {
6
+ const EXTENSION = 0;
7
  const ALIAS = 1;
8
  const DELIMITER = 2;
9
  }
12
  class CrayonLangs extends CrayonResourceCollection {
13
  // Properties and Constants ===============================================
14
  // CSS classes for known elements
15
+ private static $known_elements = array('COMMENT' => 'c', 'PREPROCESSOR' => 'p', 'STRING' => 's', 'KEYWORD' => 'k',
16
+ 'STATEMENT' => 'st', 'RESERVED' => 'r', 'TYPE' => 't', 'TAG' => 'ta', 'MODIFIER' => 'm', 'IDENTIFIER' => 'i',
17
+ 'ENTITY' => 'e', 'VARIABLE' => 'v', 'CONSTANT' => 'cn', 'OPERATOR' => 'o', 'SYMBOL' => 'sy',
18
  'NOTATION' => 'n', 'FADED' => 'f', CrayonParser::HTML_CHAR => 'h', CrayonParser::CRAYON_ELEMENT => 'crayon-internal-element');
19
  const DEFAULT_LANG = 'default';
20
  const DEFAULT_LANG_NAME = 'Default';
21
+
22
  const RESOURCE_TYPE = 'CrayonLangsResourceType';
23
+
24
  // Used to cache the objects, since they are unlikely to change during a single run
25
  private static $resource_cache = array();
26
+
27
  // Methods ================================================================
28
  public function __construct() {
29
  $this->set_default(self::DEFAULT_LANG, self::DEFAULT_LANG_NAME);
40
  parent::load_process();
41
  $this->load_exts();
42
  $this->load_aliases();
43
+ $this->load_delimiters(); // TODO check for setting?
44
  }
45
 
46
  // XXX Override
62
  public function detect($path, $fallback_id = NULL) {
63
  $this->load();
64
  extract(pathinfo($path));
65
+
66
  // If fallback id if given
67
  if ($fallback_id == NULL) {
68
  // Otherwise use global fallback
72
  $fallback = $this->get($fallback_id);
73
  // Use extension before trying fallback
74
  $extension = isset($extension) ? $extension : '';
75
+
76
  if ( !empty($extension) && ($lang = $this->ext($extension)) || ($lang = $this->get($extension)) ) {
77
  // If extension is found, attempt to find a language for it.
78
  // If that fails, attempt to load a language with the same id as the extension.
99
  }
100
  }
101
  }
102
+
103
  /* Load all extensions and add them into each language. */
104
  private function load_aliases() {
105
+ // Load only once
106
  if (!$this->is_state_loading()) {
107
  return;
108
  }
113
  }
114
  }
115
  }
116
+
117
  /* Load all extensions and add them into each language. */
118
  private function load_delimiters() {
119
+ // Load only once
120
  if (!$this->is_state_loading()) {
121
  return;
122
  }
127
  }
128
  }
129
  }
130
+
131
  // Used to load aliases and extensions to languages
132
  private function load_attr_file($path) {
133
  if ( ($lines = CrayonUtil::lines($path, 'lwc')) !== FALSE) {
157
  }
158
  return FALSE;
159
  }
160
+
161
  /* Returns the CrayonLang for the given alias */
162
  public function alias($alias) {
163
  $this->load();
168
  }
169
  return FALSE;
170
  }
171
+
172
  /* Fetches a resource. Type is an int from CrayonLangsResourceType. */
173
  public function fetch($type, $reload = FALSE, $keep_empty_fetches = FALSE) {
174
  $this->load();
175
+
176
  if (!array_key_exists($type, self::$resource_cache) || $reload) {
177
  $fetches = array();
178
  foreach ($this->get() as $lang) {
179
+
180
  switch ($type) {
181
  case CrayonLangsResourceType::EXTENSION:
182
  $fetch = $lang->ext();
190
  default:
191
  return FALSE;
192
  }
193
+
194
  if ( !empty($fetch) || $keep_empty_fetches ) {
195
  $fetches[$lang->id()] = $fetch;
196
  }
199
  }
200
  return self::$resource_cache[$type];
201
  }
202
+
203
  public function extensions($reload = FALSE) {
204
  return $this->fetch(CrayonLangsResourceType::EXTENSION, $reload);
205
  }
206
+
207
  public function aliases($reload = FALSE) {
208
  return $this->fetch(CrayonLangsResourceType::ALIAS, $reload);
209
  }
210
+
211
  public function delimiters($reload = FALSE) {
212
  return $this->fetch(CrayonLangsResourceType::DELIMITER, $reload);
213
  }
214
+
215
  public function extensions_inverted($reload = FALSE) {
216
  $extensions = $this->extensions($reload);
217
  $inverted = array();
222
  }
223
  return $inverted;
224
  }
225
+
226
  public function ids_and_aliases($reload = FALSE) {
227
  $fetch = $this->fetch(CrayonLangsResourceType::ALIAS, $reload, TRUE);
228
  foreach ($fetch as $id=>$alias_array) {
230
  foreach ($alias_array as $alias) {
231
  $ids_and_aliases[] = $alias;
232
  }
233
+ }
234
+ return $ids_and_aliases;
235
  }
236
 
237
  /* Return the array of valid elements or a particular element value */
250
  return self::known_elements($name) !== FALSE;
251
  }
252
 
253
+ /* Compare two languages by name */
254
+ public static function langcmp($a, $b) {
255
+ $a = strtolower($a->name());
256
+ $b = strtolower($b->name());
257
+ if ($a == $b) {
258
+ return 0;
259
+ } else {
260
+ return ($a < $b) ? -1 : 1;
261
+ }
262
+ }
263
+
264
+ public static function sort_by_name($langs) {
265
+ // Sort by name
266
+ usort($langs, 'CrayonLangs::langcmp');
267
+ $sorted_lags = array();
268
+ foreach ($langs as $lang) {
269
+ $sorted_lags[$lang->id()] = $lang;
270
+ }
271
+ return $sorted_lags;
272
+ }
273
+
274
  public function is_loaded($id) {
275
  if (is_string($id)) {
276
  return array_key_exists($id, $this->get());
334
  $this->ext[] = $ext;
335
  }
336
  }
337
+
338
  function has_ext($ext) {
339
  return is_string($ext) && in_array($ext, $this->ext);
340
  }
341
+
342
  function alias($alias = NULL) {
343
  if ($alias === NULL) {
344
  return $this->aliases;
351
  $this->aliases[] = $alias;
352
  }
353
  }
354
+
355
  function has_alias($alias) {
356
  return is_string($alias) && in_array($alias, $this->aliases);
357
  }
358
+
359
  function delimiter($delim = NULL) {
360
  if ($delim === NULL) {
361
  return $this->delimiters;
362
+ // Convert to regex for capturing delimiters
363
  } else if (is_string($delim) && !empty($delim)) {
364
  $this->delimiters = '(?:'.$delim.')';
365
  } else if (is_array($delim) && !empty($delim)) {
366
  for ($i = 0; $i < count($delim); $i++) {
367
  $delim[$i] = CrayonUtil::esc_atomic($delim[$i]);
368
  }
369
+
370
  $this->delimiters = '(?:'.implode(')|(?:', $delim).')';
371
  }
372
  }
378
  $regexes[] = $element->regex();
379
  }
380
  return '#' . '(?:('. implode(')|(', array_values($regexes)) . '))' . '#' .
381
+ ($this->mode(CrayonParser::CASE_INSENSITIVE) ? 'i' : '') .
382
+ ($this->mode(CrayonParser::MULTI_LINE) ? 'm' : '') .
383
+ ($this->mode(CrayonParser::SINGLE_LINE) ? 's' : '');
384
  } else if (is_string($element) && array_key_exists($element, $this->elements)) {
385
  return $this->elements[$element]->regex();
386
  }
crayon_settings.class.php CHANGED
@@ -224,7 +224,7 @@ class CrayonSettings {
224
  new CrayonSetting(self::ATTR_SEP, array(':', '_')),
225
  new CrayonSetting(self::EXCERPT_STRIP, FALSE),
226
  new CrayonSetting(self::RANGES, TRUE),
227
- new CrayonSetting(self::TAG_EDITOR_FRONT, TRUE),
228
  new CrayonSetting(self::TAG_EDITOR_SETTINGS, TRUE),
229
  new CrayonSetting(self::WRAP_TOGGLE, TRUE),
230
  new CrayonSetting(self::WRAP, FALSE)
@@ -445,9 +445,10 @@ class CrayonSettings {
445
  $value = CrayonUtil::str_to_bool($value);
446
  }
447
 
448
- if ($name == 'min-height' || $name == 'max-height' || $name == 'height') {
 
449
  self::smart_hw($name, CrayonSettings::HEIGHT_SET, CrayonSettings::HEIGHT_MODE, CrayonSettings::HEIGHT_UNIT, $settings);
450
- } else if ($name == 'min-width' || $name == 'max-width' || $name == 'width') {
451
  self::smart_hw($name, CrayonSettings::WIDTH_SET, CrayonSettings::WIDTH_MODE, CrayonSettings::WIDTH_UNIT, $settings);
452
  } else if ($name == CrayonSettings::FONT_SIZE) {
453
  $settings[CrayonSettings::FONT_SIZE_ENABLE] = TRUE;
224
  new CrayonSetting(self::ATTR_SEP, array(':', '_')),
225
  new CrayonSetting(self::EXCERPT_STRIP, FALSE),
226
  new CrayonSetting(self::RANGES, TRUE),
227
+ new CrayonSetting(self::TAG_EDITOR_FRONT, FALSE),
228
  new CrayonSetting(self::TAG_EDITOR_SETTINGS, TRUE),
229
  new CrayonSetting(self::WRAP_TOGGLE, TRUE),
230
  new CrayonSetting(self::WRAP, FALSE)
445
  $value = CrayonUtil::str_to_bool($value);
446
  }
447
 
448
+ // XXX removed height and width, since it wasn't using the global settings for mode if only height was provided
449
+ if ($name == 'min-height' || $name == 'max-height'/* || $name == 'height'*/) {
450
  self::smart_hw($name, CrayonSettings::HEIGHT_SET, CrayonSettings::HEIGHT_MODE, CrayonSettings::HEIGHT_UNIT, $settings);
451
+ } else if ($name == 'min-width' || $name == 'max-width'/* || $name == 'width'*/) {
452
  self::smart_hw($name, CrayonSettings::WIDTH_SET, CrayonSettings::WIDTH_MODE, CrayonSettings::WIDTH_UNIT, $settings);
453
  } else if ($name == CrayonSettings::FONT_SIZE) {
454
  $settings[CrayonSettings::FONT_SIZE_ENABLE] = TRUE;
crayon_settings_wp.class.php CHANGED
@@ -15,10 +15,13 @@ class CrayonSettingsWP {
15
  private static $options = NULL;
16
  // Posts containing crayons in db
17
  private static $crayon_posts = NULL;
 
 
18
  // An array of cache names for use with Transients API
19
  private static $cache = NULL;
20
  // Array of settings to pass to js
21
  private static $js_settings = NULL;
 
22
  private static $admin_page = '';
23
  private static $is_fully_loaded = FALSE;
24
 
@@ -26,6 +29,7 @@ class CrayonSettingsWP {
26
  const FIELDS = 'crayon_settings';
27
  const OPTIONS = 'crayon_options';
28
  const POSTS = 'crayon_posts';
 
29
  const CACHE = 'crayon_cache';
30
  const GENERAL = 'crayon_general';
31
  const DEBUG = 'crayon_debug';
@@ -65,24 +69,27 @@ class CrayonSettingsWP {
65
 
66
  public static function admin_styles() {
67
  global $CRAYON_VERSION;
68
- wp_enqueue_style('crayon_style', plugins_url(CRAYON_STYLE, __FILE__), array(), $CRAYON_VERSION);
69
- wp_enqueue_style('crayon_global_style', plugins_url(CRAYON_STYLE_GLOBAL, __FILE__), array(), $CRAYON_VERSION);
70
- wp_enqueue_style('crayon_admin_style', plugins_url(CRAYON_STYLE_ADMIN, __FILE__), array(), $CRAYON_VERSION);
71
- wp_enqueue_style('crayon_theme_editor_style', plugins_url(CRAYON_THEME_EDITOR_STYLE, __FILE__), array(), $CRAYON_VERSION);
72
  }
73
 
 
 
 
 
 
 
 
 
 
 
74
  public static function admin_scripts() {
75
  global $CRAYON_VERSION;
76
- wp_enqueue_script('crayon_util_js', plugins_url(CRAYON_JS_UTIL, __FILE__), array('jquery'), $CRAYON_VERSION);
77
- wp_enqueue_script('crayon_admin_js', plugins_url(CRAYON_JS_ADMIN, __FILE__), array('jquery', 'crayon_util_js'), $CRAYON_VERSION);
78
  wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array('jquery'), $CRAYON_VERSION);
79
- wp_enqueue_script('cssjson_js', plugins_url(CRAYON_CSSJSON_JS, __FILE__), $CRAYON_VERSION);
80
  wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('jquery', 'crayon_jquery_popup', 'crayon_util_js'), $CRAYON_VERSION);
81
- if (CRAYON_THEME_EDITOR) {
82
- wp_enqueue_script('crayon_theme_editor', plugins_url(CRAYON_THEME_EDITOR_JS, __FILE__), array('jquery', 'cssjson_js'), $CRAYON_VERSION);
83
- }
84
- // XXX Must come after
85
- self::init_js_settings();
86
  }
87
 
88
  public static function init_js_settings() {
@@ -99,17 +106,31 @@ class CrayonSettingsWP {
99
  'special' => CrayonSettings::SETTING_SPECIAL,
100
  'orig_value' => CrayonSettings::SETTING_ORIG_VALUE
101
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
103
- wp_localize_script('crayon_util_js', 'CrayonSyntaxSettings', self::$js_settings);
104
  }
105
 
106
  public static function settings() {
107
  if (!current_user_can('manage_options')) {
108
  wp_die(crayon__('You do not have sufficient permissions to access this page.'));
109
  }
110
-
111
  // Go through and find all Crayons in posts on each reload
112
- self::scan_and_save_posts();
113
 
114
  ?>
115
 
@@ -216,7 +237,7 @@ class CrayonSettingsWP {
216
  update_option(self::OPTIONS, $settings);
217
  }
218
 
219
- // Crayons posts
220
 
221
  /**
222
  * This loads the posts marked as containing Crayons
@@ -233,12 +254,12 @@ class CrayonSettingsWP {
233
  return self::$crayon_posts;
234
  }
235
 
236
- /**
237
- * This looks through all posts and marks those which contain Crayons
238
  */
239
- public static function scan_and_save_posts() {
240
- self::save_posts(CrayonWP::scan_posts(TRUE, TRUE));
241
- }
242
 
243
  /**
244
  * Saves the marked posts to the db
@@ -251,8 +272,8 @@ class CrayonSettingsWP {
251
  self::load_posts();
252
  }
253
 
254
- /**
255
- * Adds a post as containing a Crayon
256
  */
257
  public static function add_post($id) {
258
  self::load_posts();
@@ -262,8 +283,8 @@ class CrayonSettingsWP {
262
  self::save_posts();
263
  }
264
 
265
- /**
266
- * Removes a post as not containing a Crayon
267
  */
268
  public static function remove_post($id) {
269
  self::load_posts();
@@ -274,6 +295,75 @@ class CrayonSettingsWP {
274
  unset(self::$crayon_posts[$key]);
275
  self::save_posts();
276
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
 
278
  // Cache
279
 
@@ -377,8 +467,12 @@ class CrayonSettingsWP {
377
  return array();
378
  }
379
  // Convert old tags
380
- if (array_key_exists('convert', $inputs)) {
381
- CrayonWP::convert_tags();
 
 
 
 
382
  }
383
  // Clear the log if needed
384
  if (array_key_exists(self::LOG_CLEAR, $_POST)) {
@@ -614,18 +708,19 @@ class CrayonSettingsWP {
614
  self::checkbox(array(CrayonSettings::RANGES, crayon__('Enable line ranges for showing only parts of code')));
615
  self::checkbox(array(CrayonSettings::NUMS, crayon__('Display line numbers by default')));
616
  self::checkbox(array(CrayonSettings::NUMS_TOGGLE, crayon__('Enable line number toggling')));
617
- self::checkbox(array(CrayonSettings::WRAP, crayon__('Wrap lines by default')));
618
  self::checkbox(array(CrayonSettings::WRAP_TOGGLE, crayon__('Enable line wrap toggling')));
619
  self::span(crayon__('Start line numbers from').' ');
620
  self::textbox(array('id' => CrayonSettings::START_LINE, 'size' => 2, 'break' => TRUE));
621
  echo '</div>';
622
  }
623
-
624
  public static function langs() {
625
  echo '<a name="langs"></a>';
626
  // Specialised dropdown for languages
627
  if (array_key_exists(CrayonSettings::FALLBACK_LANG, self::$options)) {
628
  if (($langs = CrayonParser::parse_all()) != FALSE) {
 
629
  self::span(crayon__('When no language is provided, use the fallback').': ');
630
  self::dropdown(CrayonSettings::FALLBACK_LANG,FALSE,TRUE,TRUE,$langs);
631
  // Information about parsing
@@ -649,118 +744,131 @@ class CrayonSettingsWP {
649
  }
650
  }
651
 
652
- public static function show_langs() {
653
- require_once (CRAYON_PARSER_PHP);
654
- if (($langs = CrayonParser::parse_all()) != FALSE) {
655
- echo '<table class="crayon-table" cellspacing="0" cellpadding="0"><tr class="crayon-table-header">',
656
- '<td>ID</td><td>Name</td><td>Version</td><td>File Extensions</td><td>Aliases</td><td>State</td></tr>';
657
- $keys = array_values($langs);
658
- for ($i = 0; $i < count($langs); $i++) {
659
- $lang = $keys[$i];
660
- $tr = ($i == count($langs) - 1) ? 'crayon-table-last' : '';
661
- echo '<tr class="', $tr, '">',
662
- '<td>', $lang->id(), '</td>',
663
- '<td>', $lang->name(), '</td>',
664
- '<td>', $lang->version(), '</td>',
665
- '<td>', implode(', ', $lang->ext()), '</td>',
666
- '<td>', implode(', ', $lang->alias()), '</td>',
667
- '<td class="', strtolower(CrayonUtil::space_to_hyphen($lang->state_info())), '">',
668
- $lang->state_info(), '</td>',
669
- '</tr>';
670
- }
671
- echo '</table><br/>Languages that have the same extension as their name don\'t need to explicitly map extensions.';
672
- } else {
673
- echo 'No languages could be found.';
674
- }
675
- exit();
 
676
  }
677
 
678
- public static function posts() {
679
- echo '<a name="posts"></a>';
680
- echo '<div id="crayon-subsection-posts-info">'.self::button(array('id'=>'show-posts', 'title'=>crayon__('Show Crayon Posts'))).'<span class="crayon-span-10"></span><a href="http://bit.ly/NQfZN5" target="_blank" class="crayon-question">' . crayon__('?') . '</a></div>' ;
 
 
 
681
  }
682
 
683
  public static function show_posts() {
684
- $posts = self::load_posts();
685
- arsort($posts);
686
-
687
- echo '<table class="crayon-table" cellspacing="0" cellpadding="0"><tr class="crayon-table-header">',
688
- '<td>ID</td><td>Title</td><td>Posted</td><td>Modified</td></tr>';
689
-
690
- for ($i = 0; $i < count($posts); $i++) {
691
- $postID = $posts[$i];
692
- $post = get_post($postID);
693
- $tr = ($i == count($posts) - 1) ? 'crayon-table-last' : '';
694
- echo '<tr class="', $tr, '">',
695
- '<td>', $postID, '</td>',
696
- '<td><a href="', $post->guid ,'" target="_blank">', $post->post_title, '</a></td>',
697
- '<td>', $post->post_date, '</td>',
698
- '<td>', $post->post_modified, '</td>',
699
- '</tr>';
700
- }
701
-
 
 
 
 
 
 
 
 
 
702
  echo '</table>';
703
  exit();
704
  }
705
 
706
- public static function show_preview() {
707
- echo '<div id="content">';
708
-
709
- self::load_settings(); // Run first to ensure global settings loaded
710
-
711
- $crayon = CrayonWP::instance();
712
-
713
- // Settings to prevent from validating
714
  $preview_settings = array();
715
-
716
- // Load settings from GET and validate
717
- foreach ($_GET as $key => $value) {
718
- // echo $key, ' ', $value , '<br/>';
719
- if (!in_array($key, $preview_settings)) {
720
- $_GET[$key] = CrayonSettings::validate($key, $value);
721
- }
722
- }
723
- $crayon->settings($_GET);
724
- if (!isset($crayon_preview_dont_override_get) || !$crayon_preview_dont_override_get) {
725
- $settings = array(CrayonSettings::TOP_SET => TRUE, CrayonSettings::TOP_MARGIN => 10,
726
- CrayonSettings::BOTTOM_SET => FALSE, CrayonSettings::BOTTOM_MARGIN => 0);
727
- $crayon->settings($settings);
728
- }
729
-
730
- // Print the theme CSS
731
- $theme_id = $crayon->setting_val(CrayonSettings::THEME);
732
- if ($theme_id != NULL) {
733
- echo CrayonResources::themes()->get_css($theme_id);
734
- }
735
-
736
- $font_id = $crayon->setting_val(CrayonSettings::FONT);
737
- if ($font_id != NULL /*&& $font_id != CrayonFonts::DEFAULT_FONT*/) {
738
- echo CrayonResources::fonts()->get_css($font_id);
739
- }
740
-
741
- // Load custom code based on language
742
- $lang = $crayon->setting_val(CrayonSettings::FALLBACK_LANG);
743
- $path = crayon_pf( CRAYON_UTIL_PATH . '/sample/' . $lang . '.txt', FALSE );
744
-
745
- if ($lang && @file_exists($path)) {
746
- $crayon->url($path);
747
- } else {
748
- $code = "
749
- // A sample class
750
- class Human {
751
- private int age = 0;
752
- public void birthday() {
753
- age++;
754
- print('Happy Birthday!');
755
- }
756
- }
757
- ";
758
- $crayon->code($code);
759
- }
760
- $crayon->title('Sample Code');
761
- $crayon->marked('5-7');
762
- $crayon->output($highlight = true, $nums = true, $print = true);
763
- echo '</div>';
764
  crayon_load_plugin_textdomain();
765
  exit();
766
  }
@@ -771,27 +879,39 @@ class Human {
771
  $db_theme = '';
772
  }
773
  $themes_array = CrayonResources::themes()->get_array();
774
- self::dropdown(CrayonSettings::THEME,FALSE,TRUE,TRUE,$themes_array);
775
  if ($editor) {
776
  return;
777
  }
778
  // Theme editor
779
  if (CRAYON_THEME_EDITOR) {
780
  // echo '<a id="crayon-theme-editor-button" class="button-primary crayon-admin-button" loading="'. crayon__('Loading...') .'" loaded="'. crayon__('Theme Editor') .'" >'. crayon__('Theme Editor') .'</a></br>';
781
- echo '<div id="crayon-theme-editor-admin-buttons">',
782
- '<a id="crayon-theme-editor-edit-button" class="button-primary crayon-admin-button" loading="', crayon__('Loading...'), '" loaded="', crayon__('Edit'), '" >', crayon__('Edit'), '</a>',
783
- '<a id="crayon-theme-editor-create-button" class="button-primary crayon-admin-button" loading="', crayon__('Loading...'), '" loaded="', crayon__('Create'), '" >', crayon__('Create'), '</a></br></div>';
 
 
 
784
  }
785
  // Preview Box
786
- echo '<div id="crayon-live-preview"></div>';
787
- echo '<div id="crayon-preview-info">';
788
- printf(crayon__('Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 are marked.'), '<a href="#langs">', '</a>');
789
- echo '</div>';
 
 
 
 
 
 
 
 
 
 
790
  // Preview checkbox
791
- echo '<div style="height:10px;"></div>';
792
  self::checkbox(array(CrayonSettings::PREVIEW, crayon__('Enable Live Preview')), FALSE, FALSE);
793
  echo '</select><span class="crayon-span-10"></span>';
794
- self::checkbox(array(CrayonSettings::ENQUEUE_THEMES, crayon__('Enqueue themes in the header (more efficient).') . ' <a href="http://bit.ly/zTUAQV" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
795
  // Check if theme from db is loaded
796
  if (!CrayonResources::themes()->is_loaded($db_theme) || !CrayonResources::themes()->exists($db_theme)) {
797
  echo '<span class="crayon-error">', sprintf(crayon__('The selected theme with id %s could not be loaded'), '<strong>'.$db_theme.'</strong>'), '. </span>';
@@ -817,7 +937,7 @@ class Human {
817
  return;
818
  }
819
  echo '<div style="height:10px;"></div>';
820
- self::checkbox(array(CrayonSettings::ENQUEUE_FONTS, crayon__('Enqueue fonts in the header (more efficient).') . ' <a href="http://bit.ly/zTUAQV" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
821
  }
822
 
823
  public static function code($editor = FALSE) {
@@ -839,7 +959,7 @@ class Human {
839
  echo '<div class="crayon-hide-inline-only">';
840
  self::checkbox(array(CrayonSettings::TRIM_WHITESPACE, crayon__('Remove whitespace surrounding the shortcode content')));
841
  echo '</div>';
842
- self::checkbox(array(CrayonSettings::MIXED, crayon__('Allow Mixed Language Highlighting with delimiters and tags.') . ' <a href="http://bit.ly/ukwts2" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
843
  echo '<div class="crayon-hide-inline-only">';
844
  self::checkbox(array(CrayonSettings::SHOW_MIXED, crayon__('Show Mixed Language Icon (+)')));
845
  echo '</div>';
@@ -852,12 +972,12 @@ class Human {
852
  }
853
 
854
  public static function tags() {
855
- self::checkbox(array(CrayonSettings::CAPTURE_MINI_TAG, crayon__('Capture Mini Tags like [php][/php] as Crayons.') . ' <a href="http://bit.ly/rRZuzk" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
856
- self::checkbox(array(CrayonSettings::INLINE_TAG, crayon__('Capture Inline Tags like {php}{/php} inside sentences.') . ' <a href="http://bit.ly/yFafFL" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
857
- self::checkbox(array(CrayonSettings::INLINE_WRAP, crayon__('Wrap Inline Tags') . ' <a href="http://bit.ly/yFafFL" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
858
- self::checkbox(array(CrayonSettings::BACKQUOTE, crayon__('Capture `backquotes` as &lt;code&gt;') . ' <a href="http://bit.ly/yFafFL" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
859
- self::checkbox(array(CrayonSettings::CAPTURE_PRE, crayon__('Capture &lt;pre&gt; tags as Crayons') . ' <a href="http://bit.ly/rRZuzk" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
860
- self::checkbox(array(CrayonSettings::PLAIN_TAG, crayon__('Enable [plain][/plain] tag.') . ' <a href="http://bit.ly/rRZuzk" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
861
  }
862
 
863
  public static function files() {
@@ -869,7 +989,7 @@ class Human {
869
  }
870
 
871
  public static function tag_editor() {
872
- $can_convert = CrayonWP::can_convert_tags();
873
  if ($can_convert) {
874
  $disabled = '';
875
  $convert_text = crayon__('Convert Legacy Tags');
@@ -878,12 +998,12 @@ class Human {
878
  $convert_text = crayon__('No Legacy Tags Found');
879
  }
880
 
881
- echo '<input type="submit" name="', self::OPTIONS, '[convert]" id="convert" class="button-primary" value="', $convert_text, '"', $disabled, ' />';
882
- echo '<span class="crayon-span-10"></span><span>' . crayon__('Convert existing Crayon tags to Tag Editor format (&lt;pre&gt;)'), '</span>', ' <a href="http://bit.ly/ReRr0i" target="_blank" class="crayon-question">' . crayon__('?') . '</a>', CRAYON_BR, CRAYON_BR;
883
  $sep = sprintf(crayon__('Use %s to separate setting names from values in the &lt;pre&gt; class attribute'),
884
  self::dropdown(CrayonSettings::ATTR_SEP, FALSE, FALSE, FALSE));
885
- echo '<span>', $sep, ' <a href="http://bit.ly/H3xW3D" target="_blank" class="crayon-question">' . crayon__('?') . '</a>', '</span><br/>';
886
- self::checkbox(array(CrayonSettings::TAG_EDITOR_FRONT, crayon__("Display the Tag Editor in any TinyMCE instances on the frontend")));
887
  self::checkbox(array(CrayonSettings::TAG_EDITOR_SETTINGS, crayon__("Display Tag Editor settings on the frontend")));
888
  }
889
 
@@ -891,8 +1011,8 @@ class Human {
891
  echo crayon__('Clear the cache used to store remote code requests'),': ';
892
  self::dropdown(CrayonSettings::CACHE, false);
893
  echo '<input type="submit" id="crayon-cache-clear" name="crayon-cache-clear" class="button-secondary" value="', crayon__('Clear Now'), '" /><br/>';
894
- self::checkbox(array(CrayonSettings::EFFICIENT_ENQUEUE, crayon__('Attempt to load Crayon\'s CSS and JavaScript only when needed').'. <a href="http://ak.net84.net/?p=660" target="_blank" class="crayon-question">'.crayon__('?').'</a>'));
895
- self::checkbox(array(CrayonSettings::SAFE_ENQUEUE, crayon__('Disable enqueuing for page templates that may contain The Loop.') . ' <a href="http://bit.ly/AcWRNY" target="_blank" class="crayon-question">' . crayon__('?') . '</a>'));
896
  self::checkbox(array(CrayonSettings::COMMENTS, crayon__('Allow Crayons inside comments')));
897
  self::checkbox(array(CrayonSettings::EXCERPT_STRIP, crayon__('Remove Crayons from excerpts')));
898
  self::checkbox(array(CrayonSettings::MAIN_QUERY, crayon__('Load Crayons only from the main Wordpress query')));
@@ -976,14 +1096,15 @@ class Human {
976
  </table>';
977
 
978
  }
 
 
 
 
979
 
980
  public static function plugin_row_meta($meta, $file) {
981
  global $CRAYON_DONATE;
982
  if ($file == CrayonWP::basename()) {
983
  $meta[] = '<a href="options-general.php?page=crayon_settings">' . crayon__('Settings') . '</a>';
984
- if (CRAYON_THEME_EDITOR) {
985
- $meta[] = '<a href="options-general.php?page=crayon_settings&subpage=theme_editor">' . crayon__('Theme Editor') . '</a>';
986
- }
987
  $meta[] = '<a href="'.$CRAYON_DONATE.'" target="_blank">' . crayon__('Donate') . '</a>';
988
  }
989
  return $meta;
15
  private static $options = NULL;
16
  // Posts containing crayons in db
17
  private static $crayon_posts = NULL;
18
+ // Posts containing legacy tags in db
19
+ private static $crayon_legacy_posts = NULL;
20
  // An array of cache names for use with Transients API
21
  private static $cache = NULL;
22
  // Array of settings to pass to js
23
  private static $js_settings = NULL;
24
+ private static $admin_js_settings = NULL;
25
  private static $admin_page = '';
26
  private static $is_fully_loaded = FALSE;
27
 
29
  const FIELDS = 'crayon_settings';
30
  const OPTIONS = 'crayon_options';
31
  const POSTS = 'crayon_posts';
32
+ const LEGACY_POSTS = 'crayon_legacy_posts';
33
  const CACHE = 'crayon_cache';
34
  const GENERAL = 'crayon_general';
35
  const DEBUG = 'crayon_debug';
69
 
70
  public static function admin_styles() {
71
  global $CRAYON_VERSION;
72
+ wp_enqueue_style('crayon', plugins_url(CRAYON_STYLE, __FILE__), array(), $CRAYON_VERSION);
73
+ wp_enqueue_style('crayon_global', plugins_url(CRAYON_STYLE_GLOBAL, __FILE__), array(), $CRAYON_VERSION);
74
+ wp_enqueue_style('crayon_admin', plugins_url(CRAYON_STYLE_ADMIN, __FILE__), array(), $CRAYON_VERSION);
75
+ wp_enqueue_style('crayon_theme_editor', plugins_url(CRAYON_THEME_EDITOR_STYLE, __FILE__), array(), $CRAYON_VERSION);
76
  }
77
 
78
+ public static function admin_base_scripts() {
79
+ global $CRAYON_VERSION;
80
+ wp_enqueue_script('crayon_util_js', plugins_url(CRAYON_JS_UTIL, __FILE__), array('jquery'), $CRAYON_VERSION);
81
+ self::init_js_settings();
82
+ if (is_admin()) {
83
+ wp_enqueue_script('crayon_admin_js', plugins_url(CRAYON_JS_ADMIN, __FILE__), array('jquery', 'crayon_util_js'), $CRAYON_VERSION);
84
+ self::init_admin_js_settings();
85
+ }
86
+ }
87
+
88
  public static function admin_scripts() {
89
  global $CRAYON_VERSION;
90
+ self::admin_base_scripts();
 
91
  wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array('jquery'), $CRAYON_VERSION);
 
92
  wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('jquery', 'crayon_jquery_popup', 'crayon_util_js'), $CRAYON_VERSION);
 
 
 
 
 
93
  }
94
 
95
  public static function init_js_settings() {
106
  'special' => CrayonSettings::SETTING_SPECIAL,
107
  'orig_value' => CrayonSettings::SETTING_ORIG_VALUE
108
  );
109
+ wp_localize_script('crayon_util_js', 'CrayonSyntaxSettings', self::$js_settings);
110
+ }
111
+ }
112
+
113
+ public static function init_admin_js_settings() {
114
+ if (!self::$admin_js_settings) {
115
+ $themes_ = CrayonResources::themes()->get();
116
+ $themes = array();
117
+ foreach ($themes_ as $theme) {
118
+ $themes[$theme->id()] = $theme->name();
119
+ }
120
+ self::$admin_js_settings = array(
121
+ 'themes' => $themes,
122
+ 'themes_url' => plugins_url(CRAYON_THEME_DIR, __FILE__)
123
+ );
124
+ wp_localize_script('crayon_admin_js', 'CrayonAdminSettings', self::$admin_js_settings);
125
  }
 
126
  }
127
 
128
  public static function settings() {
129
  if (!current_user_can('manage_options')) {
130
  wp_die(crayon__('You do not have sufficient permissions to access this page.'));
131
  }
 
132
  // Go through and find all Crayons in posts on each reload
133
+ //self::scan_and_save_posts();
134
 
135
  ?>
136
 
237
  update_option(self::OPTIONS, $settings);
238
  }
239
 
240
+ // Crayon posts
241
 
242
  /**
243
  * This loads the posts marked as containing Crayons
254
  return self::$crayon_posts;
255
  }
256
 
257
+ /**
258
+ * This looks through all posts and marks those which contain Crayons
259
  */
260
+ // public static function scan_and_save_posts() {
261
+ // self::save_posts(CrayonWP::scan_posts(TRUE, TRUE));
262
+ // }
263
 
264
  /**
265
  * Saves the marked posts to the db
272
  self::load_posts();
273
  }
274
 
275
+ /**
276
+ * Adds a post as containing a Crayon
277
  */
278
  public static function add_post($id) {
279
  self::load_posts();
283
  self::save_posts();
284
  }
285
 
286
+ /**
287
+ * Removes a post as not containing a Crayon
288
  */
289
  public static function remove_post($id) {
290
  self::load_posts();
295
  unset(self::$crayon_posts[$key]);
296
  self::save_posts();
297
  }
298
+
299
+ public static function remove_posts() {
300
+ self::$crayon_posts = array();
301
+ self::save_posts();
302
+ }
303
+
304
+ // Crayon legacy posts
305
+
306
+ /**
307
+ * This loads the posts marked as containing Crayons
308
+ */
309
+ public static function load_legacy_posts() {
310
+ if (self::$crayon_legacy_posts === NULL) {
311
+ // Load from db
312
+ if (!(self::$crayon_legacy_posts = get_option(self::LEGACY_POSTS))) {
313
+ // Posts don't exist! Scan for them. This will fill self::$crayon_legacy_posts
314
+ self::$crayon_legacy_posts = CrayonWP::scan_legacy_posts();
315
+ update_option(self::LEGACY_POSTS, self::$crayon_legacy_posts);
316
+ }
317
+ }
318
+ return self::$crayon_legacy_posts;
319
+ }
320
+
321
+ /**
322
+ * This looks through all posts and marks those which contain Crayons
323
+ */
324
+ // public static function scan_and_save_posts() {
325
+ // self::save_posts(CrayonWP::scan_posts(TRUE, TRUE));
326
+ // }
327
+
328
+ /**
329
+ * Saves the marked posts to the db
330
+ */
331
+ public static function save_legacy_posts($posts = NULL) {
332
+ if ($posts === NULL) {
333
+ $posts = self::$crayon_legacy_posts;
334
+ }
335
+ update_option(self::LEGACY_POSTS, $posts);
336
+ self::load_legacy_posts();
337
+ }
338
+
339
+ /**
340
+ * Adds a post as containing a Crayon
341
+ */
342
+ public static function add_legacy_post($id) {
343
+ self::load_legacy_posts();
344
+ if (!in_array($id, self::$crayon_legacy_posts)) {
345
+ self::$crayon_legacy_posts[] = $id;
346
+ }
347
+ self::save_legacy_posts();
348
+ }
349
+
350
+ /**
351
+ * Removes a post as not containing a Crayon
352
+ */
353
+ public static function remove_legacy_post($id) {
354
+ self::load_legacy_posts();
355
+ $key = array_search($id, self::$crayon_legacy_posts);
356
+ if ($key === false) {
357
+ return;
358
+ }
359
+ unset(self::$crayon_legacy_posts[$key]);
360
+ self::save_legacy_posts();
361
+ }
362
+
363
+ public static function remove_legacy_posts() {
364
+ self::$crayon_legacy_posts = array();
365
+ self::save_legacy_posts();
366
+ }
367
 
368
  // Cache
369
 
467
  return array();
468
  }
469
  // Convert old tags
470
+ if (array_key_exists('convert', $inputs)) {
471
+ CrayonWP::convert_tags();
472
+ }
473
+ // Refresh internal tag management
474
+ if (array_key_exists('refresh_tags', $inputs)) {
475
+ CrayonWP::refresh_posts();
476
  }
477
  // Clear the log if needed
478
  if (array_key_exists(self::LOG_CLEAR, $_POST)) {
708
  self::checkbox(array(CrayonSettings::RANGES, crayon__('Enable line ranges for showing only parts of code')));
709
  self::checkbox(array(CrayonSettings::NUMS, crayon__('Display line numbers by default')));
710
  self::checkbox(array(CrayonSettings::NUMS_TOGGLE, crayon__('Enable line number toggling')));
711
+ self::checkbox(array(CrayonSettings::WRAP, crayon__('Wrap lines by default')));
712
  self::checkbox(array(CrayonSettings::WRAP_TOGGLE, crayon__('Enable line wrap toggling')));
713
  self::span(crayon__('Start line numbers from').' ');
714
  self::textbox(array('id' => CrayonSettings::START_LINE, 'size' => 2, 'break' => TRUE));
715
  echo '</div>';
716
  }
717
+
718
  public static function langs() {
719
  echo '<a name="langs"></a>';
720
  // Specialised dropdown for languages
721
  if (array_key_exists(CrayonSettings::FALLBACK_LANG, self::$options)) {
722
  if (($langs = CrayonParser::parse_all()) != FALSE) {
723
+ $langs = CrayonLangs::sort_by_name($langs);
724
  self::span(crayon__('When no language is provided, use the fallback').': ');
725
  self::dropdown(CrayonSettings::FALLBACK_LANG,FALSE,TRUE,TRUE,$langs);
726
  // Information about parsing
744
  }
745
  }
746
 
747
+ public static function show_langs() {
748
+ require_once (CRAYON_PARSER_PHP);
749
+ if (($langs = CrayonParser::parse_all()) != FALSE) {
750
+ $langs = CrayonLangs::sort_by_name($langs);
751
+ echo '<table class="crayon-table" cellspacing="0" cellpadding="0"><tr class="crayon-table-header">',
752
+ '<td>ID</td><td>Name</td><td>Version</td><td>File Extensions</td><td>Aliases</td><td>State</td></tr>';
753
+ $keys = array_values($langs);
754
+ for ($i = 0; $i < count($langs); $i++) {
755
+ $lang = $keys[$i];
756
+ $tr = ($i == count($langs) - 1) ? 'crayon-table-last' : '';
757
+ echo '<tr class="', $tr, '">',
758
+ '<td>', $lang->id(), '</td>',
759
+ '<td>', $lang->name(), '</td>',
760
+ '<td>', $lang->version(), '</td>',
761
+ '<td>', implode(', ', $lang->ext()), '</td>',
762
+ '<td>', implode(', ', $lang->alias()), '</td>',
763
+ '<td class="', strtolower(CrayonUtil::space_to_hyphen($lang->state_info())), '">',
764
+ $lang->state_info(), '</td>',
765
+ '</tr>';
766
+ }
767
+ echo '</table><br/>Languages that have the same extension as their name don\'t need to explicitly map extensions.';
768
+ } else {
769
+ echo 'No languages could be found.';
770
+ }
771
+ exit();
772
  }
773
 
774
+ public static function posts() {
775
+ echo '<a name="posts"></a>';
776
+ echo self::button(array('id'=>'show-posts', 'title'=>crayon__('Show Crayon Posts')));
777
+ echo ' <input type="submit" name="', self::OPTIONS, '[refresh_tags]" id="refresh_tags" class="button-primary" value="', crayon__('Refresh') ,'" />';
778
+ echo self::help_button('http://bit.ly/NQfZN5');
779
+ echo '<div id="crayon-subsection-posts-info"></div>';
780
  }
781
 
782
  public static function show_posts() {
783
+ $posts = self::load_posts();
784
+ $legacy_posts = self::load_legacy_posts();
785
+ // Avoids O(n^2) by using a hash map, tradeoff in using strval
786
+ $legacy_map = array();
787
+ foreach ($legacy_posts as $legacyID) {
788
+ $legacy_map[strval($legacyID)] = TRUE;
789
+ }
790
+ arsort($posts);
791
+
792
+ echo '<table class="crayon-table" cellspacing="0" cellpadding="0"><tr class="crayon-table-header">',
793
+ '<td>', crayon__('ID'), '</td><td>', crayon__('Title'), '</td><td>', crayon__('Posted'), '</td><td>', crayon__('Modifed'), '</td><td>', crayon__('Contains Legacy Tags?'), '</td></tr>';
794
+
795
+ for ($i = 0; $i < count($posts); $i++) {
796
+ $postID = $posts[$i];
797
+ $post = get_post($postID);
798
+ $title = $post->post_title;
799
+ $title = !empty($title) ? $title : 'N/A';
800
+ $tr = ($i == count($posts) - 1) ? 'crayon-table-last' : '';
801
+ echo '<tr class="', $tr, '">',
802
+ '<td>', $postID, '</td>',
803
+ '<td><a href="', $post->guid ,'" target="_blank">', $title, '</a></td>',
804
+ '<td>', $post->post_date, '</td>',
805
+ '<td>', $post->post_modified, '</td>',
806
+ '<td>', isset($legacy_map[strval($postID)]) ? '<span style="color: red;">'.crayon__('Yes').'</a>' : crayon__('No'), '</td>',
807
+ '</tr>';
808
+ }
809
+
810
  echo '</table>';
811
  exit();
812
  }
813
 
814
+ public static function show_preview() {
815
+ echo '<div id="content">';
816
+
817
+ self::load_settings(); // Run first to ensure global settings loaded
818
+
819
+ $crayon = CrayonWP::instance();
820
+
821
+ // Settings to prevent from validating
822
  $preview_settings = array();
823
+
824
+ // Load settings from GET and validate
825
+ foreach ($_GET as $key => $value) {
826
+ // echo $key, ' ', $value , '<br/>';
827
+ if (!in_array($key, $preview_settings)) {
828
+ $_GET[$key] = CrayonSettings::validate($key, $value);
829
+ }
830
+ }
831
+ $crayon->settings($_GET);
832
+ if (!isset($crayon_preview_dont_override_get) || !$crayon_preview_dont_override_get) {
833
+ $settings = array(CrayonSettings::TOP_SET => TRUE, CrayonSettings::TOP_MARGIN => 10,
834
+ CrayonSettings::BOTTOM_SET => FALSE, CrayonSettings::BOTTOM_MARGIN => 0);
835
+ $crayon->settings($settings);
836
+ }
837
+
838
+ // Print the theme CSS
839
+ $theme_id = $crayon->setting_val(CrayonSettings::THEME);
840
+ if ($theme_id != NULL) {
841
+ echo CrayonResources::themes()->get_css($theme_id);
842
+ }
843
+
844
+ $font_id = $crayon->setting_val(CrayonSettings::FONT);
845
+ if ($font_id != NULL /*&& $font_id != CrayonFonts::DEFAULT_FONT*/) {
846
+ echo CrayonResources::fonts()->get_css($font_id);
847
+ }
848
+
849
+ // Load custom code based on language
850
+ $lang = $crayon->setting_val(CrayonSettings::FALLBACK_LANG);
851
+ $path = crayon_pf( CRAYON_UTIL_PATH . '/sample/' . $lang . '.txt', FALSE );
852
+
853
+ if ($lang && @file_exists($path)) {
854
+ $crayon->url($path);
855
+ } else {
856
+ $code = "
857
+ // A sample class
858
+ class Human {
859
+ private int age = 0;
860
+ public void birthday() {
861
+ age++;
862
+ print('Happy Birthday!');
863
+ }
864
+ }
865
+ ";
866
+ $crayon->code($code);
867
+ }
868
+ $crayon->title('Sample Code');
869
+ $crayon->marked('5-7');
870
+ $crayon->output($highlight = true, $nums = true, $print = true);
871
+ echo '</div>';
872
  crayon_load_plugin_textdomain();
873
  exit();
874
  }
879
  $db_theme = '';
880
  }
881
  $themes_array = CrayonResources::themes()->get_array();
882
+ self::dropdown(CrayonSettings::THEME,FALSE,FALSE,TRUE,$themes_array);
883
  if ($editor) {
884
  return;
885
  }
886
  // Theme editor
887
  if (CRAYON_THEME_EDITOR) {
888
  // echo '<a id="crayon-theme-editor-button" class="button-primary crayon-admin-button" loading="'. crayon__('Loading...') .'" loaded="'. crayon__('Theme Editor') .'" >'. crayon__('Theme Editor') .'</a></br>';
889
+ echo '<div id="crayon-theme-editor-admin-buttons">';
890
+ $buttons = array('edit' => crayon__('Edit'), 'duplicate' => crayon__('Duplicate'), 'create' => crayon__('Create'), 'delete' => crayon__('Delete'));
891
+ foreach ($buttons as $k=>$v) {
892
+ echo '<a id="crayon-theme-editor-', $k, '-button" class="button-primary crayon-admin-button" loading="', crayon__('Loading...'), '" loaded="', $v, '" >', $v, '</a>';
893
+ }
894
+ echo '</br></div>';
895
  }
896
  // Preview Box
897
+ ?>
898
+ <div id="crayon-theme-panel">
899
+ <div id="crayon-theme-info">
900
+ <div class="desc"></div>
901
+ <div class="version field">Version:</div><div class="value"></div>
902
+ <div class="author field">Author:</div><div class="value"></div>
903
+ </div>
904
+
905
+ <div id="crayon-live-preview"></div>
906
+ <div id="crayon-preview-info">
907
+ <?php printf(crayon__('Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 are marked.'), '<a href="#langs">', '</a>'); ?>
908
+ </div>
909
+ </div>
910
+ <?php
911
  // Preview checkbox
 
912
  self::checkbox(array(CrayonSettings::PREVIEW, crayon__('Enable Live Preview')), FALSE, FALSE);
913
  echo '</select><span class="crayon-span-10"></span>';
914
+ self::checkbox(array(CrayonSettings::ENQUEUE_THEMES, crayon__('Enqueue themes in the header (more efficient).') . self::help_button('http://bit.ly/zTUAQV')));
915
  // Check if theme from db is loaded
916
  if (!CrayonResources::themes()->is_loaded($db_theme) || !CrayonResources::themes()->exists($db_theme)) {
917
  echo '<span class="crayon-error">', sprintf(crayon__('The selected theme with id %s could not be loaded'), '<strong>'.$db_theme.'</strong>'), '. </span>';
937
  return;
938
  }
939
  echo '<div style="height:10px;"></div>';
940
+ self::checkbox(array(CrayonSettings::ENQUEUE_FONTS, crayon__('Enqueue fonts in the header (more efficient).') . self::help_button('http://bit.ly/zTUAQV')));
941
  }
942
 
943
  public static function code($editor = FALSE) {
959
  echo '<div class="crayon-hide-inline-only">';
960
  self::checkbox(array(CrayonSettings::TRIM_WHITESPACE, crayon__('Remove whitespace surrounding the shortcode content')));
961
  echo '</div>';
962
+ self::checkbox(array(CrayonSettings::MIXED, crayon__('Allow Mixed Language Highlighting with delimiters and tags.') . self::help_button('http://bit.ly/ukwts2')));
963
  echo '<div class="crayon-hide-inline-only">';
964
  self::checkbox(array(CrayonSettings::SHOW_MIXED, crayon__('Show Mixed Language Icon (+)')));
965
  echo '</div>';
972
  }
973
 
974
  public static function tags() {
975
+ self::checkbox(array(CrayonSettings::CAPTURE_MINI_TAG, crayon__('Capture Mini Tags like [php][/php] as Crayons.') . self::help_button('http://bit.ly/rRZuzk')));
976
+ self::checkbox(array(CrayonSettings::INLINE_TAG, crayon__('Capture Inline Tags like {php}{/php} inside sentences.') . self::help_button('http://bit.ly/yFafFL')));
977
+ self::checkbox(array(CrayonSettings::INLINE_WRAP, crayon__('Wrap Inline Tags') . self::help_button('http://bit.ly/yFafFL')));
978
+ self::checkbox(array(CrayonSettings::BACKQUOTE, crayon__('Capture `backquotes` as &lt;code&gt;') . self::help_button('http://bit.ly/yFafFL')));
979
+ self::checkbox(array(CrayonSettings::CAPTURE_PRE, crayon__('Capture &lt;pre&gt; tags as Crayons') . self::help_button('http://bit.ly/rRZuzk')));
980
+ self::checkbox(array(CrayonSettings::PLAIN_TAG, crayon__('Enable [plain][/plain] tag.') . self::help_button('http://bit.ly/rRZuzk')));
981
  }
982
 
983
  public static function files() {
989
  }
990
 
991
  public static function tag_editor() {
992
+ $can_convert = self::load_legacy_posts();
993
  if ($can_convert) {
994
  $disabled = '';
995
  $convert_text = crayon__('Convert Legacy Tags');
998
  $convert_text = crayon__('No Legacy Tags Found');
999
  }
1000
 
1001
+ echo '<input type="submit" name="', self::OPTIONS, '[convert]" id="convert" class="button-primary" value="', $convert_text, '"', $disabled, ' /> ';
1002
+ echo self::help_button('http://bit.ly/ReRr0i') , CRAYON_BR, CRAYON_BR;
1003
  $sep = sprintf(crayon__('Use %s to separate setting names from values in the &lt;pre&gt; class attribute'),
1004
  self::dropdown(CrayonSettings::ATTR_SEP, FALSE, FALSE, FALSE));
1005
+ echo '<span>', $sep, self::help_button('http://bit.ly/H3xW3D'), '</span><br/>';
1006
+ self::checkbox(array(CrayonSettings::TAG_EDITOR_FRONT, crayon__("Display the Tag Editor in any TinyMCE instances on the frontend (e.g. bbPress)") . self::help_button('http://bit.ly/TyYyll')));
1007
  self::checkbox(array(CrayonSettings::TAG_EDITOR_SETTINGS, crayon__("Display Tag Editor settings on the frontend")));
1008
  }
1009
 
1011
  echo crayon__('Clear the cache used to store remote code requests'),': ';
1012
  self::dropdown(CrayonSettings::CACHE, false);
1013
  echo '<input type="submit" id="crayon-cache-clear" name="crayon-cache-clear" class="button-secondary" value="', crayon__('Clear Now'), '" /><br/>';
1014
+ self::checkbox(array(CrayonSettings::EFFICIENT_ENQUEUE, crayon__('Attempt to load Crayon\'s CSS and JavaScript only when needed'). self::help_button('http://ak.net84.net/?p=660')));
1015
+ self::checkbox(array(CrayonSettings::SAFE_ENQUEUE, crayon__('Disable enqueuing for page templates that may contain The Loop.') . self::help_button('http://bit.ly/AcWRNY')));
1016
  self::checkbox(array(CrayonSettings::COMMENTS, crayon__('Allow Crayons inside comments')));
1017
  self::checkbox(array(CrayonSettings::EXCERPT_STRIP, crayon__('Remove Crayons from excerpts')));
1018
  self::checkbox(array(CrayonSettings::MAIN_QUERY, crayon__('Load Crayons only from the main Wordpress query')));
1096
  </table>';
1097
 
1098
  }
1099
+
1100
+ public static function help_button($link) {
1101
+ return ' <a href="' . $link . '" target="_blank" class="crayon-question">' . crayon__('?') . '</a>';
1102
+ }
1103
 
1104
  public static function plugin_row_meta($meta, $file) {
1105
  global $CRAYON_DONATE;
1106
  if ($file == CrayonWP::basename()) {
1107
  $meta[] = '<a href="options-general.php?page=crayon_settings">' . crayon__('Settings') . '</a>';
 
 
 
1108
  $meta[] = '<a href="'.$CRAYON_DONATE.'" target="_blank">' . crayon__('Donate') . '</a>';
1109
  }
1110
  return $meta;
crayon_wp.class.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Crayon Syntax Highlighter
4
  Plugin URI: http://ak.net84.net/projects/crayon-syntax-highlighter
5
  Description: Supports multiple languages, themes, highlighting from a URL, local file or post text.
6
- Version: 1.14
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  Text Domain: crayon-syntax-highlighter
@@ -25,8 +25,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
  require_once ('global.php');
27
  require_once (CRAYON_HIGHLIGHTER_PHP);
28
- require_once (CRAYON_TE_PHP);
29
- require_once (CRAYON_THEME_EDITOR_PHP);
 
 
 
 
30
  require_once ('crayon_settings_wp.class.php');
31
 
32
  if (defined('ABSPATH')) {
@@ -53,9 +57,10 @@ class CrayonWP {
53
  private static $wp_head = FALSE;
54
  // Used to keep Crayon IDs
55
  private static $next_id = 0;
56
- // String to store the regex for capturing mini tags
57
  private static $alias_regex = '';
58
  private static $tags_regex = '';
 
59
  private static $tag_regexes = array();
60
  // Defined constants used in bitwise flags
61
  private static $tag_types = array(
@@ -65,6 +70,8 @@ class CrayonWP {
65
  CrayonSettings::PLAIN_TAG,
66
  CrayonSettings::BACKQUOTE);
67
  private static $tag_bits = array();
 
 
68
 
69
  // Used to detect the shortcode
70
  const REGEX_CLOSED = '(?:\[\s*crayon(?:-(\w+))?\b([^\]]*)/\s*\])'; // [crayon atts="" /]
@@ -461,7 +468,6 @@ class CrayonWP {
461
  }
462
  }
463
  }
464
- // exit;
465
 
466
  if (!is_admin() && $enqueue && !self::$enqueued) {
467
  // Crayons have been found and we enqueue efficiently
@@ -490,13 +496,20 @@ class CrayonWP {
490
  wp_enqueue_script('crayon_util_js', plugins_url(CRAYON_JS_UTIL, __FILE__), array('jquery'), $CRAYON_VERSION);
491
  wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('jquery', 'crayon_util_js'), $CRAYON_VERSION);
492
  wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array('jquery'), $CRAYON_VERSION);
 
493
  self::$enqueued = TRUE;
494
  }
495
 
496
- private static function init_tags_regex($force = FALSE, $flags = NULL) {
497
  self::init_tag_bits();
 
 
 
 
 
 
498
 
499
- if ($force || self::$tags_regex == "") {
500
  // Check which tags are in $flags. If it's NULL, then all flags are true.
501
  $in_flag = self::in_flag($flags);
502
 
@@ -514,7 +527,7 @@ class CrayonWP {
514
  }
515
 
516
  // Add other tags
517
- self::$tags_regex = '#(?<!\$)(?:(\s*\[\s*crayon\b)';
518
 
519
  $tag_regexes = array(
520
  CrayonSettings::CAPTURE_MINI_TAG => '([\[]\s*('.self::$alias_regex.')\b)',
@@ -526,28 +539,10 @@ class CrayonWP {
526
 
527
  foreach ($tag_regexes as $tag=>$regex) {
528
  if ($in_flag[$tag] && CrayonGlobalSettings::val($tag)) {
529
- self::$tags_regex .= '|' . $regex;
530
  }
531
  }
532
- self::$tags_regex .= ')#msi';
533
-
534
-
535
- // if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG)) {
536
- // self::$tags_regex .= '|([\[]\s*('.self::$alias_regex.'))';
537
- // }
538
- // if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_PRE)) {
539
- // self::$tags_regex .= '|(<\s*pre\b)';
540
- // }
541
- // if (CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG)) {
542
- // self::$tags_regex .= '|('.self::REGEX_INLINE_CLASS.')'.'|([\{]\s*('.self::$alias_regex.'))';
543
- // }
544
- // if (CrayonGlobalSettings::val(CrayonSettings::PLAIN_TAG)) {
545
- // self::$tags_regex .= '|(\s*\[\s*plain\b)';
546
- // }
547
- // if (CrayonGlobalSettings::val(CrayonSettings::BACKQUOTE)) {
548
- // self::$tags_regex .= '|(`[^`]*`)';
549
- // }
550
- // self::$tags_regex .= '#msi';
551
  }
552
  }
553
 
@@ -577,6 +572,17 @@ class CrayonWP {
577
  }
578
  return $in_flag;
579
  }
 
 
 
 
 
 
 
 
 
 
 
580
 
581
  // Add Crayon into the_content
582
  public static function the_content($the_content) {
@@ -796,7 +802,8 @@ class CrayonWP {
796
  CrayonLog::debug('head: missed enqueue');
797
  // We have missed our chance to check before enqueuing. Use setting to either load always or only in the_post
798
  CrayonSettingsWP::load_settings(TRUE); // Ensure settings are loaded
799
- if (!CrayonGlobalSettings::val(CrayonSettings::EFFICIENT_ENQUEUE)) {
 
800
  CrayonLog::debug('head: force enqueue');
801
  // Efficient enqueuing disabled, always load despite enqueuing or not in the_post
802
  self::enqueue_resources();
@@ -817,47 +824,46 @@ class CrayonWP {
817
  // // Ignore revisions
818
  // return;
819
  // }
820
-
821
- $id = $post->ID;
822
-
823
- self::init_tags_regex();
824
-
825
- if (preg_match(self::$tags_regex, $post->post_content)) {
826
- CrayonSettingsWP::add_post($id);
827
- } else {
828
- $found = FALSE;
829
- CrayonSettingsWP::load_settings(TRUE);
830
- if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
831
- $comments = get_comments(array('post_id' => $id));
832
- foreach ($comments as $comment) {
833
- $found = self::save_comment($comment->comment_ID, NULL, $comment);
834
- if ($found) {
835
- break;
836
- }
837
  }
838
- }
839
- if (!$found) {
840
- CrayonSettingsWP::remove_post($id);
841
- }
 
 
 
 
 
 
 
 
842
  }
843
  }
844
 
845
  public static function save_comment($id, $is_spam = NULL, $comment = NULL) {
846
  self::init_tags_regex();
847
-
848
- if ($comment == NULL) {
849
  $comment = get_comment($id);
850
  }
851
-
852
  $content = $comment->comment_content;
853
  $post_id = $comment->comment_post_ID;
854
-
855
- if (preg_match(self::$tags_regex, $content)) {
856
  CrayonSettingsWP::add_post($post_id);
857
- return TRUE;
858
- } else {
859
- return FALSE;
860
  }
 
861
  }
862
 
863
  public static function crayon_theme_css() {
@@ -890,46 +896,93 @@ class CrayonWP {
890
  }
891
 
892
  public static function ajax() {
893
- $allowed = array(CrayonSettings::HIDE_HELP);
894
- foreach ($allowed as $allow) {
895
- if (array_key_exists($allow, $_GET) ) {
896
- CrayonGlobalSettings::set($allow, $_GET[$allow]);
897
- CrayonSettingsWP::save_settings();
898
- }
899
  }
900
  }
901
 
 
 
 
 
 
902
  /**
903
  * Return an array of post IDs where crayons occur.
904
  * Comments are ignored by default.
905
  */
906
- public static function scan_posts($init_regex = TRUE, $check_comments = FALSE) {
907
- if ($init_regex) {
908
- // We can skip this if needed
909
- self::init_tags_regex();
910
- }
911
-
912
  $crayon_posts = array();
913
- $query = new WP_Query(array('post_type' => 'any', 'suppress_filters' => TRUE, 'posts_per_page' => '-1'));
914
- foreach ($query->posts as $post) {
915
- $post_id = $post->ID;
916
- if (preg_match(self::$tags_regex, $post->post_content)) {
917
- $crayon_posts[] = $post_id;
918
- } else if ($check_comments) {
919
- CrayonSettingsWP::load_settings(TRUE);
920
- if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
921
- $comments = get_comments(array('post_id' => $post_id));
922
- foreach ($comments as $comment) {
923
- if (preg_match(self::$tags_regex, $comment->comment_content)) {
924
- $crayon_posts[] = $post_id;
925
- break;
926
- }
927
- }
928
- }
929
  }
930
  }
931
  return $crayon_posts;
932
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
933
 
934
  public static function install() {
935
  self::update();
@@ -950,34 +1003,35 @@ class CrayonWP {
950
  $version = $settings[CrayonSettings::VERSION];
951
 
952
  // Only upgrade if the version differs
953
- if ($version != $CRAYON_VERSION) {
954
- $defaults = CrayonSettings::get_defaults_array();
955
- $touched = FALSE;
956
-
957
- // Upgrade database and settings
958
-
959
- if ($version < '1.7.21') {
960
- $settings[CrayonSettings::SCROLL] = $defaults[CrayonSettings::SCROLL];
961
- $touched = TRUE;
962
- }
963
-
964
- if ($version < '1.7.23' && $settings[CrayonSettings::FONT] == 'theme-font') {
965
- $settings[CrayonSettings::FONT] = $defaults[CrayonSettings::FONT];
966
- $touched = TRUE;
967
- }
968
 
969
- if ($version < '1.14') {
 
970
  $settings[CrayonSettings::FONT_SIZE_ENABLE] = true;
971
  }
972
 
973
- // Save new version
974
  $settings[CrayonSettings::VERSION] = $CRAYON_VERSION;
975
  CrayonSettingsWP::save_settings($settings);
976
  CrayonLog::syslog("Updated from $version to $CRAYON_VERSION");
977
 
978
  // Refresh to show new settings
979
  header('Location: ' . CrayonUtil::current_url());
980
- exit();
981
  }
982
  }
983
 
@@ -1019,26 +1073,24 @@ class CrayonWP {
1019
  * XXX: Do NOT call this while updating posts or comments, it may cause an infinite loop or fail
1020
  */
1021
  public static function convert_tags($just_check = FALSE) {
1022
- $result = self::can_convert_tags(TRUE);
1023
- if ($result === FALSE) {
1024
  return;
1025
- } else {
1026
- $crayon_posts = $result[0];
1027
- $flags = $result[1];
1028
  }
1029
 
 
1030
  $args = array(
1031
  'callback' => 'CrayonWP::capture_replace_pre',
1032
  'ignore' => FALSE,
1033
  'preserve_atts' => TRUE,
1034
- 'flags' => $flags
1035
  );
1036
-
1037
  foreach ($crayon_posts as $postID) {
1038
  $post = get_post($postID);
1039
  $post_content = $post->post_content;
1040
  $post_captures = self::capture_crayons($postID, $post_content, array(), $args);
1041
-
1042
  $post_obj = array();
1043
  $post_obj['ID'] = $postID;
1044
  $post_obj['post_content'] = $post_captures['content'];
@@ -1058,42 +1110,15 @@ class CrayonWP {
1058
  CrayonLog::syslog("Converted Crayons in post ID $postID, comment ID $commentID to pre tags", 'CONVERT');
1059
  }
1060
  }
1061
-
1062
- }
1063
- }
1064
-
1065
- public static function can_convert_tags($return = FALSE) {
1066
- CrayonSettingsWP::load_settings(TRUE);
1067
- self::init_tag_bits();
1068
- $flags = self::tag_bit(CrayonSettings::CAPTURE_MINI_TAG) |
1069
- self::tag_bit(CrayonSettings::INLINE_TAG) |
1070
- self::tag_bit(CrayonSettings::PLAIN_TAG);
1071
- self::init_tags_regex(TRUE, $flags);
1072
-
1073
- // These posts (or comments) will contain the old tag markup
1074
- $crayon_posts = self::scan_posts(FALSE, TRUE);
1075
-
1076
- // Reset to all flags for other queries
1077
- self::init_tags_regex(TRUE);
1078
- if (count($crayon_posts) > 0) {
1079
- if ($return) {
1080
- return array($crayon_posts, $flags);
1081
- } else {
1082
- return TRUE;
1083
- }
1084
- } else {
1085
- return FALSE;
1086
  }
 
 
1087
  }
1088
 
1089
  // Used as capture_crayons callback
1090
  public static function capture_replace_pre($capture, $original, $id, $is_inline, $wp_content) {
1091
  $atts = array();
1092
  $atts['class'] = CrayonUtil::html_attributes($capture['atts'], CrayonGlobalSettings::val_str(CrayonSettings::ATTR_SEP), '');
1093
- // $has_decode = isset($capture['atts'][CrayonSettings::DECODE]);
1094
- // $default = CrayonGlobalSettings::val(CrayonSettings::DECODE);
1095
- // $encoded = $has_decode ? CrayonUtil::str_to_bool($capture['atts'][CrayonSettings::DECODE], $default) : $default;
1096
- // CrayonUtil::bool_to_str($encoded);
1097
  return str_replace($original, CrayonUtil::html_element('pre', $capture['code'], $atts), $wp_content);
1098
  }
1099
 
@@ -1139,7 +1164,7 @@ if (defined('ABSPATH')) {
1139
 
1140
  add_action('template_redirect', 'CrayonWP::wp_head');
1141
  } else {
1142
- // Update between versions
1143
  CrayonWP::update();
1144
  // For marking a post as containing a Crayon
1145
  add_action('save_post', 'CrayonWP::save_post', 10, 2);
3
  Plugin Name: Crayon Syntax Highlighter
4
  Plugin URI: http://ak.net84.net/projects/crayon-syntax-highlighter
5
  Description: Supports multiple languages, themes, highlighting from a URL, local file or post text.
6
+ Version: 1.15
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  Text Domain: crayon-syntax-highlighter
25
  */
26
  require_once ('global.php');
27
  require_once (CRAYON_HIGHLIGHTER_PHP);
28
+ if (CRAYON_TAG_EDITOR) {
29
+ require_once (CRAYON_TE_PHP);
30
+ }
31
+ if (CRAYON_THEME_EDITOR) {
32
+ require_once (CRAYON_THEME_EDITOR_PHP);
33
+ }
34
  require_once ('crayon_settings_wp.class.php');
35
 
36
  if (defined('ABSPATH')) {
57
  private static $wp_head = FALSE;
58
  // Used to keep Crayon IDs
59
  private static $next_id = 0;
60
+ // String to store the regex for capturing tags
61
  private static $alias_regex = '';
62
  private static $tags_regex = '';
63
+ private static $tags_regex_legacy = '';
64
  private static $tag_regexes = array();
65
  // Defined constants used in bitwise flags
66
  private static $tag_types = array(
70
  CrayonSettings::PLAIN_TAG,
71
  CrayonSettings::BACKQUOTE);
72
  private static $tag_bits = array();
73
+ // Used to find legacy tags
74
+ private static $legacy_flags = NULL;
75
 
76
  // Used to detect the shortcode
77
  const REGEX_CLOSED = '(?:\[\s*crayon(?:-(\w+))?\b([^\]]*)/\s*\])'; // [crayon atts="" /]
468
  }
469
  }
470
  }
 
471
 
472
  if (!is_admin() && $enqueue && !self::$enqueued) {
473
  // Crayons have been found and we enqueue efficiently
496
  wp_enqueue_script('crayon_util_js', plugins_url(CRAYON_JS_UTIL, __FILE__), array('jquery'), $CRAYON_VERSION);
497
  wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('jquery', 'crayon_util_js'), $CRAYON_VERSION);
498
  wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array('jquery'), $CRAYON_VERSION);
499
+ CrayonSettingsWP::init_js_settings();
500
  self::$enqueued = TRUE;
501
  }
502
 
503
+ private static function init_tags_regex($force = FALSE, $flags = NULL, &$tags_regex = NULL) {
504
  self::init_tag_bits();
505
+
506
+ // Default output
507
+ if ($tags_regex === NULL) {
508
+ $tags_regex = &self::$tags_regex;
509
+ }
510
+
511
 
512
+ if ($force || $tags_regex === "") {
513
  // Check which tags are in $flags. If it's NULL, then all flags are true.
514
  $in_flag = self::in_flag($flags);
515
 
527
  }
528
 
529
  // Add other tags
530
+ $tags_regex = '#(?<!\$)(?:(\s*\[\s*crayon\b)';
531
 
532
  $tag_regexes = array(
533
  CrayonSettings::CAPTURE_MINI_TAG => '([\[]\s*('.self::$alias_regex.')\b)',
539
 
540
  foreach ($tag_regexes as $tag=>$regex) {
541
  if ($in_flag[$tag] && CrayonGlobalSettings::val($tag)) {
542
+ $tags_regex .= '|' . $regex;
543
  }
544
  }
545
+ $tags_regex .= ')#msi';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  }
547
  }
548
 
572
  }
573
  return $in_flag;
574
  }
575
+
576
+ private static function init_legacy_tag_bits() {
577
+ if (self::$legacy_flags === NULL) {
578
+ self::$legacy_flags = self::tag_bit(CrayonSettings::CAPTURE_MINI_TAG) |
579
+ self::tag_bit(CrayonSettings::INLINE_TAG) |
580
+ self::tag_bit(CrayonSettings::PLAIN_TAG);
581
+ }
582
+ if (self::$tags_regex_legacy === "") {
583
+ self::init_tags_regex(TRUE, self::$legacy_flags, self::$tags_regex_legacy);
584
+ }
585
+ }
586
 
587
  // Add Crayon into the_content
588
  public static function the_content($the_content) {
802
  CrayonLog::debug('head: missed enqueue');
803
  // We have missed our chance to check before enqueuing. Use setting to either load always or only in the_post
804
  CrayonSettingsWP::load_settings(TRUE); // Ensure settings are loaded
805
+ // If we need the tag editor loaded at all times, we must enqueue at all times
806
+ if (!CrayonGlobalSettings::val(CrayonSettings::EFFICIENT_ENQUEUE) || CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_FRONT)) {
807
  CrayonLog::debug('head: force enqueue');
808
  // Efficient enqueuing disabled, always load despite enqueuing or not in the_post
809
  self::enqueue_resources();
824
  // // Ignore revisions
825
  // return;
826
  // }
827
+ self::refresh_post($post);
828
+ }
829
+
830
+ public static function refresh_post($post, $refresh_legacy = TRUE) {
831
+ $postID = $post->ID;
832
+ if (CrayonWP::scan_post($post)) {
833
+ CrayonSettingsWP::add_post($postID);
834
+ if ($refresh_legacy) {
835
+ if (self::scan_legacy_post($post)) {
836
+ CrayonSettingsWP::add_legacy_post($postID);
837
+ } else {
838
+ CrayonSettingsWP::remove_legacy_post($postID);
 
 
 
 
 
839
  }
840
+ }
841
+ } else {
842
+ CrayonSettingsWP::remove_post($postID);
843
+ CrayonSettingsWP::remove_legacy_post($postID);
844
+ }
845
+ }
846
+
847
+ public static function refresh_posts() {
848
+ CrayonSettingsWP::remove_posts();
849
+ CrayonSettingsWP::remove_legacy_posts();
850
+ foreach (CrayonWP::get_posts() as $post) {
851
+ self::refresh_post($post);
852
  }
853
  }
854
 
855
  public static function save_comment($id, $is_spam = NULL, $comment = NULL) {
856
  self::init_tags_regex();
857
+ if ($comment === NULL) {
 
858
  $comment = get_comment($id);
859
  }
 
860
  $content = $comment->comment_content;
861
  $post_id = $comment->comment_post_ID;
862
+ $found = preg_match(self::$tags_regex, $content);
863
+ if ($found) {
864
  CrayonSettingsWP::add_post($post_id);
 
 
 
865
  }
866
+ return $found;
867
  }
868
 
869
  public static function crayon_theme_css() {
896
  }
897
 
898
  public static function ajax() {
899
+ $allowed = array(CrayonSettings::HIDE_HELP);
900
+ foreach ($allowed as $allow) {
901
+ if (array_key_exists($allow, $_GET) ) {
902
+ CrayonGlobalSettings::set($allow, $_GET[$allow]);
903
+ CrayonSettingsWP::save_settings();
904
+ }
905
  }
906
  }
907
 
908
+ public static function get_posts() {
909
+ $query = new WP_Query(array('post_type' => 'any', 'suppress_filters' => TRUE, 'posts_per_page' => '-1'));
910
+ return $query->posts;
911
+ }
912
+
913
  /**
914
  * Return an array of post IDs where crayons occur.
915
  * Comments are ignored by default.
916
  */
917
+ public static function scan_posts($check_comments = FALSE) {
 
 
 
 
 
918
  $crayon_posts = array();
919
+ foreach (self::get_posts() as $post) {
920
+ if (self::scan_post($post)) {
921
+ $crayon_posts[] = $post->ID;
 
 
 
 
 
 
 
 
 
 
 
 
 
922
  }
923
  }
924
  return $crayon_posts;
925
  }
926
+
927
+ public static function scan_legacy_posts($init_regex = TRUE, $check_comments = FALSE) {
928
+ if ($init_regex) {
929
+ // We can skip this if needed
930
+ self::init_tags_regex();
931
+ }
932
+ $crayon_posts = array();
933
+ foreach (self::get_posts() as $post) {
934
+ if (self::scan_legacy_post($post)) { // TODO this part is different
935
+ $crayon_posts[] = $post->ID;
936
+ }
937
+ }
938
+ return $crayon_posts;
939
+ }
940
+
941
+ /**
942
+ * Returns TRUE if a given post contains a Crayon tag
943
+ */
944
+ public static function scan_post($post, $scan_comments = TRUE, $tags_regex = NULL) {
945
+ if ($tags_regex === NULL) {
946
+ self::init_tags_regex();
947
+ $tags_regex = self::$tags_regex;
948
+ }
949
+
950
+ $id = $post->ID;
951
+ if (preg_match($tags_regex, $post->post_content)) {
952
+ return TRUE;
953
+ } else if ($scan_comments) {
954
+ CrayonSettingsWP::load_settings(TRUE);
955
+ if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
956
+ $comments = get_comments(array('post_id' => $id));
957
+ foreach ($comments as $comment) {
958
+ if (self::scan_comment($comment, $tags_regex)) {
959
+ return TRUE;
960
+ }
961
+ }
962
+ }
963
+ }
964
+ return FALSE;
965
+ }
966
+
967
+ public static function scan_legacy_post($post, $scan_comments = TRUE) {
968
+ self::init_legacy_tag_bits();
969
+ return self::scan_post($post, $scan_comments, self::$tags_regex_legacy);
970
+ }
971
+
972
+ /**
973
+ * Returns TRUE if the comment contains a Crayon tag
974
+ */
975
+ public static function scan_comment($comment, $tags_regex = NULL) {
976
+ if ($tags_regex === NULL) {
977
+ self::init_tags_regex();
978
+ $tags_regex = self::$tags_regex;
979
+ }
980
+ if (preg_match($tags_regex, $comment->comment_content)) {
981
+ return TRUE;
982
+ } else {
983
+ return FALSE;
984
+ }
985
+ }
986
 
987
  public static function install() {
988
  self::update();
1003
  $version = $settings[CrayonSettings::VERSION];
1004
 
1005
  // Only upgrade if the version differs
1006
+ if ($version != $CRAYON_VERSION) {
1007
+ $defaults = CrayonSettings::get_defaults_array();
1008
+ $touched = FALSE;
1009
+
1010
+ // Upgrade database and settings
1011
+
1012
+ if (CrayonUtil::version_compare($version, '1.7.21') < 0) {
1013
+ $settings[CrayonSettings::SCROLL] = $defaults[CrayonSettings::SCROLL];
1014
+ $touched = TRUE;
1015
+ }
1016
+
1017
+ if (CrayonUtil::version_compare($version, '1.7.23') < 0 && $settings[CrayonSettings::FONT] == 'theme-font') {
1018
+ $settings[CrayonSettings::FONT] = $defaults[CrayonSettings::FONT];
1019
+ $touched = TRUE;
1020
+ }
1021
 
1022
+ if (CrayonUtil::version_compare($version, '1.14') < 0) {
1023
+ CrayonLog::syslog("Updated to v1.14: Font size enabled");
1024
  $settings[CrayonSettings::FONT_SIZE_ENABLE] = true;
1025
  }
1026
 
1027
+ // Save new version
1028
  $settings[CrayonSettings::VERSION] = $CRAYON_VERSION;
1029
  CrayonSettingsWP::save_settings($settings);
1030
  CrayonLog::syslog("Updated from $version to $CRAYON_VERSION");
1031
 
1032
  // Refresh to show new settings
1033
  header('Location: ' . CrayonUtil::current_url());
1034
+ exit();
1035
  }
1036
  }
1037
 
1073
  * XXX: Do NOT call this while updating posts or comments, it may cause an infinite loop or fail
1074
  */
1075
  public static function convert_tags($just_check = FALSE) {
1076
+ $crayon_posts = CrayonSettingsWP::load_legacy_posts();
1077
+ if ($crayon_posts === NULL) {
1078
  return;
 
 
 
1079
  }
1080
 
1081
+ self::init_legacy_tag_bits();
1082
  $args = array(
1083
  'callback' => 'CrayonWP::capture_replace_pre',
1084
  'ignore' => FALSE,
1085
  'preserve_atts' => TRUE,
1086
+ 'flags' => self::$legacy_flags
1087
  );
1088
+
1089
  foreach ($crayon_posts as $postID) {
1090
  $post = get_post($postID);
1091
  $post_content = $post->post_content;
1092
  $post_captures = self::capture_crayons($postID, $post_content, array(), $args);
1093
+
1094
  $post_obj = array();
1095
  $post_obj['ID'] = $postID;
1096
  $post_obj['post_content'] = $post_captures['content'];
1110
  CrayonLog::syslog("Converted Crayons in post ID $postID, comment ID $commentID to pre tags", 'CONVERT');
1111
  }
1112
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1113
  }
1114
+
1115
+ self::refresh_posts();
1116
  }
1117
 
1118
  // Used as capture_crayons callback
1119
  public static function capture_replace_pre($capture, $original, $id, $is_inline, $wp_content) {
1120
  $atts = array();
1121
  $atts['class'] = CrayonUtil::html_attributes($capture['atts'], CrayonGlobalSettings::val_str(CrayonSettings::ATTR_SEP), '');
 
 
 
 
1122
  return str_replace($original, CrayonUtil::html_element('pre', $capture['code'], $atts), $wp_content);
1123
  }
1124
 
1164
 
1165
  add_action('template_redirect', 'CrayonWP::wp_head');
1166
  } else {
1167
+ // Update between versions
1168
  CrayonWP::update();
1169
  // For marking a post as containing a Crayon
1170
  add_action('save_post', 'CrayonWP::save_post', 10, 2);
css/admin_style.css CHANGED
@@ -152,8 +152,8 @@
152
 
153
  #crayon-live-preview,
154
  #crayon-log-wrapper {
155
- padding: 5px;
156
- width: 95%;
157
  float: left;
158
  clear: both;
159
  }
@@ -191,6 +191,20 @@
191
  margin-left: 5px;
192
  }
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  #crayon-editor-table td {
195
  vertical-align: top;
196
  }
152
 
153
  #crayon-live-preview,
154
  #crayon-log-wrapper {
155
+ padding: 0px;
156
+ width: 100%;
157
  float: left;
158
  clear: both;
159
  }
191
  margin-left: 5px;
192
  }
193
 
194
+ #crayon-theme-info {
195
+ float: left;
196
+ }
197
+ #crayon-theme-info * {
198
+ float: left;
199
+ }
200
+ #crayon-theme-info .field {
201
+ font-weight: bold;
202
+ }
203
+ #crayon-theme-info .field,
204
+ #crayon-theme-info .value {
205
+ margin-left: 5px;
206
+ }
207
+
208
  #crayon-editor-table td {
209
  vertical-align: top;
210
  }
global.php CHANGED
@@ -71,8 +71,11 @@ define('CRAYON_JS', CRAYON_JS_DIR . 'crayon.js');
71
  define('CRAYON_JS_ADMIN', CRAYON_JS_DIR . 'crayon_admin.js');
72
  define('CRAYON_JS_UTIL', CRAYON_JS_DIR . 'util.js');
73
  define('CRAYON_CSSJSON_JS', CRAYON_JS_DIR . 'cssjson.js');
74
- define('CRAYON_JS_FANCYBOX', CRAYON_JS_DIR . 'fancybox/jquery.fancybox.pack.js');
 
75
  define('CRAYON_CSS_FANCYBOX', CRAYON_JS_DIR . 'fancybox/jquery.fancybox.css');
 
 
76
  // TODO rename TE
77
  define('CRAYON_TE_JS', 'crayon_te.js');
78
  define('CRAYON_TE_PHP', CRAYON_TAG_EDITOR_PATH . 'crayon_tag_editor_wp.class.php');
71
  define('CRAYON_JS_ADMIN', CRAYON_JS_DIR . 'crayon_admin.js');
72
  define('CRAYON_JS_UTIL', CRAYON_JS_DIR . 'util.js');
73
  define('CRAYON_CSSJSON_JS', CRAYON_JS_DIR . 'cssjson.js');
74
+ define('CRAYON_JS_FANCYBOX', CRAYON_JS_DIR . 'fancybox/jquery.fancybox.init.pack.js');
75
+ define('CRAYON_JS_FANCYBOX_INIT', CRAYON_JS_DIR . 'fancybox/fancybox_init.js');
76
  define('CRAYON_CSS_FANCYBOX', CRAYON_JS_DIR . 'fancybox/jquery.fancybox.css');
77
+ define('CRAYON_CSS_JQUERY_UI', CRAYON_JS_DIR . 'jquery-ui/jquery-ui.css');
78
+ define('CRAYON_JS_JQUERY_UI', CRAYON_JS_DIR . 'jquery-ui/jquery-ui.js');
79
  // TODO rename TE
80
  define('CRAYON_TE_JS', 'crayon_te.js');
81
  define('CRAYON_TE_PHP', CRAYON_TAG_EDITOR_PATH . 'crayon_tag_editor_wp.class.php');
js/crayon.js CHANGED
@@ -2,226 +2,185 @@
2
 
3
  (function($) {
4
 
5
- // BEGIN AUXILIARY FUNCTIONS
6
-
7
- $.fn.exists = function () {
8
- return this.length !== 0;
9
- };
10
-
11
- // This makes IE < 9 doesn't support CSSStyleDeclaration, can't use this
12
- CrayonSyntaxUnused = function () {
13
- // For those who need them (< IE 9), add support for CSS functions
14
- var isStyleFuncSupported = null;
15
- if (typeof(CSSStyleDeclaration) != 'undefined') {
16
- isStyleFuncSupported = CSSStyleDeclaration.prototype.getPropertyValue != null;
17
- if (!isStyleFuncSupported) {
18
- CSSStyleDeclaration.prototype.getPropertyValue = function(a) {
19
- return this.getAttribute(a);
20
- };
21
- CSSStyleDeclaration.prototype.setProperty = function(styleName, value, priority) {
22
- this.setAttribute(styleName,value);
23
- var priority = typeof priority != 'undefined' ? priority : '';
24
- if (priority != '') {
25
- // Add priority manually
26
- var rule = new RegExp(RegExp.escape(styleName) + '\\s*:\\s*' + RegExp.escape(value) + '(\\s*;)?', 'gmi');
27
- this.cssText = this.cssText.replace(rule, styleName + ': ' + value + ' !' + priority + ';');
28
- }
29
- };
30
- CSSStyleDeclaration.prototype.removeProperty = function(a) {
31
- return this.removeAttribute(a);
32
- };
33
- CSSStyleDeclaration.prototype.getPropertyPriority = function(styleName) {
34
- var rule = new RegExp(RegExp.escape(styleName) + '\\s*:\\s*[^\\s]*\\s*!important(\\s*;)?', 'gmi');
35
- return rule.test(this.cssText) ? 'important' : '';
36
- };
37
- }
38
- }
39
- };
40
-
41
- // Escape regex chars with \
42
- RegExp.escape = function(text) {
43
- return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
44
- };
45
-
46
-
47
- var hasCSSStyleDeclaration = typeof(CSSStyleDeclaration) != 'undefined';
48
- $.fn.style = function(styleName, value, priority) {
49
- // DOM node
50
- var node = this.get(0);
51
- // Ensure we have a DOM node
52
- if (typeof node == 'undefined') {
53
- return;
54
- }
55
- // CSSStyleDeclaration
56
- var style = node.style;
57
- // Getter/Setter
58
- if (typeof styleName != 'undefined') {
59
- if (typeof value != 'undefined') {
60
- // Set style property
61
- var priority = typeof priority != 'undefined' ? priority : '';
62
- if (typeof style.setProperty != 'undefined') {
63
- style.setProperty(styleName, value, priority);
64
- } else {
65
- style.styleName = value + ' ' + priority;
66
- }
67
- } else {
68
- // Get style property
69
- if (hasCSSStyleDeclaration) {
70
- return style.getPropertyValue(styleName);
71
- } else {
72
- return style.styleName;
73
- }
74
- }
75
- } else {
76
- // Get CSSStyleDeclaration
77
- return style;
78
- }
79
- };
80
-
81
- // END AUXILIARY FUNCTIONS
82
-
83
- var PRESSED = 'crayon-pressed';
84
- var UNPRESSED = '';
85
-
86
- var CRAYON_SYNTAX = 'div.crayon-syntax';
87
- var CRAYON_TOOLBAR = '.crayon-toolbar';
88
- var CRAYON_INFO = '.crayon-info';
89
- var CRAYON_PLAIN = '.crayon-plain';
90
- var CRAYON_MAIN = '.crayon-main';
91
- var CRAYON_TABLE = '.crayon-table';
92
- var CRAYON_LOADING = '.crayon-loading';
93
- var CRAYON_CODE = '.crayon-code';
94
- var CRAYON_NUMS = '.crayon-nums';
95
- var CRAYON_NUM = '.crayon-num';
96
- var CRAYON_LINE = '.crayon-line';
97
- var CRAYON_WRAPPED = 'crayon-wrapped';
98
- var CRAYON_NUMS_CONTENT = '.crayon-nums-content';
99
- var CRAYON_NUMS_BUTTON = '.crayon-nums-button';
100
- var CRAYON_WRAP_BUTTON = '.crayon-wrap-button';
101
- var CRAYON_POPUP_BUTTON = '.crayon-popup-button';
102
- var CRAYON_COPY_BUTTON = '.crayon-copy-button';
103
- var CRAYON_PLAIN_BUTTON = '.crayon-plain-button';
104
-
105
- $(document).ready(function() {
106
- CrayonSyntax.init();
107
- });
108
-
109
- CrayonSyntax = new function() {
110
- var crayon = new Object();
111
- var currUID = 0;
112
-
113
- this.init = function() {
114
- if (typeof crayon == 'undefined') {
115
- crayon = new Object();
116
- }
117
-
118
- $(CRAYON_SYNTAX).each(function() {
119
- CrayonSyntax.process(this);
120
- });
121
- };
122
-
123
- this.process = function(c, replace) {
124
- c = $(c);
125
- var uid = c.attr('id');
126
- if (uid == 'crayon-') {
127
- // No ID, generate one
128
- uid += getUID();
129
- }
130
- c.attr('id', uid);
131
- console_log(uid);
132
-
133
- if (typeof replace == 'undefined') {
134
- replace = false;
135
- }
136
-
137
- if (!replace && !make_uid(uid)) {
138
- // Already a Crayon
139
- return;
140
- }
141
-
142
- var toolbar = c.find(CRAYON_TOOLBAR);
143
- var info = c.find(CRAYON_INFO);
144
- var plain = c.find(CRAYON_PLAIN);
145
- var main = c.find(CRAYON_MAIN);
146
- var table = c.find(CRAYON_TABLE);
147
- var code = c.find(CRAYON_CODE);
148
- var nums = c.find(CRAYON_NUMS);
149
- var nums_content = c.find(CRAYON_NUMS_CONTENT);
150
- var nums_button = c.find(CRAYON_NUMS_BUTTON);
151
- var wrap_button = c.find(CRAYON_WRAP_BUTTON);
152
- var popup_button = c.find(CRAYON_POPUP_BUTTON);
153
- var copy_button = c.find(CRAYON_COPY_BUTTON);
154
- var plain_button = c.find(CRAYON_PLAIN_BUTTON);
155
-
156
- crayon[uid] = c;
157
- crayon[uid].toolbar = toolbar;
158
- crayon[uid].plain = plain;
159
- crayon[uid].info = info;
160
- crayon[uid].main = main;
161
- crayon[uid].table = table;
162
- crayon[uid].code = code;
163
- crayon[uid].nums = nums;
164
- crayon[uid].nums_content = nums_content;
165
- crayon[uid].nums_button = nums_button;
166
- crayon[uid].wrap_button = wrap_button;
167
- crayon[uid].popup_button = popup_button;
168
- crayon[uid].copy_button = copy_button;
169
- crayon[uid].plain_button = plain_button;
170
- crayon[uid].nums_visible = true;
171
- crayon[uid].wrapped = false;
172
- crayon[uid].plain_visible = false;
173
-
174
- crayon[uid].toolbar_delay = 0;
175
- crayon[uid].time = 1;
176
-
177
- // Set plain
178
- $(CRAYON_PLAIN).css('z-index', 0);
179
-
180
- // XXX Remember CSS dimensions
181
- var main_style = main.style();
182
- crayon[uid].main_style = {
183
- height: main_style && main_style.height || '',
184
- max_height: main_style && main_style.maxHeight || '',
185
- min_height: main_style && main_style.minHeight || '',
186
- width: main_style && main_style.width || ''
187
- };
188
-
189
- var load_timer;
190
- var i = 0;
191
- crayon[uid].loading = true;
192
- crayon[uid].scroll_block_fix = false;
193
-
194
- // Register click events
195
- nums_button.click(function() { CrayonSyntax.toggle_nums(uid); });
196
- wrap_button.click(function() { CrayonSyntax.toggle_wrap(uid); });
197
- plain_button.click(function() { CrayonSyntax.toggle_plain(uid); });
198
- copy_button.click(function() { CrayonSyntax.copy_plain(uid); });
199
-
200
- var load_func = function() {
201
- if (main.height() < 30) {
202
- crayon[uid].scroll_block_fix = true;
203
- }
204
-
205
- // If nums hidden by default
206
- if (nums.filter('[data-settings~="hide"]').length != 0) {
207
- nums_content.ready(function() {
208
- console_log('function' + uid);
209
- CrayonSyntax.toggle_nums(uid, true, true);
210
- });
211
- } else {
212
- update_nums_button(uid);
213
- }
214
-
215
- // TODO If width has changed or timeout, stop timer
216
- if (/*last_num_width != nums.width() ||*/ i == 5) {
217
- clearInterval(load_timer);
218
- //crayon[uid].removeClass(CRAYON_LOADING);
219
- crayon[uid].loading = false;
220
- }
221
- i++;
222
- };
223
- load_timer = setInterval(load_func, 300);
224
- fix_scroll_blank(uid);
225
 
226
  $(CRAYON_NUM, crayon[uid]).each(function() {
227
  var line_id = $(this).attr('data-line');
@@ -232,650 +191,635 @@
232
  }
233
  });
234
 
235
- // Used for toggling
236
- main.css('position', 'relative');
237
- main.css('z-index', 1);
238
-
239
- // Disable certain features for touchscreen devices
240
- touchscreen = (c.filter('[data-settings~="touchscreen"]').length != 0);
241
-
242
- // Used to hide info
243
- if (!touchscreen) {
244
- main.click(function() { crayon_info(uid, '', false); });
245
- plain.click(function() { crayon_info(uid, '', false); });
246
- info.click(function() { crayon_info(uid, '', false); });
247
- }
248
-
249
- // Used for code popup
250
- crayon[uid].popup_settings = popupWindow(popup_button, {
251
- height:screen.height - 200,
252
- width:screen.width - 100,
253
- top:75,
254
- left:50,
255
- scrollbars:1,
256
- windowURL:'',
257
- data:'' // Data overrides URL
258
- }, function() {
259
- code_popup(uid);
260
- }, function() {
261
- //console_log('after');
262
- });
263
-
264
- plain.css('opacity', 0);
265
- // If a toolbar with mouseover was found
266
- if (toolbar.filter('[data-settings~="mouseover"]').length != 0 && !touchscreen) {
267
- crayon[uid].toolbar_mouseover = true;
268
-
269
- toolbar.css('margin-top', '-' + toolbar.height() + 'px');
270
- toolbar.hide();
271
- // Overlay the toolbar if needed, only if doing so will not hide the
272
- // whole code!
273
- if (toolbar.filter('[data-settings~="overlay"]').length != 0
274
- && main.height() > toolbar.height() * 2) {
275
- toolbar.css('position', 'absolute');
276
- toolbar.css('z-index', 2);
277
- // Hide on single click when overlayed
278
- if (toolbar.filter('[data-settings~="hide"]').length != 0) {
279
- main.click(function() { toolbar_toggle(uid, undefined, undefined, 0); });
280
- plain.click(function() { toolbar_toggle(uid, false, undefined, 0); });
281
- }
282
- } else {
283
- toolbar.css('z-index', 4);
284
- }
285
- // Enable delay on mouseout
286
- if (toolbar.filter('[data-settings~="delay"]').length != 0) {
287
- crayon[uid].toolbar_delay = 500;
288
- }
289
- // Use .hover() for chrome, but in firefox mouseover/mouseout worked best
290
- c.mouseenter(function() { toolbar_toggle(uid, true); })
291
- .mouseleave(function() { toolbar_toggle(uid, false); });
292
-
293
- } else if (touchscreen) {
294
- toolbar.show();
295
- }
296
- // Plain show events
297
- if (plain.length != 0 && !touchscreen) {
298
- if (plain.filter('[data-settings~="dblclick"]').length != 0) {
299
- main.dblclick(function() { CrayonSyntax.toggle_plain(uid); });
300
- } else if (plain.filter('[data-settings~="click"]').length != 0) {
301
- main.click(function() { CrayonSyntax.toggle_plain(uid); });
302
- } else if (plain.filter('[data-settings~="mouseover"]').length != 0) {
303
- c.mouseenter(function() { CrayonSyntax.toggle_plain(uid, true); })
304
- .mouseleave(function() { CrayonSyntax.toggle_plain(uid, false); });
305
- nums_button.hide();
306
- }
307
- if (plain.filter('[data-settings~="show-plain-default"]').length != 0) {
308
- // XXX
309
- CrayonSyntax.toggle_plain(uid, true);
310
- }
311
- }
312
- // Scrollbar show events
313
- if (!touchscreen && c.filter('[data-settings~="scroll-mouseover"]').length != 0) {
314
- // Disable on touchscreen devices and when set to mouseover
315
- main.css('overflow', 'hidden');
316
- plain.css('overflow', 'hidden');
317
-
318
- console_log(plain.css('overflow'));
319
-
320
- c.mouseenter(function() { toggle_scroll(uid, true); })
321
- .mouseleave(function() { toggle_scroll(uid, false); });
322
- }
323
- // Disable animations
324
- if ( c.filter('[data-settings~="disable-anim"]').length != 0 ) {
325
- crayon[uid].time = 0;
326
- }
327
-
328
- // Wrap
329
- if ( c.filter('[data-settings~="wrap"]').length != 0 ) {
330
- crayon[uid].wrapped = true;
331
- }
332
-
333
- // Determine if Mac
334
- crayon[uid].mac = c.hasClass('crayon-os-mac');
335
-
336
- // Update clickable buttons
337
- update_nums_button(uid);
338
- update_plain_button(uid);
339
- update_wrap(uid);
340
- };
341
-
342
- var make_uid = function(uid) {
343
- console_log(crayon);
344
- if (typeof crayon[uid] == 'undefined') {
345
- crayon[uid] = $('#'+uid);
346
- console_log('make ' + uid);
347
- return true;
348
- }
349
-
350
- console_log('no make ' + uid);
351
- return false;
352
- };
353
-
354
- var getUID = function() {
355
- return currUID++;
356
- };
357
-
358
- var code_popup = function(uid) {
359
- if (typeof crayon[uid] == 'undefined') {
360
- return make_uid(uid);
361
- }
362
- var settings = crayon[uid].popup_settings;
363
- if (settings.data) {
364
- // Already done
365
- return;
366
- }
367
-
368
- var clone = crayon[uid].clone(true);
369
- clone.removeClass('crayon-wrapped');
370
-
371
- // Unwrap
372
- if (crayon[uid].wrapped) {
373
- $(CRAYON_NUM, clone).each(function() {
374
- var line_id = $(this).attr('data-line');
375
- var line = $('#' + line_id);
376
- var height = line.attr('data-height');
377
- height = height ? height : '';
378
- if (typeof height != 'undefined') {
379
- line.css('height', height);
380
- $(this).css('height', height);
381
- }
382
- });
383
- }
384
- clone.find(CRAYON_MAIN).css('height', '');
385
-
386
- var code = '';
387
- if (crayon[uid].plain_visible) {
388
- code = clone.find(CRAYON_PLAIN);
389
- } else {
390
- code = clone.find(CRAYON_MAIN);
391
- }
392
-
393
- settings.data = get_all_css() + '<body class="crayon-popup-window" style="padding:0; margin:0;"><div class="' + clone.attr('class') +
394
- ' crayon-popup">' + remove_css_inline(get_jquery_str(code)) + '</div></body>';
395
- };
396
-
397
- var get_jquery_str = function(object) {
398
- return $('<div>').append(object.clone()).remove().html();
399
- };
400
-
401
- var remove_css_inline = function(string) {
402
- var reStyle = /style\s*=\s*"([^"]+)"/gmi;
403
-
404
- var match = null;
405
- while ((match = reStyle.exec(string)) != null) {
406
- var repl = match[1];
407
- repl = repl.replace(/\bwidth\s*:[^;]+;/gmi, '');
408
- string = string.sliceReplace(match.index, match.index + match[0].length, 'style="' + repl + '"');
409
- }
410
-
411
- console.log(string);
412
-
413
- return string;
414
- };
415
-
416
- // Get all CSS on the page as a string
417
- var get_all_css = function() {
418
- var css_str = '';
419
- css = $('link[rel="stylesheet"]').each(function() {
420
- var string = get_jquery_str($(this));
421
- css_str += string;
422
- });
423
- return css_str;
424
- };
425
-
426
- this.copy_plain = function(uid, hover) {
427
- if (typeof crayon[uid] == 'undefined') {
428
- return make_uid(uid);
429
- }
430
-
431
- var plain = crayon[uid].plain;
432
-
433
- this.toggle_plain(uid, true, true);
434
- toolbar_toggle(uid, true);
435
-
436
- key = crayon[uid].mac ? '\u2318' : 'CTRL';
437
- var text = crayon[uid].copy_button.attr('data-text');
438
- text = text.replace(/%s/, key + '+C');
439
- text = text.replace(/%s/, key + '+V');
440
- crayon_info(uid, text);
441
- return false;
442
- };
443
-
444
- var crayon_info = function(uid, text, show) {
445
- if (typeof crayon[uid] == 'undefined') {
446
- return make_uid(uid);
447
- }
448
-
449
- var info = crayon[uid].info;
450
-
451
- if (typeof text == 'undefined') {
452
- text = '';
453
- }
454
- if (typeof show == 'undefined') {
455
- show = true;
456
- }
457
-
458
- if (crayon_is_slide_hidden(info) && show) {
459
- info.html('<div>' + text + '</div>');
460
- info.css('margin-top', -info.height());
461
- info.show();
462
- crayon_slide(uid, info, true);
463
- setTimeout(function() {
464
- crayon_slide(uid, info, false);
465
- }, 5000);
466
- }
467
-
468
- if (!show) {
469
- crayon_slide(uid, info, false);
470
- }
471
-
472
- };
473
-
474
- var crayon_is_slide_hidden = function(object) {
475
- var object_neg_height = '-' + object.height() + 'px';
476
- if (object.css('margin-top') == object_neg_height || object.css('display') == 'none') {
477
- return true;
478
- } else {
479
- return false;
480
- }
481
- };
482
-
483
- var crayon_slide = function(uid, object, show, anim_time, hide_delay) {
484
- var object_neg_height = '-' + object.height() + 'px';
485
-
486
- if (typeof show == 'undefined') {
487
- if (crayon_is_slide_hidden(object)) {
488
- show = true;
489
- } else {
490
- show = false;
491
- }
492
- }
493
- // Instant means no time delay for showing/hiding
494
- if (typeof anim_time == 'undefined') {
495
- anim_time = 100;
496
- }
497
- if (anim_time == false) {
498
- anim_time = false;
499
- }
500
- if (typeof hide_delay== 'undefined') {
501
- hide_delay = 0;
502
- }
503
- object.stop(true);
504
- if (show == true) {
505
- object.show();
506
- object.animate({
507
- marginTop: 0
508
- }, animt(anim_time, uid));
509
- } else if (show == false) {
510
- // Delay if fully visible
511
- if (/*instant == false && */object.css('margin-top') == '0px' && hide_delay) {
512
- object.delay(hide_delay);
513
- }
514
- object.animate({
515
- marginTop: object_neg_height
516
- }, animt(anim_time, uid), function() {
517
- object.hide();
518
- });
519
- }
520
- };
521
-
522
- this.toggle_plain = function(uid, hover, select) {
523
- if (typeof crayon[uid] == 'undefined') {
524
- return make_uid(uid);
525
- }
526
-
527
- var main = crayon[uid].main;
528
- var plain = crayon[uid].plain;
529
-
530
- if ( (main.is(':animated') || plain.is(':animated')) && typeof hover == 'undefined' ) {
531
- return;
532
- }
533
-
534
- reconsile_dimensions(uid);
535
-
536
- var visible, hidden;
537
- if (typeof hover != 'undefined') {
538
- if (hover) {
539
- visible = main;
540
- hidden = plain;
541
- } else {
542
- visible = plain;
543
- hidden = main;
544
- }
545
- } else {
546
- if (main.css('z-index') == 1) {
547
- visible = main;
548
- hidden = plain;
549
- } else {
550
- visible = plain;
551
- hidden = main;
552
- }
553
- }
554
-
555
- crayon[uid].plain_visible = (hidden == plain);
556
-
557
- // Remember scroll positions of visible
558
- crayon[uid].top = visible.scrollTop();
559
- crayon[uid].left = visible.scrollLeft();
560
-
561
- /* Used to detect a change in overflow when the mouse moves out
562
- * of the Crayon. If it does, then overflow has already been changed,
563
- * no need to revert it after toggling plain. */
564
- crayon[uid].scroll_changed = false;
565
-
566
- // Hide scrollbars during toggle to avoid Chrome weird draw error
567
- // visible.css('overflow', 'hidden');
568
- // hidden.css('overflow', 'hidden');
569
-
570
- fix_scroll_blank(uid);
571
-
572
- // Show hidden, hide visible
573
- visible.stop(true);
574
- visible.fadeTo(animt(500, uid), 0,
575
- function() {
576
- visible.css('z-index', 0);
577
- });
578
- hidden.stop(true);
579
- hidden.fadeTo(animt(500, uid), 1,
580
- function() {
581
- hidden.css('z-index', 1);
582
- // Give focus to plain code
583
- if (hidden == plain) {
584
- if (select) {
585
- plain.select();
586
- } else {
587
- // XXX not needed
588
- // plain.focus();
589
- }
590
- }
591
-
592
- // Refresh scrollbar draw
593
- hidden.scrollTop(crayon[uid].top + 1);
594
- hidden.scrollTop(crayon[uid].top);
595
- hidden.scrollLeft(crayon[uid].left + 1);
596
- hidden.scrollLeft(crayon[uid].left);
597
- });
598
-
599
- // Restore scroll positions to hidden
600
- hidden.scrollTop(crayon[uid].top);
601
- hidden.scrollLeft(crayon[uid].left);
602
-
603
- update_plain_button(uid);
604
-
605
- // Hide toolbar if possible
606
- toolbar_toggle(uid, false);
607
- return false;
608
- };
609
-
610
- this.toggle_nums = function(uid, hide, instant) {
611
- if (typeof crayon[uid] == 'undefined') {
612
- make_uid(uid);
613
- return false;
614
- }
615
-
616
- if (crayon[uid].table.is(':animated')) {
617
- return false;
618
- }
619
- var nums_width = Math.round(crayon[uid].nums_content.width() + 1);
620
- var neg_width = '-' + nums_width + 'px';
621
-
622
- // Force hiding
623
- var num_hidden;
624
- if (typeof hide != 'undefined') {
625
- num_hidden = false;
626
- } else {
627
- // Check hiding
628
- num_hidden = (crayon[uid].table.css('margin-left') == neg_width);
629
- }
630
-
631
- var num_margin;
632
- if (num_hidden) {
633
- // Show
634
- num_margin = '0px';
635
- crayon[uid].nums_visible = true;
636
- } else {
637
- // Hide
638
- crayon[uid].table.css('margin-left', '0px');
639
- crayon[uid].nums_visible = false;
640
- num_margin = neg_width;
641
- }
642
-
643
- if (typeof instant != 'undefined') {
644
- crayon[uid].table.css('margin-left', num_margin);
645
- update_nums_button(uid);
646
- return false;
647
- }
648
-
649
- // Stop jerking animation from scrollbar appearing for a split second due to
650
- // change in width. Prevents scrollbar disappearing if already visible.
651
- h_scroll_visible = (crayon[uid].table.width() + px_to_int(crayon[uid].table.css('margin-left')) > crayon[uid].main.width());
652
- v_scroll_visible = (crayon[uid].table.height() > crayon[uid].main.height());
653
- if (!h_scroll_visible && !v_scroll_visible) {
654
- crayon[uid].main.css('overflow', 'hidden');
655
- }
656
- crayon[uid].table.animate({
657
- marginLeft: num_margin
658
- }, animt(200, uid), function() {
659
- if (typeof crayon[uid] != 'undefined') {
660
- update_nums_button(uid);
661
- if (!h_scroll_visible && !v_scroll_visible) {
662
- crayon[uid].main.css('overflow', 'auto');
663
- }
664
- }
665
- });
666
- return false;
667
- };
668
-
669
- this.toggle_wrap = function(uid) {
670
- crayon[uid].wrapped = !crayon[uid].wrapped;
671
- update_wrap(uid);
672
- };
673
-
674
- var update_wrap = function(uid) {
675
- if (crayon[uid].wrapped) {
676
- crayon[uid].addClass(CRAYON_WRAPPED);
677
- } else {
678
- crayon[uid].removeClass(CRAYON_WRAPPED);
679
- }
680
- update_wrap_button(uid);
681
- crayon[uid].wrap_times = 0;
682
- crayon[uid].wrap_timer = setInterval(function() {
683
- reconsile_lines(uid);
684
- crayon[uid].wrap_times++;
685
- if (crayon[uid].wrap_times == 5) {
686
- clearInterval(crayon[uid].wrap_timer);
687
- }
688
- }, 200);
689
- };
690
-
691
- var fix_table_width = function(uid) {
692
- if (typeof crayon[uid] == 'undefined') {
693
- make_uid(uid);
694
- return false;
695
- }
696
- };
697
-
698
- // Convert '-10px' to -10
699
- var px_to_int = function(pixels) {
700
- if (typeof pixels != 'string') {
701
- return 0;
702
- }
703
- var result = pixels.replace(/[^-0-9]/g, '');
704
- if (result.length == 0) {
705
- return 0;
706
- } else {
707
- return parseInt(result);
708
- }
709
- };
710
-
711
- var update_nums_button = function(uid) {
712
- if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].nums_visible == 'undefined') {
713
- return;
714
- }
715
- if (crayon[uid].nums_visible) {
716
- crayon[uid].nums_button.removeClass(UNPRESSED);
717
- crayon[uid].nums_button.addClass(PRESSED);
718
- } else {
719
- // TODO doesn't work on iPhone
720
- crayon[uid].nums_button.removeClass(PRESSED);
721
- crayon[uid].nums_button.addClass(UNPRESSED);
722
- }
723
- };
724
-
725
- var update_wrap_button = function(uid) {
726
- if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].wrapped == 'undefined') {
727
- return;
728
- }
729
- if (crayon[uid].wrapped) {
730
- crayon[uid].wrap_button.removeClass(UNPRESSED);
731
- crayon[uid].wrap_button.addClass(PRESSED);
732
- } else {
733
- // TODO doesn't work on iPhone
734
- crayon[uid].wrap_button.removeClass(PRESSED);
735
- crayon[uid].wrap_button.addClass(UNPRESSED);
736
- }
737
- };
738
-
739
- var update_plain_button = function(uid) {
740
- if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].plain_visible == 'undefined') {
741
- return;
742
- }
743
-
744
- if (crayon[uid].plain_visible) {
745
- crayon[uid].plain_button.removeClass(UNPRESSED);
746
- crayon[uid].plain_button.addClass(PRESSED);
747
- } else {
748
- // TODO doesn't work on iPhone
749
- crayon[uid].plain_button.removeClass(PRESSED);
750
- crayon[uid].plain_button.addClass(UNPRESSED);
751
- }
752
- };
753
-
754
- var toolbar_toggle = function(uid, show, anim_time, hide_delay) {
755
- if (typeof crayon[uid] == 'undefined') {
756
- return make_uid(uid);
757
- } else if (!crayon[uid].toolbar_mouseover) {
758
- return;
759
- }
760
- var toolbar = crayon[uid].toolbar;
761
-
762
- if (typeof hide_delay == 'undefined') {
763
- hide_delay = crayon[uid].toolbar_delay;
764
- }
765
-
766
- crayon_slide(uid, toolbar, show, anim_time, hide_delay);
767
- };
768
-
769
- var toggle_scroll = function(uid, show) {
770
- if (typeof crayon[uid] == 'undefined') {
771
- return make_uid(uid);
772
- }
773
- if (typeof show == 'undefined') {
774
- return;
775
- }
776
-
777
- var main = crayon[uid].main;
778
- var plain = crayon[uid].plain;
779
-
780
- var main_size = {width:main.width(), height:main.height()};
781
-
782
- if (show) {
783
- main.css('overflow', 'auto');
784
- plain.css('overflow', 'auto');
785
- if (typeof crayon[uid].top != 'undefined') {
786
- visible = (main.css('z-index') == 1 ? main : plain);
787
- // Browser will not render until scrollbar moves, move it manually
788
- visible.scrollTop(crayon[uid].top-1);
789
- visible.scrollTop(crayon[uid].top);
790
- visible.scrollLeft(crayon[uid].left-1);
791
- visible.scrollLeft(crayon[uid].left);
792
- }
793
- if (!crayon[uid].scroll_block_fix) {
794
- // Fix dimensions so scrollbars stay inside
795
- main.css('height', main_size.height);
796
- main.css('width', main_size.width);
797
- } else {
798
- // Relax dimensions so scrollbars are visible
799
- main.css('height', '');
800
- main.css('max-height', '');
801
- main.css('min-height', '');
802
- main.css('width', '');
803
- }
804
- } else {
805
- visible = (main.css('z-index') == 1 ? main : plain);
806
- crayon[uid].top = visible.scrollTop();
807
- crayon[uid].left = visible.scrollLeft();
808
- main.css('overflow', 'hidden');
809
- plain.css('overflow', 'hidden');
810
- if (!crayon[uid].scroll_block_fix) {
811
- // Restore dimensions
812
- main.css('height', crayon[uid].main_style['height']);
813
- main.css('max-height', crayon[uid].main_style['max-height']);
814
- main.css('min-height', crayon[uid].main_style['min-height']);
815
- main.css('width', crayon[uid].main_style['width']);
816
- }
817
- }
818
- // Register that overflow has changed
819
- crayon[uid].scroll_changed = true;
820
- fix_scroll_blank(uid);
821
- reconsile_dimensions(uid);
822
- };
823
-
824
- /* Fix weird draw error, causes blank area to appear where scrollbar once was. */
825
- var fix_scroll_blank = function(uid) {
826
- // Scrollbar draw error in Chrome
827
- crayon[uid].table.style('width', '100%', 'important');
828
- var redraw = setTimeout(function() {
829
- crayon[uid].table.style('width', '');
830
- clearInterval(redraw);
831
- }, 10);
832
- };
833
-
834
- var reconsile_dimensions = function(uid) {
835
- // Reconsile dimensions
836
- crayon[uid].plain.height(crayon[uid].main.height());
837
- };
838
-
839
- var reconsile_lines = function(uid) {
840
- $(CRAYON_NUM, crayon[uid]).each(function() {
841
- var line_id = $(this).attr('data-line');
842
- var line = $('#' + line_id);
843
- if (crayon[uid].wrapped) {
844
  line.css('height', '');
845
- $(this).css('height', line.height());
846
- // TODO toolbar should overlay title if needed
847
- } else {
848
  var height = line.attr('data-height');
849
- height = height ? height : '';
850
  if (typeof height != 'undefined') {
851
  line.css('height', height);
852
  $(this).css('height', height);
853
  }
854
- }
855
- });
856
- var main = crayon[uid].main;
857
- var height = main.css('height');
858
- main.css('height', '');
859
- };
860
-
861
- var animt = function(x, uid) {
862
- if (x == 'fast') {
863
- x = 200;
864
- } else if (x == 'slow') {
865
- x = 600;
866
- } else if (!isNumber(x)) {
867
- x = parseInt(x);
868
- if (isNaN(x)) {
869
- return 0;
870
- }
871
- }
872
- return x * crayon[uid].time;
873
- };
874
-
875
- var isNumber = function(x) {
876
- return typeof x == 'number';
877
- };
878
-
879
- };
880
 
881
  })(jQueryCrayon);
2
 
3
  (function($) {
4
 
5
+ // BEGIN AUXILIARY FUNCTIONS
6
+
7
+ $.fn.exists = function () {
8
+ return this.length !== 0;
9
+ };
10
+
11
+ $.fn.style = function(styleName, value, priority) {
12
+ // DOM node
13
+ var node = this.get(0);
14
+ // Ensure we have a DOM node
15
+ if (typeof node == 'undefined') {
16
+ return;
17
+ }
18
+ // CSSStyleDeclaration
19
+ var style = node.style;
20
+ // Getter/Setter
21
+ if (typeof styleName != 'undefined') {
22
+ if (typeof value != 'undefined') {
23
+ // Set style property
24
+ var priority = typeof priority != 'undefined' ? priority : '';
25
+ if (typeof style.setProperty != 'undefined') {
26
+ style.setProperty(styleName, value, priority);
27
+ } else {
28
+ style.styleName = value + ' ' + priority;
29
+ }
30
+ } else {
31
+ // Get style property
32
+ return style.styleName;
33
+ }
34
+ } else {
35
+ // Get CSSStyleDeclaration
36
+ return style;
37
+ }
38
+ };
39
+
40
+ // END AUXILIARY FUNCTIONS
41
+
42
+ var PRESSED = 'crayon-pressed';
43
+ var UNPRESSED = '';
44
+
45
+ var CRAYON_SYNTAX = 'div.crayon-syntax';
46
+ var CRAYON_TOOLBAR = '.crayon-toolbar';
47
+ var CRAYON_INFO = '.crayon-info';
48
+ var CRAYON_PLAIN = '.crayon-plain';
49
+ var CRAYON_MAIN = '.crayon-main';
50
+ var CRAYON_TABLE = '.crayon-table';
51
+ var CRAYON_LOADING = '.crayon-loading';
52
+ var CRAYON_CODE = '.crayon-code';
53
+ var CRAYON_NUMS = '.crayon-nums';
54
+ var CRAYON_NUM = '.crayon-num';
55
+ var CRAYON_LINE = '.crayon-line';
56
+ var CRAYON_WRAPPED = 'crayon-wrapped';
57
+ var CRAYON_NUMS_CONTENT = '.crayon-nums-content';
58
+ var CRAYON_NUMS_BUTTON = '.crayon-nums-button';
59
+ var CRAYON_WRAP_BUTTON = '.crayon-wrap-button';
60
+ var CRAYON_POPUP_BUTTON = '.crayon-popup-button';
61
+ var CRAYON_COPY_BUTTON = '.crayon-copy-button';
62
+ var CRAYON_PLAIN_BUTTON = '.crayon-plain-button';
63
+
64
+ $(document).ready(function() {
65
+ CrayonSyntax.init();
66
+ });
67
+
68
+ CrayonSyntax = new function() {
69
+ var crayon = new Object();
70
+ var currUID = 0;
71
+
72
+ this.init = function() {
73
+ if (typeof crayon == 'undefined') {
74
+ crayon = new Object();
75
+ }
76
+
77
+ $(CRAYON_SYNTAX).each(function() {
78
+ CrayonSyntax.process(this);
79
+ });
80
+ };
81
+
82
+ this.process = function(c, replace) {
83
+ c = $(c);
84
+ var uid = c.attr('id');
85
+ if (uid == 'crayon-') {
86
+ // No ID, generate one
87
+ uid += getUID();
88
+ }
89
+ c.attr('id', uid);
90
+ console_log(uid);
91
+
92
+ if (typeof replace == 'undefined') {
93
+ replace = false;
94
+ }
95
+
96
+ if (!replace && !make_uid(uid)) {
97
+ // Already a Crayon
98
+ return;
99
+ }
100
+
101
+ var toolbar = c.find(CRAYON_TOOLBAR);
102
+ var info = c.find(CRAYON_INFO);
103
+ var plain = c.find(CRAYON_PLAIN);
104
+ var main = c.find(CRAYON_MAIN);
105
+ var table = c.find(CRAYON_TABLE);
106
+ var code = c.find(CRAYON_CODE);
107
+ var nums = c.find(CRAYON_NUMS);
108
+ var nums_content = c.find(CRAYON_NUMS_CONTENT);
109
+ var nums_button = c.find(CRAYON_NUMS_BUTTON);
110
+ var wrap_button = c.find(CRAYON_WRAP_BUTTON);
111
+ var popup_button = c.find(CRAYON_POPUP_BUTTON);
112
+ var copy_button = c.find(CRAYON_COPY_BUTTON);
113
+ var plain_button = c.find(CRAYON_PLAIN_BUTTON);
114
+
115
+ crayon[uid] = c;
116
+ crayon[uid].toolbar = toolbar;
117
+ crayon[uid].plain = plain;
118
+ crayon[uid].info = info;
119
+ crayon[uid].main = main;
120
+ crayon[uid].table = table;
121
+ crayon[uid].code = code;
122
+ crayon[uid].nums = nums;
123
+ crayon[uid].nums_content = nums_content;
124
+ crayon[uid].nums_button = nums_button;
125
+ crayon[uid].wrap_button = wrap_button;
126
+ crayon[uid].popup_button = popup_button;
127
+ crayon[uid].copy_button = copy_button;
128
+ crayon[uid].plain_button = plain_button;
129
+ crayon[uid].nums_visible = true;
130
+ crayon[uid].wrapped = false;
131
+ crayon[uid].plain_visible = false;
132
+
133
+ crayon[uid].toolbar_delay = 0;
134
+ crayon[uid].time = 1;
135
+
136
+ // Set plain
137
+ $(CRAYON_PLAIN).css('z-index', 0);
138
+
139
+ // XXX Remember CSS dimensions
140
+ var main_style = main.style();
141
+ crayon[uid].main_style = {
142
+ 'height': main_style && main_style.height || '',
143
+ 'max-height': main_style && main_style.maxHeight || '',
144
+ 'min-height': main_style && main_style.minHeight || '',
145
+ 'width': main_style && main_style.width || ''
146
+ };
147
+
148
+ var load_timer;
149
+ var i = 0;
150
+ crayon[uid].loading = true;
151
+ crayon[uid].scroll_block_fix = false;
152
+
153
+ // Register click events
154
+ nums_button.click(function() { CrayonSyntax.toggle_nums(uid); });
155
+ wrap_button.click(function() { CrayonSyntax.toggle_wrap(uid); });
156
+ plain_button.click(function() { CrayonSyntax.toggle_plain(uid); });
157
+ copy_button.click(function() { CrayonSyntax.copy_plain(uid); });
158
+
159
+ var load_func = function() {
160
+ if (main.height() < 30) {
161
+ crayon[uid].scroll_block_fix = true;
162
+ }
163
+
164
+ // If nums hidden by default
165
+ if (nums.filter('[data-settings~="hide"]').length != 0) {
166
+ nums_content.ready(function() {
167
+ console_log('function' + uid);
168
+ CrayonSyntax.toggle_nums(uid, true, true);
169
+ });
170
+ } else {
171
+ update_nums_button(uid);
172
+ }
173
+
174
+ // TODO If width has changed or timeout, stop timer
175
+ if (/*last_num_width != nums.width() ||*/ i == 5) {
176
+ clearInterval(load_timer);
177
+ //crayon[uid].removeClass(CRAYON_LOADING);
178
+ crayon[uid].loading = false;
179
+ }
180
+ i++;
181
+ };
182
+ load_timer = setInterval(load_func, 300);
183
+ fix_scroll_blank(uid);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
  $(CRAYON_NUM, crayon[uid]).each(function() {
186
  var line_id = $(this).attr('data-line');
191
  }
192
  });
193
 
194
+ // Used for toggling
195
+ main.css('position', 'relative');
196
+ main.css('z-index', 1);
197
+
198
+ // Disable certain features for touchscreen devices
199
+ touchscreen = (c.filter('[data-settings~="touchscreen"]').length != 0);
200
+
201
+ // Used to hide info
202
+ if (!touchscreen) {
203
+ main.click(function() { crayon_info(uid, '', false); });
204
+ plain.click(function() { crayon_info(uid, '', false); });
205
+ info.click(function() { crayon_info(uid, '', false); });
206
+ }
207
+
208
+ // Used for code popup
209
+ crayon[uid].popup_settings = popupWindow(popup_button, {
210
+ height:screen.height - 200,
211
+ width:screen.width - 100,
212
+ top:75,
213
+ left:50,
214
+ scrollbars:1,
215
+ windowURL:'',
216
+ data:'' // Data overrides URL
217
+ }, function() {
218
+ code_popup(uid);
219
+ }, function() {
220
+ //console_log('after');
221
+ });
222
+
223
+ plain.css('opacity', 0);
224
+ // If a toolbar with mouseover was found
225
+ if (toolbar.filter('[data-settings~="mouseover"]').length != 0 && !touchscreen) {
226
+ crayon[uid].toolbar_mouseover = true;
227
+
228
+ toolbar.css('margin-top', '-' + toolbar.height() + 'px');
229
+ toolbar.hide();
230
+ // Overlay the toolbar if needed, only if doing so will not hide the
231
+ // whole code!
232
+ if (toolbar.filter('[data-settings~="overlay"]').length != 0
233
+ && main.height() > toolbar.height() * 2) {
234
+ toolbar.css('position', 'absolute');
235
+ toolbar.css('z-index', 2);
236
+ // Hide on single click when overlayed
237
+ if (toolbar.filter('[data-settings~="hide"]').length != 0) {
238
+ main.click(function() { toolbar_toggle(uid, undefined, undefined, 0); });
239
+ plain.click(function() { toolbar_toggle(uid, false, undefined, 0); });
240
+ }
241
+ } else {
242
+ toolbar.css('z-index', 4);
243
+ }
244
+ // Enable delay on mouseout
245
+ if (toolbar.filter('[data-settings~="delay"]').length != 0) {
246
+ crayon[uid].toolbar_delay = 500;
247
+ }
248
+ // Use .hover() for chrome, but in firefox mouseover/mouseout worked best
249
+ c.mouseenter(function() { toolbar_toggle(uid, true); })
250
+ .mouseleave(function() { toolbar_toggle(uid, false); });
251
+
252
+ } else if (touchscreen) {
253
+ toolbar.show();
254
+ }
255
+ // Plain show events
256
+ if (plain.length != 0 && !touchscreen) {
257
+ if (plain.filter('[data-settings~="dblclick"]').length != 0) {
258
+ main.dblclick(function() { CrayonSyntax.toggle_plain(uid); });
259
+ } else if (plain.filter('[data-settings~="click"]').length != 0) {
260
+ main.click(function() { CrayonSyntax.toggle_plain(uid); });
261
+ } else if (plain.filter('[data-settings~="mouseover"]').length != 0) {
262
+ c.mouseenter(function() { CrayonSyntax.toggle_plain(uid, true); })
263
+ .mouseleave(function() { CrayonSyntax.toggle_plain(uid, false); });
264
+ nums_button.hide();
265
+ }
266
+ if (plain.filter('[data-settings~="show-plain-default"]').length != 0) {
267
+ // XXX
268
+ CrayonSyntax.toggle_plain(uid, true);
269
+ }
270
+ }
271
+ // Scrollbar show events
272
+ if (!touchscreen && c.filter('[data-settings~="scroll-mouseover"]').length != 0) {
273
+ // Disable on touchscreen devices and when set to mouseover
274
+ main.css('overflow', 'hidden');
275
+ plain.css('overflow', 'hidden');
276
+
277
+ console_log(plain.css('overflow'));
278
+
279
+ c.mouseenter(function() { toggle_scroll(uid, true); })
280
+ .mouseleave(function() { toggle_scroll(uid, false); });
281
+ }
282
+ // Disable animations
283
+ if ( c.filter('[data-settings~="disable-anim"]').length != 0 ) {
284
+ crayon[uid].time = 0;
285
+ }
286
+
287
+ // Wrap
288
+ if ( c.filter('[data-settings~="wrap"]').length != 0 ) {
289
+ crayon[uid].wrapped = true;
290
+ }
291
+
292
+ // Determine if Mac
293
+ crayon[uid].mac = c.hasClass('crayon-os-mac');
294
+
295
+ // Update clickable buttons
296
+ update_nums_button(uid);
297
+ update_plain_button(uid);
298
+ update_wrap(uid);
299
+ };
300
+
301
+ var make_uid = function(uid) {
302
+ console_log(crayon);
303
+ if (typeof crayon[uid] == 'undefined') {
304
+ crayon[uid] = $('#'+uid);
305
+ console_log('make ' + uid);
306
+ return true;
307
+ }
308
+
309
+ console_log('no make ' + uid);
310
+ return false;
311
+ };
312
+
313
+ var getUID = function() {
314
+ return currUID++;
315
+ };
316
+
317
+ var code_popup = function(uid) {
318
+ if (typeof crayon[uid] == 'undefined') {
319
+ return make_uid(uid);
320
+ }
321
+ var settings = crayon[uid].popup_settings;
322
+ if (settings.data) {
323
+ // Already done
324
+ return;
325
+ }
326
+
327
+ var clone = crayon[uid].clone(true);
328
+ clone.removeClass('crayon-wrapped');
329
+
330
+ // Unwrap
331
+ if (crayon[uid].wrapped) {
332
+ $(CRAYON_NUM, clone).each(function() {
333
+ var line_id = $(this).attr('data-line');
334
+ var line = $('#' + line_id);
335
+ var height = line.attr('data-height');
336
+ height = height ? height : '';
337
+ if (typeof height != 'undefined') {
338
+ line.css('height', height);
339
+ $(this).css('height', height);
340
+ }
341
+ });
342
+ }
343
+ clone.find(CRAYON_MAIN).css('height', '');
344
+
345
+ var code = '';
346
+ if (crayon[uid].plain_visible) {
347
+ code = clone.find(CRAYON_PLAIN);
348
+ } else {
349
+ code = clone.find(CRAYON_MAIN);
350
+ }
351
+
352
+ settings.data = get_all_css() + '<body class="crayon-popup-window" style="padding:0; margin:0;"><div class="' + clone.attr('class') +
353
+ ' crayon-popup">' + remove_css_inline(get_jquery_str(code)) + '</div></body>';
354
+ };
355
+
356
+ var get_jquery_str = function(object) {
357
+ return $('<div>').append(object.clone()).remove().html();
358
+ };
359
+
360
+ var remove_css_inline = function(string) {
361
+ var reStyle = /style\s*=\s*"([^"]+)"/gmi;
362
+ var match = null;
363
+ while ((match = reStyle.exec(string)) != null) {
364
+ var repl = match[1];
365
+ repl = repl.replace(/\b(?:width|height)\s*:[^;]+;/gmi, '');
366
+ string = string.sliceReplace(match.index, match.index + match[0].length, 'style="' + repl + '"');
367
+ }
368
+ return string;
369
+ };
370
+
371
+ // Get all CSS on the page as a string
372
+ var get_all_css = function() {
373
+ var css_str = '';
374
+ css = $('link[rel="stylesheet"][href*="crayon-syntax-highlighter"]').each(function() {
375
+ var string = get_jquery_str($(this));
376
+ css_str += string;
377
+ });
378
+ return css_str;
379
+ };
380
+
381
+ this.copy_plain = function(uid, hover) {
382
+ if (typeof crayon[uid] == 'undefined') {
383
+ return make_uid(uid);
384
+ }
385
+
386
+ var plain = crayon[uid].plain;
387
+
388
+ this.toggle_plain(uid, true, true);
389
+ toolbar_toggle(uid, true);
390
+
391
+ key = crayon[uid].mac ? '\u2318' : 'CTRL';
392
+ var text = crayon[uid].copy_button.attr('data-text');
393
+ text = text.replace(/%s/, key + '+C');
394
+ text = text.replace(/%s/, key + '+V');
395
+ crayon_info(uid, text);
396
+ return false;
397
+ };
398
+
399
+ var crayon_info = function(uid, text, show) {
400
+ if (typeof crayon[uid] == 'undefined') {
401
+ return make_uid(uid);
402
+ }
403
+
404
+ var info = crayon[uid].info;
405
+
406
+ if (typeof text == 'undefined') {
407
+ text = '';
408
+ }
409
+ if (typeof show == 'undefined') {
410
+ show = true;
411
+ }
412
+
413
+ if (crayon_is_slide_hidden(info) && show) {
414
+ info.html('<div>' + text + '</div>');
415
+ info.css('margin-top', -info.height());
416
+ info.show();
417
+ crayon_slide(uid, info, true);
418
+ setTimeout(function() {
419
+ crayon_slide(uid, info, false);
420
+ }, 5000);
421
+ }
422
+
423
+ if (!show) {
424
+ crayon_slide(uid, info, false);
425
+ }
426
+
427
+ };
428
+
429
+ var crayon_is_slide_hidden = function(object) {
430
+ var object_neg_height = '-' + object.height() + 'px';
431
+ if (object.css('margin-top') == object_neg_height || object.css('display') == 'none') {
432
+ return true;
433
+ } else {
434
+ return false;
435
+ }
436
+ };
437
+
438
+ var crayon_slide = function(uid, object, show, anim_time, hide_delay) {
439
+ var object_neg_height = '-' + object.height() + 'px';
440
+
441
+ if (typeof show == 'undefined') {
442
+ if (crayon_is_slide_hidden(object)) {
443
+ show = true;
444
+ } else {
445
+ show = false;
446
+ }
447
+ }
448
+ // Instant means no time delay for showing/hiding
449
+ if (typeof anim_time == 'undefined') {
450
+ anim_time = 100;
451
+ }
452
+ if (anim_time == false) {
453
+ anim_time = false;
454
+ }
455
+ if (typeof hide_delay== 'undefined') {
456
+ hide_delay = 0;
457
+ }
458
+ object.stop(true);
459
+ if (show == true) {
460
+ object.show();
461
+ object.animate({
462
+ marginTop: 0
463
+ }, animt(anim_time, uid));
464
+ } else if (show == false) {
465
+ // Delay if fully visible
466
+ if (/*instant == false && */object.css('margin-top') == '0px' && hide_delay) {
467
+ object.delay(hide_delay);
468
+ }
469
+ object.animate({
470
+ marginTop: object_neg_height
471
+ }, animt(anim_time, uid), function() {
472
+ object.hide();
473
+ });
474
+ }
475
+ };
476
+
477
+ this.toggle_plain = function(uid, hover, select) {
478
+ if (typeof crayon[uid] == 'undefined') {
479
+ return make_uid(uid);
480
+ }
481
+
482
+ var main = crayon[uid].main;
483
+ var plain = crayon[uid].plain;
484
+
485
+ if ( (main.is(':animated') || plain.is(':animated')) && typeof hover == 'undefined' ) {
486
+ return;
487
+ }
488
+
489
+ reconsile_dimensions(uid);
490
+
491
+ var visible, hidden;
492
+ if (typeof hover != 'undefined') {
493
+ if (hover) {
494
+ visible = main;
495
+ hidden = plain;
496
+ } else {
497
+ visible = plain;
498
+ hidden = main;
499
+ }
500
+ } else {
501
+ if (main.css('z-index') == 1) {
502
+ visible = main;
503
+ hidden = plain;
504
+ } else {
505
+ visible = plain;
506
+ hidden = main;
507
+ }
508
+ }
509
+
510
+ crayon[uid].plain_visible = (hidden == plain);
511
+
512
+ // Remember scroll positions of visible
513
+ crayon[uid].top = visible.scrollTop();
514
+ crayon[uid].left = visible.scrollLeft();
515
+
516
+ /* Used to detect a change in overflow when the mouse moves out
517
+ * of the Crayon. If it does, then overflow has already been changed,
518
+ * no need to revert it after toggling plain. */
519
+ crayon[uid].scroll_changed = false;
520
+
521
+ // Hide scrollbars during toggle to avoid Chrome weird draw error
522
+ // visible.css('overflow', 'hidden');
523
+ // hidden.css('overflow', 'hidden');
524
+
525
+ fix_scroll_blank(uid);
526
+
527
+ // Show hidden, hide visible
528
+ visible.stop(true);
529
+ visible.fadeTo(animt(500, uid), 0,
530
+ function() {
531
+ visible.css('z-index', 0);
532
+ });
533
+ hidden.stop(true);
534
+ hidden.fadeTo(animt(500, uid), 1,
535
+ function() {
536
+ hidden.css('z-index', 1);
537
+ // Give focus to plain code
538
+ if (hidden == plain) {
539
+ if (select) {
540
+ plain.select();
541
+ } else {
542
+ // XXX not needed
543
+ // plain.focus();
544
+ }
545
+ }
546
+
547
+ // Refresh scrollbar draw
548
+ hidden.scrollTop(crayon[uid].top + 1);
549
+ hidden.scrollTop(crayon[uid].top);
550
+ hidden.scrollLeft(crayon[uid].left + 1);
551
+ hidden.scrollLeft(crayon[uid].left);
552
+ });
553
+
554
+ // Restore scroll positions to hidden
555
+ hidden.scrollTop(crayon[uid].top);
556
+ hidden.scrollLeft(crayon[uid].left);
557
+
558
+ update_plain_button(uid);
559
+
560
+ // Hide toolbar if possible
561
+ toolbar_toggle(uid, false);
562
+ return false;
563
+ };
564
+
565
+ this.toggle_nums = function(uid, hide, instant) {
566
+ if (typeof crayon[uid] == 'undefined') {
567
+ make_uid(uid);
568
+ return false;
569
+ }
570
+
571
+ if (crayon[uid].table.is(':animated')) {
572
+ return false;
573
+ }
574
+ var nums_width = Math.round(crayon[uid].nums_content.width() + 1);
575
+ var neg_width = '-' + nums_width + 'px';
576
+
577
+ // Force hiding
578
+ var num_hidden;
579
+ if (typeof hide != 'undefined') {
580
+ num_hidden = false;
581
+ } else {
582
+ // Check hiding
583
+ num_hidden = (crayon[uid].table.css('margin-left') == neg_width);
584
+ }
585
+
586
+ var num_margin;
587
+ if (num_hidden) {
588
+ // Show
589
+ num_margin = '0px';
590
+ crayon[uid].nums_visible = true;
591
+ } else {
592
+ // Hide
593
+ crayon[uid].table.css('margin-left', '0px');
594
+ crayon[uid].nums_visible = false;
595
+ num_margin = neg_width;
596
+ }
597
+
598
+ if (typeof instant != 'undefined') {
599
+ crayon[uid].table.css('margin-left', num_margin);
600
+ update_nums_button(uid);
601
+ return false;
602
+ }
603
+
604
+ // Stop jerking animation from scrollbar appearing for a split second due to
605
+ // change in width. Prevents scrollbar disappearing if already visible.
606
+ h_scroll_visible = (crayon[uid].table.width() + px_to_int(crayon[uid].table.css('margin-left')) > crayon[uid].main.width());
607
+ v_scroll_visible = (crayon[uid].table.height() > crayon[uid].main.height());
608
+ if (!h_scroll_visible && !v_scroll_visible) {
609
+ crayon[uid].main.css('overflow', 'hidden');
610
+ }
611
+ crayon[uid].table.animate({
612
+ marginLeft: num_margin
613
+ }, animt(200, uid), function() {
614
+ if (typeof crayon[uid] != 'undefined') {
615
+ update_nums_button(uid);
616
+ if (!h_scroll_visible && !v_scroll_visible) {
617
+ crayon[uid].main.css('overflow', 'auto');
618
+ }
619
+ }
620
+ });
621
+ return false;
622
+ };
623
+
624
+ this.toggle_wrap = function(uid) {
625
+ crayon[uid].wrapped = !crayon[uid].wrapped;
626
+ update_wrap(uid);
627
+ };
628
+
629
+ var update_wrap = function(uid) {
630
+ if (crayon[uid].wrapped) {
631
+ crayon[uid].addClass(CRAYON_WRAPPED);
632
+ } else {
633
+ crayon[uid].removeClass(CRAYON_WRAPPED);
634
+ }
635
+ update_wrap_button(uid);
636
+ crayon[uid].wrap_times = 0;
637
+ crayon[uid].wrap_timer = setInterval(function() {
638
+ reconsile_lines(uid);
639
+ crayon[uid].wrap_times++;
640
+ if (crayon[uid].wrap_times == 5) {
641
+ clearInterval(crayon[uid].wrap_timer);
642
+ }
643
+ }, 200);
644
+ };
645
+
646
+ var fix_table_width = function(uid) {
647
+ if (typeof crayon[uid] == 'undefined') {
648
+ make_uid(uid);
649
+ return false;
650
+ }
651
+ };
652
+
653
+ // Convert '-10px' to -10
654
+ var px_to_int = function(pixels) {
655
+ if (typeof pixels != 'string') {
656
+ return 0;
657
+ }
658
+ var result = pixels.replace(/[^-0-9]/g, '');
659
+ if (result.length == 0) {
660
+ return 0;
661
+ } else {
662
+ return parseInt(result);
663
+ }
664
+ };
665
+
666
+ var update_nums_button = function(uid) {
667
+ if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].nums_visible == 'undefined') {
668
+ return;
669
+ }
670
+ if (crayon[uid].nums_visible) {
671
+ crayon[uid].nums_button.removeClass(UNPRESSED);
672
+ crayon[uid].nums_button.addClass(PRESSED);
673
+ } else {
674
+ // TODO doesn't work on iPhone
675
+ crayon[uid].nums_button.removeClass(PRESSED);
676
+ crayon[uid].nums_button.addClass(UNPRESSED);
677
+ }
678
+ };
679
+
680
+ var update_wrap_button = function(uid) {
681
+ if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].wrapped == 'undefined') {
682
+ return;
683
+ }
684
+ if (crayon[uid].wrapped) {
685
+ crayon[uid].wrap_button.removeClass(UNPRESSED);
686
+ crayon[uid].wrap_button.addClass(PRESSED);
687
+ } else {
688
+ // TODO doesn't work on iPhone
689
+ crayon[uid].wrap_button.removeClass(PRESSED);
690
+ crayon[uid].wrap_button.addClass(UNPRESSED);
691
+ }
692
+ };
693
+
694
+ var update_plain_button = function(uid) {
695
+ if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].plain_visible == 'undefined') {
696
+ return;
697
+ }
698
+
699
+ if (crayon[uid].plain_visible) {
700
+ crayon[uid].plain_button.removeClass(UNPRESSED);
701
+ crayon[uid].plain_button.addClass(PRESSED);
702
+ } else {
703
+ // TODO doesn't work on iPhone
704
+ crayon[uid].plain_button.removeClass(PRESSED);
705
+ crayon[uid].plain_button.addClass(UNPRESSED);
706
+ }
707
+ };
708
+
709
+ var toolbar_toggle = function(uid, show, anim_time, hide_delay) {
710
+ if (typeof crayon[uid] == 'undefined') {
711
+ return make_uid(uid);
712
+ } else if (!crayon[uid].toolbar_mouseover) {
713
+ return;
714
+ }
715
+ var toolbar = crayon[uid].toolbar;
716
+
717
+ if (typeof hide_delay == 'undefined') {
718
+ hide_delay = crayon[uid].toolbar_delay;
719
+ }
720
+
721
+ crayon_slide(uid, toolbar, show, anim_time, hide_delay);
722
+ };
723
+
724
+ var toggle_scroll = function(uid, show) {
725
+ if (typeof crayon[uid] == 'undefined') {
726
+ return make_uid(uid);
727
+ }
728
+ if (typeof show == 'undefined') {
729
+ return;
730
+ }
731
+
732
+ var main = crayon[uid].main;
733
+ var plain = crayon[uid].plain;
734
+
735
+ if (show) {
736
+ // Show scrollbars
737
+ main.css('overflow', 'auto');
738
+ plain.css('overflow', 'auto');
739
+ if (typeof crayon[uid].top != 'undefined') {
740
+ visible = (main.css('z-index') == 1 ? main : plain);
741
+ // Browser will not render until scrollbar moves, move it manually
742
+ visible.scrollTop(crayon[uid].top-1);
743
+ visible.scrollTop(crayon[uid].top);
744
+ visible.scrollLeft(crayon[uid].left-1);
745
+ visible.scrollLeft(crayon[uid].left);
746
+ }
747
+ main.css('height', main.height());
748
+ main.css('width', main.width());
749
+ } else {
750
+ // Hide scrollbars
751
+ visible = (main.css('z-index') == 1 ? main : plain);
752
+ crayon[uid].top = visible.scrollTop();
753
+ crayon[uid].left = visible.scrollLeft();
754
+ main.css('overflow', 'hidden');
755
+ plain.css('overflow', 'hidden');
756
+ // Restore dimensions
757
+ main.css('height', crayon[uid].main_style['height']);
758
+ main.css('max-height', crayon[uid].main_style['max-height']);
759
+ main.css('min-height', crayon[uid].main_style['min-height']);
760
+ main.css('width', crayon[uid].main_style['width']);
761
+ }
762
+ // Register that overflow has changed
763
+ crayon[uid].scroll_changed = true;
764
+ fix_scroll_blank(uid);
765
+ reconsile_dimensions(uid);
766
+ };
767
+
768
+ /* Fix weird draw error, causes blank area to appear where scrollbar once was. */
769
+ var fix_scroll_blank = function(uid) {
770
+ // Scrollbar draw error in Chrome
771
+ crayon[uid].table.style('width', '100%', 'important');
772
+ var redraw = setTimeout(function() {
773
+ crayon[uid].table.style('width', '');
774
+ clearInterval(redraw);
775
+ }, 10);
776
+ };
777
+
778
+ var reconsile_dimensions = function(uid) {
779
+ // Reconsile dimensions
780
+ crayon[uid].plain.height(crayon[uid].main.height());
781
+ };
782
+
783
+ var reconsile_lines = function(uid) {
784
+ $(CRAYON_NUM, crayon[uid]).each(function() {
785
+ var line_id = $(this).attr('data-line');
786
+ var line = $('#' + line_id);
787
+ if (crayon[uid].wrapped) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
788
  line.css('height', '');
789
+ $(this).css('height', line.height());
790
+ // TODO toolbar should overlay title if needed
791
+ } else {
792
  var height = line.attr('data-height');
793
+ height = height ? height : '';
794
  if (typeof height != 'undefined') {
795
  line.css('height', height);
796
  $(this).css('height', height);
797
  }
798
+ }
799
+ });
800
+ var main = crayon[uid].main;
801
+ var height = main.css('height');
802
+ main.css('height', '');
803
+ };
804
+
805
+ var animt = function(x, uid) {
806
+ if (x == 'fast') {
807
+ x = 200;
808
+ } else if (x == 'slow') {
809
+ x = 600;
810
+ } else if (!isNumber(x)) {
811
+ x = parseInt(x);
812
+ if (isNaN(x)) {
813
+ return 0;
814
+ }
815
+ }
816
+ return x * crayon[uid].time;
817
+ };
818
+
819
+ var isNumber = function(x) {
820
+ return typeof x == 'number';
821
+ };
822
+
823
+ };
824
 
825
  })(jQueryCrayon);
js/crayon_admin.js CHANGED
@@ -1,378 +1,378 @@
1
  // Crayon Syntax Highlighter Admin JavaScript
2
 
3
- (function($) {
4
-
5
- window.CrayonSyntaxAdmin = new function() {
6
- var base = this;
7
-
8
- // Preview
9
- var preview = preview_info = preview_cbox = preview_url = preview_delay_timer = preview_get = null;
10
- // The DOM object ids that trigger a preview update
11
- var preview_obj_names = [];
12
- // The jQuery objects for these objects
13
- var preview_objs = [];
14
- var preview_last_values = [];
15
- // Alignment
16
- var align_drop = float = null;
17
- // Toolbar
18
- var overlay = toolbar = null;
19
- // Error
20
- var msg_cbox = msg = null;
21
- // Log
22
- var log_button = log_text = null;
23
-
24
- var main_wrap = theme_editor_wrap = editor_url = theme_editor_edit_button = theme_editor_create_button = null;
25
- // var theme_editor_loaded = false;
26
- // var theme_editor_loading = false;
27
-
28
- var settings = null;
29
-
30
- base.cssElem = function(id) {
31
- return $(base.addPrefixToID(id));
32
- };
33
-
34
- // Used in Tag Editor
35
- base.addPrefixToID = function(id) {
36
- return id.replace(/^([#.])?(.*)$/, '$1' + settings.prefix + '$2');
37
- };
38
-
39
- base.removePrefixFromID = function(id) {
40
- var re = new RegExp('^[#.]?' + settings.prefix, 'i');
41
- return id.replace(re, '');
42
- };
43
-
44
- base.init = function() {
45
- console_log('admin init');
46
- settings = CrayonSyntaxSettings;
47
-
48
- // Wraps
49
- main_wrap = $('#crayon-main-wrap');
50
- theme_editor_wrap = $('#crayon-theme-editor-wrap');
51
- editor_url = theme_editor_wrap.attr('url');
52
- theme_editor_edit_button = $('#crayon-theme-editor-edit-button');
53
- theme_editor_create_button = $('#crayon-theme-editor-create-button');
54
- theme_editor_edit_button.click(function() {
55
- CrayonSyntaxAdmin.show_theme_editor(theme_editor_edit_button,
56
- true);
57
- });
58
- theme_editor_create_button.click(function() {
59
- CrayonSyntaxAdmin.show_theme_editor(theme_editor_create_button,
60
- false);
61
- });
62
-
63
- // Theme editor
64
- var get_vars = base.get_vars();
65
- if (get_vars['subpage'] == 'theme_editor') {
66
- base.show_theme_editor();
67
- } else {
68
- base.show_main();
69
- }
70
-
71
- // Help
72
- help = $('.crayon-help-close');
73
- help.click(function() {
74
- $('.crayon-help').hide();
75
- $.get(CrayonSyntaxSettings.ajaxurl, {action : 'crayon-ajax', 'hide-help' : 1});
76
- });
77
-
78
- // Preview
79
- preview = $('#crayon-live-preview');
80
- preview_info = $('#crayon-preview-info');
81
- preview_url = preview.attr('url');
82
- preview_cbox = base.cssElem('#preview');
83
- if (preview.length != 0) {
84
- // Preview not needed in Tag Editor
85
- preview_register();
86
- preview.ready(function() {
87
- preview_toggle();
88
- });
89
- preview_cbox.change(function() {
90
- preview_toggle();
91
- });
92
- }
93
-
94
- $('#show-posts').click(function() {
95
- $.get(CrayonSyntaxSettings.ajaxurl, {action : 'crayon-show-posts'}, function(data) {
96
- $('#crayon-subsection-posts-info').html(data);
97
- });
98
- });
99
-
100
- $('#show-langs').click(function() {
101
- $.get(CrayonSyntaxSettings.ajaxurl, {action : 'crayon-show-langs'}, function(data) {
102
- $('#lang-info').hide();
103
- $('#crayon-subsection-langs-info').html(data);
104
- });
105
- });
106
-
107
- // Convert
108
- $('#crayon-settings-form input').live('focusin focusout mouseup', function() {
109
- $('#crayon-settings-form').data('lastSelected', $(this));
110
- });
111
- $('#crayon-settings-form').submit(function() {
112
- var last = $(this).data('lastSelected').get(0);
113
- var target = $('#convert').get(0);
114
- if (last == target) {
115
- var r = confirm("Please BACKUP your database first! Converting will update your post content. Do you wish to continue?");
116
- return r;
117
- }
118
- });
119
-
120
- // Alignment
121
- align_drop = base.cssElem('#h-align');
122
- float = $('#crayon-subsection-float');
123
- align_drop.change(function() {
124
- float_toggle();
125
- });
126
- align_drop.ready(function() {
127
- float_toggle();
128
- });
129
-
130
- // Custom Error
131
- msg_cbox = base.cssElem('#error-msg-show');
132
- msg = base.cssElem('#error-msg');
133
- toggle_error();
134
- msg_cbox.change(function() {
135
- toggle_error();
136
- });
137
-
138
- // Toolbar
139
- overlay = $('#crayon-subsection-toolbar');
140
- toolbar = base.cssElem('#toolbar');
141
- toggle_toolbar();
142
- toolbar.change(function() {
143
- toggle_toolbar();
144
- });
145
-
146
- // Copy
147
- plain = base.cssElem('#plain');
148
- copy = $('#crayon-subsection-copy-check');
149
- plain.change(function() {
150
- if (plain.is(':checked')) {
151
- copy.show();
152
- } else {
153
- copy.hide();
154
- }
155
- });
156
-
157
- // Log
158
- log_wrapper = $('#crayon-log-wrapper');
159
- log_button = $('#crayon-log-toggle');
160
- log_text = $('#crayon-log-text');
161
- var show_log = log_button.attr('show_txt');
162
- var hide_log = log_button.attr('hide_txt');
163
- clog = $('#crayon-log');
164
- log_button.val(show_log);
165
- log_button
166
- .click(function() {
167
- clog.width(log_wrapper.width());
168
- clog.toggle();
169
- // Scrolls content
170
- clog.scrollTop(log_text.height());
171
- var text = (log_button.val() == show_log ? hide_log
172
- : show_log);
173
- log_button.val(text);
174
- });
175
-
176
- };
177
-
178
- /* Whenever a control changes preview */
179
- var preview_update = function() {
180
- var val = 0;
181
- var obj;
182
- var getVars = {action : 'crayon-show-preview'};
183
- for ( var i = 0; i < preview_obj_names.length; i++) {
184
- obj = preview_objs[i];
185
- if (obj.attr('type') == 'checkbox') {
186
- val = obj.is(':checked');
187
- } else {
188
- val = obj.val();
189
- }
190
- getVars[preview_obj_names[i]] = crayon_escape(val);
191
- }
192
-
193
- // Load Preview
194
- $.get(CrayonSyntaxSettings.ajaxurl, getVars, function(data) {
195
- //console.log(1);
196
- preview.html(data);
197
- // Important! Calls the crayon.js init
198
- CrayonSyntax.init();
199
- });
200
- };
201
-
202
- var preview_toggle = function() {
203
- // console_log('preview_toggle');
204
- if (preview_cbox.is(':checked')) {
205
- preview.show();
206
- preview_info.show();
207
- preview_update();
208
- } else {
209
- preview.hide();
210
- preview_info.hide();
211
- }
212
- };
213
-
214
- var float_toggle = function() {
215
- if (align_drop.val() != 0) {
216
- float.show();
217
- } else {
218
- float.hide();
219
- }
220
- };
221
-
222
- // List of callbacks
223
- var preview_callback;
224
- var preview_txt_change;
225
- var preview_txt_callback; // Only updates if text value changed
226
- var preview_txt_callback_delayed;
227
- // var height_set;
228
-
229
- // Register all event handlers for preview objects
230
- var preview_register = function() {
231
- // Instant callback
232
- preview_callback = function() {
233
- preview_update();
234
- };
235
-
236
- // Checks if the text input is changed, if so, runs the callback
237
- // with given event
238
- preview_txt_change = function(callback, event) {
239
- // console_log('checking if changed');
240
- var obj = event.target;
241
- var last = preview_last_values[obj.id];
242
- // console_log('last' + preview_last_values[obj.id]);
243
-
244
- if (obj.value != last) {
245
- // console_log('changed');
246
- // Update last value to current
247
- preview_last_values[obj.id] = obj.value;
248
- // Run callback with event
249
- callback(event);
250
- }
251
- };
252
-
253
- // Only updates when text is changed
254
- preview_txt_callback = function(event) {
255
- // console_log('txt callback');
256
- preview_txt_change(preview_update, event);
257
- };
258
-
259
- // Only updates when text is changed, but callback
260
- preview_txt_callback_delayed = function(event) {
261
- preview_txt_change(function() {
262
- clearInterval(preview_delay_timer);
263
- preview_delay_timer = setInterval(function() {
264
- // console_log('delayed update');
265
- preview_update();
266
- clearInterval(preview_delay_timer);
267
- }, 500);
268
- }, event);
269
- };
270
-
271
- // Retreive preview objects
272
- $('[crayon-preview="1"]').each(function(i) {
273
- var obj = $(this);
274
- var id = obj.attr('id');
275
- // XXX Remove prefix
276
- id = base.removePrefixFromID(id);
277
- preview_obj_names[i] = id;
278
- preview_objs[i] = obj;
279
- // To capture key up events when typing
280
- if (obj.attr('type') == 'text') {
281
- preview_last_values[obj.attr('id')] = obj.val();
282
- obj.bind('keyup', preview_txt_callback_delayed);
283
- obj.change(preview_txt_callback);
284
- } else {
285
- // For all other objects
286
- obj.change(preview_callback);
287
- }
288
- });
289
- };
290
-
291
- var toggle_error = function() {
292
- if (msg_cbox.is(':checked')) {
293
- msg.show();
294
- } else {
295
- msg.hide();
296
- }
297
- };
298
-
299
- var toggle_toolbar = function() {
300
- if (toolbar.val() == 0) {
301
- overlay.show();
302
- } else {
303
- overlay.hide();
304
- }
305
- };
306
-
307
- base.get_vars = function() {
308
- var vars = {};
309
- window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,
310
- key, value) {
311
- vars[key] = value;
312
- });
313
- return vars;
314
- };
315
-
316
- // Changing wrap views
317
- base.show_main = function() {
318
- theme_editor_wrap.hide();
319
- main_wrap.show();
320
- // $(window).scrollTop(0);
321
- return false;
322
- };
323
-
324
- base.show_theme_editor_now = function(button) {
325
- main_wrap.hide();
326
- theme_editor_wrap.show();
327
- // $(window).scrollTop(0);
328
-
329
- theme_editor_loading = false;
330
- button.html(button.attr('loaded'));
331
- };
332
-
333
- base.show_theme_editor = function(button, editing) {
334
- // if (theme_editor_loading) {
335
- // return;
336
- // }
337
- // theme_editor_button.css('width', theme_editor_button.width());
338
- // if (!theme_editor_loaded) {
339
- // theme_editor_loading = true;
340
- button.html(button.attr('loading'));
341
-
342
- // Simulate loading with timer
343
- // editor_timer = setInterval(function() {
344
- // clearInterval(editor_timer);
345
-
346
- CrayonThemeEditorSettings.curr_theme = $('#crayon-theme').val();
347
- CrayonThemeEditorSettings.editing = editing;
348
-
349
- // Load theme editor
350
- $.get(editor_url + '?curr_theme='
351
- + CrayonThemeEditorSettings.curr_theme + '&editing='
352
- + editing, function(data) {
353
- theme_editor_wrap.html(data);
354
- // CrayonSyntax.init();
355
-
356
- // Load url from preview into theme editor
357
- // $('#crayon-editor-preview').attr('url', preview_url);
358
-
359
- // Load preview into editor
360
- CrayonSyntaxThemeEditor.init(function() {
361
- CrayonSyntaxAdmin.show_theme_editor_now(button);
362
- }, preview.clone());
363
-
364
- // show_theme_editor_now();
365
- });
366
-
367
- // }, 2000);
368
-
369
- // theme_editor_loaded = true;
370
- // } else {
371
- // base.show_theme_editor_now();
372
- // }
373
- return false;
374
- };
375
-
376
- };
377
 
378
  })(jQueryCrayon);
1
  // Crayon Syntax Highlighter Admin JavaScript
2
 
3
+ (function ($) {
4
+
5
+ window.CrayonSyntaxAdmin = new function () {
6
+ var base = this;
7
+
8
+ // Preview
9
+ var preview, preview_info, preview_cbox, preview_delay_timer, preview_get = null;
10
+ // The DOM object ids that trigger a preview update
11
+ var preview_obj_names = [];
12
+ // The jQuery objects for these objects
13
+ var preview_objs = [];
14
+ var preview_last_values = [];
15
+ // Alignment
16
+ var align_drop = float = null;
17
+ // Toolbar
18
+ var overlay = toolbar = null;
19
+ // Error
20
+ var msg_cbox = msg = null;
21
+ // Log
22
+ var log_button = log_text = null;
23
+
24
+ var main_wrap, theme_editor_wrap, editor_url, theme_editor_edit_button, theme_editor_create_button = null;
25
+ var theme_select, theme_info, theme_ver, theme_author, theme_desc = null;
26
+
27
+ var settings = null;
28
+ var adminSettings = null;
29
+ var util = null;
30
+
31
+ base.init = function () {
32
+ console_log('admin init');
33
+ settings = CrayonSyntaxSettings;
34
+ adminSettings = CrayonAdminSettings;
35
+ util = CrayonUtil;
36
+
37
+ // Wraps
38
+ main_wrap = $('#crayon-main-wrap');
39
+ theme_editor_wrap = $('#crayon-theme-editor-wrap');
40
+ editor_url = theme_editor_wrap.attr('url');
41
+ theme_editor_edit_button = $('#crayon-theme-editor-edit-button');
42
+ theme_editor_create_button = $('#crayon-theme-editor-create-button');
43
+ theme_editor_edit_button.click(function () {
44
+ CrayonSyntaxAdmin.show_theme_editor(theme_editor_edit_button,
45
+ true);
46
+ });
47
+ theme_editor_create_button.click(function () {
48
+ CrayonSyntaxAdmin.show_theme_editor(theme_editor_create_button,
49
+ false);
50
+ });
51
+
52
+ // Themes
53
+ theme_select = $('#crayon-theme');
54
+ theme_info = $('#crayon-theme-info');
55
+ theme_ver = theme_info.find('.version').next('div');
56
+ theme_author = theme_info.find('.author').next('div');
57
+ theme_desc = theme_info.find('.desc');
58
+ base.show_theme_info();
59
+ theme_select.change(function () {
60
+ base.show_theme_info();
61
+ base.preview_update();
62
+ });
63
+
64
+ // Help
65
+ help = $('.crayon-help-close');
66
+ help.click(function () {
67
+ $('.crayon-help').hide();
68
+ $.get(settings.ajaxurl, {action : 'crayon-ajax', 'hide-help' : 1});
69
+ });
70
+
71
+ // Preview
72
+ preview = $('#crayon-live-preview');
73
+ preview_info = $('#crayon-preview-info');
74
+ preview_cbox = util.cssElem('#preview');
75
+ if (preview.length != 0) {
76
+ // Preview not needed in Tag Editor
77
+ preview_register();
78
+ preview.ready(function () {
79
+ preview_toggle();
80
+ });
81
+ preview_cbox.change(function () {
82
+ preview_toggle();
83
+ });
84
+ }
85
+
86
+ $('#show-posts').click(function () {
87
+ $.get(settings.ajaxurl, {action : 'crayon-show-posts'}, function (data) {
88
+ $('#crayon-subsection-posts-info').html(data);
89
+ });
90
+ });
91
+
92
+ $('#show-langs').click(function () {
93
+ $.get(settings.ajaxurl, {action : 'crayon-show-langs'}, function (data) {
94
+ $('#lang-info').hide();
95
+ $('#crayon-subsection-langs-info').html(data);
96
+ });
97
+ });
98
+
99
+ // Convert
100
+ $('#crayon-settings-form input').live('focusin focusout mouseup', function () {
101
+ $('#crayon-settings-form').data('lastSelected', $(this));
102
+ });
103
+ $('#crayon-settings-form').submit(function () {
104
+ var last = $(this).data('lastSelected').get(0);
105
+ var target = $('#convert').get(0);
106
+ if (last == target) {
107
+ var r = confirm("Please BACKUP your database first! Converting will update your post content. Do you wish to continue?");
108
+ return r;
109
+ }
110
+ });
111
+
112
+ // Alignment
113
+ align_drop = util.cssElem('#h-align');
114
+ float = $('#crayon-subsection-float');
115
+ align_drop.change(function () {
116
+ float_toggle();
117
+ });
118
+ align_drop.ready(function () {
119
+ float_toggle();
120
+ });
121
+
122
+ // Custom Error
123
+ msg_cbox = util.cssElem('#error-msg-show');
124
+ msg = util.cssElem('#error-msg');
125
+ toggle_error();
126
+ msg_cbox.change(function () {
127
+ toggle_error();
128
+ });
129
+
130
+ // Toolbar
131
+ overlay = $('#crayon-subsection-toolbar');
132
+ toolbar = util.cssElem('#toolbar');
133
+ toggle_toolbar();
134
+ toolbar.change(function () {
135
+ toggle_toolbar();
136
+ });
137
+
138
+ // Copy
139
+ plain = util.cssElem('#plain');
140
+ copy = $('#crayon-subsection-copy-check');
141
+ plain.change(function () {
142
+ if (plain.is(':checked')) {
143
+ copy.show();
144
+ } else {
145
+ copy.hide();
146
+ }
147
+ });
148
+
149
+ // Log
150
+ log_wrapper = $('#crayon-log-wrapper');
151
+ log_button = $('#crayon-log-toggle');
152
+ log_text = $('#crayon-log-text');
153
+ var show_log = log_button.attr('show_txt');
154
+ var hide_log = log_button.attr('hide_txt');
155
+ clog = $('#crayon-log');
156
+ log_button.val(show_log);
157
+ log_button
158
+ .click(function () {
159
+ clog.width(log_wrapper.width());
160
+ clog.toggle();
161
+ // Scrolls content
162
+ clog.scrollTop(log_text.height());
163
+ var text = (log_button.val() == show_log ? hide_log
164
+ : show_log);
165
+ log_button.val(text);
166
+ });
167
+
168
+ };
169
+
170
+ /* Whenever a control changes preview */
171
+ base.preview_update = function () {
172
+ var val = 0;
173
+ var obj;
174
+ var getVars = {
175
+ action : 'crayon-show-preview',
176
+ theme : adminSettings.curr_theme
177
+ };
178
+ for (var i = 0; i < preview_obj_names.length; i++) {
179
+ obj = preview_objs[i];
180
+ if (obj.attr('type') == 'checkbox') {
181
+ val = obj.is(':checked');
182
+ } else {
183
+ val = obj.val();
184
+ }
185
+ getVars[preview_obj_names[i]] = crayon_escape(val);
186
+ }
187
+
188
+ // Load Preview
189
+ $.get(settings.ajaxurl, getVars, function (data) {
190
+ preview.html(data);
191
+ // Important! Calls the crayon.js init
192
+ CrayonSyntax.init();
193
+ });
194
+ };
195
+
196
+ var preview_toggle = function () {
197
+ // console_log('preview_toggle');
198
+ if (preview_cbox.is(':checked')) {
199
+ preview.show();
200
+ preview_info.show();
201
+ base.preview_update();
202
+ } else {
203
+ preview.hide();
204
+ preview_info.hide();
205
+ }
206
+ };
207
+
208
+ var float_toggle = function () {
209
+ if (align_drop.val() != 0) {
210
+ float.show();
211
+ } else {
212
+ float.hide();
213
+ }
214
+ };
215
+
216
+ // List of callbacks
217
+ var preview_callback;
218
+ var preview_txt_change;
219
+ var preview_txt_callback; // Only updates if text value changed
220
+ var preview_txt_callback_delayed;
221
+ // var height_set;
222
+
223
+ // Register all event handlers for preview objects
224
+ var preview_register = function () {
225
+ // Instant callback
226
+ preview_callback = function () {
227
+ base.preview_update();
228
+ };
229
+
230
+ // Checks if the text input is changed, if so, runs the callback
231
+ // with given event
232
+ preview_txt_change = function (callback, event) {
233
+ // console_log('checking if changed');
234
+ var obj = event.target;
235
+ var last = preview_last_values[obj.id];
236
+ // console_log('last' + preview_last_values[obj.id]);
237
+
238
+ if (obj.value != last) {
239
+ // console_log('changed');
240
+ // Update last value to current
241
+ preview_last_values[obj.id] = obj.value;
242
+ // Run callback with event
243
+ callback(event);
244
+ }
245
+ };
246
+
247
+ // Only updates when text is changed
248
+ preview_txt_callback = function (event) {
249
+ // console_log('txt callback');
250
+ preview_txt_change(base.preview_update, event);
251
+ };
252
+
253
+ // Only updates when text is changed, but callback
254
+ preview_txt_callback_delayed = function (event) {
255
+ preview_txt_change(function () {
256
+ clearInterval(preview_delay_timer);
257
+ preview_delay_timer = setInterval(function () {
258
+ // console_log('delayed update');
259
+ base.preview_update();
260
+ clearInterval(preview_delay_timer);
261
+ }, 500);
262
+ }, event);
263
+ };
264
+
265
+ // Retreive preview objects
266
+ $('[crayon-preview="1"]').each(function (i) {
267
+ var obj = $(this);
268
+ var id = obj.attr('id');
269
+ // XXX Remove prefix
270
+ id = util.removePrefixFromID(id);
271
+ preview_obj_names[i] = id;
272
+ preview_objs[i] = obj;
273
+ // To capture key up events when typing
274
+ if (obj.attr('type') == 'text') {
275
+ preview_last_values[obj.attr('id')] = obj.val();
276
+ obj.bind('keyup', preview_txt_callback_delayed);
277
+ obj.change(preview_txt_callback);
278
+ } else {
279
+ // For all other objects
280
+ obj.change(preview_callback);
281
+ }
282
+ });
283
+ };
284
+
285
+ var toggle_error = function () {
286
+ if (msg_cbox.is(':checked')) {
287
+ msg.show();
288
+ } else {
289
+ msg.hide();
290
+ }
291
+ };
292
+
293
+ var toggle_toolbar = function () {
294
+ if (toolbar.val() == 0) {
295
+ overlay.show();
296
+ } else {
297
+ overlay.hide();
298
+ }
299
+ };
300
+
301
+ base.get_vars = function () {
302
+ var vars = {};
303
+ window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
304
+ vars[key] = value;
305
+ });
306
+ return vars;
307
+ };
308
+
309
+ // Changing wrap views
310
+ base.show_main = function () {
311
+ theme_editor_wrap.hide();
312
+ main_wrap.show();
313
+ return false;
314
+ };
315
+
316
+ base.show_theme_editor_now = function (button) {
317
+ main_wrap.hide();
318
+ theme_editor_wrap.show();
319
+ theme_editor_loading = false;
320
+ button.html(button.attr('loaded'));
321
+ };
322
+
323
+ base.show_theme_info = function (callback) {
324
+ adminSettings.curr_theme = $('#crayon-theme').val();
325
+ adminSettings.curr_theme_url = adminSettings.themes_url + adminSettings.curr_theme + '/' + adminSettings.curr_theme + '.css';
326
+ $.ajax({
327
+ url : adminSettings.curr_theme_url,
328
+ success : function (data) {
329
+ adminSettings.curr_theme_str = data;
330
+ var fields = {
331
+ 'Version' : theme_ver,
332
+ 'Author' : theme_author,
333
+ 'Author URI' : null,
334
+ 'Description' : theme_desc
335
+ };
336
+ for (field in fields) {
337
+ var re = new RegExp('(?:^|[\\r\\n]\\s*)\\b' + field + '\\s*:\\s*([^\\r\\n]+)', 'gmi');
338
+ var match = re.exec(data);
339
+ var val = fields[field];
340
+ if (match) {
341
+ if (val != null) {
342
+ val.html(match[1].escape().linkify('_blank'));
343
+ } else if (field == 'Author URI') {
344
+ theme_author.html('<a href="' + match[1] + '" target="_blank">' + theme_author.text() + '</a>');
345
+ }
346
+ } else if (val != null) {
347
+ val.text('N/A');
348
+ }
349
+ }
350
+ if (callback) {
351
+ callback();
352
+ }
353
+ },
354
+ cache : false
355
+ });
356
+ };
357
+
358
+ base.show_theme_editor = function (button, editing) {
359
+ button.html(button.attr('loading'));
360
+
361
+ adminSettings.editing = editing;
362
+
363
+ // Load theme editor
364
+ $.get(editor_url + '?curr_theme='
365
+ + adminSettings.curr_theme + '&editing='
366
+ + editing, function (data) {
367
+ theme_editor_wrap.html(data);
368
+ // Load preview into editor
369
+ CrayonSyntaxThemeEditor.init(function () {
370
+ base.show_theme_editor_now(button);
371
+ }, preview.clone());
372
+ });
373
+ return false;
374
+ };
375
+
376
+ };
377
 
378
  })(jQueryCrayon);
js/fancybox/fancybox_init.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ if (fancyboxInit) {
4
+ // Initialise a custom version of Fancybox to avoid conflicting
5
+ fancyboxInit(window, document, jQueryCrayon, 'crayonFancybox');
6
+ }
7
+
8
+ })(jQueryCrayon);
js/fancybox/jquery.fancybox.init.pack.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * fancyBox - jQuery Plugin
3
+ * version: 2.1.3 (Tue, 23 Oct 2012)
4
+ * @requires jQuery v1.6 or later
5
+ *
6
+ * Examples at http://fancyapps.com/fancybox/
7
+ * License: www.fancyapps.com/fancybox/#license
8
+ *
9
+ * Copyright 2012 Janis Skarnelis - janis@fancyapps.com
10
+ *
11
+ * Modified by Aram Kocharyan:
12
+ * http://ak.net84.net/crayon/initialising-fancybox-with-custom-objects
13
+ */
14
+ window.fancyboxInit=function(k,n,i,g){var d=i(k),a=i(n),o=i[g]=function(){o.open.apply(this,arguments)},c=null,e=n.createTouch!==undefined,j=function(p){return p&&p.hasOwnProperty&&p instanceof i},b=function(p){return p&&i.type(p)==="string"},l=function(p){return b(p)&&p.indexOf("%")>0},h=function(p){return(p&&!(p.style.overflow&&p.style.overflow==="hidden")&&((p.clientWidth&&p.scrollWidth>p.clientWidth)||(p.clientHeight&&p.scrollHeight>p.clientHeight)))},m=function(r,q){var p=parseInt(r,10)||0;if(q&&l(r)){p=o.getViewport()[q]/100*p}return Math.ceil(p)},f=function(p,q){return m(p,q)+"px"};i.extend(o,{version:"2.1.3",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:true,autoHeight:false,autoWidth:false,autoResize:true,autoCenter:!e,fitToView:true,aspectRatio:false,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:true,closeBtn:true,closeClick:false,nextClick:false,mouseWheel:true,autoPlay:false,playSpeed:3000,preload:3,modal:false,loop:true,ajax:{dataType:"html",headers:{"X-fancyBox":true}},iframe:{scrolling:"auto",preload:true},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:true,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(i.browser.msie?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:true,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:true,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:true,title:true},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:false,isOpen:false,isOpened:false,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:false},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(q,p){if(!q){return}if(!i.isPlainObject(p)){p={}}if(false===o.close(true)){return}if(!i.isArray(q)){q=j(q)?i(q).get():[q]}i.each(q,function(v,w){var u={},r,z,x,y,t,A,s;if(i.type(w)==="object"){if(w.nodeType){w=i(w)}if(j(w)){u={href:w.data("fancybox-href")||w.attr("href"),title:w.data("fancybox-title")||w.attr("title"),isDom:true,element:w};if(i.metadata){i.extend(true,u,w.metadata())}}else{u=w}}r=p.href||u.href||(b(w)?w:null);z=p.title!==undefined?p.title:u.title||"";x=p.content||u.content;y=x?"html":(p.type||u.type);if(!y&&u.isDom){y=w.data("fancybox-type");if(!y){t=w.prop("class").match(/fancybox\.(\w+)/);y=t?t[1]:null}}if(b(r)){if(!y){if(o.isImage(r)){y="image"}else{if(o.isSWF(r)){y="swf"}else{if(r.charAt(0)==="#"){y="inline"}else{if(b(w)){y="html";x=w}}}}}if(y==="ajax"){A=r.split(/\s+/,2);r=A.shift();s=A.shift()}}if(!x){if(y==="inline"){if(r){x=i(b(r)?r.replace(/.*(?=#[^\s]+$)/,""):r)}else{if(u.isDom){x=w}}}else{if(y==="html"){x=r}else{if(!y&&!r&&u.isDom){y="inline";x=w}}}}i.extend(u,{href:r,type:y,content:x,title:z,selector:s});q[v]=u});o.opts=i.extend(true,{},o.defaults,p);if(p.keys!==undefined){o.opts.keys=p.keys?i.extend({},o.defaults.keys,p.keys):false}o.group=q;return o._start(o.opts.index)},cancel:function(){var p=o.coming;if(!p||false===o.trigger("onCancel")){return}o.hideLoading();if(o.ajaxLoad){o.ajaxLoad.abort()}o.ajaxLoad=null;if(o.imgPreload){o.imgPreload.onload=o.imgPreload.onerror=null}if(p.wrap){p.wrap.stop(true,true).trigger("onReset").remove()}o.coming=null;if(!o.current){o._afterZoomOut(p)}},close:function(p){o.cancel();if(false===o.trigger("beforeClose")){return}o.unbindEvents();if(!o.isActive){return}if(!o.isOpen||p===true){i(".fancybox-wrap").stop(true).trigger("onReset").remove();o._afterZoomOut()}else{o.isOpen=o.isOpened=false;o.isClosing=true;i(".fancybox-item, .fancybox-nav").remove();o.wrap.stop(true,true).removeClass("fancybox-opened");o.transitions[o.current.closeMethod]()}},play:function(r){var p=function(){clearTimeout(o.player.timer)},t=function(){p();if(o.current&&o.player.isActive){o.player.timer=setTimeout(o.next,o.current.playSpeed)}},q=function(){p();i("body").unbind(".player");o.player.isActive=false;o.trigger("onPlayEnd")},s=function(){if(o.current&&(o.current.loop||o.current.index<o.group.length-1)){o.player.isActive=true;i("body").bind({"afterShow.player onUpdate.player":t,"onCancel.player beforeClose.player":q,"beforeLoad.player":p});t();o.trigger("onPlayStart")}};if(r===true||(!o.player.isActive&&r!==false)){s()}else{q()}},next:function(q){var p=o.current;if(p){if(!b(q)){q=p.direction.next}o.jumpto(p.index+1,q,"next")}},prev:function(q){var p=o.current;if(p){if(!b(q)){q=p.direction.prev}o.jumpto(p.index-1,q,"prev")}},jumpto:function(q,s,p){var r=o.current;if(!r){return}q=m(q);o.direction=s||r.direction[(q>=r.index?"next":"prev")];o.router=p||"jumpto";if(r.loop){if(q<0){q=r.group.length+(q%r.group.length)}q=q%r.group.length}if(r.group[q]!==undefined){o.cancel();o._start(q)}},reposition:function(s,p){var r=o.current,q=r?r.wrap:null,t;if(q){t=o._getPosition(p);if(s&&s.type==="scroll"){delete t.position;q.stop(true,true).animate(t,200)}else{q.css(t);r.pos=i.extend({},r.dim,t)}}},update:function(r){var p=(r&&r.type),q=!p||p==="orientationchange";if(q){clearTimeout(c);c=null}if(!o.isOpen||c){return}c=setTimeout(function(){var s=o.current;if(!s||o.isClosing){return}o.wrap.removeClass("fancybox-tmp");if(q||p==="load"||(p==="resize"&&s.autoResize)){o._setDimension()}if(!(p==="scroll"&&s.canShrink)){o.reposition(r)}o.trigger("onUpdate");c=null},(q&&!e?0:300))},toggle:function(p){if(o.isOpen){o.current.fitToView=i.type(p)==="boolean"?p:!o.current.fitToView;if(e){o.wrap.removeAttr("style").addClass("fancybox-tmp");o.trigger("onUpdate")}o.update()}},hideLoading:function(){a.unbind(".loading");i("#fancybox-loading").remove()},showLoading:function(){var q,p;o.hideLoading();q=i('<div id="fancybox-loading"><div></div></div>').click(o.cancel).appendTo("body");a.bind("keydown.loading",function(r){if((r.which||r.keyCode)===27){r.preventDefault();o.cancel()}});if(!o.defaults.fixed){p=o.getViewport();q.css({position:"absolute",top:(p.h*0.5)+p.y,left:(p.w*0.5)+p.x})}},getViewport:function(){var p=(o.current&&o.current.locked)||false,q={x:d.scrollLeft(),y:d.scrollTop()};if(p){q.w=p[0].clientWidth;q.h=p[0].clientHeight}else{q.w=e&&k.innerWidth?k.innerWidth:d.width();q.h=e&&k.innerHeight?k.innerHeight:d.height()}return q},unbindEvents:function(){if(o.wrap&&j(o.wrap)){o.wrap.unbind(".fb")}a.unbind(".fb");d.unbind(".fb")},bindEvents:function(){var q=o.current,p;if(!q){return}d.bind("orientationchange.fb"+(e?"":" resize.fb")+(q.autoCenter&&!q.locked?" scroll.fb":""),o.update);p=q.keys;if(p){a.bind("keydown.fb",function(t){var r=t.which||t.keyCode,s=t.target||t.srcElement;if(r===27&&o.coming){return false}if(!t.ctrlKey&&!t.altKey&&!t.shiftKey&&!t.metaKey&&!(s&&(s.type||i(s).is("[contenteditable]")))){i.each(p,function(u,v){if(q.group.length>1&&v[r]!==undefined){o[u](v[r]);t.preventDefault();return false}if(i.inArray(r,v)>-1){o[u]();t.preventDefault();return false}})}})}if(i.fn.mousewheel&&q.mouseWheel){o.wrap.bind("mousewheel.fb",function(w,x,s,r){var v=w.target||null,t=i(v),u=false;while(t.length){if(u||t.is(".fancybox-skin")||t.is(".fancybox-wrap")){break}u=h(t[0]);t=i(t).parent()}if(x!==0&&!u){if(o.group.length>1&&!q.canShrink){if(r>0||s>0){o.prev(r>0?"down":"left")}else{if(r<0||s<0){o.next(r<0?"up":"right")}}w.preventDefault()}}})}},trigger:function(q,s){var p,r=s||o.coming||o.current;if(!r){return}if(i.isFunction(r[q])){p=r[q].apply(r,Array.prototype.slice.call(arguments,1))}if(p===false){return false}if(r.helpers){i.each(r.helpers,function(u,t){if(t&&o.helpers[u]&&i.isFunction(o.helpers[u][q])){t=i.extend(true,{},o.helpers[u].defaults,t);o.helpers[u][q](t,r)}})}i.event.trigger(q+".fb")},isImage:function(p){return b(p)&&p.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(p){return b(p)&&p.match(/\.(swf)((\?|#).*)?$/i)},_start:function(q){var r={},v,p,s,t,u;q=m(q);v=o.group[q]||null;if(!v){return false}r=i.extend(true,{},o.opts,v);t=r.margin;u=r.padding;if(i.type(t)==="number"){r.margin=[t,t,t,t]}if(i.type(u)==="number"){r.padding=[u,u,u,u]}if(r.modal){i.extend(true,r,{closeBtn:false,closeClick:false,nextClick:false,arrows:false,mouseWheel:false,keys:null,helpers:{overlay:{closeClick:false}}})}if(r.autoSize){r.autoWidth=r.autoHeight=true}if(r.width==="auto"){r.autoWidth=true}if(r.height==="auto"){r.autoHeight=true}r.group=o.group;r.index=q;o.coming=r;if(false===o.trigger("beforeLoad")){o.coming=null;return}s=r.type;p=r.href;if(!s){o.coming=null;if(o.current&&o.router&&o.router!=="jumpto"){o.current.index=q;return o[o.router](o.direction)}return false}o.isActive=true;if(s==="image"||s==="swf"){r.autoHeight=r.autoWidth=false;r.scrolling="visible"}if(s==="image"){r.aspectRatio=true}if(s==="iframe"&&e){r.scrolling="scroll"}r.wrap=i(r.tpl.wrap).addClass("fancybox-"+(e?"mobile":"desktop")+" fancybox-type-"+s+" fancybox-tmp "+r.wrapCSS).appendTo(r.parent||"body");i.extend(r,{skin:i(".fancybox-skin",r.wrap),outer:i(".fancybox-outer",r.wrap),inner:i(".fancybox-inner",r.wrap)});i.each(["Top","Right","Bottom","Left"],function(x,w){r.skin.css("padding"+w,f(r.padding[x]))});o.trigger("onReady");if(s==="inline"||s==="html"){if(!r.content||!r.content.length){return o._error("content")}}else{if(!p){return o._error("href")}}if(s==="image"){o._loadImage()}else{if(s==="ajax"){o._loadAjax()}else{if(s==="iframe"){o._loadIframe()}else{o._afterLoad()}}}},_error:function(p){i.extend(o.coming,{type:"html",autoWidth:true,autoHeight:true,minWidth:0,minHeight:0,scrolling:"no",hasError:p,content:o.coming.tpl.error});o._afterLoad()},_loadImage:function(){var p=o.imgPreload=new Image();p.onload=function(){this.onload=this.onerror=null;o.coming.width=this.width;o.coming.height=this.height;o._afterLoad()};p.onerror=function(){this.onload=this.onerror=null;o._error("image")};p.src=o.coming.href;if(p.complete!==true){o.showLoading()}},_loadAjax:function(){var p=o.coming;o.showLoading();o.ajaxLoad=i.ajax(i.extend({},p.ajax,{url:p.href,error:function(q,r){if(o.coming&&r!=="abort"){o._error("ajax",q)}else{o.hideLoading()}},success:function(q,r){if(r==="success"){p.content=q;o._afterLoad()}}}))},_loadIframe:function(){var p=o.coming,q=i(p.tpl.iframe.replace(/\{rnd\}/g,new Date().getTime())).attr("scrolling",e?"auto":p.iframe.scrolling).attr("src",p.href);i(p.wrap).bind("onReset",function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(r){}});if(p.iframe.preload){o.showLoading();q.one("load",function(){i(this).data("ready",1);if(!e){i(this).bind("load.fb",o.update)}i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();o._afterLoad()})}p.content=q.appendTo(p.inner);if(!p.iframe.preload){o._afterLoad()}},_preloadImages:function(){var u=o.group,t=o.current,p=u.length,r=t.preload?Math.min(t.preload,p-1):0,s,q;for(q=1;q<=r;q+=1){s=u[(t.index+q)%p];if(s.type==="image"&&s.href){new Image().src=s.href}}},_afterLoad:function(){var q=o.coming,s=o.current,x="fancybox-placeholder",u,v,w,r,p,t;o.hideLoading();if(!q||o.isActive===false){return}if(false===o.trigger("afterLoad",q,s)){q.wrap.stop(true).trigger("onReset").remove();o.coming=null;return}if(s){o.trigger("beforeChange",s);s.wrap.stop(true).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()}o.unbindEvents();u=q;v=q.content;w=q.type;r=q.scrolling;i.extend(o,{wrap:u.wrap,skin:u.skin,outer:u.outer,inner:u.inner,current:u,previous:s});p=u.href;switch(w){case"inline":case"ajax":case"html":if(u.selector){v=i("<div>").html(v).find(u.selector)}else{if(j(v)){if(!v.data(x)){v.data(x,i('<div class="'+x+'"></div>').insertAfter(v).hide())}v=v.show().detach();u.wrap.bind("onReset",function(){if(i(this).find(v).length){v.hide().replaceAll(v.data(x)).data(x,false)}})}}break;case"image":v=u.tpl.image.replace("{href}",p);break;case"swf":v='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+p+'"></param>';t="";i.each(u.swf,function(y,z){v+='<param name="'+y+'" value="'+z+'"></param>';t+=" "+y+'="'+z+'"'});v+='<embed src="'+p+'" type="application/x-shockwave-flash" width="100%" height="100%"'+t+"></embed></object>";break}if(!(j(v)&&v.parent().is(u.inner))){u.inner.append(v)}o.trigger("beforeShow");u.inner.css("overflow",r==="yes"?"scroll":(r==="no"?"hidden":r));o._setDimension();o.reposition();o.isOpen=false;o.coming=null;o.bindEvents();if(!o.isOpened){i(".fancybox-wrap").not(u.wrap).stop(true).trigger("onReset").remove()}else{if(s.prevMethod){o.transitions[s.prevMethod]()}}o.transitions[o.isOpened?u.nextMethod:u.openMethod]();o._preloadImages()},_setDimension:function(){var S=o.getViewport(),O=0,U=false,W=false,A=o.wrap,M=o.skin,X=o.inner,J=o.current,K=J.width,H=J.height,D=J.minWidth,w=J.minHeight,Q=J.maxWidth,I=J.maxHeight,C=J.scrolling,u=J.scrollOutside?J.scrollbarWidth:0,G=J.margin,v=m(G[1]+G[3]),t=m(G[0]+G[2]),r,q,N,P,F,E,L,y,x,T,s,V,p,z,B;A.add(M).add(X).width("auto").height("auto").removeClass("fancybox-tmp");r=m(M.outerWidth(true)-M.width());q=m(M.outerHeight(true)-M.height());N=v+r;P=t+q;F=l(K)?(S.w-N)*m(K)/100:K;E=l(H)?(S.h-P)*m(H)/100:H;if(J.type==="iframe"){z=J.content;if(J.autoHeight&&z.data("ready")===1){try{if(z[0].contentWindow.document.location){X.width(F).height(9999);B=z.contents().find("body");if(u){B.css("overflow-x","hidden")}E=B.height()}}catch(R){}}}else{if(J.autoWidth||J.autoHeight){X.addClass("fancybox-tmp");if(!J.autoWidth){X.width(F)}if(!J.autoHeight){X.height(E)}if(J.autoWidth){F=X.width()}if(J.autoHeight){E=X.height()}X.removeClass("fancybox-tmp")}}K=m(F);H=m(E);x=F/E;D=m(l(D)?m(D,"w")-N:D);Q=m(l(Q)?m(Q,"w")-N:Q);w=m(l(w)?m(w,"h")-P:w);I=m(l(I)?m(I,"h")-P:I);L=Q;y=I;if(J.fitToView){Q=Math.min(S.w-N,Q);I=Math.min(S.h-P,I)}V=S.w-v;p=S.h-t;if(J.aspectRatio){if(K>Q){K=Q;H=m(K/x)}if(H>I){H=I;K=m(H*x)}if(K<D){K=D;H=m(K/x)}if(H<w){H=w;K=m(H*x)}}else{K=Math.max(D,Math.min(K,Q));if(J.autoHeight&&J.type!=="iframe"){X.width(K);H=X.height()}H=Math.max(w,Math.min(H,I))}if(J.fitToView){X.width(K).height(H);A.width(K+r);T=A.width();s=A.height();if(J.aspectRatio){while((T>V||s>p)&&K>D&&H>w){if(O++>19){break}H=Math.max(w,Math.min(I,H-10));K=m(H*x);if(K<D){K=D;H=m(K/x)}if(K>Q){K=Q;H=m(K/x)}X.width(K).height(H);A.width(K+r);T=A.width();s=A.height()}}else{K=Math.max(D,Math.min(K,K-(T-V)));H=Math.max(w,Math.min(H,H-(s-p)))}}if(u&&C==="auto"&&H<E&&(K+r+u)<V){K+=u}X.width(K).height(H);A.width(K+r);T=A.width();s=A.height();U=(T>V||s>p)&&K>D&&H>w;W=J.aspectRatio?(K<L&&H<y&&K<F&&H<E):((K<L||H<y)&&(K<F||H<E));i.extend(J,{dim:{width:f(T),height:f(s)},origWidth:F,origHeight:E,canShrink:U,canExpand:W,wPadding:r,hPadding:q,wrapSpace:s-M.outerHeight(true),skinSpace:M.height()-H});if(!z&&J.autoHeight&&H>w&&H<I&&!W){X.height("auto")}},_getPosition:function(r){var v=o.current,q=o.getViewport(),t=v.margin,s=o.wrap.width()+t[1]+t[3],p=o.wrap.height()+t[0]+t[2],u={position:"absolute",top:t[0],left:t[3]};if(v.autoCenter&&v.fixed&&!r&&p<=q.h&&s<=q.w){u.position="fixed"}else{if(!v.locked){u.top+=q.y;u.left+=q.x}}u.top=f(Math.max(u.top,u.top+((q.h-p)*v.topRatio)));u.left=f(Math.max(u.left,u.left+((q.w-s)*v.leftRatio)));return u},_afterZoomIn:function(){var p=o.current;if(!p){return}o.isOpen=o.isOpened=true;o.wrap.css("overflow","visible").addClass("fancybox-opened");o.update();if(p.closeClick||(p.nextClick&&o.group.length>1)){o.inner.css("cursor","pointer").bind("click.fb",function(q){if(!i(q.target).is("a")&&!i(q.target).parent().is("a")){q.preventDefault();o[p.closeClick?"close":"next"]()}})}if(p.closeBtn){i(p.tpl.closeBtn).appendTo(o.skin).bind(e?"touchstart.fb":"click.fb",function(q){q.preventDefault();o.close()})}if(p.arrows&&o.group.length>1){if(p.loop||p.index>0){i(p.tpl.prev).appendTo(o.outer).bind("click.fb",o.prev)}if(p.loop||p.index<o.group.length-1){i(p.tpl.next).appendTo(o.outer).bind("click.fb",o.next)}}o.trigger("afterShow");if(!p.loop&&p.index===p.group.length-1){o.play(false)}else{if(o.opts.autoPlay&&!o.player.isActive){o.opts.autoPlay=false;o.play()}}},_afterZoomOut:function(p){p=p||o.current;i(".fancybox-wrap").trigger("onReset").remove();i.extend(o,{group:{},opts:{},router:false,current:null,isActive:false,isOpened:false,isOpen:false,isClosing:false,wrap:null,skin:null,outer:null,inner:null});o.trigger("afterClose",p)}});o.transitions={getOrigPosition:function(){var s=o.current,q=s.element,v=s.orig,u={},p=50,w=50,t=s.hPadding,x=s.wPadding,r=o.getViewport();if(!v&&s.isDom&&q.is(":visible")){v=q.find("img:first");if(!v.length){v=q}}if(j(v)){u=v.offset();if(v.is("img")){p=v.outerWidth();w=v.outerHeight()}}else{u.top=r.y+(r.h-w)*s.topRatio;u.left=r.x+(r.w-p)*s.leftRatio}if(o.wrap.css("position")==="fixed"||s.locked){u.top-=r.y;u.left-=r.x}u={top:f(u.top-t*s.topRatio),left:f(u.left-x*s.leftRatio),width:f(p+x),height:f(w+t)};return u},step:function(q,r){var t,v,w,p=r.prop,s=o.current,u=s.wrapSpace,x=s.skinSpace;if(p==="width"||p==="height"){t=r.end===r.start?1:(q-r.start)/(r.end-r.start);if(o.isClosing){t=1-t}v=p==="width"?s.wPadding:s.hPadding;w=q-v;o.skin[p](m(p==="width"?w:w-(u*t)));o.inner[p](m(p==="width"?w:w-(u*t)-(x*t)))}},zoomIn:function(){var t=o.current,q=t.pos,r=t.openEffect,s=r==="elastic",p=i.extend({opacity:1},q);delete p.position;if(s){q=this.getOrigPosition();if(t.openOpacity){q.opacity=0.1}}else{if(r==="fade"){q.opacity=0.1}}o.wrap.css(q).animate(p,{duration:r==="none"?0:t.openSpeed,easing:t.openEasing,step:s?this.step:null,complete:o._afterZoomIn})},zoomOut:function(){var s=o.current,q=s.closeEffect,r=q==="elastic",p={opacity:0.1};if(r){p=this.getOrigPosition();if(s.closeOpacity){p.opacity=0.1}}o.wrap.animate(p,{duration:q==="none"?0:s.closeSpeed,easing:s.closeEasing,step:r?this.step:null,complete:o._afterZoomOut})},changeIn:function(){var u=o.current,r=u.nextEffect,q=u.pos,p={opacity:1},t=o.direction,v=200,s;q.opacity=0.1;if(r==="elastic"){s=t==="down"||t==="up"?"top":"left";if(t==="down"||t==="right"){q[s]=f(m(q[s])-v);p[s]="+="+v+"px"}else{q[s]=f(m(q[s])+v);p[s]="-="+v+"px"}}if(r==="none"){o._afterZoomIn()}else{o.wrap.css(q).animate(p,{duration:u.nextSpeed,easing:u.nextEasing,complete:function(){setTimeout(o._afterZoomIn,20)}})}},changeOut:function(){var r=o.previous,q=r.prevEffect,p={opacity:0.1},s=o.direction,t=200;if(q==="elastic"){p[s==="down"||s==="up"?"top":"left"]=(s==="up"||s==="left"?"-":"+")+"="+t+"px"}r.wrap.animate(p,{duration:q==="none"?0:r.prevSpeed,easing:r.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}};o.helpers.overlay={defaults:{closeClick:true,speedOut:200,showEarly:true,css:{},locked:!e,fixed:true},overlay:null,fixed:false,create:function(p){p=i.extend({},this.defaults,p);if(this.overlay){this.close()}this.overlay=i('<div class="fancybox-overlay"></div>').appendTo("body");this.fixed=false;if(p.fixed&&o.defaults.fixed){this.overlay.addClass("fancybox-overlay-fixed");this.fixed=true}},open:function(q){var p=this;q=i.extend({},this.defaults,q);if(this.overlay){this.overlay.unbind(".overlay").width("auto").height("auto")}else{this.create(q)}if(!this.fixed){d.bind("resize.overlay",i.proxy(this.update,this));this.update()}if(q.closeClick){this.overlay.bind("click.overlay",function(r){if(i(r.target).hasClass("fancybox-overlay")){if(o.isActive){o.close()}else{p.close()}}})}this.overlay.css(q.css).show()},close:function(){i(".fancybox-overlay").remove();d.unbind("resize.overlay");this.overlay=null;if(this.margin!==false){i("body").css("margin-right",this.margin);this.margin=false}if(this.el){this.el.removeClass("fancybox-lock")}},update:function(){var q="100%",p;this.overlay.width(q).height("100%");if(i.browser.msie){p=Math.max(n.documentElement.offsetWidth,n.body.offsetWidth);if(a.width()>p){q=a.width()}}else{if(a.width()>d.width()){q=a.width()}}this.overlay.width(q).height(a.height())},onReady:function(p,q){i(".fancybox-overlay").stop(true,true);if(!this.overlay){this.margin=a.height()>d.height()||i("body").css("overflow-y")==="scroll"?i("body").css("margin-right"):false;this.el=n.all&&!n.querySelector?i("html"):i("body");this.create(p)}if(p.locked&&this.fixed){q.locked=this.overlay.append(q.wrap);q.fixed=false}if(p.showEarly===true){this.beforeShow.apply(this,arguments)}},beforeShow:function(p,q){if(q.locked){this.el.addClass("fancybox-lock");if(this.margin!==false){i("body").css("margin-right",m(this.margin)+q.scrollbarWidth)}}this.open(p)},onUpdate:function(){if(!this.fixed){this.update()}},afterClose:function(p){if(this.overlay&&!o.isActive){this.overlay.fadeOut(p.speedOut,i.proxy(this.close,this))}}};o.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(q){var s=o.current,u=s.title,p=q.type,t,r;if(i.isFunction(u)){u=u.call(s.element,s)}if(!b(u)||i.trim(u)===""){return}t=i('<div class="fancybox-title fancybox-title-'+p+'-wrap">'+u+"</div>");switch(p){case"inside":r=o.skin;break;case"outside":r=o.wrap;break;case"over":r=o.inner;break;default:r=o.skin;t.appendTo("body");if(i.browser.msie){t.width(t.width())}t.wrapInner('<span class="child"></span>');o.current.margin[2]+=Math.abs(m(t.css("margin-bottom")));break}t[(q.position==="top"?"prependTo":"appendTo")](r)}};i.fn[g]=function(r){var q,s=i(this),p=this.selector||"",t=function(x){var w=i(this).blur(),u=q,v,y;if(!(x.ctrlKey||x.altKey||x.shiftKey||x.metaKey)&&!w.is(".fancybox-wrap")){v=r.groupAttr||"data-fancybox-group";y=w.attr(v);if(!y){v="rel";y=w.get(0)[v]}if(y&&y!==""&&y!=="nofollow"){w=p.length?i(p):s;w=w.filter("["+v+'="'+y+'"]');u=w.index(this)}r.index=u;if(o.open(w,r)!==false){x.preventDefault()}}};r=r||{};q=r.index||0;if(!p||r.live===false){s.unbind("click.fb-start").bind("click.fb-start",t)}else{a.undelegate(p,"click.fb-start").delegate(p+":not('.fancybox-item, .fancybox-nav')","click.fb-start",t)}this.filter("[data-fancybox-start=1]").trigger("click");return this};a.ready(function(){if(i.scrollbarWidth===undefined){i.scrollbarWidth=function(){var q=i('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),r=q.children(),p=r.innerWidth()-r.height(99).innerWidth();q.remove();return p}}if(i.support.fixedPosition===undefined){i.support.fixedPosition=(function(){var q=i('<div style="position:fixed;top:20px;"></div>').appendTo("body"),p=(q[0].offsetTop===20||q[0].offsetTop===15);q.remove();return p}())}i.extend(o.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")})})};
js/fancybox/jquery.fancybox.pack.js DELETED
@@ -1,44 +0,0 @@
1
- /*! fancyBox v2.1.0 fancyapps.com | fancyapps.com/fancybox/#license */
2
- (function(u,p,f,q){var o=f(u),n=f(p),b=f.fancybox=function(){b.open.apply(this,arguments)},z=null,m=p.createTouch!==q,x=function(a){return a&&a.hasOwnProperty&&a instanceof f},s=function(a){return a&&"string"===f.type(a)},C=function(a){return s(a)&&0<a.indexOf("%")},k=function(a,c){var e=parseInt(a,10);c&&C(a)&&(e*=b.getViewport()[c]/100);return Math.ceil(e)},v=function(a,b){return k(a,b)+"px"};f.extend(b,{version:"2.1.0",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,
3
- maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!m,autoCenter:!m,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},
4
- prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0"'+
5
- (f.browser.msie?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",
6
- openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{closeClick:!0,speedOut:200,showEarly:!0,css:{}},title:{type:"float"}},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},
7
- group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,c){if(a&&(f.isPlainObject(c)||(c={}),!1!==b.close(!0)))return f.isArray(a)||(a=x(a)?f(a).get():[a]),f.each(a,function(e,d){var j={},g,h,i,l,k;"object"===f.type(d)&&(d.nodeType&&(d=f(d)),x(d)?(j={href:d.attr("href"),title:d.attr("title"),isDom:!0,element:d},f.metadata&&
8
- f.extend(!0,j,d.metadata())):j=d);g=c.href||j.href||(s(d)?d:null);h=c.title!==q?c.title:j.title||"";l=(i=c.content||j.content)?"html":c.type||j.type;!l&&j.isDom&&(l=d.data("fancybox-type"),l||(l=(l=d.prop("class").match(/fancybox\.(\w+)/))?l[1]:null));if(s(g)&&(l||(b.isImage(g)?l="image":b.isSWF(g)?l="swf":"#"===g.charAt(0)?l="inline":s(d)&&(l="html",i=d)),"ajax"===l))k=g.split(/\s+/,2),g=k.shift(),k=k.shift();i||("inline"===l?g?i=f(s(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):j.isDom&&(i=d):"html"===l?
9
- i=g:!l&&(!g&&j.isDom)&&(l="inline",i=d));f.extend(j,{href:g,type:l,content:i,title:h,selector:k});a[e]=j}),b.opts=f.extend(!0,{},b.defaults,c),c.keys!==q&&(b.opts.keys=c.keys?f.extend({},b.defaults.keys,c.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0).trigger("onReset").remove(),b.current||
10
- b.trigger("afterClose"),b.coming=null)},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),"fixed"===b.wrap.css("position")&&b.wrap.css(b._getPosition(!0)),b.transitions[b.current.closeMethod]()))},play:function(a){var c=function(){clearTimeout(b.player.timer)},
11
- e=function(){c();b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},d=function(){c();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":d,"beforeLoad.player":c}),e(),b.trigger("onPlayStart")}else d()},next:function(a){var c=b.current;
12
- c&&(s(a)||(a=c.direction.next),b.jumpto(c.index+1,a,"next"))},prev:function(a){var c=b.current;c&&(s(a)||(a=c.direction.prev),b.jumpto(c.index-1,a,"prev"))},jumpto:function(a,c,e){var d=b.current;if(d&&(a=k(a),b.direction=c||d.direction[a>=d.index?"next":"prev"],b.router=e||"jumpto",d.loop&&(0>a&&(a=d.group.length+a%d.group.length),a%=d.group.length),d.group[a]!==q))b.cancel(),b._start(a)},reposition:function(a,c){var e;b.isOpen&&(e=b._getPosition(c),a&&"scroll"===a.type?(delete e.position,b.wrap.stop(!0,
13
- !0).animate(e,200)):b.wrap.css(e))},update:function(a){var c=a&&a.type,e=!c||"orientationchange"===c;e&&(clearTimeout(z),z=null);if(b.isOpen&&!z){if(e||m)b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate");z=setTimeout(function(){var d=b.current;if(d){b.wrap.removeClass("fancybox-tmp");c!=="scroll"&&b._setDimension();c==="scroll"&&d.canShrink||b.reposition(a);b.trigger("onUpdate");z=null}},m?500:e?20:300)}},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?
14
- a:!b.current.fitToView,b.update())},hideLoading:function(){n.unbind("keypress.fb");f("#fancybox-loading").remove()},showLoading:function(){var a,c;b.hideLoading();n.bind("keypress.fb",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");b.defaults.fixed||(c=b.getViewport(),a.css({position:"absolute",top:0.5*c.h+c.y,left:0.5*c.w+c.x}))},getViewport:function(){var a=b.current?b.current.locked:!1,
15
- c={x:o.scrollLeft(),y:o.scrollTop()};a?(c.w=a[0].clientWidth,c.h=a[0].clientHeight):(c.w=m&&u.innerWidth?u.innerWidth:o.width(),c.h=m&&u.innerHeight?u.innerHeight:o.height());return c},unbindEvents:function(){b.wrap&&x(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");o.unbind(".fb")},bindEvents:function(){var a=b.current,c;a&&(o.bind("orientationchange.fb"+(m?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(c=a.keys)&&n.bind("keydown.fb",function(e){var d=e.which||e.keyCode,j=e.target||
16
- e.srcElement;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!j||!j.type&&!f(j).is("[contenteditable]")))&&f.each(c,function(c,j){if(1<a.group.length&&j[d]!==q)return b[c](j[d]),e.preventDefault(),!1;if(-1<f.inArray(d,j))return b[c](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(c,d,j,g){for(var h=f(c.target||null),i=!1;h.length&&!i&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)i=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
17
- (h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==d&&!i&&1<b.group.length&&!a.canShrink){if(0<g||0<j)b.prev(0<g?"down":"left");else if(0>g||0>j)b.next(0>g?"up":"right");c.preventDefault()}}))},trigger:function(a,c){var e,d=c||b.coming||b.current;if(d){f.isFunction(d[a])&&(e=d[a].apply(d,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;"onCancel"===a&&!b.isOpened&&(b.isActive=!1);d.helpers&&f.each(d.helpers,
18
- function(c,e){if(e&&b.helpers[c]&&f.isFunction(b.helpers[c][a]))b.helpers[c][a](e,d)});f.event.trigger(a+".fb")}},isImage:function(a){return s(a)&&a.match(/\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$/i)},isSWF:function(a){return s(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var c={},e,d,a=k(a);e=b.group[a]||null;if(!e)return!1;c=f.extend(!0,{},b.opts,e);e=c.margin;d=c.padding;"number"===f.type(e)&&(c.margin=[e,e,e,e]);"number"===f.type(d)&&(c.padding=[d,d,d,d]);c.modal&&f.extend(!0,c,
19
- {closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});c.autoSize&&(c.autoWidth=c.autoHeight=!0);"auto"===c.width&&(c.autoWidth=!0);"auto"===c.height&&(c.autoHeight=!0);c.group=b.group;c.index=a;b.coming=c;if(!1===b.trigger("beforeLoad"))b.coming=null;else{d=c.type;e=c.href;if(!d)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===d||"swf"===d)c.autoHeight=c.autoWidth=
20
- !1,c.scrolling="visible";"image"===d&&(c.aspectRatio=!0);"iframe"===d&&m&&(c.scrolling="scroll");c.wrap=f(c.tpl.wrap).addClass("fancybox-"+(m?"mobile":"desktop")+" fancybox-type-"+d+" fancybox-tmp "+c.wrapCSS).appendTo(c.parent);f.extend(c,{skin:f(".fancybox-skin",c.wrap),outer:f(".fancybox-outer",c.wrap),inner:f(".fancybox-inner",c.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){c.skin.css("padding"+b,v(c.padding[a]))});b.trigger("onReady");if("inline"===d||"html"===d){if(!c.content||
21
- !c.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===d?b._loadImage():"ajax"===d?b._loadAjax():"iframe"===d?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width;b.coming.height=this.height;
22
- b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;(a.complete===q||!a.complete)&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(c,e){"success"===e&&(a.content=c,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,c=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",
23
- m?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),c.one("load",function(){f(this).data("ready",1);m||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=c.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,c=b.current,
24
- e=a.length,d=c.preload?Math.min(c.preload,e-1):0,f,g;for(g=1;g<=d;g+=1)f=a[(c.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,c=b.current,e,d,j,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,c))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{c&&(b.trigger("beforeChange",c),c.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove(),"fixed"===c.wrap.css("position")&&c.wrap.css(b._getPosition(!0)));
25
- b.unbindEvents();e=a.content;d=a.type;j=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:c});g=a.href;switch(d){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):x(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
26
- false)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e=e+('<param name="'+a+'" value="'+b+'"></param>');h=h+(" "+a+'="'+b+'"')}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!x(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
27
- a.inner.css("overflow","yes"===j?"scroll":"no"===j?"hidden":j);b._setDimension();a.wrap.removeClass("fancybox-tmp");a.pos=f.extend({},a.dim,b._getPosition(!0));b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(c.prevMethod)b.transitions[c.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),c=0,e=!1,d=!1,e=b.wrap,j=b.skin,g=b.inner,h=
28
- b.current,d=h.width,i=h.height,l=h.minWidth,t=h.minHeight,m=h.maxWidth,n=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,w=h.margin,o=w[1]+w[3],p=w[0]+w[2],x,r,u,A,y,D,z,B,E;e.add(j).add(g).width("auto").height("auto");w=j.outerWidth(!0)-j.width();x=j.outerHeight(!0)-j.height();r=o+w;u=p+x;A=C(d)?(a.w-r)*k(d)/100:d;y=C(i)?(a.h-u)*k(i)/100:i;if("iframe"===h.type){if(E=h.content,h.autoHeight&&1===E.data("ready"))try{E[0].contentWindow.document.location&&(g.width(A).height(9999),D=E.contents().find("body"),
29
- q&&D.css("overflow-x","hidden"),y=D.height())}catch(F){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(A),h.autoHeight||g.height(y),h.autoWidth&&(A=g.width()),h.autoHeight&&(y=g.height()),g.removeClass("fancybox-tmp");d=k(A);i=k(y);B=A/y;l=k(C(l)?k(l,"w")-r:l);m=k(C(m)?k(m,"w")-r:m);t=k(C(t)?k(t,"h")-u:t);n=k(C(n)?k(n,"h")-u:n);D=m;z=n;o=a.w-o;p=a.h-p;if(h.aspectRatio){if(d>m&&(d=m,i=d/B),i>n&&(i=n,d=i*B),d<l&&(d=l,i=d/B),i<t)i=t,d=i*B}else d=Math.max(l,Math.min(d,
30
- m)),i=Math.max(t,Math.min(i,n));if(h.fitToView)if(m=Math.min(a.w-r,m),n=Math.min(a.h-u,n),g.width(k(d)).height(k(i)),e.width(k(d+w)),a=e.width(),r=e.height(),h.aspectRatio)for(;(a>o||r>p)&&(d>l&&i>t)&&!(19<c++);)i=Math.max(t,Math.min(n,i-10)),d=i*B,d<l&&(d=l,i=d/B),d>m&&(d=m,i=d/B),g.width(k(d)).height(k(i)),e.width(k(d+w)),a=e.width(),r=e.height();else d=Math.max(l,Math.min(d,d-(a-o))),i=Math.max(t,Math.min(i,i-(r-p)));q&&("auto"===s&&i<y&&d+w+q<o)&&(d+=q);g.width(k(d)).height(k(i));e.width(k(d+
31
- w));a=e.width();r=e.height();e=(a>o||r>p)&&d>l&&i>t;d=h.aspectRatio?d<D&&i<z&&d<A&&i<y:(d<D||i<z)&&(d<A||i<y);f.extend(h,{dim:{width:v(a),height:v(r)},origWidth:A,origHeight:y,canShrink:e,canExpand:d,wPadding:w,hPadding:x,wrapSpace:r-j.outerHeight(!0),skinSpace:j.height()-i});!E&&(h.autoHeight&&i>t&&i<n&&!d)&&g.height("auto")},_getPosition:function(a){var c=b.current,e=b.getViewport(),d=c.margin,f=b.wrap.width()+d[1]+d[3],g=b.wrap.height()+d[0]+d[2],d={position:"absolute",top:d[0],left:d[3]};c.autoCenter&&
32
- c.fixed&&!a&&g<=e.h&&f<=e.w?d.position="fixed":c.locked||(d.top+=e.y,d.left+=e.x);d.top=v(Math.max(d.top,d.top+(e.h-g)*c.topRatio));d.left=v(Math.max(d.left,d.left+(e.w-f)*c.leftRatio));return d},_afterZoomIn:function(){var a=b.current;a&&((b.isOpen=b.isOpened=!0,b.wrap.addClass("fancybox-opened").css("overflow","visible"),b.reposition(),(a.closeClick||a.nextClick)&&b.inner.css("cursor","pointer").bind("click.fb",function(c){if(!f(c.target).is("a")&&!f(c.target).parent().is("a"))b[a.closeClick?"close":
33
- "next"]()}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",b.close),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1)?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(){var a=b.current;f(".fancybox-wrap").stop(!0).trigger("onReset").remove();
34
- f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,c=a.element,e=a.orig,d={},f=50,g=50,h=a.hPadding,i=a.wPadding,l=b.getViewport();!e&&(a.isDom&&c.is(":visible"))&&(e=c.find("img:first"),e.length||(e=c));x(e)?(d=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(d.top=l.y+(l.h-g)*a.topRatio,d.left=l.x+(l.w-f)*
35
- a.leftRatio);a.locked&&(d.top-=l.y,d.left-=l.x);return d={top:v(d.top-h*a.topRatio),left:v(d.left-i*a.leftRatio),width:v(f+i),height:v(g+h)}},step:function(a,c){var e,d,f=c.prop;d=b.current;var g=d.wrapSpace,h=d.skinSpace;if("width"===f||"height"===f)e=c.end===c.start?1:(a-c.start)/(c.end-c.start),b.isClosing&&(e=1-e),d="width"===f?d.wPadding:d.hPadding,d=a-d,b.skin[f](k("width"===f?d:d-g*e)),b.inner[f](k("width"===f?d:d-g*e-h*e))},zoomIn:function(){var a=b.current,c=a.pos,e=a.openEffect,d="elastic"===
36
- e,j=f.extend({opacity:1},c);delete j.position;d?(c=this.getOrigPosition(),a.openOpacity&&(c.opacity=0.1)):"fade"===e&&(c.opacity=0.1);b.wrap.css(c).animate(j,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:d?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,c=a.closeEffect,e="elastic"===c,d={opacity:0.1};e&&(d=this.getOrigPosition(),a.closeOpacity&&(d.opacity=0.1));b.wrap.animate(d,{duration:"none"===c?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,
37
- complete:b._afterZoomOut})},changeIn:function(){var a=b.current,c=a.nextEffect,e=a.pos,d={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===c&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=v(k(e[g])-200),d[g]="+=200px"):(e[g]=v(k(e[g])+200),d[g]="-=200px"));"none"===c?b._afterZoomIn():b.wrap.css(e).animate(d,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,c=a.prevEffect,e={opacity:0.1},d=b.direction;"elastic"===c&&
38
- (e["down"===d||"up"===d?"top":"left"]=("up"===d||"left"===d?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===c?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={overlay:null,update:function(){var a="100%",b;this.overlay.width(a).height("100%");f.browser.msie?(b=Math.max(p.documentElement.offsetWidth,p.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>o.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,
39
- b){f(".fancybox-overlay").stop(!0,!0);this.overlay||f.extend(this,{overlay:f('<div class="fancybox-overlay"></div>').appendTo(b.parent),margin:n.height()>o.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,el:p.all&&!p.querySelector?f("html"):f("body")});b.fixed&&!m&&(this.overlay.addClass("fancybox-overlay-fixed"),b.autoCenter&&(this.overlay.append(b.wrap),b.locked=this.overlay));!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,c){var e=
40
- this.overlay.unbind(".fb").width("auto").height("auto").css(a.css);a.closeClick&&e.bind("click.fb",function(a){f(a.target).hasClass("fancybox-overlay")&&b.close()});c.fixed&&!m?c.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",k(this.margin)+c.scrollbarWidth)):this.update();e.show()},onUpdate:function(a,b){(!b.fixed||m)&&this.update()},afterClose:function(a){var c=this,a=a.speedOut||0;c.overlay&&!b.isActive&&c.overlay.fadeOut(a||0,function(){f("body").css("margin-right",
41
- c.margin);c.el.removeClass("fancybox-lock");c.overlay.remove();c.overlay=null})}};b.helpers.title={beforeShow:function(a){var c=b.current.title,e=a.type;if(s(c)&&""!==f.trim(c)){c=f('<div class="fancybox-title fancybox-title-'+e+'-wrap">'+c+"</div>");switch(e){case "inside":e=b.skin;break;case "outside":e=b.wrap;break;case "over":e=b.inner;break;default:e=b.skin,c.appendTo("body").width(c.width()).wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(k(c.css("margin-bottom")))}"top"===
42
- a.position?c.prependTo(e):c.appendTo(e)}}};f.fn.fancybox=function(a){var c,e=f(this),d=this.selector||"",j=function(g){var h=f(this).blur(),i=c,j,k;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(j=a.groupAttr||"data-fancybox-group",k=h.attr(j),k||(j="rel",k=h.get(0)[j]),k&&(""!==k&&"nofollow"!==k)&&(h=d.length?f(d):e,h=h.filter("["+j+'="'+k+'"]'),i=h.index(this)),a.index=i,!1!==b.open(h,a)&&g.preventDefault())},a=a||{};c=a.index||0;!d||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",
43
- j):n.undelegate(d,"click.fb-start").delegate(d+":not('.fancybox-item, .fancybox-nav')","click.fb-start",j);return this};n.ready(function(){f.scrollbarWidth===q&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===q){var a=f.support,c=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),e=20===c[0].offsetTop||
44
- 15===c[0].offsetTop;c.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png ADDED
Binary file
js/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png ADDED
Binary file
js/jquery-ui/images/ui-bg_flat_10_000000_40x100.png ADDED
Binary file
js/jquery-ui/images/ui-bg_highlight-soft_100_dbf1ff_1x100.png ADDED
Binary file
js/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png ADDED
Binary file
js/jquery-ui/images/ui-bg_highlight-soft_60_dedede_1x100.png ADDED
Binary file
js/jquery-ui/images/ui-bg_highlight-soft_65_f2f2f2_1x100.png ADDED
Binary file
js/jquery-ui/images/ui-bg_highlight-soft_75_fefc95_1x100.png ADDED
Binary file
js/jquery-ui/images/ui-bg_inset-soft_100_f2f2f2_1x100.png ADDED
Binary file
js/jquery-ui/images/ui-icons_0879ef_256x240.png ADDED
Binary file
js/jquery-ui/images/ui-icons_222222_256x240.png ADDED
Binary file
js/jquery-ui/images/ui-icons_228ef1_256x240.png ADDED
Binary file
js/jquery-ui/images/ui-icons_474747_256x240.png ADDED
Binary file
js/jquery-ui/images/ui-icons_616161_256x240.png ADDED
Binary file
js/jquery-ui/images/ui-icons_ffd27a_256x240.png ADDED
Binary file
js/jquery-ui/images/ui-icons_ffffff_256x240.png ADDED
Binary file
js/jquery-ui/jquery-ui.css ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.9.1 - 2012-11-23
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.button.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=sans-serif&fwDefault=bold&fsDefault=12px&cornerRadius=4px&bgColorHeader=dedede&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=60&borderColorHeader=b3b3b3&fcHeader=474747&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f2f2f2&bgTextureDefault=05_inset_soft.png&bgImgOpacityDefault=100&borderColorDefault=ababab&fcDefault=545454&iconColorDefault=616161&bgColorHover=dbf1ff&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=100&borderColorHover=5f9cd8&fcHover=00467a&iconColorHover=474747&bgColorActive=f2f2f2&bgTextureActive=03_highlight_soft.png&bgImgOpacityActive=65&borderColorActive=8f8f8f&fcActive=4f4f4f&iconColorActive=0879ef&bgColorHighlight=fefc95&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
5
+ * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden { display: none; }
10
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
11
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
+ .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
13
+ .ui-helper-clearfix:after { clear: both; }
14
+ .ui-helper-clearfix { zoom: 1; }
15
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
16
+
17
+
18
+ /* Interaction Cues
19
+ ----------------------------------*/
20
+ .ui-state-disabled { cursor: default !important; }
21
+
22
+
23
+ /* Icons
24
+ ----------------------------------*/
25
+
26
+ /* states and images */
27
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
28
+
29
+
30
+ /* Misc visuals
31
+ ----------------------------------*/
32
+
33
+ /* Overlays */
34
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
35
+ .ui-resizable { position: relative;}
36
+ .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
37
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
38
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
39
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
40
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
41
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
42
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
43
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
44
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
45
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
46
+ .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
47
+ .ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
48
+ .ui-accordion .ui-accordion-noicons { padding-left: .7em; }
49
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
50
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
51
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
52
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
53
+ .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
54
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
55
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
56
+ .ui-button-icons-only { width: 3.4em; }
57
+ button.ui-button-icons-only { width: 3.7em; }
58
+
59
+ /*button text element */
60
+ .ui-button .ui-button-text { display: block; line-height: 1.4; }
61
+ .ui-button-text-only .ui-button-text { padding: .4em 1em; }
62
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
63
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
64
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
65
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
66
+ /* no icon support for input elements, provide padding by default */
67
+ input.ui-button { padding: .4em 1em; }
68
+
69
+ /*button icon element(s) */
70
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
71
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
72
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
73
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
74
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
75
+
76
+ /*button sets*/
77
+ .ui-buttonset { margin-right: 7px; }
78
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
79
+
80
+ /* workarounds */
81
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
82
+ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
83
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
84
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
85
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
86
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
87
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
88
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
89
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
90
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
91
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
92
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
93
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
94
+ .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
95
+ .ui-menu .ui-menu { margin-top: -3px; position: absolute; }
96
+ .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
97
+ .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
98
+ .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
99
+ .ui-menu .ui-menu-item a.ui-state-focus,
100
+ .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
101
+
102
+ .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
103
+ .ui-menu .ui-state-disabled a { cursor: default; }
104
+
105
+ /* icon support */
106
+ .ui-menu-icons { position: relative; }
107
+ .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
108
+
109
+ /* left-aligned */
110
+ .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
111
+
112
+ /* right-aligned */
113
+ .ui-menu .ui-menu-icon { position: static; float: right; }
114
+ .ui-slider { position: relative; text-align: left; }
115
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
116
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
117
+
118
+ .ui-slider-horizontal { height: .8em; }
119
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
120
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
121
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
122
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
123
+
124
+ .ui-slider-vertical { width: .8em; height: 100px; }
125
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
126
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
127
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
128
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
129
+ .ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
130
+ .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
131
+ .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
132
+ .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
133
+ .ui-spinner-up { top: 0; }
134
+ .ui-spinner-down { bottom: 0; }
135
+
136
+ /* TR overrides */
137
+ .ui-spinner .ui-icon-triangle-1-s {
138
+ /* need to fix icons sprite */
139
+ background-position:-65px -16px;
140
+ }
141
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
142
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
143
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
144
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
145
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
146
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
147
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
148
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
149
+
150
+ /* Component containers
151
+ ----------------------------------*/
152
+ .ui-widget { font-family: sans-serif; font-size: 12px; }
153
+ .ui-widget .ui-widget { font-size: 1em; }
154
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: sans-serif; font-size: 1em; }
155
+ .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
156
+ .ui-widget-content a { color: #333333; }
157
+ .ui-widget-header { border: 1px solid #b3b3b3; background: #dedede url(images/ui-bg_highlight-soft_60_dedede_1x100.png) 50% 50% repeat-x; color: #474747; font-weight: bold; }
158
+ .ui-widget-header a { color: #474747; }
159
+
160
+ /* Interaction states
161
+ ----------------------------------*/
162
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #ababab; background: #f2f2f2 url(images/ui-bg_inset-soft_100_f2f2f2_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #545454; }
163
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #545454; text-decoration: none; }
164
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #5f9cd8; background: #dbf1ff url(images/ui-bg_highlight-soft_100_dbf1ff_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #00467a; }
165
+ .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #00467a; text-decoration: none; }
166
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #8f8f8f; background: #f2f2f2 url(images/ui-bg_highlight-soft_65_f2f2f2_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #4f4f4f; }
167
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #4f4f4f; text-decoration: none; }
168
+
169
+ /* Interaction Cues
170
+ ----------------------------------*/
171
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #fefc95 url(images/ui-bg_highlight-soft_75_fefc95_1x100.png) 50% top repeat-x; color: #363636; }
172
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
173
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; }
174
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; }
175
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; }
176
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
177
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
178
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
179
+ .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
180
+
181
+ /* Icons
182
+ ----------------------------------*/
183
+
184
+ /* states and images */
185
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
186
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
187
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); }
188
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_616161_256x240.png); }
189
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_474747_256x240.png); }
190
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_0879ef_256x240.png); }
191
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); }
192
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
193
+
194
+ /* positioning */
195
+ .ui-icon-carat-1-n { background-position: 0 0; }
196
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
197
+ .ui-icon-carat-1-e { background-position: -32px 0; }
198
+ .ui-icon-carat-1-se { background-position: -48px 0; }
199
+ .ui-icon-carat-1-s { background-position: -64px 0; }
200
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
201
+ .ui-icon-carat-1-w { background-position: -96px 0; }
202
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
203
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
204
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
205
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
206
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
207
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
208
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
209
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
210
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
211
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
212
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
213
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
214
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
215
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
216
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
217
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
218
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
219
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
220
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
221
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
222
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
223
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
224
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
225
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
226
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
227
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
228
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
229
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
230
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
231
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
232
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
233
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
234
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
235
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
236
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
237
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
238
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
239
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
240
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
241
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
242
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
243
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
244
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
245
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
246
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
247
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
248
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
249
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
250
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
251
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
252
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
253
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
254
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
255
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
256
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
257
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
258
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
259
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
260
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
261
+ .ui-icon-extlink { background-position: -32px -80px; }
262
+ .ui-icon-newwin { background-position: -48px -80px; }
263
+ .ui-icon-refresh { background-position: -64px -80px; }
264
+ .ui-icon-shuffle { background-position: -80px -80px; }
265
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
266
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
267
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
268
+ .ui-icon-folder-open { background-position: -16px -96px; }
269
+ .ui-icon-document { background-position: -32px -96px; }
270
+ .ui-icon-document-b { background-position: -48px -96px; }
271
+ .ui-icon-note { background-position: -64px -96px; }
272
+ .ui-icon-mail-closed { background-position: -80px -96px; }
273
+ .ui-icon-mail-open { background-position: -96px -96px; }
274
+ .ui-icon-suitcase { background-position: -112px -96px; }
275
+ .ui-icon-comment { background-position: -128px -96px; }
276
+ .ui-icon-person { background-position: -144px -96px; }
277
+ .ui-icon-print { background-position: -160px -96px; }
278
+ .ui-icon-trash { background-position: -176px -96px; }
279
+ .ui-icon-locked { background-position: -192px -96px; }
280
+ .ui-icon-unlocked { background-position: -208px -96px; }
281
+ .ui-icon-bookmark { background-position: -224px -96px; }
282
+ .ui-icon-tag { background-position: -240px -96px; }
283
+ .ui-icon-home { background-position: 0 -112px; }
284
+ .ui-icon-flag { background-position: -16px -112px; }
285
+ .ui-icon-calendar { background-position: -32px -112px; }
286
+ .ui-icon-cart { background-position: -48px -112px; }
287
+ .ui-icon-pencil { background-position: -64px -112px; }
288
+ .ui-icon-clock { background-position: -80px -112px; }
289
+ .ui-icon-disk { background-position: -96px -112px; }
290
+ .ui-icon-calculator { background-position: -112px -112px; }
291
+ .ui-icon-zoomin { background-position: -128px -112px; }
292
+ .ui-icon-zoomout { background-position: -144px -112px; }
293
+ .ui-icon-search { background-position: -160px -112px; }
294
+ .ui-icon-wrench { background-position: -176px -112px; }
295
+ .ui-icon-gear { background-position: -192px -112px; }
296
+ .ui-icon-heart { background-position: -208px -112px; }
297
+ .ui-icon-star { background-position: -224px -112px; }
298
+ .ui-icon-link { background-position: -240px -112px; }
299
+ .ui-icon-cancel { background-position: 0 -128px; }
300
+ .ui-icon-plus { background-position: -16px -128px; }
301
+ .ui-icon-plusthick { background-position: -32px -128px; }
302
+ .ui-icon-minus { background-position: -48px -128px; }
303
+ .ui-icon-minusthick { background-position: -64px -128px; }
304
+ .ui-icon-close { background-position: -80px -128px; }
305
+ .ui-icon-closethick { background-position: -96px -128px; }
306
+ .ui-icon-key { background-position: -112px -128px; }
307
+ .ui-icon-lightbulb { background-position: -128px -128px; }
308
+ .ui-icon-scissors { background-position: -144px -128px; }
309
+ .ui-icon-clipboard { background-position: -160px -128px; }
310
+ .ui-icon-copy { background-position: -176px -128px; }
311
+ .ui-icon-contact { background-position: -192px -128px; }
312
+ .ui-icon-image { background-position: -208px -128px; }
313
+ .ui-icon-video { background-position: -224px -128px; }
314
+ .ui-icon-script { background-position: -240px -128px; }
315
+ .ui-icon-alert { background-position: 0 -144px; }
316
+ .ui-icon-info { background-position: -16px -144px; }
317
+ .ui-icon-notice { background-position: -32px -144px; }
318
+ .ui-icon-help { background-position: -48px -144px; }
319
+ .ui-icon-check { background-position: -64px -144px; }
320
+ .ui-icon-bullet { background-position: -80px -144px; }
321
+ .ui-icon-radio-on { background-position: -96px -144px; }
322
+ .ui-icon-radio-off { background-position: -112px -144px; }
323
+ .ui-icon-pin-w { background-position: -128px -144px; }
324
+ .ui-icon-pin-s { background-position: -144px -144px; }
325
+ .ui-icon-play { background-position: 0 -160px; }
326
+ .ui-icon-pause { background-position: -16px -160px; }
327
+ .ui-icon-seek-next { background-position: -32px -160px; }
328
+ .ui-icon-seek-prev { background-position: -48px -160px; }
329
+ .ui-icon-seek-end { background-position: -64px -160px; }
330
+ .ui-icon-seek-start { background-position: -80px -160px; }
331
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
332
+ .ui-icon-seek-first { background-position: -80px -160px; }
333
+ .ui-icon-stop { background-position: -96px -160px; }
334
+ .ui-icon-eject { background-position: -112px -160px; }
335
+ .ui-icon-volume-off { background-position: -128px -160px; }
336
+ .ui-icon-volume-on { background-position: -144px -160px; }
337
+ .ui-icon-power { background-position: 0 -176px; }
338
+ .ui-icon-signal-diag { background-position: -16px -176px; }
339
+ .ui-icon-signal { background-position: -32px -176px; }
340
+ .ui-icon-battery-0 { background-position: -48px -176px; }
341
+ .ui-icon-battery-1 { background-position: -64px -176px; }
342
+ .ui-icon-battery-2 { background-position: -80px -176px; }
343
+ .ui-icon-battery-3 { background-position: -96px -176px; }
344
+ .ui-icon-circle-plus { background-position: 0 -192px; }
345
+ .ui-icon-circle-minus { background-position: -16px -192px; }
346
+ .ui-icon-circle-close { background-position: -32px -192px; }
347
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
348
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
349
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
350
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
351
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
352
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
353
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
354
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
355
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
356
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
357
+ .ui-icon-circle-check { background-position: -208px -192px; }
358
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
359
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
360
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
361
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
362
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
363
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
364
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
365
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
366
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
367
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
368
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
369
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
370
+
371
+
372
+ /* Misc visuals
373
+ ----------------------------------*/
374
+
375
+ /* Corner radius */
376
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
377
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
378
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
379
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
380
+
381
+ /* Overlays */
382
+ .ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .5;filter:Alpha(Opacity=50); }
383
+ .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .2;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
js/jquery-ui/jquery-ui.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.9.1 - 2012-11-23
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.button.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js
4
+ * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
5
+
6
+ (function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.1",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:u.widgetEventPrefix||t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():new i(o,this)}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n){var r,i=this;n?(t=r=e(t),this.bindings=this.bindings.add(t)):(n=t,t=this.element,r=this.widget()),e.each(n,function(n,s){function o(){if(i.options.disabled===!0||e(this).hasClass("ui-state-disabled"))return;return(typeof s=="string"?i[s]:s).apply(i,arguments)}typeof s!="string"&&(o.guid=s.guid=s.guid||o.guid||e.guid++);var u=n.match(/^(\w+)\s*(.*)$/),a=u[1]+i.eventNamespace,f=u[2];f?r.delegate(f,a,o):t.bind(a,o)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(jQuery);(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(jQuery);(function(e,t){e.widget("ui.droppable",{version:"1.9.1",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(jQuery);(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(jQuery);(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.1",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).height("").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype))})(jQuery);(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.1",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c="ui-state-hover"+(a?"":" ui-state-active"),h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;e(this).addClass("ui-state-hover"),this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is(":disabled")||this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.1",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.1",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||"&#160;",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){r=e.isFunction(r)?{click:r,text:t}:r;var i=e("<button type='button'></button>").attr(r,!0).unbind("click").click(function(){r.click.apply(n.element[0],arguments)}).appendTo(n.uiButtonSet);e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||"&#160;"))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus+":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"});t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),r.each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(jQuery);(function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.1",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r=this._superApply(arguments);return r?(e==="beforeActivate"&&n.newTab.length?r=this._super("select",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()}):e==="activate"&&n.newTab.length&&(r=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),r):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);
js/util.js CHANGED
@@ -3,6 +3,30 @@ var jQueryCrayon = jQuery;
3
 
4
  var CRAYON_DEBUG = false;
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  if (typeof CrayonTagEditorSettings == 'undefined') {
7
  // WP may have already added it
8
  CrayonTagEditorSettings = {};
@@ -24,10 +48,31 @@ RegExp.prototype.execAll = function(string) {
24
  return matches;
25
  };
26
 
 
 
 
 
 
27
  String.prototype.sliceReplace = function(start, end, repl) {
28
  return this.substring(0, start) + repl + this.substring(end);
29
  };
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  function console_log(string) {
32
  if (typeof console != 'undefined' && CRAYON_DEBUG) {
33
  console.log(string);
3
 
4
  var CRAYON_DEBUG = false;
5
 
6
+ (function ($) {
7
+
8
+ CrayonUtil = new function() {
9
+
10
+ var base = this;
11
+ var settings = CrayonSyntaxSettings;
12
+
13
+ base.addPrefixToID = function (id) {
14
+ return id.replace(/^([#.])?(.*)$/, '$1' + settings.prefix + '$2');
15
+ };
16
+
17
+ base.removePrefixFromID = function(id) {
18
+ var re = new RegExp('^[#.]?' + settings.prefix, 'i');
19
+ return id.replace(re, '');
20
+ };
21
+
22
+ base.cssElem = function (id) {
23
+ return $(base.addPrefixToID(id));
24
+ };
25
+
26
+ };
27
+
28
+ })(jQueryCrayon);
29
+
30
  if (typeof CrayonTagEditorSettings == 'undefined') {
31
  // WP may have already added it
32
  CrayonTagEditorSettings = {};
48
  return matches;
49
  };
50
 
51
+ // Escape regex chars with \
52
+ RegExp.prototype.escape = function(text) {
53
+ return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
54
+ };
55
+
56
  String.prototype.sliceReplace = function(start, end, repl) {
57
  return this.substring(0, start) + repl + this.substring(end);
58
  };
59
 
60
+ String.prototype.escape = function() {
61
+ var tagsToReplace = {
62
+ '&': '&amp;',
63
+ '<': '&lt;',
64
+ '>': '&gt;'
65
+ };
66
+ return this.replace(/[&<>]/g, function(tag) {
67
+ return tagsToReplace[tag] || tag;
68
+ });
69
+ };
70
+
71
+ String.prototype.linkify = function(target) {
72
+ target = typeof target != 'undefined' ? target : '';
73
+ return this.replace(/(http(s)?:\/\/(\S)+)/gmi, '<a href="$1" target="' + target + '">$1</a>');
74
+ };
75
+
76
  function console_log(string) {
77
  if (typeof console != 'undefined' && CRAYON_DEBUG) {
78
  console.log(string);
langs/applescript/.DS_Store CHANGED
Binary file
langs/batch/batch.txt ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### MS DOS BATCH SCRIPT ###
2
+
3
+ # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
+
5
+ NAME MS-DOS Batch
6
+ VERSION 1.0
7
+
8
+ STRING (?default)|(?<=\becho\b).*?$
9
+
10
+ LABEL:FADED (:[a-zA-Z_\-][a-zA-Z0-9_\-\.]+)
11
+ COMMENT ^::.*?$|^rem\s(.*?)$
12
+
13
+ KEYWORD \b(?alt:keywords.txt)\b
14
+
15
+ RESERVED \b(?alt:builtins.txt)\b|^[a-zA-Z][a-zA-Z0-9_\-\.]*
16
+
17
+ VARIABLE %?%[0-9]+|%[^%\s]+%
18
+
19
+ PARAMETER:VARIABLE \s-[a-zA-Z][a-zA-Z0.9]*
20
+
21
+ OPERATOR ($default)|==|\[|\]|\*
langs/batch/builtins.txt ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ smartdrive
2
+ echo off
3
+ fastopen
4
+ intersvr
5
+ interlnk
6
+ loadhigh
7
+ memmaker
8
+ scandisk
9
+ truename
10
+ undelete
11
+ restore
12
+ deltree
13
+ echo on
14
+ exe2bin
15
+ loadfix
16
+ append
17
+ assign
18
+ attrib
19
+ backup
20
+ basica
21
+ chkdsk
22
+ choice
23
+ defrag
24
+ format
25
+ pcpark
26
+ setver
27
+ verify
28
+ basic
29
+ chdir
30
+ erase
31
+ edlin
32
+ fdisk
33
+ label
34
+ mkdir
35
+ pause
36
+ print
37
+ rmdir
38
+ share
39
+ subst
40
+ xcopy
41
+ call
42
+ chcp
43
+ copy
44
+ ctty
45
+ echo
46
+ edit
47
+ exit
48
+ comp
49
+ find
50
+ help
51
+ join
52
+ mode
53
+ more
54
+ move
55
+ path
56
+ sort
57
+ time
58
+ date
59
+ tree
60
+ type
61
+ cls
62
+ del
63
+ dir
64
+ mem
65
+ msd
66
+ rem
67
+ ren
68
+ set
69
+ sys
70
+ ver
71
+ cd
72
+ fc
73
+ lh
74
+ md
75
+ rd
langs/batch/keywords.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ errorlevel
2
+ setlocal
3
+ endlocal
4
+ choice
5
+ lfnfor
6
+ shift
7
+ pause
8
+ exist
9
+ start
10
+ else
11
+ call
12
+ goto
13
+ echo
14
+ for
15
+ not
16
+ set
17
+ do
18
+ in
19
+ if
langs/delphi/.DS_Store CHANGED
Binary file
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Crayon Syntax Highlighter ===
2
  Contributors: akarmenia
3
- Donate link: https://www.paypal.com/au/cgi-bin/webscr?cmd=_flow&SESSION=4FKp23py2y97iYDcCYZ9zOSEMedaceiEpb8Pvf_qQyezHR3TQROKd_IeRfC&dispatch=5885d80a13c0db1f8e263663d3faee8d0b7e678a25d883d0fa72c947f193f8fd
4
  License: GPLv2 or later
5
  Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter, bbpress
6
  Requires at least: 3.0
7
  Tested up to: 3.4.2
8
- Stable tag: 1.14
9
 
10
  Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
11
 
@@ -61,7 +61,7 @@ There are many ways you can help!
61
  * Make a Theme and share
62
  * Add support for your favourite <a href="http://ak.net84.net/projects/crayon-language-file-specification/" target="_blank">Language</a>
63
  * Write a post about your pastel experiences and share
64
- * <a href="https://www.paypal.com/au/cgi-bin/webscr?cmd=_flow&SESSION=4FKp23py2y97iYDcCYZ9zOSEMedaceiEpb8Pvf_qQyezHR3TQROKd_IeRfC&dispatch=5885d80a13c0db1f8e263663d3faee8d0b7e678a25d883d0fa72c947f193f8fd" target="_blank">Donate</a> to the project
65
 
66
  **Supported Languages**
67
 
@@ -89,6 +89,7 @@ See the <a href="http://ak.net84.net/projects/crayon-language-file-specification
89
  * Microsoft Registry (thanks to <a href="http://techexplored.com/2012/03/21/crayon-syntax-highlighter-reg-support/" target="_blank">techexplored.com</a>)
90
  * MIVA Script
91
  * Monkey (thanks to <a href="https://github.com/devolonter" target="_blank">Devolonter</a>)
 
92
  * Java
93
  * JavaScript
94
  * Objective-C
@@ -138,10 +139,11 @@ These are helpful for discovering new features.
138
 
139
  A handful of articles from others written about Crayon, thanks guys!
140
 
 
141
  * <a href="http://themesplugins.com/wordpress-Plugin/add-php-java-html-codes-posts-pages/" target="_blank">Crayon Syntax Highlighter � Plugin</a>
142
  * <a href="http://bbpress.org/forums/topic/state-of-syntax-highlighter-support-in-bbpress-2/" target="_blank">State of syntax highlighter support in bbPress 2</a>
143
  * <a href="http://www.techbrunch.fr/informations/plugin-wordpress-afficher-code-source/" target="_blank">The ultimate plugin for displaying code in WordPress (French)</a>
144
- * <a href="http://www.trynull.com/2012/06/15/finally-wordpress-code-syntax-highlighting-that-works/" target="_blank">Finally!�A WordPress code syntax highlighting that works</a>
145
  * <a href="http://selfpwnt.com/crayon-syntax-highlighter-and-its-studly-author/" target="_blank">Crayon Syntax Highlighter (and its studly author)</a>
146
  * <a href="http://bit51.com/add-code-to-your-wordpress-posts-with-crayon-syntax-highlighter/" target="_blank">Add Code To Your WordPress Posts With Crayon Syntax Highlighter</a>
147
  * <a href="http://www.wpsquare.com/syntax-highlighter-wordpress-plugins/" target="_blank">15 Best Syntax Highlighter WordPress Plugins</a>
@@ -249,8 +251,25 @@ Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
249
 
250
  == Changelog ==
251
 
252
- = 1.14.1 =
253
- * Improved version updating
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
 
255
  = 1.14 =
256
  * All AJAX functions are now using the wp_ajax action and admin-ajax.php method defined here: http://codex.wordpress.org/AJAX_in_Plugins. This means Crayon no longer passes around the wp_load path and doesn't use it as a $_GET variable to load AJAX requests. The security vulnerability in 1.13 is no longer present and that code has been removed.
1
  === Crayon Syntax Highlighter ===
2
  Contributors: akarmenia
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=AW99EMEPQ4CFE&lc=AU&item_name=Crayon%20Syntax%20Highlighter%20Donation&item_number=crayon%2ddonate&currency_code=AUD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  License: GPLv2 or later
5
  Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter, bbpress
6
  Requires at least: 3.0
7
  Tested up to: 3.4.2
8
+ Stable tag: 1.15
9
 
10
  Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
11
 
61
  * Make a Theme and share
62
  * Add support for your favourite <a href="http://ak.net84.net/projects/crayon-language-file-specification/" target="_blank">Language</a>
63
  * Write a post about your pastel experiences and share
64
+ * <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=AW99EMEPQ4CFE&lc=AU&item_name=Crayon%20Syntax%20Highlighter%20Donation&item_number=crayon%2ddonate&currency_code=AUD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted" target="_blank">Donate</a> to the project
65
 
66
  **Supported Languages**
67
 
89
  * Microsoft Registry (thanks to <a href="http://techexplored.com/2012/03/21/crayon-syntax-highlighter-reg-support/" target="_blank">techexplored.com</a>)
90
  * MIVA Script
91
  * Monkey (thanks to <a href="https://github.com/devolonter" target="_blank">Devolonter</a>)
92
+ * MS-DOS Batch (thanks to <a href="http://www.amigalog.com/?p=334" target="_blank">http://www.amigalog.com/?p=334</a>)
93
  * Java
94
  * JavaScript
95
  * Objective-C
139
 
140
  A handful of articles from others written about Crayon, thanks guys!
141
 
142
+ * <a href="http://icrunched.co/top-5-syntax-highlighter-wordpress-plugins/" target="_blank">Top 5 Syntax Highlighter WordPress Plugins</a>
143
  * <a href="http://themesplugins.com/wordpress-Plugin/add-php-java-html-codes-posts-pages/" target="_blank">Crayon Syntax Highlighter � Plugin</a>
144
  * <a href="http://bbpress.org/forums/topic/state-of-syntax-highlighter-support-in-bbpress-2/" target="_blank">State of syntax highlighter support in bbPress 2</a>
145
  * <a href="http://www.techbrunch.fr/informations/plugin-wordpress-afficher-code-source/" target="_blank">The ultimate plugin for displaying code in WordPress (French)</a>
146
+ * <a href="http://www.trynull.com/2012/06/15/finally-wordpress-code-syntax-highlighting-that-works/" target="_blank">Finally!, A WordPress code syntax highlighting that works</a>
147
  * <a href="http://selfpwnt.com/crayon-syntax-highlighter-and-its-studly-author/" target="_blank">Crayon Syntax Highlighter (and its studly author)</a>
148
  * <a href="http://bit51.com/add-code-to-your-wordpress-posts-with-crayon-syntax-highlighter/" target="_blank">Add Code To Your WordPress Posts With Crayon Syntax Highlighter</a>
149
  * <a href="http://www.wpsquare.com/syntax-highlighter-wordpress-plugins/" target="_blank">15 Best Syntax Highlighter WordPress Plugins</a>
251
 
252
  == Changelog ==
253
 
254
+ = 1.15 =
255
+ * ADDED:
256
+ * The settings page no longer searches through all posts looking for legacy tags until you hit a new "refresh" button. Refreshing will look through all posts for crayon tags, and also mark any that are legacy tags. The same process occurs on an individual basis when saving a post.
257
+ * The settings page shows which posts contains legacy tags, and the buttons do not hide when showing the table.
258
+ * Added theme information to the settings page
259
+ * Improved version updating
260
+ * Code in a new window loses size constraints
261
+ * MS-DOS batch language (thanks to <a href="http://www.amigalog.com/?p=334" target="_blank">http://www.amigalog.com/?p=334</a>)
262
+ * Minor improvements
263
+ * FIXED:
264
+ * Fancybox issues have been fixed: http://ak.net84.net/crayon/initialising-fancybox-with-custom-objects/
265
+ * max/min-height/width didn't work on Tag Editor
266
+ * Width discrepancy before and after mouseover from 1px border
267
+ * Before and after whitespace didn't display correctly
268
+ * Code opened in a new window didn't display if the current wp theme css was included
269
+ * IE 8 compatibility issues
270
+ * Dropdown of languages in settings and Tag Editor are now sorted by name, not id
271
+ * By default "Display the Tag Editor in any TinyMCE instances on the frontend" is disabled to reduce resources
272
+ * Chinese translation updated
273
 
274
  = 1.14 =
275
  * All AJAX functions are now using the wp_ajax action and admin-ajax.php method defined here: http://codex.wordpress.org/AJAX_in_Plugins. This means Crayon no longer passes around the wp_load path and doesn't use it as a $_GET variable to load AJAX requests. The security vulnerability in 1.13 is no longer present and that code has been removed.
themes/ado/ado.css CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  Theme Name: Ado
3
  Description: Classic extended.
4
- Version: 1
5
  Author: Andrea Dell'Orco
6
  Author URI: http://www.adostudio.it/
7
  */
1
  /*
2
  Theme Name: Ado
3
  Description: Classic extended.
4
+ Version: 1.0
5
  Author: Andrea Dell'Orco
6
  Author URI: http://www.adostudio.it/
7
  */
themes/epicgeeks/epicgeeks.css CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  Theme Name: Epicgeeks
3
- Description: Epicgeeks Cryaon Theme.
4
  Version: 1.2
5
  Author: J. Newing (synmuffin)
6
  Author URI: http://epicgeeks.net/
1
  /*
2
  Theme Name: Epicgeeks
3
+ Description: Epicgeeks Theme.
4
  Version: 1.2
5
  Author: J. Newing (synmuffin)
6
  Author URI: http://epicgeeks.net/
themes/neon/neon.css CHANGED
@@ -1,9 +1,9 @@
1
  /*
2
- Theme Name: neon
3
- Description: Dark and elegant.
4
- Version: 1.3
5
- Author: Aram Kocharyan
6
- Author URI: http://ak.net84.net/
7
  */
8
 
9
  /* Code Style ====================== */
1
  /*
2
+ Theme Name: Neon
3
+ Description: Dark, elegant and electric.
4
+ Version: 1.0
5
+ Author: Di_Skyer
6
+ Author URI: http://atlocal.net/
7
  */
8
 
9
  /* Code Style ====================== */
themes/phiphou/phiphou.css CHANGED
@@ -1,12 +1,11 @@
1
  /*
2
-
3
- Theme name: SonOfObsidian
4
- Description: Inspired from http://studiostyl.es/schemes/son-of-obsidian
5
- Original author : http://studiostyl.es/users/135
6
- Author: Phiphou
7
- Author URL : http://blog.phiphou.com
8
- Author twitter: @__phiphou__
9
-
10
  */
11
 
12
  /* code style ====================== */
1
  /*
2
+ Theme Name : SonOfObsidian
3
+ Description : Inspired from http://studiostyl.es/schemes/son-of-obsidian
4
+ Version: 1.0
5
+ Original Author : http://studiostyl.es/users/135
6
+ Author : Phiphou
7
+ Author URI : http://blog.phiphou.com
8
+ Author Twitter: @__phiphou__
 
9
  */
10
 
11
  /* code style ====================== */
themes/solarized-dark/solarized-dark.css ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Theme Name: Solarized Dark
3
+ Description: Clean, crisp and colorful.
4
+ Version: 1.0.0 Beta 2
5
+ Author: Ethan Schoonover
6
+ Author URI: http://ethanschoonover.com/
7
+ */
8
+
9
+ /* Code Style ====================== */
10
+ .crayon-theme-solarized-dark {
11
+ border: 1px #999 solid !important;
12
+ text-shadow: none !important;
13
+ }
14
+
15
+ .crayon-theme-solarized-dark,
16
+ .crayon-theme-solarized-dark .crayon-code {
17
+ background: #002b36 !important;
18
+ }
19
+
20
+ /* Inline Style */
21
+ .crayon-theme-solarized-dark-inline {
22
+ border: 1px solid #ddd !important;
23
+ background: #002b36 !important;
24
+ }
25
+
26
+ /* Line Numbers */
27
+ .crayon-theme-solarized-dark .crayon-nums {
28
+ background: #073642 !important;
29
+ color: #586e75 !important;
30
+ border-right: 1px solid #b3d3f3 !important;
31
+ }
32
+
33
+ /* Selection */
34
+ .crayon-theme-solarized-dark .crayon-code::selection,
35
+ .crayon-theme-solarized-dark .crayon-code *::selection {
36
+ background: #ddeeff !important;
37
+ color: #316ba5 !important;
38
+ }
39
+ .crayon-theme-solarized-dark::selection,
40
+ .crayon-theme-solarized-dark .crayon-toolbar::selection,
41
+ .crayon-theme-solarized-dark .crayon-toolbar *::selection,
42
+ .crayon-theme-solarized-dark .crayon-info::selection,
43
+ .crayon-theme-solarized-dark .crayon-info *::selection,
44
+ .crayon-theme-solarized-dark .crayon-nums::selection,
45
+ .crayon-theme-solarized-dark .crayon-nums *::selection {
46
+ background: transparent !important;
47
+ }
48
+
49
+ /* Striped Lines */
50
+ .crayon-theme-solarized-dark .crayon-striped-line {
51
+ background: #073642 !important;
52
+ border: 1px #CCC !important;
53
+ }
54
+ .crayon-theme-solarized-dark .crayon-striped-num {
55
+ border: 1px #CCC !important;
56
+ color: #586e75 !important;
57
+ background: #054150 !important;
58
+ }
59
+
60
+ /* Marked Lines */
61
+ .crayon-theme-solarized-dark .crayon-marked-line {
62
+ background: #2f4d54 !important;
63
+ border-color: #446b73;
64
+ border-width: 1px;
65
+ }
66
+ .crayon-theme-solarized-dark .crayon-marked-num {
67
+ color: #586e75 !important;
68
+ background: #024e61 !important;
69
+ border: 1px #4e747d !important;
70
+ }
71
+ .crayon-theme-solarized-dark .crayon-marked-line.crayon-striped-line {
72
+ background: #2b474e !important;
73
+ }
74
+ .crayon-theme-solarized-dark .crayon-marked-num.crayon-striped-num {
75
+ background: #2a444a !important;
76
+ }
77
+ .crayon-theme-solarized-dark .crayon-marked-line.crayon-top,
78
+ .crayon-theme-solarized-dark .crayon-marked-num.crayon-top {
79
+ border-top-style: solid !important;
80
+ }
81
+ .crayon-theme-solarized-dark .crayon-marked-line.crayon-bottom,
82
+ .crayon-theme-solarized-dark .crayon-marked-num.crayon-bottom {
83
+ border-bottom-style: solid !important;
84
+ }
85
+
86
+ /* Info */
87
+ .crayon-theme-solarized-dark .crayon-info {
88
+ background: #faf9d7 !important;
89
+ border-bottom: 1px #b1af5e solid !important;
90
+ color: #7e7d34;
91
+ }
92
+
93
+ /* Toolbar */
94
+ .crayon-theme-solarized-dark .crayon-toolbar {
95
+ background: #DDD !important;
96
+ border-bottom: 1px #BBB solid !important;
97
+ }
98
+ .crayon-theme-solarized-dark .crayon-toolbar > div {
99
+ float: left !important;
100
+ }
101
+ .crayon-theme-solarized-dark .crayon-toolbar .crayon-tools {
102
+ float: right !important;
103
+ }
104
+ .crayon-theme-solarized-dark .crayon-title {
105
+ color: #333 !important;
106
+ }
107
+ .crayon-theme-solarized-dark .crayon-language {
108
+ color: #999 !important;
109
+ }
110
+
111
+ /* Buttons */
112
+ .crayon-theme-solarized-dark a.crayon-button {
113
+ background-color: transparent;
114
+ }
115
+ .crayon-theme-solarized-dark a.crayon-button:hover,
116
+ .crayon-theme-solarized-dark a.crayon-button.crayon-pressed:hover {
117
+ background-color: #EEE;
118
+ color: #666;
119
+ }
120
+ /* :active MUST come after :hover */
121
+ .crayon-theme-solarized-dark a.crayon-button.crayon-pressed,
122
+ .crayon-theme-solarized-dark a.crayon-button.crayon-pressed:active,
123
+ .crayon-theme-solarized-dark a.crayon-button:active {
124
+ background-color: #BCBCBC;
125
+ color: #FFF;
126
+ }
127
+
128
+ /* End Code Style ================== */
129
+
130
+ /* Syntax Highlighting ============= */
131
+ .crayon-theme-solarized-dark .crayon-pre .c {
132
+ color: #586e75 !important;
133
+ }
134
+ .crayon-theme-solarized-dark .crayon-pre .p {
135
+ color: #839496 !important;
136
+ }
137
+ .crayon-theme-solarized-dark .crayon-pre .s {
138
+ color: #2aa198 !important;
139
+ }
140
+ .crayon-theme-solarized-dark .crayon-pre .k,
141
+ .crayon-theme-solarized-dark .crayon-pre .r,
142
+ .crayon-theme-solarized-dark .crayon-pre .st,
143
+ .crayon-theme-solarized-dark .crayon-pre .t {
144
+ color: #b58900 !important;
145
+ }
146
+ .crayon-theme-solarized-dark .crayon-pre .m {
147
+ color: #859900 !important;
148
+ }
149
+ .crayon-theme-solarized-dark .crayon-pre .ta {
150
+ color: #FF0000 !important;
151
+ }
152
+ .crayon-theme-solarized-dark .crayon-pre .i {
153
+ color: #839496 !important;
154
+ }
155
+ .crayon-theme-solarized-dark .crayon-pre .v {
156
+ color: #839496 !important;
157
+ }
158
+ .crayon-theme-solarized-dark .crayon-pre .e {
159
+ color: #839496 !important;
160
+ }
161
+ .crayon-theme-solarized-dark .crayon-pre .cn {
162
+ color: #ce0000 !important;
163
+ }
164
+ .crayon-theme-solarized-dark .crayon-pre .o {
165
+ color: #839496 !important;
166
+ }
167
+ .crayon-theme-solarized-dark .crayon-pre .h {
168
+ color: #dc322f !important;
169
+ }
170
+ .crayon-theme-solarized-dark .crayon-pre .sy {
171
+ color: #839496 !important;
172
+ }
173
+ .crayon-theme-solarized-dark .crayon-pre .n {
174
+ color: #666 !important;
175
+ font-style: italic;
176
+ }
177
+ .crayon-theme-solarized-dark .crayon-pre .f {
178
+ color: #999 !important;
179
+ }
180
+ /* End Syntax Highlighting ========= */
181
+
182
+ /* End Classic Scheme ============================================ */
trans/crayon-syntax-highlighter-zh_CN.mo CHANGED
Binary file
trans/crayon-syntax-highlighter-zh_CN.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Crayon Syntax Highlighter v1.9.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2012-03-30 18:54+0000\n"
7
  "Last-Translator: admin <admin@neverno.me>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -19,375 +19,375 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
- #: crayon_formatter.class.php:266
23
  #@ crayon-syntax-highlighter
24
  msgid "Toggle Plain Code"
25
  msgstr "纯文本显示代码"
26
 
27
- #: crayon_formatter.class.php:268
28
  #, php-format
29
  #@ crayon-syntax-highlighter
30
  msgid "Press %s to Copy, %s to Paste"
31
  msgstr "使用 %s 复制,使用 %s 粘贴。"
32
 
33
- #: crayon_formatter.class.php:268
34
  #@ crayon-syntax-highlighter
35
  msgid "Copy Plain Code"
36
  msgstr "复制代码"
37
 
38
- #: crayon_formatter.class.php:270
39
  #@ crayon-syntax-highlighter
40
  msgid "Open Code In New Window"
41
  msgstr "在新窗口中显示代码"
42
 
43
- #: crayon_formatter.class.php:273
44
  #@ crayon-syntax-highlighter
45
  msgid "Toggle Line Numbers"
46
- msgstr "显示/隐藏行编号"
47
 
48
- #: crayon_formatter.class.php:279
49
  #@ crayon-syntax-highlighter
50
  msgid "Contains Mixed Languages"
51
  msgstr "含多种语言"
52
 
53
- #: crayon_settings.class.php:138
54
  #@ crayon-syntax-highlighter
55
  msgid "Hourly"
56
  msgstr "每小时"
57
 
58
- #: crayon_settings.class.php:138
59
  #@ crayon-syntax-highlighter
60
  msgid "Daily"
61
  msgstr "每天"
62
 
63
- #: crayon_settings.class.php:139
64
  #@ crayon-syntax-highlighter
65
  msgid "Weekly"
66
  msgstr "每周"
67
 
68
- #: crayon_settings.class.php:139
69
  #@ crayon-syntax-highlighter
70
  msgid "Monthly"
71
  msgstr "每月"
72
 
73
- #: crayon_settings.class.php:140
74
  #@ crayon-syntax-highlighter
75
  msgid "Immediately"
76
  msgstr "立刻"
77
 
78
- #: crayon_settings.class.php:150
79
- #: crayon_settings.class.php:154
80
  #@ crayon-syntax-highlighter
81
  msgid "Max"
82
  msgstr "最大"
83
 
84
- #: crayon_settings.class.php:150
85
- #: crayon_settings.class.php:154
86
  #@ crayon-syntax-highlighter
87
  msgid "Min"
88
  msgstr "最小"
89
 
90
- #: crayon_settings.class.php:150
91
- #: crayon_settings.class.php:154
92
  #@ crayon-syntax-highlighter
93
  msgid "Static"
94
  msgstr "指定"
95
 
96
- #: crayon_settings.class.php:152
97
- #: crayon_settings.class.php:156
98
- #: crayon_settings_wp.class.php:541
99
- #: crayon_settings_wp.class.php:550
100
- #: crayon_settings_wp.class.php:649
101
  #@ crayon-syntax-highlighter
102
  msgid "Pixels"
103
  msgstr "px"
104
 
105
- #: crayon_settings.class.php:152
106
- #: crayon_settings.class.php:156
107
  #@ crayon-syntax-highlighter
108
  msgid "Percent"
109
  msgstr "%"
110
 
111
- #: crayon_settings.class.php:165
112
  #@ crayon-syntax-highlighter
113
  msgid "None"
114
  msgstr "从不"
115
 
116
- #: crayon_settings.class.php:165
117
  #@ crayon-syntax-highlighter
118
  msgid "Left"
119
  msgstr "左对齐"
120
 
121
- #: crayon_settings.class.php:165
122
  #@ crayon-syntax-highlighter
123
  msgid "Center"
124
  msgstr "居中"
125
 
126
- #: crayon_settings.class.php:165
127
  #@ crayon-syntax-highlighter
128
  msgid "Right"
129
  msgstr "右对齐"
130
 
131
- #: crayon_settings.class.php:167
132
- #: crayon_settings.class.php:189
133
  #@ crayon-syntax-highlighter
134
  msgid "On MouseOver"
135
  msgstr "鼠标经过"
136
 
137
- #: crayon_settings.class.php:167
138
- #: crayon_settings.class.php:173
139
  #@ crayon-syntax-highlighter
140
  msgid "Always"
141
  msgstr "始终显示"
142
 
143
- #: crayon_settings.class.php:167
144
- #: crayon_settings.class.php:173
145
  #@ crayon-syntax-highlighter
146
  msgid "Never"
147
  msgstr "从不显示"
148
 
149
- #: crayon_settings.class.php:173
150
  #@ crayon-syntax-highlighter
151
  msgid "When Found"
152
  msgstr "当发现时"
153
 
154
- #: crayon_settings.class.php:189
155
  #@ crayon-syntax-highlighter
156
  msgid "On Double Click"
157
  msgstr "双击"
158
 
159
- #: crayon_settings.class.php:189
160
  #@ crayon-syntax-highlighter
161
  msgid "On Single Click"
162
  msgstr "单击"
163
 
164
- #: crayon_settings.class.php:189
165
  #@ crayon-syntax-highlighter
166
  msgid "Disable Mouse Events"
167
  msgstr "禁止鼠标行为"
168
 
169
- #: crayon_settings.class.php:196
170
  #@ crayon-syntax-highlighter
171
  msgid "An error has occurred. Please try again later."
172
  msgstr "发生错误,请稍后重试。"
173
 
174
- #: crayon_settings_wp.class.php:44
175
- #: crayon_settings_wp.class.php:118
176
- #: crayon_settings_wp.class.php:802
177
- #: util/tag-editor/crayon_te_content.php:114
178
  #@ crayon-syntax-highlighter
179
  msgid "Settings"
180
  msgstr "设置"
181
 
182
- #: crayon_settings_wp.class.php:99
183
  #@ crayon-syntax-highlighter
184
  msgid "You do not have sufficient permissions to access this page."
185
  msgstr "无权限访问此页面"
186
 
187
- #: crayon_settings_wp.class.php:130
188
  #@ crayon-syntax-highlighter
189
  msgid "Save Changes"
190
- msgstr "保存"
191
 
192
- #: crayon_settings_wp.class.php:136
193
  #@ crayon-syntax-highlighter
194
  msgid "Reset Settings"
195
  msgstr "初始化设置"
196
 
197
- #: crayon_settings_wp.class.php:301
198
  #@ crayon-syntax-highlighter
199
  msgid "General"
200
  msgstr "一般"
201
 
202
- #: crayon_settings_wp.class.php:302
203
  #@ crayon-syntax-highlighter
204
  msgid "Theme"
205
  msgstr "主题"
206
 
207
- #: crayon_settings_wp.class.php:303
208
  #@ crayon-syntax-highlighter
209
  msgid "Font"
210
  msgstr "字体"
211
 
212
- #: crayon_settings_wp.class.php:304
213
  #@ crayon-syntax-highlighter
214
  msgid "Metrics"
215
  msgstr "排版"
216
 
217
- #: crayon_settings_wp.class.php:305
218
  #@ crayon-syntax-highlighter
219
  msgid "Toolbar"
220
  msgstr "工具栏"
221
 
222
- #: crayon_settings_wp.class.php:306
223
  #@ crayon-syntax-highlighter
224
  msgid "Lines"
225
  msgstr "行"
226
 
227
- #: crayon_settings_wp.class.php:307
228
- #: util/tag-editor/crayon_te_content.php:87
229
  #@ crayon-syntax-highlighter
230
  msgid "Code"
231
  msgstr "代码"
232
 
233
- #: crayon_settings_wp.class.php:308
234
  #@ crayon-syntax-highlighter
235
  msgid "Tags"
236
  msgstr "标签"
237
 
238
- #: crayon_settings_wp.class.php:309
239
  #@ crayon-syntax-highlighter
240
  msgid "Languages"
241
  msgstr "语言"
242
 
243
- #: crayon_settings_wp.class.php:310
244
  #@ crayon-syntax-highlighter
245
  msgid "Files"
246
  msgstr "文件"
247
 
248
- #: crayon_settings_wp.class.php:311
249
  #@ crayon-syntax-highlighter
250
  msgid "Tag Editor"
251
- msgstr "编辑器"
252
 
253
- #: crayon_settings_wp.class.php:312
254
  #@ crayon-syntax-highlighter
255
  msgid "Misc"
256
  msgstr "其它"
257
 
258
- #: crayon_settings_wp.class.php:315
259
  #@ crayon-syntax-highlighter
260
  msgid "Debug"
261
  msgstr "调试"
262
 
263
- #: crayon_settings_wp.class.php:316
264
  #@ crayon-syntax-highlighter
265
  msgid "Errors"
266
  msgstr "错误"
267
 
268
- #: crayon_settings_wp.class.php:317
269
  #@ crayon-syntax-highlighter
270
  msgid "Log"
271
  msgstr "日志"
272
 
273
- #: crayon_settings_wp.class.php:320
274
  #@ crayon-syntax-highlighter
275
  msgid "About"
276
  msgstr "关于"
277
 
278
- #: crayon_settings_wp.class.php:503
279
  #@ crayon-syntax-highlighter
280
  msgid "Crayon Help"
281
  msgstr "帮助"
282
 
283
- #: crayon_settings_wp.class.php:518
284
  #@ crayon-syntax-highlighter
285
  msgid "Height"
286
  msgstr "高"
287
 
288
- #: crayon_settings_wp.class.php:524
289
  #@ crayon-syntax-highlighter
290
  msgid "Width"
291
  msgstr "宽"
292
 
293
- #: crayon_settings_wp.class.php:530
294
  #@ crayon-syntax-highlighter
295
  msgid "Top Margin"
296
  msgstr "顶部外边距"
297
 
298
- #: crayon_settings_wp.class.php:531
299
  #@ crayon-syntax-highlighter
300
  msgid "Bottom Margin"
301
  msgstr "底部外边距"
302
 
303
- #: crayon_settings_wp.class.php:532
304
- #: crayon_settings_wp.class.php:537
305
  #@ crayon-syntax-highlighter
306
  msgid "Left Margin"
307
  msgstr "左外边距"
308
 
309
- #: crayon_settings_wp.class.php:533
310
- #: crayon_settings_wp.class.php:537
311
  #@ crayon-syntax-highlighter
312
  msgid "Right Margin"
313
  msgstr "右外边距"
314
 
315
- #: crayon_settings_wp.class.php:543
316
  #@ crayon-syntax-highlighter
317
  msgid "Horizontal Alignment"
318
  msgstr "对齐方式"
319
 
320
- #: crayon_settings_wp.class.php:546
321
  #@ crayon-syntax-highlighter
322
  msgid "Allow floating elements to surround Crayon"
323
  msgstr "允许插件代码周围使用浮动元素"
324
 
325
- #: crayon_settings_wp.class.php:548
326
  #@ crayon-syntax-highlighter
327
  msgid "Inline Margin"
328
- msgstr "间距"
329
 
330
- #: crayon_settings_wp.class.php:556
331
  #@ crayon-syntax-highlighter
332
  msgid "Display the Toolbar"
333
- msgstr "工具栏显示"
334
 
335
- #: crayon_settings_wp.class.php:559
336
  #@ crayon-syntax-highlighter
337
  msgid "Overlay the toolbar on code rather than push it down when possible"
338
- msgstr "尽量覆盖工具栏而不是挤到下面"
339
 
340
- #: crayon_settings_wp.class.php:560
341
  #@ crayon-syntax-highlighter
342
  msgid "Toggle the toolbar on single click when it is overlayed"
343
- msgstr "当工具栏被挡住时单击显示"
344
 
345
- #: crayon_settings_wp.class.php:561
346
  #@ crayon-syntax-highlighter
347
  msgid "Delay hiding the toolbar on MouseOut"
348
- msgstr "工具栏消失带延迟效果"
349
 
350
- #: crayon_settings_wp.class.php:563
351
  #@ crayon-syntax-highlighter
352
  msgid "Display the title when provided"
353
- msgstr "当有标题则显示"
354
 
355
- #: crayon_settings_wp.class.php:564
356
  #@ crayon-syntax-highlighter
357
  msgid "Display the language"
358
- msgstr "显示语言"
359
 
360
- #: crayon_settings_wp.class.php:571
361
  #@ crayon-syntax-highlighter
362
  msgid "Display striped code lines"
363
  msgstr "条纹显示代码"
364
 
365
- #: crayon_settings_wp.class.php:572
366
  #@ crayon-syntax-highlighter
367
  msgid "Enable line marking for important lines"
368
  msgstr "允许关键行高亮"
369
 
370
- #: crayon_settings_wp.class.php:573
371
  #@ crayon-syntax-highlighter
372
  msgid "Display line numbers by default"
373
- msgstr "默认显示每行编号"
374
 
375
- #: crayon_settings_wp.class.php:574
376
  #@ crayon-syntax-highlighter
377
  msgid "Enable line number toggling"
378
- msgstr "允许显示行编号"
379
 
380
- #: crayon_settings_wp.class.php:575
381
  #@ crayon-syntax-highlighter
382
  msgid "Start line numbers from"
383
- msgstr "编号始于"
384
 
385
- #: crayon_settings_wp.class.php:585
386
  #@ crayon-syntax-highlighter
387
  msgid "When no language is provided, use the fallback"
388
  msgstr "当没指定语言,则默认语言为"
389
 
390
- #: crayon_settings_wp.class.php:591
391
  #, php-format
392
  #@ crayon-syntax-highlighter
393
  msgid "%d language has been detected."
@@ -395,325 +395,327 @@ msgid_plural "%d languages have been detected."
395
  msgstr[0] "已支持 %d 种语言。"
396
  msgstr[1] "已支持 %d 种语言。"
397
 
398
- #: crayon_settings_wp.class.php:592
399
  #@ crayon-syntax-highlighter
400
  msgid "Parsing was successful"
401
  msgstr "加载完成"
402
 
403
- #: crayon_settings_wp.class.php:592
404
  #@ crayon-syntax-highlighter
405
  msgid "Parsing was unsuccessful"
406
  msgstr "加载失败"
407
 
408
- #: crayon_settings_wp.class.php:598
409
  #, php-format
410
  #@ crayon-syntax-highlighter
411
  msgid "The selected language with id %s could not be loaded"
412
  msgstr "ID为 %s 的语言加载失败"
413
 
414
- #: crayon_settings_wp.class.php:602
415
  #@ crayon-syntax-highlighter
416
  msgid "Show Languages"
417
  msgstr "显示全部语言"
418
 
419
- #: crayon_settings_wp.class.php:621
 
420
  #@ crayon-syntax-highlighter
421
  msgid "Loading..."
422
  msgstr "载入中..."
423
 
424
- #: crayon_settings_wp.class.php:621
425
- #: crayon_settings_wp.class.php:804
426
- #: util/theme-editor/editor.php:14
427
  #@ crayon-syntax-highlighter
428
  msgid "Theme Editor"
429
  msgstr "主题编辑器"
430
 
431
- #: crayon_settings_wp.class.php:626
432
  #, php-format
433
  #@ crayon-syntax-highlighter
434
  msgid "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 are marked."
435
- msgstr "改变 %1$s默认语言%2$s 可以在这里看到效果,5-7 为重点代码。"
436
 
437
- #: crayon_settings_wp.class.php:630
438
  #@ crayon-syntax-highlighter
439
  msgid "Enable Live Preview"
440
  msgstr "允许即时预览"
441
 
442
- #: crayon_settings_wp.class.php:632
443
  #@ crayon-syntax-highlighter
444
  msgid "Enqueue themes in the header (more efficient)."
445
- msgstr "在头部就加载主题(高效)"
446
-
447
- #: crayon_settings_wp.class.php:632
448
- #: crayon_settings_wp.class.php:658
449
- #: crayon_settings_wp.class.php:683
450
- #: crayon_settings_wp.class.php:690
451
- #: crayon_settings_wp.class.php:691
452
- #: crayon_settings_wp.class.php:692
453
- #: crayon_settings_wp.class.php:693
454
- #: crayon_settings_wp.class.php:694
455
- #: crayon_settings_wp.class.php:695
456
- #: crayon_settings_wp.class.php:709
457
- #: crayon_settings_wp.class.php:716
458
- #: crayon_settings_wp.class.php:717
 
 
459
  #@ crayon-syntax-highlighter
460
  msgid "?"
461
  msgstr "?"
462
 
463
- #: crayon_settings_wp.class.php:635
464
  #, php-format
465
  #@ crayon-syntax-highlighter
466
  msgid "The selected theme with id %s could not be loaded"
467
  msgstr "ID为 %s 的主题加载失败"
468
 
469
- #: crayon_settings_wp.class.php:647
470
  #@ crayon-syntax-highlighter
471
  msgid "Custom Font Size"
472
  msgstr "字体大小"
473
 
474
- #: crayon_settings_wp.class.php:652
475
  #, php-format
476
  #@ crayon-syntax-highlighter
477
  msgid "The selected font with id %s could not be loaded"
478
  msgstr "ID为 %s 的字体加载失败"
479
 
480
- #: crayon_settings_wp.class.php:658
481
  #@ crayon-syntax-highlighter
482
  msgid "Enqueue fonts in the header (more efficient)."
483
- msgstr "在头部就加载字体(高效)"
484
 
485
- #: crayon_settings_wp.class.php:663
486
  #@ crayon-syntax-highlighter
487
  msgid "Enable plain code view and display"
488
- msgstr "允许纯文本显示代码,显示方式"
489
 
490
- #: crayon_settings_wp.class.php:666
491
  #@ crayon-syntax-highlighter
492
  msgid "Enable plain code toggling"
493
- msgstr "允许纯文本显示代码"
494
 
495
- #: crayon_settings_wp.class.php:667
496
  #@ crayon-syntax-highlighter
497
  msgid "Show the plain code by default"
498
  msgstr "默认纯文本显示代码"
499
 
500
- #: crayon_settings_wp.class.php:668
501
  #@ crayon-syntax-highlighter
502
  msgid "Enable code copy/paste"
503
  msgstr "允许代码复制/粘贴"
504
 
505
- #: crayon_settings_wp.class.php:670
506
  #@ crayon-syntax-highlighter
507
  msgid "Enable opening code in a window"
508
  msgstr "允许新窗口显示代码"
509
 
510
- #: crayon_settings_wp.class.php:671
511
  #@ crayon-syntax-highlighter
512
  msgid "Always display scrollbars"
513
  msgstr "总是显示滚动条"
514
 
515
- #: crayon_settings_wp.class.php:672
516
  #@ crayon-syntax-highlighter
517
  msgid "Tab size in spaces"
518
- msgstr "Tab等于几个空格"
519
 
520
- #: crayon_settings_wp.class.php:677
521
  #@ crayon-syntax-highlighter
522
  msgid "Decode HTML entities in code"
523
- msgstr "在代码中进行HTML解码"
524
 
525
- #: crayon_settings_wp.class.php:679
526
  #@ crayon-syntax-highlighter
527
  msgid "Decode HTML entities in attributes"
528
- msgstr "在属性中进行HTML解码"
529
 
530
- #: crayon_settings_wp.class.php:681
531
  #@ crayon-syntax-highlighter
532
  msgid "Remove whitespace surrounding the shortcode content"
533
  msgstr "删除短代码周围的空白"
534
 
535
- #: crayon_settings_wp.class.php:683
536
  #@ crayon-syntax-highlighter
537
  msgid "Allow Mixed Language Highlighting with delimiters and tags."
538
  msgstr "允许多重语言高亮使用分隔符和标签"
539
 
540
- #: crayon_settings_wp.class.php:685
541
  #@ crayon-syntax-highlighter
542
  msgid "Show Mixed Language Icon (+)"
543
  msgstr "显示多重语言图标 (+)"
544
 
545
- #: crayon_settings_wp.class.php:690
546
  #@ crayon-syntax-highlighter
547
  msgid "Capture Mini Tags like [php][/php] as Crayons."
548
  msgstr "使用迷你标签(如[php][/php])"
549
 
550
- #: crayon_settings_wp.class.php:691
551
  #@ crayon-syntax-highlighter
552
  msgid "Capture Inline Tags like {php}{/php} inside sentences."
553
- msgstr "允许在文中使用标签(如{php}{/php}"
554
 
555
- #: crayon_settings_wp.class.php:692
556
  #@ crayon-syntax-highlighter
557
  msgid "Wrap Inline Tags"
558
- msgstr "文中标签自动换行"
559
 
560
- #: crayon_settings_wp.class.php:693
561
  #@ crayon-syntax-highlighter
562
  msgid "Capture `backquotes` as &lt;code&gt;"
563
- msgstr "把 `backquotes` 绑定为 &lt;code&gt;"
564
 
565
- #: crayon_settings_wp.class.php:694
566
  #@ crayon-syntax-highlighter
567
  msgid "Capture &lt;pre&gt; tags as Crayons"
568
  msgstr "指定 &lt;pre&gt; 为插件所有"
569
 
570
- #: crayon_settings_wp.class.php:695
571
  #@ crayon-syntax-highlighter
572
  msgid "Enable [plain][/plain] tag."
573
  msgstr "启用 [plain][/plain] 标签"
574
 
575
- #: crayon_settings_wp.class.php:700
576
  #@ crayon-syntax-highlighter
577
  msgid "When loading local files and a relative path is given for the URL, use the absolute path"
578
- msgstr "当URL为相对路径,使用的绝对路径为"
579
 
580
- #: crayon_settings_wp.class.php:703
581
  #@ crayon-syntax-highlighter
582
  msgid "Followed by your relative URL."
583
  msgstr "置于相对路径之前"
584
 
585
- #: crayon_settings_wp.class.php:707
586
  #, php-format
587
  #@ crayon-syntax-highlighter
588
  msgid "Use %s to separate setting names from values in the &lt;pre&gt; class attribute"
589
  msgstr "&lt;pre&gt; 标签中使用 %s 分割每个属性与属性值。"
590
 
591
- #: crayon_settings_wp.class.php:713
592
  #@ crayon-syntax-highlighter
593
  msgid "Clear the cache used to store remote code requests"
594
- msgstr "清空用于存储远程代码的缓存频率"
595
 
596
- #: crayon_settings_wp.class.php:715
597
  #@ crayon-syntax-highlighter
598
  msgid "Clear Now"
599
- msgstr "立刻清空"
600
 
601
- #: crayon_settings_wp.class.php:716
602
  #@ crayon-syntax-highlighter
603
  msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
604
- msgstr "按需加载插件的CSS与JavaScript"
605
 
606
- #: crayon_settings_wp.class.php:717
607
  #@ crayon-syntax-highlighter
608
  msgid "Disable enqueuing for page templates that may contain The Loop."
609
- msgstr "当可能造成循环时禁用加载页面模板"
610
 
611
- #: crayon_settings_wp.class.php:718
612
  #@ crayon-syntax-highlighter
613
  msgid "Allow Crayons inside comments"
614
  msgstr "允许在评论中使用"
615
 
616
- #: crayon_settings_wp.class.php:720
617
  #@ crayon-syntax-highlighter
618
  msgid "Load Crayons only from the main Wordpress query"
619
- msgstr "仅在Wordpress主请求中加载插件"
620
 
621
- #: crayon_settings_wp.class.php:721
622
  #@ crayon-syntax-highlighter
623
  msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
624
  msgstr "使用触屏设备时禁止鼠标行为(如鼠标经过)"
625
 
626
- #: crayon_settings_wp.class.php:722
627
  #@ crayon-syntax-highlighter
628
  msgid "Disable animations"
629
  msgstr "禁止动画效果"
630
 
631
- #: crayon_settings_wp.class.php:723
632
  #@ crayon-syntax-highlighter
633
  msgid "Disable runtime stats"
634
  msgstr "禁止运行时间统计"
635
 
636
- #: crayon_settings_wp.class.php:729
637
  #@ crayon-syntax-highlighter
638
  msgid "Log errors for individual Crayons"
639
  msgstr "使用独立的错误日志"
640
 
641
- #: crayon_settings_wp.class.php:730
642
  #@ crayon-syntax-highlighter
643
  msgid "Log system-wide errors"
644
  msgstr "启用系统错误日志"
645
 
646
- #: crayon_settings_wp.class.php:731
647
  #@ crayon-syntax-highlighter
648
  msgid "Display custom message for errors"
649
  msgstr "自定义错误提示"
650
 
651
- #: crayon_settings_wp.class.php:743
652
  #@ crayon-syntax-highlighter
653
  msgid "Show Log"
654
  msgstr "显示日志"
655
 
656
- #: crayon_settings_wp.class.php:743
657
  #@ crayon-syntax-highlighter
658
  msgid "Hide Log"
659
  msgstr "隐藏日志"
660
 
661
- #: crayon_settings_wp.class.php:745
662
  #@ crayon-syntax-highlighter
663
  msgid "Clear Log"
664
- msgstr "清空日志"
665
 
666
- #: crayon_settings_wp.class.php:746
667
  #@ crayon-syntax-highlighter
668
  msgid "Email Admin"
669
  msgstr "发邮件给管理员"
670
 
671
- #: crayon_settings_wp.class.php:748
672
  #@ crayon-syntax-highlighter
673
  msgid "Email Developer"
674
  msgstr "发邮件给开发者"
675
 
676
- #: crayon_settings_wp.class.php:750
677
  #@ crayon-syntax-highlighter
678
  msgid "The log is currently empty."
679
  msgstr "日志为空,"
680
 
681
- #: crayon_settings_wp.class.php:752
682
  #@ crayon-syntax-highlighter
683
  msgid "The log file exists and is writable."
684
  msgstr "日志文件存在并可写。"
685
 
686
- #: crayon_settings_wp.class.php:752
687
  #@ crayon-syntax-highlighter
688
  msgid "The log file exists and is not writable."
689
  msgstr "日志文件存在但不可写。"
690
 
691
- #: crayon_settings_wp.class.php:754
692
  #@ crayon-syntax-highlighter
693
  msgid "The log file does not exist and is not writable."
694
- msgstr "日志文件不存且不可写。"
695
 
696
- #: crayon_settings_wp.class.php:764
697
  #@ crayon-syntax-highlighter
698
  msgid "Version"
699
  msgstr "版本"
700
 
701
- #: crayon_settings_wp.class.php:766
702
  #@ crayon-syntax-highlighter
703
  msgid "Developer"
704
  msgstr "开发者"
705
 
706
- #: crayon_settings_wp.class.php:767
707
  #@ crayon-syntax-highlighter
708
  msgid "Translators"
709
  msgstr "翻译者"
710
 
711
- #: crayon_settings_wp.class.php:790
712
  #@ crayon-syntax-highlighter
713
  msgid "The result of innumerable hours of hard work over many months. It's an ongoing project, keep me motivated!"
714
  msgstr "本插件是数月辛勤劳动的结果,为了让它不断的完善,如果你喜欢它,请告诉我!"
715
 
716
- #: crayon_settings_wp.class.php:806
717
  #@ crayon-syntax-highlighter
718
  msgid "Donate"
719
  msgstr "捐助"
@@ -734,7 +736,7 @@ msgstr ""
734
  #: crayon_wp.class.php:0
735
  #@ crayon-syntax-highlighter
736
  msgid "Supports multiple languages, themes, highlighting from a URL, local file or post text."
737
- msgstr ""
738
 
739
  #. translators: plugin header field 'Author'
740
  #: crayon_wp.class.php:0
@@ -748,121 +750,218 @@ msgstr ""
748
  msgid "http://ak.net84.net/"
749
  msgstr ""
750
 
751
- #: util/tag-editor/crayon_tag_editor_wp.class.php:57
752
  #@ crayon-syntax-highlighter
753
  msgid "Add Crayon Code"
754
  msgstr "插入代码高亮"
755
 
756
- #: util/tag-editor/crayon_tag_editor_wp.class.php:58
757
  #@ crayon-syntax-highlighter
758
  msgid "Edit Crayon Code"
759
  msgstr "编辑代码高亮"
760
 
761
- #: util/tag-editor/crayon_tag_editor_wp.class.php:59
762
  #@ crayon-syntax-highlighter
763
  msgid "Add"
764
- msgstr "确认插入"
765
 
766
- #: util/tag-editor/crayon_tag_editor_wp.class.php:60
767
  #@ crayon-syntax-highlighter
768
  msgid "Save"
769
  msgstr "保存"
770
 
771
- #: util/tag-editor/crayon_te_content.php:65
772
  #@ crayon-syntax-highlighter
773
  msgid "Title"
774
  msgstr "标题"
775
 
776
- #: util/tag-editor/crayon_te_content.php:67
777
  #@ crayon-syntax-highlighter
778
  msgid "A short description"
779
- msgstr "简短的描述"
780
 
781
- #: util/tag-editor/crayon_te_content.php:70
782
  #@ crayon-syntax-highlighter
783
  msgid "Inline"
784
  msgstr "行内"
785
 
786
- #: util/tag-editor/crayon_te_content.php:75
787
  #@ crayon-syntax-highlighter
788
  msgid "Language"
789
  msgstr "语言"
790
 
791
- #: util/tag-editor/crayon_te_content.php:78
792
  #@ crayon-syntax-highlighter
793
  msgid "Marked Lines"
794
- msgstr "重点代码"
795
 
796
- #: util/tag-editor/crayon_te_content.php:79
797
  #@ crayon-syntax-highlighter
798
  msgid "(e.g. 1,2,3-5)"
799
  msgstr "(如 1,2,3-5)"
800
 
801
- #: util/tag-editor/crayon_te_content.php:82
802
- #@ crayon-syntax-highlighter
803
- msgid "Disable Highlighting"
804
- msgstr "禁止高亮"
805
-
806
- #: util/tag-editor/crayon_te_content.php:87
807
  #@ crayon-syntax-highlighter
808
  msgid "Clear"
809
- msgstr "清空"
810
 
811
- #: util/tag-editor/crayon_te_content.php:88
812
  #@ crayon-syntax-highlighter
813
  msgid "Paste your code here, or type it in manually."
814
  msgstr "粘贴代码到这里,或者手工输入。"
815
 
816
- #: util/tag-editor/crayon_te_content.php:91
817
  #@ crayon-syntax-highlighter
818
  msgid "URL"
819
  msgstr "URL"
820
 
821
- #: util/tag-editor/crayon_te_content.php:93
822
  #@ crayon-syntax-highlighter
823
  msgid "Relative local path or absolute URL"
824
- msgstr "相对路径或绝对路径URL"
825
 
826
- #: util/tag-editor/crayon_te_content.php:96
827
  #@ crayon-syntax-highlighter
828
  msgid "If the URL fails to load, the code above will be shown instead. If no code exists, an error is shown."
829
- msgstr "如果URL不能加载,将会使用下面的代码代替显示,如果也没有代码,则显示错误提示。"
830
 
831
- #: util/tag-editor/crayon_te_content.php:98
832
  #, php-format
833
  #@ crayon-syntax-highlighter
834
  msgid "If a relative local path is given it will be appended to %s - which is defined in %sCrayon &gt; Settings &gt; Files%s."
835
  msgstr "如果是相对路径,则前面的路径将是 %s (在 %sCrayon &gt; Settings &gt; Files%s 里面设置)"
836
 
837
- #: util/tag-editor/crayon_te_content.php:117
838
  #@ crayon-syntax-highlighter
839
  msgid "Change the following settings to override their global values."
840
- msgstr "以下设置优先于默认设置,"
841
 
842
- #: util/tag-editor/crayon_te_content.php:119
843
  #@ crayon-syntax-highlighter
844
  msgid "Only changes (shown yellow) are applied."
845
- msgstr "只有背景色为黄色的选项会优先于默认设置,"
846
 
847
- #: util/tag-editor/crayon_te_content.php:121
848
  #, php-format
849
  #@ crayon-syntax-highlighter
850
  msgid "Future changes to the global settings under %sCrayon &gt; Settings%s won't affect overridden settings."
851
- msgstr "其它设置会沿用默认设置(%sCrayon &gt; Settings%s)。"
852
 
853
- #: util/theme-editor/editor.php:16
854
  #@ crayon-syntax-highlighter
855
  msgid "Back To Settings"
856
  msgstr "返回设置"
857
 
858
- #: crayon_settings_wp.class.php:719
859
  #@ crayon-syntax-highlighter
860
  msgid "Remove Crayons from excerpts"
861
  msgstr "文章摘要不启用代码高亮"
862
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  #. translators: plugin header field 'Version'
864
  #: crayon_wp.class.php:0
865
  #@ crayon-syntax-highlighter
866
- msgid "_1.9.4_beta1"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
  msgstr ""
868
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: Crayon Syntax Highlighter v1.14\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2012-12-01 08:03:47+0000\n"
7
  "Last-Translator: admin <admin@neverno.me>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
+ #: crayon_formatter.class.php:275
23
  #@ crayon-syntax-highlighter
24
  msgid "Toggle Plain Code"
25
  msgstr "纯文本显示代码"
26
 
27
+ #: crayon_formatter.class.php:278
28
  #, php-format
29
  #@ crayon-syntax-highlighter
30
  msgid "Press %s to Copy, %s to Paste"
31
  msgstr "使用 %s 复制,使用 %s 粘贴。"
32
 
33
+ #: crayon_formatter.class.php:278
34
  #@ crayon-syntax-highlighter
35
  msgid "Copy Plain Code"
36
  msgstr "复制代码"
37
 
38
+ #: crayon_formatter.class.php:280
39
  #@ crayon-syntax-highlighter
40
  msgid "Open Code In New Window"
41
  msgstr "在新窗口中显示代码"
42
 
43
+ #: crayon_formatter.class.php:282
44
  #@ crayon-syntax-highlighter
45
  msgid "Toggle Line Numbers"
46
+ msgstr "切换是否显示行编号"
47
 
48
+ #: crayon_formatter.class.php:285
49
  #@ crayon-syntax-highlighter
50
  msgid "Contains Mixed Languages"
51
  msgstr "含多种语言"
52
 
53
+ #: crayon_settings.class.php:143
54
  #@ crayon-syntax-highlighter
55
  msgid "Hourly"
56
  msgstr "每小时"
57
 
58
+ #: crayon_settings.class.php:143
59
  #@ crayon-syntax-highlighter
60
  msgid "Daily"
61
  msgstr "每天"
62
 
63
+ #: crayon_settings.class.php:144
64
  #@ crayon-syntax-highlighter
65
  msgid "Weekly"
66
  msgstr "每周"
67
 
68
+ #: crayon_settings.class.php:144
69
  #@ crayon-syntax-highlighter
70
  msgid "Monthly"
71
  msgstr "每月"
72
 
73
+ #: crayon_settings.class.php:145
74
  #@ crayon-syntax-highlighter
75
  msgid "Immediately"
76
  msgstr "立刻"
77
 
78
+ #: crayon_settings.class.php:155
79
+ #: crayon_settings.class.php:159
80
  #@ crayon-syntax-highlighter
81
  msgid "Max"
82
  msgstr "最大"
83
 
84
+ #: crayon_settings.class.php:155
85
+ #: crayon_settings.class.php:159
86
  #@ crayon-syntax-highlighter
87
  msgid "Min"
88
  msgstr "最小"
89
 
90
+ #: crayon_settings.class.php:155
91
+ #: crayon_settings.class.php:159
92
  #@ crayon-syntax-highlighter
93
  msgid "Static"
94
  msgstr "指定"
95
 
96
+ #: crayon_settings.class.php:157
97
+ #: crayon_settings.class.php:161
98
+ #: crayon_settings_wp.class.php:582
99
+ #: crayon_settings_wp.class.php:591
100
+ #: crayon_settings_wp.class.php:811
101
  #@ crayon-syntax-highlighter
102
  msgid "Pixels"
103
  msgstr "px"
104
 
105
+ #: crayon_settings.class.php:157
106
+ #: crayon_settings.class.php:161
107
  #@ crayon-syntax-highlighter
108
  msgid "Percent"
109
  msgstr "%"
110
 
111
+ #: crayon_settings.class.php:170
112
  #@ crayon-syntax-highlighter
113
  msgid "None"
114
  msgstr "从不"
115
 
116
+ #: crayon_settings.class.php:170
117
  #@ crayon-syntax-highlighter
118
  msgid "Left"
119
  msgstr "左对齐"
120
 
121
+ #: crayon_settings.class.php:170
122
  #@ crayon-syntax-highlighter
123
  msgid "Center"
124
  msgstr "居中"
125
 
126
+ #: crayon_settings.class.php:170
127
  #@ crayon-syntax-highlighter
128
  msgid "Right"
129
  msgstr "右对齐"
130
 
131
+ #: crayon_settings.class.php:172
132
+ #: crayon_settings.class.php:196
133
  #@ crayon-syntax-highlighter
134
  msgid "On MouseOver"
135
  msgstr "鼠标经过"
136
 
137
+ #: crayon_settings.class.php:172
138
+ #: crayon_settings.class.php:178
139
  #@ crayon-syntax-highlighter
140
  msgid "Always"
141
  msgstr "始终显示"
142
 
143
+ #: crayon_settings.class.php:172
144
+ #: crayon_settings.class.php:178
145
  #@ crayon-syntax-highlighter
146
  msgid "Never"
147
  msgstr "从不显示"
148
 
149
+ #: crayon_settings.class.php:178
150
  #@ crayon-syntax-highlighter
151
  msgid "When Found"
152
  msgstr "当发现时"
153
 
154
+ #: crayon_settings.class.php:196
155
  #@ crayon-syntax-highlighter
156
  msgid "On Double Click"
157
  msgstr "双击"
158
 
159
+ #: crayon_settings.class.php:196
160
  #@ crayon-syntax-highlighter
161
  msgid "On Single Click"
162
  msgstr "单击"
163
 
164
+ #: crayon_settings.class.php:196
165
  #@ crayon-syntax-highlighter
166
  msgid "Disable Mouse Events"
167
  msgstr "禁止鼠标行为"
168
 
169
+ #: crayon_settings.class.php:203
170
  #@ crayon-syntax-highlighter
171
  msgid "An error has occurred. Please try again later."
172
  msgstr "发生错误,请稍后重试。"
173
 
174
+ #: crayon_settings_wp.class.php:45
175
+ #: crayon_settings_wp.class.php:130
176
+ #: crayon_settings_wp.class.php:983
177
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:242
178
  #@ crayon-syntax-highlighter
179
  msgid "Settings"
180
  msgstr "设置"
181
 
182
+ #: crayon_settings_wp.class.php:108
183
  #@ crayon-syntax-highlighter
184
  msgid "You do not have sufficient permissions to access this page."
185
  msgstr "无权限访问此页面"
186
 
187
+ #: crayon_settings_wp.class.php:145
188
  #@ crayon-syntax-highlighter
189
  msgid "Save Changes"
190
+ msgstr "保存设置"
191
 
192
+ #: crayon_settings_wp.class.php:152
193
  #@ crayon-syntax-highlighter
194
  msgid "Reset Settings"
195
  msgstr "初始化设置"
196
 
197
+ #: crayon_settings_wp.class.php:328
198
  #@ crayon-syntax-highlighter
199
  msgid "General"
200
  msgstr "一般"
201
 
202
+ #: crayon_settings_wp.class.php:329
203
  #@ crayon-syntax-highlighter
204
  msgid "Theme"
205
  msgstr "主题"
206
 
207
+ #: crayon_settings_wp.class.php:330
208
  #@ crayon-syntax-highlighter
209
  msgid "Font"
210
  msgstr "字体"
211
 
212
+ #: crayon_settings_wp.class.php:331
213
  #@ crayon-syntax-highlighter
214
  msgid "Metrics"
215
  msgstr "排版"
216
 
217
+ #: crayon_settings_wp.class.php:332
218
  #@ crayon-syntax-highlighter
219
  msgid "Toolbar"
220
  msgstr "工具栏"
221
 
222
+ #: crayon_settings_wp.class.php:333
223
  #@ crayon-syntax-highlighter
224
  msgid "Lines"
225
  msgstr "行"
226
 
227
+ #: crayon_settings_wp.class.php:334
228
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:205
229
  #@ crayon-syntax-highlighter
230
  msgid "Code"
231
  msgstr "代码"
232
 
233
+ #: crayon_settings_wp.class.php:335
234
  #@ crayon-syntax-highlighter
235
  msgid "Tags"
236
  msgstr "标签"
237
 
238
+ #: crayon_settings_wp.class.php:336
239
  #@ crayon-syntax-highlighter
240
  msgid "Languages"
241
  msgstr "语言"
242
 
243
+ #: crayon_settings_wp.class.php:337
244
  #@ crayon-syntax-highlighter
245
  msgid "Files"
246
  msgstr "文件"
247
 
248
+ #: crayon_settings_wp.class.php:339
249
  #@ crayon-syntax-highlighter
250
  msgid "Tag Editor"
251
+ msgstr "标签编辑器"
252
 
253
+ #: crayon_settings_wp.class.php:340
254
  #@ crayon-syntax-highlighter
255
  msgid "Misc"
256
  msgstr "其它"
257
 
258
+ #: crayon_settings_wp.class.php:343
259
  #@ crayon-syntax-highlighter
260
  msgid "Debug"
261
  msgstr "调试"
262
 
263
+ #: crayon_settings_wp.class.php:344
264
  #@ crayon-syntax-highlighter
265
  msgid "Errors"
266
  msgstr "错误"
267
 
268
+ #: crayon_settings_wp.class.php:345
269
  #@ crayon-syntax-highlighter
270
  msgid "Log"
271
  msgstr "日志"
272
 
273
+ #: crayon_settings_wp.class.php:348
274
  #@ crayon-syntax-highlighter
275
  msgid "About"
276
  msgstr "关于"
277
 
278
+ #: crayon_settings_wp.class.php:544
279
  #@ crayon-syntax-highlighter
280
  msgid "Crayon Help"
281
  msgstr "帮助"
282
 
283
+ #: crayon_settings_wp.class.php:559
284
  #@ crayon-syntax-highlighter
285
  msgid "Height"
286
  msgstr "高"
287
 
288
+ #: crayon_settings_wp.class.php:565
289
  #@ crayon-syntax-highlighter
290
  msgid "Width"
291
  msgstr "宽"
292
 
293
+ #: crayon_settings_wp.class.php:571
294
  #@ crayon-syntax-highlighter
295
  msgid "Top Margin"
296
  msgstr "顶部外边距"
297
 
298
+ #: crayon_settings_wp.class.php:572
299
  #@ crayon-syntax-highlighter
300
  msgid "Bottom Margin"
301
  msgstr "底部外边距"
302
 
303
+ #: crayon_settings_wp.class.php:573
304
+ #: crayon_settings_wp.class.php:578
305
  #@ crayon-syntax-highlighter
306
  msgid "Left Margin"
307
  msgstr "左外边距"
308
 
309
+ #: crayon_settings_wp.class.php:574
310
+ #: crayon_settings_wp.class.php:578
311
  #@ crayon-syntax-highlighter
312
  msgid "Right Margin"
313
  msgstr "右外边距"
314
 
315
+ #: crayon_settings_wp.class.php:584
316
  #@ crayon-syntax-highlighter
317
  msgid "Horizontal Alignment"
318
  msgstr "对齐方式"
319
 
320
+ #: crayon_settings_wp.class.php:587
321
  #@ crayon-syntax-highlighter
322
  msgid "Allow floating elements to surround Crayon"
323
  msgstr "允许插件代码周围使用浮动元素"
324
 
325
+ #: crayon_settings_wp.class.php:589
326
  #@ crayon-syntax-highlighter
327
  msgid "Inline Margin"
328
+ msgstr "行内间距"
329
 
330
+ #: crayon_settings_wp.class.php:597
331
  #@ crayon-syntax-highlighter
332
  msgid "Display the Toolbar"
333
+ msgstr "工具栏显示方式:"
334
 
335
+ #: crayon_settings_wp.class.php:600
336
  #@ crayon-syntax-highlighter
337
  msgid "Overlay the toolbar on code rather than push it down when possible"
338
+ msgstr ""
339
 
340
+ #: crayon_settings_wp.class.php:601
341
  #@ crayon-syntax-highlighter
342
  msgid "Toggle the toolbar on single click when it is overlayed"
343
+ msgstr ""
344
 
345
+ #: crayon_settings_wp.class.php:602
346
  #@ crayon-syntax-highlighter
347
  msgid "Delay hiding the toolbar on MouseOut"
348
+ msgstr "工具栏消失附带延迟效果"
349
 
350
+ #: crayon_settings_wp.class.php:604
351
  #@ crayon-syntax-highlighter
352
  msgid "Display the title when provided"
353
+ msgstr "有标题则显示标题"
354
 
355
+ #: crayon_settings_wp.class.php:605
356
  #@ crayon-syntax-highlighter
357
  msgid "Display the language"
358
+ msgstr "显示语言方式:"
359
 
360
+ #: crayon_settings_wp.class.php:612
361
  #@ crayon-syntax-highlighter
362
  msgid "Display striped code lines"
363
  msgstr "条纹显示代码"
364
 
365
+ #: crayon_settings_wp.class.php:613
366
  #@ crayon-syntax-highlighter
367
  msgid "Enable line marking for important lines"
368
  msgstr "允许关键行高亮"
369
 
370
+ #: crayon_settings_wp.class.php:615
371
  #@ crayon-syntax-highlighter
372
  msgid "Display line numbers by default"
373
+ msgstr "默认显示行编号"
374
 
375
+ #: crayon_settings_wp.class.php:616
376
  #@ crayon-syntax-highlighter
377
  msgid "Enable line number toggling"
378
+ msgstr "允许切换显示行编号"
379
 
380
+ #: crayon_settings_wp.class.php:619
381
  #@ crayon-syntax-highlighter
382
  msgid "Start line numbers from"
383
+ msgstr "行编号始于"
384
 
385
+ #: crayon_settings_wp.class.php:629
386
  #@ crayon-syntax-highlighter
387
  msgid "When no language is provided, use the fallback"
388
  msgstr "当没指定语言,则默认语言为"
389
 
390
+ #: crayon_settings_wp.class.php:635
391
  #, php-format
392
  #@ crayon-syntax-highlighter
393
  msgid "%d language has been detected."
395
  msgstr[0] "已支持 %d 种语言。"
396
  msgstr[1] "已支持 %d 种语言。"
397
 
398
+ #: crayon_settings_wp.class.php:636
399
  #@ crayon-syntax-highlighter
400
  msgid "Parsing was successful"
401
  msgstr "加载完成"
402
 
403
+ #: crayon_settings_wp.class.php:636
404
  #@ crayon-syntax-highlighter
405
  msgid "Parsing was unsuccessful"
406
  msgstr "加载失败"
407
 
408
+ #: crayon_settings_wp.class.php:642
409
  #, php-format
410
  #@ crayon-syntax-highlighter
411
  msgid "The selected language with id %s could not be loaded"
412
  msgstr "ID为 %s 的语言加载失败"
413
 
414
+ #: crayon_settings_wp.class.php:645
415
  #@ crayon-syntax-highlighter
416
  msgid "Show Languages"
417
  msgstr "显示全部语言"
418
 
419
+ #: crayon_settings_wp.class.php:782
420
+ #: crayon_settings_wp.class.php:783
421
  #@ crayon-syntax-highlighter
422
  msgid "Loading..."
423
  msgstr "载入中..."
424
 
425
+ #: crayon_settings_wp.class.php:985
426
+ #: util/theme-editor/theme_editor_content.php:27
 
427
  #@ crayon-syntax-highlighter
428
  msgid "Theme Editor"
429
  msgstr "主题编辑器"
430
 
431
+ #: crayon_settings_wp.class.php:788
432
  #, php-format
433
  #@ crayon-syntax-highlighter
434
  msgid "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 are marked."
435
+ msgstr "改变 %1$s默认语言%2$s 可以在这里看到效果,5-7 为关键行。"
436
 
437
+ #: crayon_settings_wp.class.php:792
438
  #@ crayon-syntax-highlighter
439
  msgid "Enable Live Preview"
440
  msgstr "允许即时预览"
441
 
442
+ #: crayon_settings_wp.class.php:794
443
  #@ crayon-syntax-highlighter
444
  msgid "Enqueue themes in the header (more efficient)."
445
+ msgstr "在头部就加载主题(推荐)"
446
+
447
+ #: crayon_settings_wp.class.php:680
448
+ #: crayon_settings_wp.class.php:794
449
+ #: crayon_settings_wp.class.php:820
450
+ #: crayon_settings_wp.class.php:842
451
+ #: crayon_settings_wp.class.php:855
452
+ #: crayon_settings_wp.class.php:856
453
+ #: crayon_settings_wp.class.php:857
454
+ #: crayon_settings_wp.class.php:858
455
+ #: crayon_settings_wp.class.php:859
456
+ #: crayon_settings_wp.class.php:860
457
+ #: crayon_settings_wp.class.php:882
458
+ #: crayon_settings_wp.class.php:885
459
+ #: crayon_settings_wp.class.php:894
460
+ #: crayon_settings_wp.class.php:895
461
  #@ crayon-syntax-highlighter
462
  msgid "?"
463
  msgstr "?"
464
 
465
+ #: crayon_settings_wp.class.php:797
466
  #, php-format
467
  #@ crayon-syntax-highlighter
468
  msgid "The selected theme with id %s could not be loaded"
469
  msgstr "ID为 %s 的主题加载失败"
470
 
471
+ #: crayon_settings_wp.class.php:809
472
  #@ crayon-syntax-highlighter
473
  msgid "Custom Font Size"
474
  msgstr "字体大小"
475
 
476
+ #: crayon_settings_wp.class.php:814
477
  #, php-format
478
  #@ crayon-syntax-highlighter
479
  msgid "The selected font with id %s could not be loaded"
480
  msgstr "ID为 %s 的字体加载失败"
481
 
482
+ #: crayon_settings_wp.class.php:820
483
  #@ crayon-syntax-highlighter
484
  msgid "Enqueue fonts in the header (more efficient)."
485
+ msgstr "在头部就加载字体(推荐)"
486
 
487
+ #: crayon_settings_wp.class.php:825
488
  #@ crayon-syntax-highlighter
489
  msgid "Enable plain code view and display"
490
+ msgstr "允许纯文本显示代码且显示方式为"
491
 
492
+ #: crayon_settings_wp.class.php:828
493
  #@ crayon-syntax-highlighter
494
  msgid "Enable plain code toggling"
495
+ msgstr "允许切换纯文本显示代码"
496
 
497
+ #: crayon_settings_wp.class.php:829
498
  #@ crayon-syntax-highlighter
499
  msgid "Show the plain code by default"
500
  msgstr "默认纯文本显示代码"
501
 
502
+ #: crayon_settings_wp.class.php:830
503
  #@ crayon-syntax-highlighter
504
  msgid "Enable code copy/paste"
505
  msgstr "允许代码复制/粘贴"
506
 
507
+ #: crayon_settings_wp.class.php:832
508
  #@ crayon-syntax-highlighter
509
  msgid "Enable opening code in a window"
510
  msgstr "允许新窗口显示代码"
511
 
512
+ #: crayon_settings_wp.class.php:833
513
  #@ crayon-syntax-highlighter
514
  msgid "Always display scrollbars"
515
  msgstr "总是显示滚动条"
516
 
517
+ #: crayon_settings_wp.class.php:846
518
  #@ crayon-syntax-highlighter
519
  msgid "Tab size in spaces"
520
+ msgstr "Tab 等于几个空格"
521
 
522
+ #: crayon_settings_wp.class.php:836
523
  #@ crayon-syntax-highlighter
524
  msgid "Decode HTML entities in code"
525
+ msgstr "在代码中进行 HTML 解码"
526
 
527
+ #: crayon_settings_wp.class.php:838
528
  #@ crayon-syntax-highlighter
529
  msgid "Decode HTML entities in attributes"
530
+ msgstr "在属性中进行 HTML 解码"
531
 
532
+ #: crayon_settings_wp.class.php:840
533
  #@ crayon-syntax-highlighter
534
  msgid "Remove whitespace surrounding the shortcode content"
535
  msgstr "删除短代码周围的空白"
536
 
537
+ #: crayon_settings_wp.class.php:842
538
  #@ crayon-syntax-highlighter
539
  msgid "Allow Mixed Language Highlighting with delimiters and tags."
540
  msgstr "允许多重语言高亮使用分隔符和标签"
541
 
542
+ #: crayon_settings_wp.class.php:844
543
  #@ crayon-syntax-highlighter
544
  msgid "Show Mixed Language Icon (+)"
545
  msgstr "显示多重语言图标 (+)"
546
 
547
+ #: crayon_settings_wp.class.php:855
548
  #@ crayon-syntax-highlighter
549
  msgid "Capture Mini Tags like [php][/php] as Crayons."
550
  msgstr "使用迷你标签(如[php][/php])"
551
 
552
+ #: crayon_settings_wp.class.php:856
553
  #@ crayon-syntax-highlighter
554
  msgid "Capture Inline Tags like {php}{/php} inside sentences."
555
+ msgstr "捕获如{php}{/php}形式的行内标签"
556
 
557
+ #: crayon_settings_wp.class.php:857
558
  #@ crayon-syntax-highlighter
559
  msgid "Wrap Inline Tags"
560
+ msgstr "行内标签自动换行"
561
 
562
+ #: crayon_settings_wp.class.php:858
563
  #@ crayon-syntax-highlighter
564
  msgid "Capture `backquotes` as &lt;code&gt;"
565
+ msgstr "把 `反引号` 绑定为 &lt;code&gt;"
566
 
567
+ #: crayon_settings_wp.class.php:859
568
  #@ crayon-syntax-highlighter
569
  msgid "Capture &lt;pre&gt; tags as Crayons"
570
  msgstr "指定 &lt;pre&gt; 为插件所有"
571
 
572
+ #: crayon_settings_wp.class.php:860
573
  #@ crayon-syntax-highlighter
574
  msgid "Enable [plain][/plain] tag."
575
  msgstr "启用 [plain][/plain] 标签"
576
 
577
+ #: crayon_settings_wp.class.php:865
578
  #@ crayon-syntax-highlighter
579
  msgid "When loading local files and a relative path is given for the URL, use the absolute path"
580
+ msgstr "当 URL 为相对路径,使用的绝对路径为"
581
 
582
+ #: crayon_settings_wp.class.php:868
583
  #@ crayon-syntax-highlighter
584
  msgid "Followed by your relative URL."
585
  msgstr "置于相对路径之前"
586
 
587
+ #: crayon_settings_wp.class.php:883
588
  #, php-format
589
  #@ crayon-syntax-highlighter
590
  msgid "Use %s to separate setting names from values in the &lt;pre&gt; class attribute"
591
  msgstr "&lt;pre&gt; 标签中使用 %s 分割每个属性与属性值。"
592
 
593
+ #: crayon_settings_wp.class.php:891
594
  #@ crayon-syntax-highlighter
595
  msgid "Clear the cache used to store remote code requests"
596
+ msgstr "清理用于存储远程代码的缓存频率"
597
 
598
+ #: crayon_settings_wp.class.php:893
599
  #@ crayon-syntax-highlighter
600
  msgid "Clear Now"
601
+ msgstr "立刻清理"
602
 
603
+ #: crayon_settings_wp.class.php:894
604
  #@ crayon-syntax-highlighter
605
  msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
606
+ msgstr "按需加载插件的 CSS JavaScript"
607
 
608
+ #: crayon_settings_wp.class.php:895
609
  #@ crayon-syntax-highlighter
610
  msgid "Disable enqueuing for page templates that may contain The Loop."
611
+ msgstr ""
612
 
613
+ #: crayon_settings_wp.class.php:896
614
  #@ crayon-syntax-highlighter
615
  msgid "Allow Crayons inside comments"
616
  msgstr "允许在评论中使用"
617
 
618
+ #: crayon_settings_wp.class.php:898
619
  #@ crayon-syntax-highlighter
620
  msgid "Load Crayons only from the main Wordpress query"
621
+ msgstr ""
622
 
623
+ #: crayon_settings_wp.class.php:899
624
  #@ crayon-syntax-highlighter
625
  msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
626
  msgstr "使用触屏设备时禁止鼠标行为(如鼠标经过)"
627
 
628
+ #: crayon_settings_wp.class.php:900
629
  #@ crayon-syntax-highlighter
630
  msgid "Disable animations"
631
  msgstr "禁止动画效果"
632
 
633
+ #: crayon_settings_wp.class.php:901
634
  #@ crayon-syntax-highlighter
635
  msgid "Disable runtime stats"
636
  msgstr "禁止运行时间统计"
637
 
638
+ #: crayon_settings_wp.class.php:907
639
  #@ crayon-syntax-highlighter
640
  msgid "Log errors for individual Crayons"
641
  msgstr "使用独立的错误日志"
642
 
643
+ #: crayon_settings_wp.class.php:908
644
  #@ crayon-syntax-highlighter
645
  msgid "Log system-wide errors"
646
  msgstr "启用系统错误日志"
647
 
648
+ #: crayon_settings_wp.class.php:909
649
  #@ crayon-syntax-highlighter
650
  msgid "Display custom message for errors"
651
  msgstr "自定义错误提示"
652
 
653
+ #: crayon_settings_wp.class.php:921
654
  #@ crayon-syntax-highlighter
655
  msgid "Show Log"
656
  msgstr "显示日志"
657
 
658
+ #: crayon_settings_wp.class.php:921
659
  #@ crayon-syntax-highlighter
660
  msgid "Hide Log"
661
  msgstr "隐藏日志"
662
 
663
+ #: crayon_settings_wp.class.php:923
664
  #@ crayon-syntax-highlighter
665
  msgid "Clear Log"
666
+ msgstr "清理日志"
667
 
668
+ #: crayon_settings_wp.class.php:924
669
  #@ crayon-syntax-highlighter
670
  msgid "Email Admin"
671
  msgstr "发邮件给管理员"
672
 
673
+ #: crayon_settings_wp.class.php:926
674
  #@ crayon-syntax-highlighter
675
  msgid "Email Developer"
676
  msgstr "发邮件给开发者"
677
 
678
+ #: crayon_settings_wp.class.php:928
679
  #@ crayon-syntax-highlighter
680
  msgid "The log is currently empty."
681
  msgstr "日志为空,"
682
 
683
+ #: crayon_settings_wp.class.php:930
684
  #@ crayon-syntax-highlighter
685
  msgid "The log file exists and is writable."
686
  msgstr "日志文件存在并可写。"
687
 
688
+ #: crayon_settings_wp.class.php:930
689
  #@ crayon-syntax-highlighter
690
  msgid "The log file exists and is not writable."
691
  msgstr "日志文件存在但不可写。"
692
 
693
+ #: crayon_settings_wp.class.php:932
694
  #@ crayon-syntax-highlighter
695
  msgid "The log file does not exist and is not writable."
696
+ msgstr "日志文件不存在且不可写。"
697
 
698
+ #: crayon_settings_wp.class.php:942
699
  #@ crayon-syntax-highlighter
700
  msgid "Version"
701
  msgstr "版本"
702
 
703
+ #: crayon_settings_wp.class.php:944
704
  #@ crayon-syntax-highlighter
705
  msgid "Developer"
706
  msgstr "开发者"
707
 
708
+ #: crayon_settings_wp.class.php:945
709
  #@ crayon-syntax-highlighter
710
  msgid "Translators"
711
  msgstr "翻译者"
712
 
713
+ #: crayon_settings_wp.class.php:971
714
  #@ crayon-syntax-highlighter
715
  msgid "The result of innumerable hours of hard work over many months. It's an ongoing project, keep me motivated!"
716
  msgstr "本插件是数月辛勤劳动的结果,为了让它不断的完善,如果你喜欢它,请告诉我!"
717
 
718
+ #: crayon_settings_wp.class.php:987
719
  #@ crayon-syntax-highlighter
720
  msgid "Donate"
721
  msgstr "捐助"
736
  #: crayon_wp.class.php:0
737
  #@ crayon-syntax-highlighter
738
  msgid "Supports multiple languages, themes, highlighting from a URL, local file or post text."
739
+ msgstr "支持多种和多重语言高亮,丰富的高亮主题;无论是本地还是远端的文件,或文本代码,都能一律高亮!"
740
 
741
  #. translators: plugin header field 'Author'
742
  #: crayon_wp.class.php:0
750
  msgid "http://ak.net84.net/"
751
  msgstr ""
752
 
753
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:64
754
  #@ crayon-syntax-highlighter
755
  msgid "Add Crayon Code"
756
  msgstr "插入代码高亮"
757
 
758
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:65
759
  #@ crayon-syntax-highlighter
760
  msgid "Edit Crayon Code"
761
  msgstr "编辑代码高亮"
762
 
763
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:66
764
  #@ crayon-syntax-highlighter
765
  msgid "Add"
766
+ msgstr "插入"
767
 
768
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:67
769
  #@ crayon-syntax-highlighter
770
  msgid "Save"
771
  msgstr "保存"
772
 
773
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:183
774
  #@ crayon-syntax-highlighter
775
  msgid "Title"
776
  msgstr "标题"
777
 
778
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:185
779
  #@ crayon-syntax-highlighter
780
  msgid "A short description"
781
+ msgstr "一段简短的描述"
782
 
783
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:187
784
  #@ crayon-syntax-highlighter
785
  msgid "Inline"
786
  msgstr "行内"
787
 
788
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:194
789
  #@ crayon-syntax-highlighter
790
  msgid "Language"
791
  msgstr "语言"
792
 
793
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:199
794
  #@ crayon-syntax-highlighter
795
  msgid "Marked Lines"
796
+ msgstr "关键行"
797
 
798
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:200
799
  #@ crayon-syntax-highlighter
800
  msgid "(e.g. 1,2,3-5)"
801
  msgstr "(如 1,2,3-5)"
802
 
803
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:207
 
 
 
 
 
804
  #@ crayon-syntax-highlighter
805
  msgid "Clear"
806
+ msgstr "清理"
807
 
808
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:211
809
  #@ crayon-syntax-highlighter
810
  msgid "Paste your code here, or type it in manually."
811
  msgstr "粘贴代码到这里,或者手工输入。"
812
 
813
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:215
814
  #@ crayon-syntax-highlighter
815
  msgid "URL"
816
  msgstr "URL"
817
 
818
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:217
819
  #@ crayon-syntax-highlighter
820
  msgid "Relative local path or absolute URL"
821
+ msgstr "相对路径或绝对路径 URL"
822
 
823
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:220
824
  #@ crayon-syntax-highlighter
825
  msgid "If the URL fails to load, the code above will be shown instead. If no code exists, an error is shown."
826
+ msgstr "如果 URL 不能加载,将会使用下面的代码代替显示,如果也没有代码,则显示错误提示。"
827
 
828
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:222
829
  #, php-format
830
  #@ crayon-syntax-highlighter
831
  msgid "If a relative local path is given it will be appended to %s - which is defined in %sCrayon &gt; Settings &gt; Files%s."
832
  msgstr "如果是相对路径,则前面的路径将是 %s (在 %sCrayon &gt; Settings &gt; Files%s 里面设置)"
833
 
834
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:247
835
  #@ crayon-syntax-highlighter
836
  msgid "Change the following settings to override their global values."
837
+ msgstr "以下设置优先级高于默认设置,"
838
 
839
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:249
840
  #@ crayon-syntax-highlighter
841
  msgid "Only changes (shown yellow) are applied."
842
+ msgstr "只有背景色为黄色的选项优先级会高于默认设置,"
843
 
844
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:251
845
  #, php-format
846
  #@ crayon-syntax-highlighter
847
  msgid "Future changes to the global settings under %sCrayon &gt; Settings%s won't affect overridden settings."
848
+ msgstr "其它设置会沿用默认设置(%s点击前往设置%s)。"
849
 
850
+ #: util/theme-editor/theme_editor_content.php:39
851
  #@ crayon-syntax-highlighter
852
  msgid "Back To Settings"
853
  msgstr "返回设置"
854
 
855
+ #: crayon_settings_wp.class.php:897
856
  #@ crayon-syntax-highlighter
857
  msgid "Remove Crayons from excerpts"
858
  msgstr "文章摘要不启用代码高亮"
859
 
860
+ #: crayon_formatter.class.php:276
861
+ #@ crayon-syntax-highlighter
862
+ msgid "Toggle Line Wrap"
863
+ msgstr "切换自动换行"
864
+
865
+ #: crayon_settings_wp.class.php:338
866
+ #@ crayon-syntax-highlighter
867
+ msgid "Posts"
868
+ msgstr "文章"
869
+
870
+ #: crayon_settings_wp.class.php:614
871
+ #@ crayon-syntax-highlighter
872
+ msgid "Enable line ranges for showing only parts of code"
873
+ msgstr "开启 指定显示的行 功能"
874
+
875
+ #: crayon_settings_wp.class.php:617
876
+ #@ crayon-syntax-highlighter
877
+ msgid "Wrap lines by default"
878
+ msgstr "默认自动换行"
879
+
880
+ #: crayon_settings_wp.class.php:618
881
+ #@ crayon-syntax-highlighter
882
+ msgid "Enable line wrap toggling"
883
+ msgstr "允许切换自动换行"
884
+
885
+ #: crayon_settings_wp.class.php:680
886
+ #@ crayon-syntax-highlighter
887
+ msgid "Show Crayon Posts"
888
+ msgstr "显示已使用代码高亮的文章"
889
+
890
+ #: crayon_settings_wp.class.php:782
891
+ #@ crayon-syntax-highlighter
892
+ msgid "Edit"
893
+ msgstr "编辑"
894
+
895
+ #: crayon_settings_wp.class.php:783
896
+ #@ crayon-syntax-highlighter
897
+ msgid "Create"
898
+ msgstr "创建"
899
+
900
+ #: crayon_settings_wp.class.php:848
901
+ #@ crayon-syntax-highlighter
902
+ msgid "Blank lines before code:"
903
+ msgstr "代码高亮前的空行数:"
904
+
905
+ #: crayon_settings_wp.class.php:850
906
+ #@ crayon-syntax-highlighter
907
+ msgid "Blank lines after code:"
908
+ msgstr "代码高亮后的空行数:"
909
+
910
+ #: crayon_settings_wp.class.php:875
911
+ #@ crayon-syntax-highlighter
912
+ msgid "Convert Legacy Tags"
913
+ msgstr "转换迷你标签"
914
+
915
+ #: crayon_settings_wp.class.php:878
916
+ #@ crayon-syntax-highlighter
917
+ msgid "No Legacy Tags Found"
918
+ msgstr "暂无迷你标签"
919
+
920
+ #: crayon_settings_wp.class.php:882
921
+ #@ crayon-syntax-highlighter
922
+ msgid "Convert existing Crayon tags to Tag Editor format (&lt;pre&gt;)"
923
+ msgstr "转换已使用的迷你标签为兼容性更好的标准格式 (&lt;pre&gt;)"
924
+
925
+ #: crayon_settings_wp.class.php:886
926
+ #@ crayon-syntax-highlighter
927
+ msgid "Display the Tag Editor in any TinyMCE instances on the frontend"
928
+ msgstr "在前端的 TinyMCE 编辑器显示标签编辑器"
929
+
930
+ #: crayon_settings_wp.class.php:887
931
+ #@ crayon-syntax-highlighter
932
+ msgid "Display Tag Editor settings on the frontend"
933
+ msgstr "在前端显示标签编辑器的设置"
934
+
935
  #. translators: plugin header field 'Version'
936
  #: crayon_wp.class.php:0
937
  #@ crayon-syntax-highlighter
938
+ msgid "1.14"
939
+ msgstr ""
940
+
941
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:189
942
+ #@ crayon-syntax-highlighter
943
+ msgid "Don't Highlight"
944
+ msgstr "取消高亮"
945
+
946
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:197
947
+ #@ crayon-syntax-highlighter
948
+ msgid "Line Range"
949
+ msgstr "指定显示的行"
950
+
951
+ #: util/tag-editor/crayon_tag_editor_wp.class.php:198
952
+ #@ crayon-syntax-highlighter
953
+ msgid "(e.g. 3-5 or 3)"
954
+ msgstr "(如 3-5 或 3)"
955
+
956
+ #: util/theme-editor/theme_editor_content.php:32
957
+ #, php-format
958
+ #@ crayon-syntax-highlighter
959
+ msgid "Editing \"%s\" Theme"
960
+ msgstr ""
961
+
962
+ #: util/theme-editor/theme_editor_content.php:34
963
+ #, php-format
964
+ #@ crayon-syntax-highlighter
965
+ msgid "Creating Theme From \"%s\""
966
  msgstr ""
967
 
util/crayon_log.class.php CHANGED
@@ -37,7 +37,7 @@ class CrayonLog {
37
  // Remove stupid formatting from wampserver
38
  $buffer = str_replace('&apos;', '"', $buffer);
39
  $buffer = preg_replace('#^string\([^\)]*\)#mi', 'str', $buffer);
40
- $title = (!empty($title) && is_string($title) ? " [$title]" : '');
41
 
42
  // Remove absolute path to plugin directory from buffer
43
  if ($trim_url) {
37
  // Remove stupid formatting from wampserver
38
  $buffer = str_replace('&apos;', '"', $buffer);
39
  $buffer = preg_replace('#^string\([^\)]*\)#mi', 'str', $buffer);
40
+ $title = (!empty($title) ? " [$title]" : '');
41
 
42
  // Remove absolute path to plugin directory from buffer
43
  if ($trim_url) {
util/crayon_util.class.php CHANGED
@@ -354,7 +354,7 @@ class CrayonUtil {
354
  }
355
 
356
  // Creates a unique ID from a string
357
- function get_var_str() {
358
  $get_vars = array();
359
  foreach ($_GET as $get=>$val) {
360
  $get_vars[] = $get . '=' . $val;
@@ -363,7 +363,7 @@ class CrayonUtil {
363
  }
364
 
365
  // Creates a unique ID from a string
366
- function str_uid($str) {
367
  $uid = 0;
368
  for ($i = 1; $i < strlen($str); $i++) {
369
  $uid += round(ord($str[$i]) * ($i / strlen($str)), 2) * 100;
@@ -371,6 +371,37 @@ class CrayonUtil {
371
  return strval(dechex(strlen($str))).strval(dechex($uid));
372
  }
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  // strpos with an array of $needles
375
  public static function strposa($haystack, $needles, $insensitive = FALSE) {
376
  if (is_array($needles)) {
354
  }
355
 
356
  // Creates a unique ID from a string
357
+ public static function get_var_str() {
358
  $get_vars = array();
359
  foreach ($_GET as $get=>$val) {
360
  $get_vars[] = $get . '=' . $val;
363
  }
364
 
365
  // Creates a unique ID from a string
366
+ public static function str_uid($str) {
367
  $uid = 0;
368
  for ($i = 1; $i < strlen($str); $i++) {
369
  $uid += round(ord($str[$i]) * ($i / strlen($str)), 2) * 100;
371
  return strval(dechex(strlen($str))).strval(dechex($uid));
372
  }
373
 
374
+ // Breaks up a version string into parts
375
+ public static function version_parts($version) {
376
+ preg_match('#[\d+\.]+#msi', $version, $match);
377
+ if (count($match[0])) {
378
+ return split('\.', $match[0]);
379
+ } else {
380
+ return array();
381
+ }
382
+ }
383
+
384
+ // Compares two version strings lexicographically
385
+ public static function version_compare($a, $b) {
386
+ $a_parts = self::version_parts($a);
387
+ $b_parts = self::version_parts($b);
388
+ return self::array_compare_lexi($a_parts, $b_parts);
389
+ }
390
+
391
+ // Compares two arrays lexicographically
392
+ // This could be extended with a compare function argument
393
+ public static function array_compare_lexi($a, $b) {
394
+ $short = count($a) < count($b) ? $a : $b;
395
+ for ($i = 0; $i < count($short); $i++) {
396
+ if ($a[$i] > $b[$i]) {
397
+ return 1;
398
+ } else if ($a[$i] < $b[$i]) {
399
+ return -1;
400
+ }
401
+ }
402
+ return 0;
403
+ }
404
+
405
  // strpos with an array of $needles
406
  public static function strposa($haystack, $needles, $insensitive = FALSE) {
407
  if (is_array($needles)) {
util/sample/batch.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ if [%3]==[] (
2
+ goto :usage
3
+ )
4
+ if not exist %3 (
5
+ echo Creating %3 dir...
6
+ mkdir %3
7
+ )
8
+ echo Copying original files to %3 dir...
9
+ copy %2\* %3 >nul
10
+ echo Adding background...
11
+ mogrify -background #%1 -flatten %3\*
util/tag-editor/crayon_tag_editor_wp.class.php CHANGED
@@ -24,7 +24,7 @@ class CrayonTagEditorWP {
24
  add_action('wp', 'CrayonTagEditorWP::enqueue_resources');
25
  add_filter('tiny_mce_before_init', 'CrayonTagEditorWP::init_tinymce');
26
  // Must come after
27
- add_action("wp", 'CrayonSettingsWP::init_js_settings');
28
  self::addbuttons();
29
  }
30
  }
@@ -88,16 +88,14 @@ class CrayonTagEditorWP {
88
  global $CRAYON_VERSION;
89
  self::init_settings();
90
 
91
- if (!wp_script_is('fancybox', 'queue')) {
92
- wp_enqueue_style('fancybox', plugins_url(CRAYON_CSS_FANCYBOX, dirname(dirname(__FILE__))), array(), $CRAYON_VERSION);
93
- wp_enqueue_script('fancybox', plugins_url(CRAYON_JS_FANCYBOX, dirname(dirname(__FILE__))), array('jquery'), $CRAYON_VERSION);
94
- }
95
-
96
- wp_enqueue_script('crayon_util_js', plugins_url(CRAYON_JS_UTIL, dirname(dirname(__FILE__))), array('jquery'), $CRAYON_VERSION);
97
- wp_enqueue_script('crayon_admin_js', plugins_url(CRAYON_JS_ADMIN, dirname(dirname(__FILE__))), array('jquery', 'crayon_util_js'), $CRAYON_VERSION);
98
- wp_enqueue_script('crayon_te_js', plugins_url(CRAYON_TE_JS, __FILE__), array('crayon_admin_js', 'fancybox'), $CRAYON_VERSION);
99
  wp_enqueue_script('crayon_qt_js', plugins_url(CRAYON_QUICKTAGS_JS, __FILE__), array('quicktags','crayon_te_js'), $CRAYON_VERSION, TRUE);
100
  wp_localize_script('crayon_te_js', 'CrayonTagEditorSettings', self::$settings);
 
101
  }
102
 
103
  public static function register_buttons($buttons) {
@@ -157,6 +155,7 @@ class CrayonTagEditorWP {
157
 
158
  CrayonSettingsWP::load_settings();
159
  $langs = CrayonParser::parse_all();
 
160
  $curr_lang = CrayonGlobalSettings::val(CrayonSettings::FALLBACK_LANG);
161
  $themes = CrayonResources::themes()->get();
162
  $curr_theme = CrayonGlobalSettings::val(CrayonSettings::THEME);
@@ -171,9 +170,9 @@ class CrayonTagEditorWP {
171
  <div id="crayon-te-bar-content">
172
  <div id="crayon-te-title">Title</div>
173
  <div id="crayon-te-controls">
174
- <a id="crayon-te-ok" href="#">Ok</a> <span
175
  class="crayon-te-seperator">|</span> <a id="crayon-te-cancel"
176
- href="#">Cancel</a>
177
  </div>
178
  </div>
179
  </div>
@@ -269,7 +268,7 @@ class CrayonTagEditorWP {
269
 
270
  }
271
 
272
- if (defined('ABSPATH') /*&& is_admin()*/) {
273
  add_action('init', 'CrayonTagEditorWP::init');
274
  }
275
 
24
  add_action('wp', 'CrayonTagEditorWP::enqueue_resources');
25
  add_filter('tiny_mce_before_init', 'CrayonTagEditorWP::init_tinymce');
26
  // Must come after
27
+ //add_action("wp", 'CrayonSettingsWP::init_js_settings');
28
  self::addbuttons();
29
  }
30
  }
88
  global $CRAYON_VERSION;
89
  self::init_settings();
90
 
91
+ wp_enqueue_style('crayon_fancybox', plugins_url(CRAYON_CSS_FANCYBOX, dirname(dirname(__FILE__))), array(), $CRAYON_VERSION);
92
+ wp_enqueue_script('crayon_fancybox', plugins_url(CRAYON_JS_FANCYBOX, dirname(dirname(__FILE__))), array('jquery'), $CRAYON_VERSION);
93
+ wp_enqueue_script('fancybox_init', plugins_url(CRAYON_JS_FANCYBOX_INIT, dirname(dirname(__FILE__))), array('crayon_fancybox', 'crayon_util_js'), $CRAYON_VERSION);
94
+
95
+ wp_enqueue_script('crayon_te_js', plugins_url(CRAYON_TE_JS, __FILE__), array('crayon_fancybox', 'fancybox_init'), $CRAYON_VERSION);
 
 
 
96
  wp_enqueue_script('crayon_qt_js', plugins_url(CRAYON_QUICKTAGS_JS, __FILE__), array('quicktags','crayon_te_js'), $CRAYON_VERSION, TRUE);
97
  wp_localize_script('crayon_te_js', 'CrayonTagEditorSettings', self::$settings);
98
+ CrayonSettingsWP::admin_base_scripts();
99
  }
100
 
101
  public static function register_buttons($buttons) {
155
 
156
  CrayonSettingsWP::load_settings();
157
  $langs = CrayonParser::parse_all();
158
+ $langs = CrayonLangs::sort_by_name($langs);
159
  $curr_lang = CrayonGlobalSettings::val(CrayonSettings::FALLBACK_LANG);
160
  $themes = CrayonResources::themes()->get();
161
  $curr_theme = CrayonGlobalSettings::val(CrayonSettings::THEME);
170
  <div id="crayon-te-bar-content">
171
  <div id="crayon-te-title">Title</div>
172
  <div id="crayon-te-controls">
173
+ <a id="crayon-te-ok" href="#"><?php crayon_e('OK'); ?></a> <span
174
  class="crayon-te-seperator">|</span> <a id="crayon-te-cancel"
175
+ href="#"><?php crayon_e('Cancel'); ?></a>
176
  </div>
177
  </div>
178
  </div>
268
 
269
  }
270
 
271
+ if (defined('ABSPATH')) {
272
  add_action('init', 'CrayonTagEditorWP::init');
273
  }
274
 
util/tag-editor/crayon_te.js CHANGED
@@ -5,18 +5,12 @@
5
 
6
  var loaded = false;
7
  var editing = false;
8
- var insertCallback = null;
9
- var editCallback = null;
10
- var showCallback = null;
11
- var hideCallback = null;
12
  // Used for encoding, decoding
13
- var inputHTML = null;
14
- var outputHTML = null;
15
- var editor_name = null;
16
- var ajax_class_timer = null;
17
  var ajax_class_timer_count = 0;
18
 
19
- var code_refresh = url_refresh = null;
20
 
21
  // Current $ obj of pre node
22
  var currCrayon = null;
@@ -26,26 +20,26 @@
26
  var is_inline = false;
27
 
28
  // Generated in WP and contains the settings
29
- var s, gs, admin = null;
30
  // For use in async functions
31
  var me = this;
32
 
33
  // CSS
34
- var dialog = code = clear = submit = null;
35
 
36
  base.init = function(button) {
37
  s = CrayonTagEditorSettings;
38
  gs = CrayonSyntaxSettings;
39
- admin = CrayonSyntaxAdmin;
40
 
41
  base.loadDialog();
42
- $(button).fancybox({
43
  href : s.content_css,
44
  margin : [40,10,40,10],
45
  padding : 0,
46
  width : 690,
47
- //height : '100%',
48
- //autoSize : false,
49
  title : '',
50
  beforeShow : function () {
51
  $(this.outer).prepend($(s.bar_content));
@@ -60,13 +54,13 @@
60
  });
61
 
62
  $(s.cancel_css).live('click', function () {
63
- $.fancybox.close();
64
  return false;
65
  });
66
  };
67
 
68
  base.hide = function() {
69
- $.fancybox.close();
70
  return false;
71
  };
72
 
@@ -85,11 +79,6 @@
85
  dialog.appendTo('body').hide();
86
  dialog.html(data);
87
 
88
- dialog.ready(function() {
89
- // Some settings have dependencies, need to load js for that
90
- admin.init();
91
- });
92
-
93
  me.setOrigValues();
94
 
95
  submit = dialog.find(s.submit_css);
@@ -340,20 +329,10 @@
340
 
341
  // Show the dialog
342
  var dialog_title = editing ? s.dialog_title_edit : s.dialog_title_add;
343
- // if (tb_show) {
344
- // tb_show(dialog_title, '#TB_inline?inlineId=' + s.css);
345
- // } else {
346
- $(s.dialog_title_css).html(dialog_title);
347
- if (showCallback) {
348
- showCallback();
349
- }
350
- // }
351
-
352
- //tb_show(dialog_title, '#TB_inline?inlineId=' + s.css);
353
- // console.log($("#crayon-te-table"));
354
- // $("#bbp_topic_content_crayon_tinymce").fancybox({afterLoad: function() {
355
- // alert();
356
- // }, content: '#crayon-te-table'});
357
 
358
  code.focus();
359
  code_refresh();
@@ -363,9 +342,6 @@
363
  ajax_class_timer_count = 0;
364
  }
365
 
366
- // Position submit button
367
- // $('#TB_title').append(submit);
368
-
369
  var ajax_window = $('#TB_window');
370
  ajax_window.hide();
371
  var fallback = function () {
@@ -408,7 +384,7 @@
408
  // Spacing only for <pre>
409
  var br_before = br_after = '';
410
  if (!editing) {
411
- // Don't add spaces if editting
412
  if (!is_inline) {
413
  if (editor_name == 'html') {
414
  br_after = br_before = ' \n';
@@ -447,7 +423,7 @@
447
  var id = $(this).attr('id');
448
  var value = $(this).attr(s.data_value);
449
  // Remove prefix
450
- id = admin.removePrefixFromID(id);
451
  atts[id] = value;
452
  });
453
 
@@ -530,14 +506,6 @@
530
  if (hideCallback) {
531
  hideCallback();
532
  }
533
- // Hide dialog
534
- // tb_remove();
535
- // var ajax = $('#TB_ajaxContent');
536
- // if ( typeof ajax == 'undefined' ) {
537
- // ajax.removeClass('crayon-te-ajax');
538
- // }
539
- // Title is destroyed, so move the submit out
540
- // $(s.submit_wrapper_css).append(submit);
541
  };
542
 
543
  // XXX Auxiliary methods
5
 
6
  var loaded = false;
7
  var editing = false;
8
+ var insertCallback, editCallback, showCallback, hideCallback = null;
 
 
 
9
  // Used for encoding, decoding
10
+ var inputHTML, outputHTML, editor_name, ajax_class_timer = null;
 
 
 
11
  var ajax_class_timer_count = 0;
12
 
13
+ var code_refresh, url_refresh = null;
14
 
15
  // Current $ obj of pre node
16
  var currCrayon = null;
20
  var is_inline = false;
21
 
22
  // Generated in WP and contains the settings
23
+ var s, gs, util = null;
24
  // For use in async functions
25
  var me = this;
26
 
27
  // CSS
28
+ var dialog, code, clear, submit = null;
29
 
30
  base.init = function(button) {
31
  s = CrayonTagEditorSettings;
32
  gs = CrayonSyntaxSettings;
33
+ util = CrayonUtil;
34
 
35
  base.loadDialog();
36
+ $(button).crayonFancybox({
37
  href : s.content_css,
38
  margin : [40,10,40,10],
39
  padding : 0,
40
  width : 690,
41
+ height : '100%',
42
+ autoSize : false,
43
  title : '',
44
  beforeShow : function () {
45
  $(this.outer).prepend($(s.bar_content));
54
  });
55
 
56
  $(s.cancel_css).live('click', function () {
57
+ $.crayonFancybox.close();
58
  return false;
59
  });
60
  };
61
 
62
  base.hide = function() {
63
+ $.crayonFancybox.close();
64
  return false;
65
  };
66
 
79
  dialog.appendTo('body').hide();
80
  dialog.html(data);
81
 
 
 
 
 
 
82
  me.setOrigValues();
83
 
84
  submit = dialog.find(s.submit_css);
329
 
330
  // Show the dialog
331
  var dialog_title = editing ? s.dialog_title_edit : s.dialog_title_add;
332
+ $(s.dialog_title_css).html(dialog_title);
333
+ if (showCallback) {
334
+ showCallback();
335
+ }
 
 
 
 
 
 
 
 
 
 
336
 
337
  code.focus();
338
  code_refresh();
342
  ajax_class_timer_count = 0;
343
  }
344
 
 
 
 
345
  var ajax_window = $('#TB_window');
346
  ajax_window.hide();
347
  var fallback = function () {
384
  // Spacing only for <pre>
385
  var br_before = br_after = '';
386
  if (!editing) {
387
+ // Don't add spaces if editing
388
  if (!is_inline) {
389
  if (editor_name == 'html') {
390
  br_after = br_before = ' \n';
423
  var id = $(this).attr('id');
424
  var value = $(this).attr(s.data_value);
425
  // Remove prefix
426
+ id = util.removePrefixFromID(id);
427
  atts[id] = value;
428
  });
429
 
506
  if (hideCallback) {
507
  hideCallback();
508
  }
 
 
 
 
 
 
 
 
509
  };
510
 
511
  // XXX Auxiliary methods
util/tag-editor/crayon_tinymce.js CHANGED
@@ -129,6 +129,7 @@
129
  base.setHighlight(true);
130
  } else {
131
  // No pre selected
 
132
  }
133
  var tooltip = currPre ? s.dialog_title_edit : s.dialog_title_add;
134
  $(s.tinymce_button).attr('title', tooltip);
129
  base.setHighlight(true);
130
  } else {
131
  // No pre selected
132
+ base.setHighlight(false);
133
  }
134
  var tooltip = currPre ? s.dialog_title_edit : s.dialog_title_add;
135
  $(s.tinymce_button).attr('title', tooltip);
util/theme-editor/theme_editor.js CHANGED
@@ -1,96 +1,33 @@
1
  // Crayon Syntax Highlighter Theme Editor JavaScript
2
 
3
- var CrayonSyntaxThemeEditor = new function() {
4
-
5
- // var preview, preview_url, preview_get; //, preview_callback, editor_controls, editor_top_controls;
6
- // var preview_objects, preview_loaded;
7
- // var theme_dropdown;
8
- // var theme_css, is_theme_changed;
9
-
10
- var settings = CrayonThemeEditorSettings;
11
-
12
- this.init = function(callback, crayon) {
13
-
14
- console_log(CrayonThemeEditorSettings);
15
-
16
- console_log('editor init');
17
- preview = jQuery('#crayon-editor-preview');
18
-
19
- crayon.attr('id', 'theme-editor-instance');
20
- CrayonSyntax.process(crayon, true);
21
- preview.html(crayon);
22
-
23
- jQuery.get(settings.themes_url + settings.curr_theme + '/' + settings.curr_theme + '.css' , function(css) {
24
- console_log(css);
25
-
26
- var json = CSSJSON.toJSON(css, true);
27
- console_log(json);
28
- });
29
-
30
- // preview_loaded = false;
31
- // editor_controls = jQuery('#crayon-editor-controls');
32
- // editor_top_controls = jQuery('#crayon-editor-top-controls');
33
- // preview_url = preview.attr('url');
34
- // theme_css = {};
35
- // preview_objects = {};
36
- // is_theme_changed = false;
37
- //
38
- // preview_callback = function() {
39
- // preview_update();
40
- // };
41
-
42
- // Duplicate controls from settings screen
43
- // theme_dropdown = jQuery('#theme').clone();
44
- // theme_dropdown.attr('id', 'editor-theme');
45
-
46
- // theme_dropdown = add_preview_object('#theme');
47
- // editor_top_controls.html(theme_dropdown);
48
-
49
- // Initial load
50
- // preview_update();
51
-
52
- callback();
53
-
54
- };
55
-
56
- // var preview_update =
57
- // function() {
58
- // console_log('editor_preview_update');
59
- // update_get();
60
- //
61
- // // Load Preview
62
- // jQuery.get(preview_url + preview_get, function(data) {
63
- // preview.html(data);
64
- // CrayonSyntax.init();
65
- // if (!self.preview_loaded) {
66
- // CrayonSyntaxAdmin.show_theme_editor_now();
67
- // preview_loaded = true;
68
- // }
69
- // });
70
- // };
71
-
72
- // var add_preview_object = function(selector) {
73
- // var obj = jQuery(selector);
74
- // if (obj.length == 0) {
75
- // console_log('add_preview_object selector: ' + selector + ' gives null');
76
- // return null;
77
- // }
78
- // obj = obj.clone();
79
- // obj.attr('old-id', obj.attr('id'));
80
- // obj.attr('id', 'editor-' + obj.attr('id'));
81
- // preview_objects[obj.attr('old-id')] = obj;
82
- // obj.change(preview_callback);
83
- // return obj;
84
- // }
85
-
86
- // var update_get = function() {
87
- // preview_get = '?toolbar=1&theme=' + CrayonThemeEditorSettings.curr_theme;
88
- //// for (id in preview_objects) {
89
- //// obj = preview_objects[id];
90
- //// preview_get += id + '=' + obj.val() + '&';
91
- //// }
92
- //// console_log('show_theme_editor ' + preview_get);
93
- //// console_log('TEST');
94
- // };
95
-
96
- };
1
  // Crayon Syntax Highlighter Theme Editor JavaScript
2
 
3
+ (function ($) {
4
+
5
+ CrayonSyntaxThemeEditor = new function () {
6
+
7
+ var base = this;
8
+
9
+ var adminSettings = CrayonAdminSettings;
10
+ var settings = CrayonThemeEditorSettings;
11
+
12
+ var preview;
13
+
14
+ base.init = function (callback, crayon) {
15
+ console_log('editor init');
16
+ preview = jQuery('#crayon-editor-preview');
17
+ crayon.attr('id', 'theme-editor-instance');
18
+ CrayonSyntax.process(crayon, true);
19
+ preview.html(crayon);
20
+
21
+ //console.log(adminSettings.curr_theme_str);
22
+
23
+ callback();
24
+ base.initUI();
25
+ };
26
+
27
+ base.initUI = function() {
28
+ $('#crayon-editor-controls').tabs();
29
+ }
30
+
31
+ };
32
+
33
+ })(jQueryCrayon);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
util/theme-editor/theme_editor.php CHANGED
@@ -1,26 +1,28 @@
1
  <?php
2
 
3
- $crayon_root_theme = dirname(dirname(dirname(__FILE__))) . '/';
4
- require_once $crayon_root_theme . 'global.php';
5
-
6
  class CrayonThemeEditorWP {
7
 
8
- public static function admin_scripts() {
9
-
10
- $themes_ = CrayonResources::themes()->get();
11
- $themes = array();
12
-
13
- foreach ($themes_ as $theme) {
14
- $themes[$theme->id()] = $theme->name();
15
- }
16
-
17
  $settings = array(
18
- 'themes' => $themes,
19
- 'themes_url' => plugins_url(CRAYON_THEME_DIR, dirname(dirname(__FILE__)))
20
- );
 
 
21
  wp_localize_script('crayon_theme_editor', 'CrayonThemeEditorSettings', $settings);
 
 
22
  }
23
 
24
  }
25
 
 
 
 
 
26
  ?>
1
  <?php
2
 
 
 
 
3
  class CrayonThemeEditorWP {
4
 
5
+ public static function init() {
6
+ self::admin_resources();
7
+ }
8
+
9
+ public static function admin_resources() {
10
+ global $CRAYON_VERSION;
 
 
 
11
  $settings = array(
12
+ // Only things the theme editor needs
13
+ );
14
+ wp_enqueue_script('cssjson_js', plugins_url(CRAYON_CSSJSON_JS, dirname(dirname(__FILE__))), $CRAYON_VERSION);
15
+ wp_enqueue_script('jquery_ui_js', plugins_url(CRAYON_JS_JQUERY_UI, dirname(dirname(__FILE__))), array('jquery'), $CRAYON_VERSION);
16
+ wp_enqueue_script('crayon_theme_editor', plugins_url(CRAYON_THEME_EDITOR_JS, dirname(dirname(__FILE__))), array('jquery', 'jquery_ui_js', 'crayon_util_js', 'cssjson_js'), $CRAYON_VERSION);
17
  wp_localize_script('crayon_theme_editor', 'CrayonThemeEditorSettings', $settings);
18
+
19
+ wp_enqueue_style('jquery_ui', plugins_url(CRAYON_CSS_JQUERY_UI, dirname(dirname(__FILE__))), array(), $CRAYON_VERSION);
20
  }
21
 
22
  }
23
 
24
+ if (defined('ABSPATH') && is_admin()) {
25
+ add_action('init', 'CrayonThemeEditorWP::init');
26
+ }
27
+
28
  ?>
util/theme-editor/theme_editor_content.php CHANGED
@@ -3,7 +3,6 @@
3
  // TODO this needs lots of work! remove the old wp_load procedure
4
 
5
  require_once('../../crayon_wp.class.php');
6
-
7
  $theme = CrayonResources::themes()->get_default();
8
  $editing = false;
9
 
@@ -15,34 +14,37 @@ if ( isset($_GET['editing']) ) {
15
  $editing = CrayonUtil::str_to_bool($_GET['editing'], FALSE);
16
  }
17
 
18
- // var_dump($_GET);
19
-
20
- // var_dump($theme);
21
- // var_dump($editing);
22
-
23
  ?>
24
 
25
- <div id="icon-options-general" class="icon32"><br>
26
- </div>
27
- <h2>Crayon Syntax Highlighter <?php crayon_e('Theme Editor'); ?></h2>
 
 
 
28
 
29
  <h3>
30
- <?php
31
  if ($editing) {
32
  echo sprintf(crayon__('Editing "%s" Theme'), $theme->name());
33
  } else {
34
  echo sprintf(crayon__('Creating Theme From "%s"'), $theme->name());
35
  }
36
- ?>
37
  </h3>
38
 
39
- <p><a class="button-primary" onclick="CrayonSyntaxAdmin.show_main();"><?php crayon_e('Back To Settings'); ?></a></p>
 
 
 
40
 
41
  <?php //crayon_e('Use the Sidebar on the right to change the Theme of the Preview window.') ?>
42
 
43
- <div id="crayon-editor-top-controls"></div>
 
44
 
45
- <table id="crayon-editor-table" style="width: 100%;" cellspacing="5" cellpadding="0">
 
46
  <tr>
47
  <td id="crayon-editor-preview-wrapper">
48
  <div id="crayon-editor-preview"></div>
@@ -50,7 +52,57 @@ if ( isset($_GET['editing']) ) {
50
  </tr>
51
  <tr>
52
  <td id="crayon-editor-control-wrapper">
53
- <div id="crayon-editor-controls"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  </td>
55
  </tr>
56
 
3
  // TODO this needs lots of work! remove the old wp_load procedure
4
 
5
  require_once('../../crayon_wp.class.php');
 
6
  $theme = CrayonResources::themes()->get_default();
7
  $editing = false;
8
 
14
  $editing = CrayonUtil::str_to_bool($_GET['editing'], FALSE);
15
  }
16
 
 
 
 
 
 
17
  ?>
18
 
19
+ <div
20
+ id="icon-options-general" class="icon32"></div>
21
+ <h2>
22
+ Crayon Syntax Highlighter
23
+ <?php crayon_e('Theme Editor'); ?>
24
+ </h2>
25
 
26
  <h3>
27
+ <?php
28
  if ($editing) {
29
  echo sprintf(crayon__('Editing "%s" Theme'), $theme->name());
30
  } else {
31
  echo sprintf(crayon__('Creating Theme From "%s"'), $theme->name());
32
  }
33
+ ?>
34
  </h3>
35
 
36
+ <p>
37
+ <a class="button-primary" onclick="CrayonSyntaxAdmin.show_main();"><?php crayon_e('Back To Settings'); ?>
38
+ </a>
39
+ </p>
40
 
41
  <?php //crayon_e('Use the Sidebar on the right to change the Theme of the Preview window.') ?>
42
 
43
+ <div
44
+ id="crayon-editor-top-controls"></div>
45
 
46
+ <table id="crayon-editor-table" style="width: 100%;" cellspacing="5"
47
+ cellpadding="0">
48
  <tr>
49
  <td id="crayon-editor-preview-wrapper">
50
  <div id="crayon-editor-preview"></div>
52
  </tr>
53
  <tr>
54
  <td id="crayon-editor-control-wrapper">
55
+ <div id="crayon-editor-controls">
56
+ <ul>
57
+ <li><a href="#tabs-1">Nunc tincidunt</a></li>
58
+ <li><a href="#tabs-2">Proin dolor</a></li>
59
+ <li><a href="#tabs-3">Aenean lacinia</a></li>
60
+ </ul>
61
+ <div id="tabs-1">
62
+ <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a,
63
+ risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris.
64
+ Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem.
65
+ Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo.
66
+ Vivamus sed magna quis ligula eleifend adipiscing. Duis orci.
67
+ Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam
68
+ molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut
69
+ dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique
70
+ tempus lectus.</p>
71
+ </div>
72
+ <div id="tabs-2">
73
+ <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus
74
+ gravida ante, ut pharetra massa metus id nunc. Duis scelerisque
75
+ molestie turpis. Sed fringilla, massa eget luctus malesuada, metus
76
+ eros molestie lectus, ut tempus eros massa ut dolor. Aenean
77
+ aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit
78
+ aliquam. Praesent in eros vestibulum mi adipiscing adipiscing.
79
+ Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel
80
+ metus. Ut posuere viverra nulla. Aliquam erat volutpat.
81
+ Pellentesque convallis. Maecenas feugiat, tellus pellentesque
82
+ pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel
83
+ felis. Mauris consectetur tortor et purus.</p>
84
+ </div>
85
+ <div id="tabs-3">
86
+ <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse
87
+ potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque
88
+ rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante.
89
+ Class aptent taciti sociosqu ad litora torquent per conubia
90
+ nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel
91
+ enim commodo pellentesque. Praesent eu risus hendrerit ligula
92
+ tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec,
93
+ luctus a, lacus.</p>
94
+ <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at,
95
+ semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent
96
+ viverra justo vitae neque. Praesent blandit adipiscing velit.
97
+ Suspendisse potenti. Donec mattis, pede vel pharetra blandit,
98
+ magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam
99
+ scelerisque. Donec non libero sed nulla mattis commodo. Ut
100
+ sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor
101
+ vitae, pede. Aenean vehicula velit eu tellus interdum rutrum.
102
+ Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a
103
+ libero vitae lectus hendrerit hendrerit.</p>
104
+ </div>
105
+ </div>
106
  </td>
107
  </tr>
108