Crayon Syntax Highlighter - Version 1.17

Version Description

  • ADDED:
    • Selected text in the TinyMCE editor is now added into the code box of the Tag Editor
    • Retina buttons for the toolbar
    • Support for Wordpress 3.5
  • FIXED:
    • Removed fancybox_init.js and integrated into util.js, other minor improvements in loading Tag Editor
    • Disabling popup now removes the JS resource
    • Refactored Tag Editor functions
    • Display Tag Editor settings on the frontend wasn't working
    • Removed contextual help and added more useful links, including online help
    • Checkboxes have labels instead of spans thanks to https://github.com/toszcze
    • Undefined php variable fix thanks to https://github.com/toszcze
    • Dimension fixes in js on hover
    • On iOS the fonts appeared larger for code than for line numbers.
    • Expanding code shrunk instead if the toolbar was visible
    • Updated Turkish
Download this release

Release Info

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

Code changes from version 1.15 to 1.17

Files changed (43) hide show
  1. crayon_formatter.class.php +20 -3
  2. crayon_highlighter.class.php +0 -14
  3. crayon_settings.class.php +5 -1
  4. crayon_settings_wp.class.php +137 -106
  5. crayon_wp.class.php +1137 -1134
  6. css/admin_style.css +10 -2
  7. css/crayon_style.css +20 -8
  8. css/images/docs.png +0 -0
  9. css/images/github.png +0 -0
  10. css/images/toolbar/copy.png +0 -0
  11. css/images/toolbar/copy@2x.png +0 -0
  12. css/images/toolbar/expand.png +0 -0
  13. css/images/toolbar/expand@2x.png +0 -0
  14. css/images/toolbar/nums.png +0 -0
  15. css/images/toolbar/nums@2x.png +0 -0
  16. css/images/toolbar/plain.png +0 -0
  17. css/images/toolbar/plain@2x.png +0 -0
  18. css/images/toolbar/plus.png +0 -0
  19. css/images/toolbar/plus@2x.png +0 -0
  20. css/images/toolbar/popup.png +0 -0
  21. css/images/toolbar/popup@2x.png +0 -0
  22. css/images/toolbar/wrap.png +0 -0
  23. css/images/toolbar/wrap@2x.png +0 -0
  24. css/images/wordpress-blue.png +0 -0
  25. global.php +2 -1
  26. js/crayon.js +332 -104
  27. js/fancybox/fancybox_init.js +0 -8
  28. js/util.js +50 -19
  29. langs/yaml/operator.txt +1 -0
  30. langs/yaml/yaml.txt +13 -12
  31. readme.txt +43 -5
  32. themes/classic/classic.css +2 -4
  33. trans/crayon-syntax-highlighter-fr_FR.mo +0 -0
  34. trans/crayon-syntax-highlighter-fr_FR.po +454 -307
  35. trans/crayon-syntax-highlighter-pt_BR.mo +0 -0
  36. trans/crayon-syntax-highlighter-pt_BR.po +723 -0
  37. trans/crayon-syntax-highlighter-tr_TR.mo +0 -0
  38. trans/crayon-syntax-highlighter-tr_TR.po +258 -203
  39. util/help.htm +0 -279
  40. util/tag-editor/crayon_qt.js +35 -21
  41. util/tag-editor/crayon_tag_editor_wp.class.php +240 -240
  42. util/tag-editor/crayon_te.js +70 -53
  43. util/tag-editor/crayon_tinymce.js +170 -176
crayon_formatter.class.php CHANGED
@@ -146,7 +146,7 @@ class CrayonFormatter {
146
  // Generate the code lines and separate each line as a div
147
  $print_code = '';
148
  $print_nums = '';
149
- $hl->line_count(preg_match_all("|^.*$|m", $code, $code_lines));
150
 
151
  // The line number to start from
152
  $start_line = $hl->setting_val(CrayonSettings::START_LINE);
@@ -163,6 +163,12 @@ class CrayonFormatter {
163
  }
164
  }
165
  $code_line = $code_lines[0][$i - 1];
 
 
 
 
 
 
166
  // Check if the current line has been selected
167
  $marked_lines = $hl->marked();
168
  // Check if lines need to be marked as important
@@ -237,6 +243,11 @@ class CrayonFormatter {
237
  $code_settings .= ' touchscreen';
238
  }
239
 
 
 
 
 
 
240
  // Draw the plain code and toolbar
241
  $toolbar_settings = $print_plain_button = $print_copy_button = '';
242
  if (empty($error) && $hl->setting_index(CrayonSettings::TOOLBAR) != 2) {
@@ -260,8 +271,9 @@ class CrayonFormatter {
260
  $toolbar_settings .= '';
261
  }
262
 
263
- $print_plain_button = $hl->setting_val(CrayonSettings::PLAIN_TOGGLE) ? '<a class="crayon-plain-button crayon-button" title="'.crayon__('Toggle Plain Code').'"></a>' : '';
264
  $print_wrap_button = $hl->setting_val(CrayonSettings::WRAP_TOGGLE) ? '<a class="crayon-wrap-button crayon-button" title="'.crayon__('Toggle Line Wrap').'"></a>' : '';
 
265
  $print_copy_button = !$touch && $hl->setting_val(CrayonSettings::PLAIN) && $hl->setting_val(CrayonSettings::COPY) ?
266
  '<a class="crayon-copy-button crayon-button" data-text="'.crayon__('Press %s to Copy, %s to Paste').'" title="'.crayon__('Copy Plain Code').'"></a>' : '';
267
  $print_popup_button = $hl->setting_val(CrayonSettings::POPUP) ?
@@ -271,7 +283,7 @@ class CrayonFormatter {
271
  /* The table is rendered invisible by CSS and enabled with JS when asked to. If JS
272
  is not enabled or fails, the toolbar won't work so there is no point to display it. */
273
  $print_plus = $hl->is_mixed() && $hl->setting_val(CrayonSettings::SHOW_MIXED) ? '<span class="crayon-mixed-highlight" title="'.crayon__('Contains Mixed Languages').'"></span>' : '';
274
- $buttons = $print_plus.$print_nums_button.$print_wrap_button.$print_copy_button.$print_popup_button.$print_plain_button.$print_lang;
275
  $toolbar = '
276
  <div class="crayon-toolbar" data-settings="'.$toolbar_settings.'" style="'.$toolbar_style.'">'.$print_title.'
277
  <div class="crayon-tools">'.$buttons.'</div></div>
@@ -331,6 +343,11 @@ class CrayonFormatter {
331
  $code_settings .= ' wrap';
332
  }
333
 
 
 
 
 
 
334
  // Determine dimensions
335
  if ($hl->setting_val(CrayonSettings::HEIGHT_SET)) {
336
  $height_style = self::dimension_style($hl, CrayonSettings::HEIGHT);
146
  // Generate the code lines and separate each line as a div
147
  $print_code = '';
148
  $print_nums = '';
149
+ $hl->line_count(preg_match_all("#(?:^|(?<=\r\n|\n))[^\r\n]*#", $code, $code_lines));
150
 
151
  // The line number to start from
152
  $start_line = $hl->setting_val(CrayonSettings::START_LINE);
163
  }
164
  }
165
  $code_line = $code_lines[0][$i - 1];
166
+
167
+ // If line is blank, add a space so the div has the correct height
168
+ if (empty($code_line)) {
169
+ $code_line = '&nbsp;';
170
+ }
171
+
172
  // Check if the current line has been selected
173
  $marked_lines = $hl->marked();
174
  // Check if lines need to be marked as important
243
  $code_settings .= ' touchscreen';
244
  }
245
 
246
+ // Disabling Popup
247
+ if (!$hl->setting_val(CrayonSettings::POPUP)) {
248
+ $code_settings .= ' no-popup';
249
+ }
250
+
251
  // Draw the plain code and toolbar
252
  $toolbar_settings = $print_plain_button = $print_copy_button = '';
253
  if (empty($error) && $hl->setting_index(CrayonSettings::TOOLBAR) != 2) {
271
  $toolbar_settings .= '';
272
  }
273
 
274
+ $print_plain_button = $hl->setting_val(CrayonSettings::PLAIN) && $hl->setting_val(CrayonSettings::PLAIN_TOGGLE) ? '<a class="crayon-plain-button crayon-button" title="'.crayon__('Toggle Plain Code').'"></a>' : '';
275
  $print_wrap_button = $hl->setting_val(CrayonSettings::WRAP_TOGGLE) ? '<a class="crayon-wrap-button crayon-button" title="'.crayon__('Toggle Line Wrap').'"></a>' : '';
276
+ $print_expand_button = $hl->setting_val(CrayonSettings::EXPAND_TOGGLE) ? '<a class="crayon-expand-button crayon-button" title="'.crayon__('Expand Code').'"></a>' : '';
277
  $print_copy_button = !$touch && $hl->setting_val(CrayonSettings::PLAIN) && $hl->setting_val(CrayonSettings::COPY) ?
278
  '<a class="crayon-copy-button crayon-button" data-text="'.crayon__('Press %s to Copy, %s to Paste').'" title="'.crayon__('Copy Plain Code').'"></a>' : '';
279
  $print_popup_button = $hl->setting_val(CrayonSettings::POPUP) ?
283
  /* The table is rendered invisible by CSS and enabled with JS when asked to. If JS
284
  is not enabled or fails, the toolbar won't work so there is no point to display it. */
285
  $print_plus = $hl->is_mixed() && $hl->setting_val(CrayonSettings::SHOW_MIXED) ? '<span class="crayon-mixed-highlight" title="'.crayon__('Contains Mixed Languages').'"></span>' : '';
286
+ $buttons = $print_plus.$print_nums_button.$print_wrap_button.$print_copy_button.$print_popup_button.$print_expand_button.$print_plain_button.$print_lang;
287
  $toolbar = '
288
  <div class="crayon-toolbar" data-settings="'.$toolbar_settings.'" style="'.$toolbar_style.'">'.$print_title.'
289
  <div class="crayon-tools">'.$buttons.'</div></div>
343
  $code_settings .= ' wrap';
344
  }
345
 
346
+ // Expand
347
+ if ($hl->setting_val(CrayonSettings::EXPAND)) {
348
+ $code_settings .= ' expand';
349
+ }
350
+
351
  // Determine dimensions
352
  if ($hl->setting_val(CrayonSettings::HEIGHT_SET)) {
353
  $height_style = self::dimension_style($hl, CrayonSettings::HEIGHT);
crayon_highlighter.class.php CHANGED
@@ -157,8 +157,6 @@ class CrayonHighlighter {
157
 
158
  if ($this->language === NULL) {
159
  $this->language_detect();
160
- // $this->language($this->setting_val(CrayonSettings::FALLBACK_LANG));
161
- // $this->language(NULL);
162
  }
163
  if ($this->needs_format) {
164
  $tmr->start();
@@ -229,11 +227,6 @@ class CrayonHighlighter {
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;
@@ -245,7 +238,6 @@ class CrayonHighlighter {
245
 
246
  if (!empty($code)) {
247
  $this->code = $code;
248
- // $this->needs_load = FALSE; // No need to load, code provided
249
  $this->needs_format = TRUE;
250
  }
251
  }
@@ -282,12 +274,6 @@ class CrayonHighlighter {
282
  $this->url = $url;
283
  $this->needs_load = TRUE;
284
  }
285
-
286
- // if (CrayonUtil::str($this->url, $url)) {
287
- // $this->needs_load = TRUE;
288
- // } else {
289
- // return $this->url;
290
- // }
291
  }
292
 
293
  function title($title = NULL) {
157
 
158
  if ($this->language === NULL) {
159
  $this->language_detect();
 
 
160
  }
161
  if ($this->needs_format) {
162
  $tmr->start();
227
  $code = preg_replace("#(?:^\\s*\\r?\\n)|(?:\\r?\\n\\s*$)#", '', $code);
228
  }
229
 
 
 
 
 
 
230
  $before = $this->setting_val(CrayonSettings::WHITESPACE_BEFORE);
231
  if ($before > 0) {
232
  $code = str_repeat("\n", $before) . $code;
238
 
239
  if (!empty($code)) {
240
  $this->code = $code;
 
241
  $this->needs_format = TRUE;
242
  }
243
  }
274
  $this->url = $url;
275
  $this->needs_load = TRUE;
276
  }
 
 
 
 
 
 
277
  }
278
 
279
  function title($title = NULL) {
crayon_settings.class.php CHANGED
@@ -103,6 +103,8 @@ class CrayonSettings {
103
  const TAG_EDITOR_SETTINGS = 'tag-editor-front-hide';
104
  const WRAP_TOGGLE = 'wrap-toggle';
105
  const WRAP = 'wrap';
 
 
106
 
107
  private static $cache_array;
108
 
@@ -227,7 +229,9 @@ class CrayonSettings {
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)
 
 
231
  );
232
 
233
  $this->set($settings);
103
  const TAG_EDITOR_SETTINGS = 'tag-editor-front-hide';
104
  const WRAP_TOGGLE = 'wrap-toggle';
105
  const WRAP = 'wrap';
106
+ const EXPAND = 'expand';
107
+ const EXPAND_TOGGLE = 'expand-toggle';
108
 
109
  private static $cache_array;
110
 
229
  new CrayonSetting(self::TAG_EDITOR_FRONT, FALSE),
230
  new CrayonSetting(self::TAG_EDITOR_SETTINGS, TRUE),
231
  new CrayonSetting(self::WRAP_TOGGLE, TRUE),
232
+ new CrayonSetting(self::WRAP, FALSE),
233
+ new CrayonSetting(self::EXPAND, FALSE),
234
+ new CrayonSetting(self::EXPAND_TOGGLE, TRUE)
235
  );
236
 
237
  $this->set($settings);
crayon_settings_wp.class.php CHANGED
@@ -75,21 +75,26 @@ class CrayonSettingsWP {
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() {
@@ -97,7 +102,7 @@ class CrayonSettingsWP {
97
  self::load_settings(TRUE);
98
  if (!self::$js_settings) {
99
  self::$js_settings = array(
100
- 'is_admin' => is_admin(),
101
  'ajaxurl' => admin_url('admin-ajax.php'),
102
  'prefix' => CrayonSettings::PREFIX,
103
  'setting' => CrayonSettings::SETTING,
@@ -112,11 +117,11 @@ class CrayonSettingsWP {
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__)
@@ -301,68 +306,68 @@ class CrayonSettingsWP {
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
@@ -472,7 +477,7 @@ class CrayonSettingsWP {
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)) {
@@ -562,7 +567,7 @@ class CrayonSettingsWP {
562
  $checked = (!array_key_exists($id, self::$options)) ? FALSE : self::$options[$id] == TRUE;
563
  $checked_str = $checked ? ' checked="checked"' : '';
564
  echo '<input id="', CrayonSettings::PREFIX, $id, '" name="', self::OPTIONS, '[', $id, ']" type="checkbox" class="'.CrayonSettings::SETTING.'" value="1"', $checked_str,
565
- ' crayon-preview="', ($preview ? 1 : 0), '" /> ', '<span>', $text, '</span>', ($line_break ? CRAYON_BR : '');
566
  }
567
 
568
  // Draws a dropdown by loading the default value (an array) from a setting
@@ -603,27 +608,26 @@ class CrayonSettingsWP {
603
 
604
  // General Fields =========================================================
605
  public static function help() {
606
- global $CRAYON_WEBSITE;
607
  if (CrayonGlobalSettings::val(CrayonSettings::HIDE_HELP)) {
608
  return;
609
  }
610
- $web = $CRAYON_WEBSITE;
611
  echo '
612
  <div id="crayon-help" class="updated settings-error crayon-help">
613
- <p><strong>Howdy, coder!</strong> Thanks for using Crayon. Use <strong>help</strong> on the top of this page to learn how to use the shortcode and basic features, or check out my <a href="#info">Twitter & Email</a>. For online help and info, visit <a target="_blank" href="'.$web,'">here</a>. <a class="crayon-help-close">X</a></p>
614
  </div>
615
  ';
616
  }
617
 
618
- public static function get_crayon_help_file() {
619
- // Load help
620
- if ( ($help = @file_get_contents(CRAYON_HELP_FILE)) !== FALSE) {
621
- $help = str_replace('{PLUGIN}', CrayonGlobalSettings::plugin_path(), $help);
622
- } else {
623
- $help = 'Help failed to load... Try <a href="#info">these</a> instead.';
624
- }
625
- return $help;
626
- }
627
 
628
  public static function help_screen() {
629
  $screen = get_current_screen();
@@ -633,20 +637,20 @@ class CrayonSettingsWP {
633
  }
634
 
635
  // Add my_help_tab if current screen is My Admin Page
636
- $screen->add_help_tab( array(
637
- 'id' => 'crayon_help_tab',
638
- 'title' => crayon__('Crayon Help'),
639
- 'content' => self::get_crayon_help_file() // TODO consider adding tranlations for help
640
- ) );
641
  }
642
 
643
  // XXX Depreciated since WP 3.3
644
- public static function cont_help($contextual_help, $screen_id, $screen) {
645
- if ($screen_id == self::$admin_page) {
646
- return self::get_crayon_help_file();
647
- }
648
- return $contextual_help;
649
- }
650
 
651
  public static function metrics() {
652
  echo '<div id="crayon-section-metrics" class="crayon-hide-inline">';
@@ -778,23 +782,39 @@ class CrayonSettingsWP {
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' : '';
@@ -951,6 +971,8 @@ class Human {
951
  echo '</span>';
952
  self::checkbox(array(CrayonSettings::POPUP, crayon__('Enable opening code in a window')));
953
  self::checkbox(array(CrayonSettings::SCROLL, crayon__('Always display scrollbars')));
 
 
954
  echo '</div>';
955
  if (!$editor) {
956
  self::checkbox(array(CrayonSettings::DECODE, crayon__('Decode HTML entities in code')));
@@ -1057,7 +1079,7 @@ class Human {
1057
  // About Fields ===========================================================
1058
 
1059
  public static function info() {
1060
- global $CRAYON_VERSION, $CRAYON_DATE, $CRAYON_AUTHOR, $CRAYON_TWITTER, $CRAYON_EMAIL, $CRAYON_AUTHOR_SITE, $CRAYON_DONATE;
1061
  echo '<a name="info"></a>';
1062
  $version = '<strong>'.crayon__('Version').':</strong> ' . $CRAYON_VERSION;
1063
  $date = $CRAYON_DATE;
@@ -1065,16 +1087,25 @@ class Human {
1065
  $translators = '<strong>'.crayon__('Translators').':</strong> ' .
1066
  'Chinese (<a href="http://smerpup.com/" target="_blank">Dezhi Liu</a>, <a href="http://neverno.me/" target="_blank">Jash Yin</a>),
1067
  Dutch (<a href="https://twitter.com/#!/chilionsnoek" target="_blank">Chilion Snoek</a>),
 
1068
  German (<a href="http://www.technologyblog.de/" target="_blank">Stephan Knau&#223;</a>),
1069
  Italian (<a href="http://www.federicobellucci.net/" target="_blank">Federico Bellucci</a>),
1070
- Lithuanian (<a href="http://www.host1free.com" target="_blank">Vincent G</a>),
1071
  Japanese (<a href="https://twitter.com/#!/west_323" target="_blank">@west_323</a>),
 
 
1072
  Russian (<a href="http://simplelib.com/" target="_blank">Minimus</a>, <a href="http://atlocal.net/" target="_blank">Di_Skyer</a>),
1073
  Spanish (<a href="http://www.hbravo.com/" target="_blank">Hermann Bravo</a>),
1074
  Turkish (<a href="http://hakanertr.wordpress.com" target="_blank">Hakan</a>)';
1075
 
1076
- $links = '<a id="twitter-icon" href="' . $CRAYON_TWITTER . '" target="_blank"></a>
1077
- <a id="gmail-icon" href="mailto:' . $CRAYON_EMAIL . '" target="_blank"></a><div id="crayon-donate"><a href="' . $CRAYON_DONATE . '" target="_blank"><img src="'.plugins_url(CRAYON_DONATE_BUTTON, __FILE__).'"></a></div>';
 
 
 
 
 
 
 
1078
 
1079
  echo '
1080
  <table id="crayon-info" border="0">
75
  wp_enqueue_style('crayon_theme_editor', plugins_url(CRAYON_THEME_EDITOR_STYLE, __FILE__), array(), $CRAYON_VERSION);
76
  }
77
 
78
+ public static function admin_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
+ self::other_scripts();
87
  }
88
 
89
+ public static function other_scripts() {
90
  global $CRAYON_VERSION;
91
+ self::load_settings(TRUE);
92
+ $deps = array('jquery', 'crayon_util_js');
93
+ if (CrayonGlobalSettings::val(CrayonSettings::POPUP) || is_admin()) {
94
+ wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array('jquery'), $CRAYON_VERSION);
95
+ $deps[] = 'crayon_jquery_popup';
96
+ }
97
+ wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), $deps, $CRAYON_VERSION);
98
  }
99
 
100
  public static function init_js_settings() {
102
  self::load_settings(TRUE);
103
  if (!self::$js_settings) {
104
  self::$js_settings = array(
105
+ 'is_admin' => intval(is_admin()),
106
  'ajaxurl' => admin_url('admin-ajax.php'),
107
  'prefix' => CrayonSettings::PREFIX,
108
  'setting' => CrayonSettings::SETTING,
117
 
118
  public static function init_admin_js_settings() {
119
  if (!self::$admin_js_settings) {
120
+ $themes_ = CrayonResources::themes()->get();
121
+ $themes = array();
122
+ foreach ($themes_ as $theme) {
123
+ $themes[$theme->id()] = $theme->name();
124
+ }
125
  self::$admin_js_settings = array(
126
  'themes' => $themes,
127
  'themes_url' => plugins_url(CRAYON_THEME_DIR, __FILE__)
306
  self::save_posts();
307
  }
308
 
309
+ // Crayon legacy posts
310
+
311
+ /**
312
+ * This loads the posts marked as containing Crayons
313
+ */
314
+ public static function load_legacy_posts() {
315
+ if (self::$crayon_legacy_posts === NULL) {
316
+ // Load from db
317
+ if (!(self::$crayon_legacy_posts = get_option(self::LEGACY_POSTS))) {
318
+ // Posts don't exist! Scan for them. This will fill self::$crayon_legacy_posts
319
+ self::$crayon_legacy_posts = CrayonWP::scan_legacy_posts();
320
+ update_option(self::LEGACY_POSTS, self::$crayon_legacy_posts);
321
+ }
322
+ }
323
+ return self::$crayon_legacy_posts;
324
+ }
325
+
326
+ /**
327
+ * This looks through all posts and marks those which contain Crayons
328
+ */
329
+ // public static function scan_and_save_posts() {
330
+ // self::save_posts(CrayonWP::scan_posts(TRUE, TRUE));
331
+ // }
332
+
333
+ /**
334
+ * Saves the marked posts to the db
335
+ */
336
+ public static function save_legacy_posts($posts = NULL) {
337
+ if ($posts === NULL) {
338
+ $posts = self::$crayon_legacy_posts;
339
+ }
340
+ update_option(self::LEGACY_POSTS, $posts);
341
+ self::load_legacy_posts();
342
+ }
343
+
344
+ /**
345
+ * Adds a post as containing a Crayon
346
+ */
347
+ public static function add_legacy_post($id) {
348
+ self::load_legacy_posts();
349
+ if (!in_array($id, self::$crayon_legacy_posts)) {
350
+ self::$crayon_legacy_posts[] = $id;
351
+ }
352
+ self::save_legacy_posts();
353
+ }
354
+
355
+ /**
356
+ * Removes a post as not containing a Crayon
357
+ */
358
+ public static function remove_legacy_post($id) {
359
+ self::load_legacy_posts();
360
+ $key = array_search($id, self::$crayon_legacy_posts);
361
+ if ($key === false) {
362
+ return;
363
+ }
364
+ unset(self::$crayon_legacy_posts[$key]);
365
+ self::save_legacy_posts();
366
  }
367
 
368
+ public static function remove_legacy_posts() {
369
+ self::$crayon_legacy_posts = array();
370
+ self::save_legacy_posts();
371
  }
372
 
373
  // Cache
477
  }
478
  // Refresh internal tag management
479
  if (array_key_exists('refresh_tags', $inputs)) {
480
+ CrayonWP::refresh_posts();
481
  }
482
  // Clear the log if needed
483
  if (array_key_exists(self::LOG_CLEAR, $_POST)) {
567
  $checked = (!array_key_exists($id, self::$options)) ? FALSE : self::$options[$id] == TRUE;
568
  $checked_str = $checked ? ' checked="checked"' : '';
569
  echo '<input id="', CrayonSettings::PREFIX, $id, '" name="', self::OPTIONS, '[', $id, ']" type="checkbox" class="'.CrayonSettings::SETTING.'" value="1"', $checked_str,
570
+ ' crayon-preview="', ($preview ? 1 : 0), '" /> ', '<label for="', CrayonSettings::PREFIX, $id, '">', $text, '</label>', ($line_break ? CRAYON_BR : '');
571
  }
572
 
573
  // Draws a dropdown by loading the default value (an array) from a setting
608
 
609
  // General Fields =========================================================
610
  public static function help() {
611
+ global $CRAYON_WEBSITE, $CRAYON_TWITTER, $CRAYON_GIT, $CRAYON_PLUGIN_WP;
612
  if (CrayonGlobalSettings::val(CrayonSettings::HIDE_HELP)) {
613
  return;
614
  }
 
615
  echo '
616
  <div id="crayon-help" class="updated settings-error crayon-help">
617
+ <p><strong>Howdy, coder!</strong> Thanks for using Crayon. <strong>Useful Links:</strong> <a href="'.$CRAYON_WEBSITE.'" target="_blank">Documentation</a>, <a href="'.$CRAYON_GIT.'" target="_blank">GitHub</a>, <a href="'.$CRAYON_PLUGIN_WP.'" target="_blank">Plugin Page</a>, <a href="'.$CRAYON_TWITTER.'" target="_blank">Twitter</a>. <a class="crayon-help-close">X</a></p>
618
  </div>
619
  ';
620
  }
621
 
622
+ // public static function get_crayon_help_file() {
623
+ // // Load help
624
+ // if ( ($help = @file_get_contents(CRAYON_HELP_FILE)) !== FALSE) {
625
+ // $help = str_replace('{PLUGIN}', CrayonGlobalSettings::plugin_path(), $help);
626
+ // } else {
627
+ // $help = 'Help failed to load... Try <a href="#info">these</a> instead.';
628
+ // }
629
+ // return $help;
630
+ // }
631
 
632
  public static function help_screen() {
633
  $screen = get_current_screen();
637
  }
638
 
639
  // Add my_help_tab if current screen is My Admin Page
640
+ // $screen->add_help_tab( array(
641
+ // 'id' => 'crayon_help_tab',
642
+ // 'title' => crayon__('Crayon Help'),
643
+ // 'content' => self::get_crayon_help_file() // TODO consider adding tranlations for help
644
+ // ) );
645
  }
646
 
647
  // XXX Depreciated since WP 3.3
648
+ // public static function cont_help($contextual_help, $screen_id, $screen) {
649
+ // if ($screen_id == self::$admin_page) {
650
+ // return self::get_crayon_help_file();
651
+ // }
652
+ // return $contextual_help;
653
+ // }
654
 
655
  public static function metrics() {
656
  echo '<div id="crayon-section-metrics" class="crayon-hide-inline">';
782
  echo self::help_button('http://bit.ly/NQfZN5');
783
  echo '<div id="crayon-subsection-posts-info"></div>';
784
  }
785
+
786
+ public static function post_cmp($a, $b) {
787
+ $a = $a->post_modified;
788
+ $b = $b->post_modified;
789
+ if ($a == $b) {
790
+ return 0;
791
+ } else {
792
+ return $a < $b ? 1 : -1;
793
+ }
794
+ }
795
 
796
  public static function show_posts() {
797
+ $postIDs = self::load_posts();
798
  $legacy_posts = self::load_legacy_posts();
799
  // Avoids O(n^2) by using a hash map, tradeoff in using strval
800
  $legacy_map = array();
801
  foreach ($legacy_posts as $legacyID) {
802
  $legacy_map[strval($legacyID)] = TRUE;
803
  }
 
804
 
805
  echo '<table class="crayon-table" cellspacing="0" cellpadding="0"><tr class="crayon-table-header">',
806
  '<td>', crayon__('ID'), '</td><td>', crayon__('Title'), '</td><td>', crayon__('Posted'), '</td><td>', crayon__('Modifed'), '</td><td>', crayon__('Contains Legacy Tags?'), '</td></tr>';
807
 
808
+ $posts = array();
809
+ for ($i = 0; $i < count($postIDs); $i++) {
810
+ $posts[$i] = get_post($postIDs[$i]);
811
+ }
812
+
813
+ usort($posts, 'CrayonSettingsWP::post_cmp');
814
+
815
  for ($i = 0; $i < count($posts); $i++) {
816
+ $post = $posts[$i];
817
+ $postID = $post->ID;
818
  $title = $post->post_title;
819
  $title = !empty($title) ? $title : 'N/A';
820
  $tr = ($i == count($posts) - 1) ? 'crayon-table-last' : '';
971
  echo '</span>';
972
  self::checkbox(array(CrayonSettings::POPUP, crayon__('Enable opening code in a window')));
973
  self::checkbox(array(CrayonSettings::SCROLL, crayon__('Always display scrollbars')));
974
+ self::checkbox(array(CrayonSettings::EXPAND, crayon__('Expand code beyond page borders on mouseover')));
975
+ self::checkbox(array(CrayonSettings::EXPAND_TOGGLE, crayon__('Enable code expanding toggling when possible')));
976
  echo '</div>';
977
  if (!$editor) {
978
  self::checkbox(array(CrayonSettings::DECODE, crayon__('Decode HTML entities in code')));
1079
  // About Fields ===========================================================
1080
 
1081
  public static function info() {
1082
+ global $CRAYON_VERSION, $CRAYON_DATE, $CRAYON_AUTHOR, $CRAYON_WEBSITE, $CRAYON_TWITTER, $CRAYON_GIT, $CRAYON_PLUGIN_WP, $CRAYON_AUTHOR_SITE, $CRAYON_EMAIL, $CRAYON_DONATE;
1083
  echo '<a name="info"></a>';
1084
  $version = '<strong>'.crayon__('Version').':</strong> ' . $CRAYON_VERSION;
1085
  $date = $CRAYON_DATE;
1087
  $translators = '<strong>'.crayon__('Translators').':</strong> ' .
1088
  'Chinese (<a href="http://smerpup.com/" target="_blank">Dezhi Liu</a>, <a href="http://neverno.me/" target="_blank">Jash Yin</a>),
1089
  Dutch (<a href="https://twitter.com/#!/chilionsnoek" target="_blank">Chilion Snoek</a>),
1090
+ French (<a href="http://tech.dupeu.pl" target="_blank">Victor Felder</a>),
1091
  German (<a href="http://www.technologyblog.de/" target="_blank">Stephan Knau&#223;</a>),
1092
  Italian (<a href="http://www.federicobellucci.net/" target="_blank">Federico Bellucci</a>),
 
1093
  Japanese (<a href="https://twitter.com/#!/west_323" target="_blank">@west_323</a>),
1094
+ Lithuanian (<a href="http://www.host1free.com" target="_blank">Vincent G</a>),
1095
+ Portuguese (<a href="http://www.adonai.eti.br" target="_blank">Adonai S. Canez</a>),
1096
  Russian (<a href="http://simplelib.com/" target="_blank">Minimus</a>, <a href="http://atlocal.net/" target="_blank">Di_Skyer</a>),
1097
  Spanish (<a href="http://www.hbravo.com/" target="_blank">Hermann Bravo</a>),
1098
  Turkish (<a href="http://hakanertr.wordpress.com" target="_blank">Hakan</a>)';
1099
 
1100
+ $links = '
1101
+ <a id="docs-icon" class="small-icon" title="Documentation" href="' . $CRAYON_WEBSITE . '" target="_blank"></a>
1102
+ <a id="git-icon" class="small-icon" title="GitHub" href="' . $CRAYON_GIT . '" target="_blank"></a>
1103
+ <a id="wp-icon" class="small-icon" title="Plugin Page" href="' . $CRAYON_PLUGIN_WP . '" target="_blank"></a>
1104
+ <a id="twitter-icon" class="small-icon" title="Twitter" href="' . $CRAYON_TWITTER . '" target="_blank"></a>
1105
+ <a id="gmail-icon" class="small-icon" title="Email" href="mailto:' . $CRAYON_EMAIL . '" target="_blank"></a>
1106
+ <div id="crayon-donate"><a href="' . $CRAYON_DONATE . '" title="Donate" target="_blank">
1107
+ <img src="'.plugins_url(CRAYON_DONATE_BUTTON, __FILE__).'"></a>
1108
+ </div>';
1109
 
1110
  echo '
1111
  <table id="crayon-info" border="0">
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.15
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  Text Domain: crayon-syntax-highlighter
@@ -26,1154 +26,1157 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
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')) {
37
- // Used to get plugin version info
38
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
39
- crayon_set_info(get_plugin_data( __FILE__ ));
40
  }
41
 
42
  /* The plugin class that manages all other classes and integrates Crayon with WP */
43
  class CrayonWP {
44
- // Properties and Constants ===============================================
45
-
46
- // Associative array, keys are post IDs as strings and values are number of crayons parsed as ints
47
- private static $post_queue = array();
48
- // Ditto for comments
49
- private static $comment_queue = array();
50
- private static $post_captures = array();
51
- private static $comment_captures = array();
52
- // Whether we are displaying an excerpt
53
- private static $is_excerpt = FALSE;
54
- // Whether we have added styles and scripts
55
- private static $enqueued = FALSE;
56
- // Whether we have already printed the wp head
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(
67
- CrayonSettings::CAPTURE_MINI_TAG,
68
- CrayonSettings::CAPTURE_PRE,
69
- CrayonSettings::INLINE_TAG,
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="" /]
78
- const REGEX_TAG = '(?:\[\s*crayon(?:-(\w+))?\b([^\]]*)\][\r\n]*?(.*?)[\r\n]*?\[\s*/\s*crayon\s*\])'; // [crayon atts=""] ... [/crayon]
79
- const REGEX_INLINE_CLASS = '\bcrayon-inline\b';
80
-
81
- const REGEX_CLOSED_NO_CAPTURE = '(?:\[\s*crayon\b[^\]]*/\])';
82
- const REGEX_TAG_NO_CAPTURE = '(?:\[\s*crayon\b[^\]]*\][\r\n]*?.*?[\r\n]*?\[/crayon\])';
83
-
84
- const REGEX_QUICK_CAPTURE = '(?:\[\s*crayon[^\]]*\].*?\[\s*/\s*crayon\s*\])|(?:\[\s*crayon[^\]]*/\s*\])';
85
-
86
- const REGEX_BETWEEN_PARAGRAPH = '<p[^<]*>(?:[^<]*<(?!/?p(\s+[^>]*)?>)[^>]+(\s+[^>]*)?>)*[^<]*((?:\[\s*crayon[^\]]*\].*?\[\s*/\s*crayon\s*\])|(?:\[\s*crayon[^\]]*/\s*\]))(?:[^<]*<(?!/?p(\s+[^>]*)?>)[^>]+(\s+[^>]*)?>)*[^<]*</p[^<]*>';
87
- const REGEX_BETWEEN_PARAGRAPH_SIMPLE = '(<p(?:\s+[^>]*)?>)(.*?)(</p(?:\s+[^>]*)?>)';
88
-
89
- // For [crayon-id/]
90
- const REGEX_BR_BEFORE = '#<\s*br\s*/?\s*>\s*(\[\s*crayon-\w+\])#msi';
91
- const REGEX_BR_AFTER = '#(\[\s*crayon-\w+\])\s*<\s*br\s*/?\s*>#msi';
92
-
93
- const REGEX_ID = '#(?<!\$)\[\s*crayon#mi';
94
- //const REGEX_WITH_ID = '#(\[\s*crayon-\w+)\b([^\]]*["\'])(\s*/?\s*\])#mi';
95
- const REGEX_WITH_ID = '#\[\s*(crayon-\w+)\b[^\]]*\]#mi';
96
-
97
- const MODE_NORMAL = 0, MODE_JUST_CODE = 1, MODE_PLAIN_CODE = 2;
98
-
99
-
100
- //const TAGS = array(CrayonSettings::CAPTURE_MINI_TAG => 1 | 1);
101
-
102
- // Public Methods =========================================================
103
-
104
- public static function post_captures() {
105
- return self::$post_queue;
106
- }
107
-
108
- // Methods ================================================================
109
-
110
- private function __construct() {
111
- }
112
-
113
- public static function regex() {
114
- return '#(?<!\$)(?:'. self::REGEX_CLOSED .'|'. self::REGEX_TAG .')(?!\$)#msi';
115
- }
116
-
117
- public static function regex_with_id($id) {
118
- return '#\[\s*(crayon-'.$id.')\b[^\]]*\]#mi';
119
- }
120
-
121
- public static function regex_no_capture() {
122
- return '#(?<!\$)(?:'. self::REGEX_CLOSED_NO_CAPTURE .'|'. self::REGEX_TAG_NO_CAPTURE .')(?!\$)#msi';
123
- }
124
-
125
- /**
126
- * Adds the actual Crayon instance.
127
- * $mode can be: 0 = return crayon content, 1 = return only code, 2 = return only plain code
128
- */
129
- public static function shortcode($atts, $content = NULL, $id = NULL) {
130
- CrayonLog::debug('shortcode');
131
-
132
- // Load attributes from shortcode
133
- $allowed_atts = array('url' => NULL, 'lang' => NULL, 'title' => NULL, 'mark' => NULL, 'range' => NULL, 'inline' => NULL);
134
- $filtered_atts = shortcode_atts($allowed_atts, $atts);
135
-
136
- // Clean attributes
137
- $keys = array_keys($filtered_atts);
138
- for ($i = 0; $i < count($keys); $i++) {
139
- $key = $keys[$i];
140
- $value = $filtered_atts[$key];
141
- if ($value !== NULL) {
142
- $filtered_atts[$key] = trim(strip_tags($value));
143
- }
144
- }
145
-
146
- // Contains all other attributes not found in allowed, used to override global settings
147
- $extra_attr = array();
148
- if (!empty($atts)) {
149
- $extra_attr = array_diff_key($atts, $allowed_atts);
150
- $extra_attr = CrayonSettings::smart_settings($extra_attr);
151
- }
152
- $url = $lang = $title = $mark = $range = $inline = '';
153
- extract($filtered_atts);
154
-
155
- $crayon = self::instance($extra_attr, $id);
156
-
157
- // Set URL
158
- $crayon->url($url);
159
- $crayon->code($content);
160
- // Set attributes, should be set after URL to allow language auto detection
161
- $crayon->language($lang);
162
- $crayon->title($title);
163
- $crayon->marked($mark);
164
- $crayon->range($range);
165
-
166
- $crayon->is_inline($inline);
167
-
168
- // Determine if we should highlight
169
- $highlight = array_key_exists('highlight', $atts) ? CrayonUtil::str_to_bool($atts['highlight'], FALSE) : TRUE;
170
- $crayon->is_highlighted($highlight);
171
- return $crayon;
172
- }
173
-
174
- /* Returns Crayon instance */
175
- public static function instance($extra_attr = array(), $id = NULL) {
176
- CrayonLog::debug('instance');
177
-
178
- // Create Crayon
179
- $crayon = new CrayonHighlighter();
180
-
181
- /* Load settings and merge shortcode attributes which will override any existing.
182
- * Stores the other shortcode attributes as settings in the crayon. */
183
- if (!empty($extra_attr)) {
184
- $crayon->settings($extra_attr);
185
- }
186
- if (!empty($id)) {
187
- $crayon->id($id);
188
- }
189
-
190
- return $crayon;
191
- }
192
-
193
- /* For manually highlighting code, useful for other PHP contexts */
194
- public static function highlight($code) {
195
- $crayon_str = '';
196
-
197
- $captures = CrayonWP::capture_crayons(0, $code);
198
- $the_captures = $captures['capture'];
199
- $the_content = $captures['content'];
200
- foreach ($the_captures as $capture) {
201
- $id = $capture['id'];
202
- $atts = $capture['atts'];
203
- $no_enqueue = array(
204
- CrayonSettings::ENQUEUE_THEMES => FALSE,
205
- CrayonSettings::ENQUEUE_FONTS => FALSE);
206
- $atts = array_merge($atts, $no_enqueue);
207
- $code = $capture['code'];
208
- $crayon = CrayonWP::shortcode($atts, $code, $id);
209
- $crayon_formatted = $crayon->output(TRUE, FALSE);
210
- $the_content = CrayonUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $the_content, 1, $count);
211
- }
212
-
213
- return $the_content;
214
- }
215
-
216
- /* Uses the main query */
217
- public static function wp() {
218
- CrayonLog::debug('wp (global)');
219
-
220
- global $wp_the_query;
221
- $posts = $wp_the_query->posts;
222
- self::the_posts($posts);
223
- }
224
-
225
- // TODO put args into an array
226
- public static function capture_crayons($wp_id, $wp_content, $extra_settings = array(), $args = array()) {
227
- extract($args);
228
- CrayonUtil::set_var($callback, NULL);
229
- CrayonUtil::set_var($ignore, TRUE);
230
- CrayonUtil::set_var($preserve_atts, FALSE);
231
- CrayonUtil::set_var($flags, NULL);
232
-
233
- // Will contain captured crayons and altered $wp_content
234
- $capture = array('capture' => array(), 'content' => $wp_content, 'has_captured' => FALSE);
235
-
236
- // Flags for which Crayons to convert
237
- $in_flag = self::in_flag($flags);
238
-
239
- CrayonLog::debug('capture for id ' . $wp_id . ' len ' . strlen($wp_content));
240
-
241
- // Convert <pre> tags to crayon tags, if needed
242
- if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_PRE) && $in_flag[CrayonSettings::CAPTURE_PRE]) {
243
- // XXX This will fail if <pre></pre> is used inside another <pre></pre>
244
- $wp_content = preg_replace_callback('#(?<!\$)<\s*pre(?=(?:([^>]*)\bclass\s*=\s*(["\'])(.*?)\2([^>]*))?)([^>]*)>(.*?)<\s*/\s*pre\s*>#msi', 'CrayonWP::pre_tag', $wp_content);
245
- }
246
-
247
- // Convert mini [php][/php] tags to crayon tags, if needed
248
- if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG) && $in_flag[CrayonSettings::CAPTURE_MINI_TAG]) {
249
- $wp_content = preg_replace('#(?<!\$)\[\s*('.self::$alias_regex.')\b([^\]]*)\](.*?)\[\s*/\s*(?:\1)\s*\](?!\$)#msi', '[crayon lang="\1" \2]\3[/crayon]', $wp_content);
250
- $wp_content = preg_replace('#(?<!\$)\[\s*('.self::$alias_regex.')\b([^\]]*)/\s*\](?!\$)#msi', '[crayon lang="\1" \2 /]', $wp_content);
251
- }
252
-
253
- // Convert inline {php}{/php} tags to crayon tags, if needed
254
- if (CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG) && $in_flag[CrayonSettings::INLINE_TAG]) {
255
- $wp_content = preg_replace('#(?<!\$)\{\s*('.self::$alias_regex.')\b([^\}]*)\}(.*?)\{/(?:\1)\}(?!\$)#msi', '[crayon lang="\1" inline="true" \2]\3[/crayon]', $wp_content);
256
- // Convert <span class="crayon-inline"> tags to inline crayon tags
257
- $wp_content = preg_replace_callback('#(?<!\$)<\s*span([^>]*)\bclass\s*=\s*(["\'])(.*?)\2([^>]*)>(.*?)<\s*/\s*span\s*>#msi', 'CrayonWP::span_tag', $wp_content);
258
- }
259
-
260
- // Convert [plain] tags into <pre><code></code></pre>, if needed
261
- if (CrayonGlobalSettings::val(CrayonSettings::PLAIN_TAG) && $in_flag[CrayonSettings::PLAIN_TAG]) {
262
- $wp_content = preg_replace_callback('#(?<!\$)\[\s*plain\s*\](.*?)\[\s*/\s*plain\s*\]#msi', 'CrayonFormatter::plain_code', $wp_content);
263
- }
264
-
265
- // Add IDs to the Crayons
266
- CrayonLog::debug('capture adding id ' . $wp_id . ' , now has len ' . strlen($wp_content));
267
- $wp_content = preg_replace_callback(self::REGEX_ID, 'CrayonWP::add_crayon_id', $wp_content);
268
-
269
- CrayonLog::debug('capture added id ' . $wp_id . ' : ' . strlen($wp_content));
270
-
271
- // Only include if a post exists with Crayon tag
272
- preg_match_all(self::regex(), $wp_content, $matches);
273
-
274
- CrayonLog::debug('capture ignore for id ' . $wp_id . ' : ' . strlen($capture['content']) . ' vs ' . strlen($wp_content));
275
-
276
- if ( count($matches[0]) != 0 ) {
277
-
278
- // Crayons found! Load settings first to ensure global settings loaded
279
- CrayonSettingsWP::load_settings();
280
- $capture['has_captured'] = TRUE;
281
-
282
- CrayonLog::debug('CAPTURED FOR ID ' . $wp_id);
283
-
284
- $full_matches = $matches[0];
285
- $closed_ids = $matches[1];
286
- $closed_atts = $matches[2];
287
- $open_ids = $matches[3];
288
- $open_atts = $matches[4];
289
- $contents = $matches[5];
290
-
291
- // Make sure we enqueue the styles/scripts
292
- $enqueue = TRUE;
293
-
294
- for ($i = 0; $i < count($full_matches); $i++) {
295
- // Get attributes
296
- if ( !empty($closed_atts[$i]) ) {
297
- $atts = $closed_atts[$i];
298
- } else if ( !empty($open_atts[$i]) ) {
299
- $atts = $open_atts[$i];
300
- } else {
301
- $atts = '';
302
- }
303
-
304
- // Capture attributes
305
- preg_match_all('#([^="\'\s]+)[\t ]*=[\t ]*("|\')(.*?)\2#', $atts, $att_matches);
306
- // Add extra attributes
307
- $atts_array = $extra_settings;
308
- if ( count($att_matches[0]) != 0 ) {
309
- for ($j = 0; $j < count($att_matches[1]); $j++) {
310
- $atts_array[trim(strtolower($att_matches[1][$j]))] = trim($att_matches[3][$j]);
311
- }
312
- }
313
-
314
- // Capture theme
315
- $theme_id = array_key_exists(CrayonSettings::THEME, $atts_array) ? $atts_array[CrayonSettings::THEME] : '';
316
- $theme = CrayonResources::themes()->get($theme_id);
317
- // If theme not found, use fallbacks
318
- if (!$theme) {
319
- // Given theme is invalid, try global setting
320
- $theme_id = CrayonGlobalSettings::val(CrayonSettings::THEME);
321
- $theme = CrayonResources::themes()->get($theme_id);
322
- if (!$theme) {
323
- // Global setting is invalid, fall back to default
324
- $theme = CrayonResources::themes()->get_default();
325
- $theme_id = CrayonThemes::DEFAULT_THEME;
326
- }
327
- }
328
- // If theme is now valid, change the array
329
- if ($theme) {
330
- if (!$preserve_atts || isset($atts_array[CrayonSettings::THEME])) {
331
- $atts_array[CrayonSettings::THEME] = $theme_id;
332
- }
333
- $theme->used(TRUE);
334
- }
335
-
336
- // Capture font
337
- $font_id = array_key_exists(CrayonSettings::FONT, $atts_array) ? $atts_array[CrayonSettings::FONT] : '';
338
- $font = CrayonResources::fonts()->get($font_id);
339
- // If font not found, use fallbacks
340
- if (!$font) {
341
- // Given font is invalid, try global setting
342
- $font_id = CrayonGlobalSettings::val(CrayonSettings::FONT);
343
- $font = CrayonResources::fonts()->get($font_id);
344
- if (!$font) {
345
- // Global setting is invalid, fall back to default
346
- $font = CrayonResources::fonts()->get_default();
347
- $font_id = CrayonFonts::DEFAULT_FONT;
348
- }
349
- }
350
-
351
- // If font is now valid, change the array
352
- if ($font/* != NULL && $font_id != CrayonFonts::DEFAULT_FONT*/) {
353
- if (!$preserve_atts || isset($atts_array[CrayonSettings::FONT])) {
354
- $atts_array[CrayonSettings::FONT] = $font_id;
355
- }
356
- $font->used(TRUE);
357
- }
358
-
359
- // Add array of atts and content to post queue with key as post ID
360
- // XXX If at this point no ID is added we have failed!
361
- $id = !empty($open_ids[$i]) ? $open_ids[$i] : $closed_ids[$i];
362
- //if ($ignore) {
363
- $code = self::crayon_remove_ignore($contents[$i]);
364
- //}
365
- $c = array('post_id'=>$wp_id, 'atts'=>$atts_array, 'code'=>$code);
366
- $capture['capture'][$id] = $c;
367
- CrayonLog::debug('capture finished for post id ' . $wp_id . ' crayon-id ' . $id . ' atts: ' . count($atts_array) . ' code: ' . strlen($code));
368
- $is_inline = isset($atts_array['inline']) && CrayonUtil::str_to_bool($atts_array['inline'], FALSE) ? '-i' : '';
369
- if ($callback === NULL) {
370
- $wp_content = str_replace($full_matches[$i], '[crayon-'.$id.$is_inline.'/]', $wp_content);
371
- } else {
372
- $wp_content = call_user_func($callback, $c, $full_matches[$i], $id, $is_inline, $wp_content);
373
- }
374
- }
375
-
376
- }
377
-
378
- if ($ignore) {
379
- // We need to escape ignored Crayons, since they won't be captured
380
- // XXX Do this after replacing the Crayon with the shorter ID tag, otherwise $full_matches will be different from $wp_content
381
- $wp_content = self::crayon_remove_ignore($wp_content);
382
- }
383
-
384
- // Convert `` backquote tags into <code></code>, if needed
385
- // XXX Some code may contain `` so must do it after all Crayons are captured
386
- if (CrayonGlobalSettings::val(CrayonSettings::BACKQUOTE)) {
387
- $wp_content = preg_replace('#(?<!\\\\)`([^`]*)`#msi', '<code>$1</code>', $wp_content);
388
- }
389
-
390
- $capture['content'] = $wp_content;
391
- return $capture;
392
- }
393
-
394
- /* Search for Crayons in posts and queue them for creation */
395
- public static function the_posts($posts) {
396
- CrayonLog::debug('the_posts');
397
-
398
- // Whether to enqueue syles/scripts
399
- $enqueue = FALSE;
400
- CrayonSettingsWP::load_settings(TRUE); // Load just the settings from db, for now
401
-
402
- self::init_tags_regex();
403
- $crayon_posts = CrayonSettingsWP::load_posts(); // Loads posts containing crayons
404
-
405
- // Search for shortcode in posts
406
- foreach ($posts as $post) {
407
- $wp_id = $post->ID;
408
- if (!in_array($wp_id, $crayon_posts)) {
409
- // If we get query for a page, then that page might have a template and load more posts containing Crayons
410
- // By this state, we would be unable to enqueue anything (header already written).
411
- if (CrayonGlobalSettings::val(CrayonSettings::SAFE_ENQUEUE) && is_page($wp_id)) {
412
- CrayonGlobalSettings::set(CrayonSettings::ENQUEUE_THEMES, false);
413
- CrayonGlobalSettings::set(CrayonSettings::ENQUEUE_FONTS, false);
414
- }
415
- // Only include crayon posts
416
- continue;
417
- }
418
-
419
- $id_str = strval($wp_id);
420
-
421
- if (wp_is_post_revision($wp_id)) {
422
- // Ignore post revisions, use the parent, which has the updated post content
423
- continue;
424
- }
425
-
426
- if ( isset(self::$post_captures[$id_str]) ) {
427
- // Don't capture twice
428
- // XXX post->post_content is reset each loop, replace content
429
- // Doing this might cause content changed by other plugins between the last loop
430
- // to fail, so be cautious
431
- $post->post_content = self::$post_captures[$id_str];
432
- continue;
433
- }
434
- // Capture post Crayons
435
- $captures = self::capture_crayons(intval($post->ID), $post->post_content);
436
-
437
- // XXX Careful not to undo changes by other plugins
438
- // XXX Must replace to remove $ for ignored Crayons
439
- $post->post_content = $captures['content'];
440
- self::$post_captures[$id_str] = $captures['content'];
441
- if ($captures['has_captured'] === TRUE) {
442
- $enqueue = TRUE;
443
- self::$post_queue[$id_str] = array();
444
- foreach ($captures['capture'] as $capture_id=>$capture_content) {
445
- self::$post_queue[$id_str][$capture_id] = $capture_content;
446
- }
447
- }
448
-
449
- // Search for shortcode in comments
450
- if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
451
- $comments = get_comments(array('post_id' => $post->ID));
452
- foreach ($comments as $comment) {
453
- $id_str = strval($comment->comment_ID);
454
- if ( isset(self::$comment_queue[$id_str]) ) {
455
- // Don't capture twice
456
- continue;
457
- }
458
- // Capture comment Crayons, decode their contents if decode not specified
459
- $captures = self::capture_crayons($comment->comment_ID, $comment->comment_content, array(CrayonSettings::DECODE => TRUE));
460
- self::$comment_captures[$id_str] = $captures['content'];
461
- if ($captures['has_captured'] === TRUE) {
462
- $enqueue = TRUE;
463
- self::$comment_queue[$id_str] = array();
464
- foreach ($captures['capture'] as $capture_id=>$capture_content) {
465
- self::$comment_queue[$id_str][$capture_id] = $capture_content;
466
- }
467
- }
468
- }
469
- }
470
- }
471
-
472
- if (!is_admin() && $enqueue && !self::$enqueued) {
473
- // Crayons have been found and we enqueue efficiently
474
- self::enqueue_resources();
475
- }
476
-
477
- return $posts;
478
- }
479
-
480
- private static function add_crayon_id($content) {
481
- $uid = $content[0].'-'.uniqid();
482
- CrayonLog::debug('add_crayon_id ' . $uid);
483
- return $uid;
484
- }
485
-
486
- private static function get_crayon_id() {
487
- return self::$next_id++;
488
- }
489
-
490
- private static function enqueue_resources() {
491
- CrayonLog::debug('enqueue');
492
-
493
- global $CRAYON_VERSION;
494
- wp_enqueue_style('crayon_style', plugins_url(CRAYON_STYLE, __FILE__), array(), $CRAYON_VERSION);
495
- wp_enqueue_style('crayon_global_style', plugins_url(CRAYON_STYLE_GLOBAL, __FILE__), array(), $CRAYON_VERSION);
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
-
516
- if ( ($in_flag[CrayonSettings::CAPTURE_MINI_TAG] && CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG)) ||
517
- ($in_flag[CrayonSettings::INLINE_TAG] && CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG)) ) {
518
- $aliases = CrayonResources::langs()->ids_and_aliases();
519
- for ($i = 0; $i < count($aliases); $i++) {
520
- $alias = $aliases[$i];
521
- $alias_regex = CrayonUtil::esc_hash(CrayonUtil::esc_regex($alias));
522
- if ($i != count($aliases) - 1) {
523
- $alias_regex .= '|';
524
- }
525
- self::$alias_regex .= $alias_regex;
526
- }
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)',
534
- CrayonSettings::CAPTURE_PRE => '(<\s*pre\b)',
535
- CrayonSettings::INLINE_TAG => '('.self::REGEX_INLINE_CLASS.')'.'|([\{]\s*('.self::$alias_regex.'))',
536
- CrayonSettings::PLAIN_TAG => '(\s*\[\s*plain\b)',
537
- CrayonSettings::BACKQUOTE => '(`[^`]*`)'
538
- );
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
-
549
- private static function init_tag_bits() {
550
- if (count(self::$tag_bits) == 0) {
551
- $values = array();
552
- for ($i = 0; $i < count(self::$tag_types); $i++) {
553
- $j = pow(2, $i);
554
- self::$tag_bits[self::$tag_types[$i]] = $j;
555
- }
556
- }
557
- }
558
-
559
- public static function tag_bit($tag) {
560
- self::init_tag_bits();
561
- if (isset(self::$tag_bits[$tag])) {
562
- return self::$tag_bits[$tag];
563
- } else {
564
- return null;
565
- }
566
- }
567
-
568
- public static function in_flag($flags) {
569
- $in_flag = array();
570
- foreach (self::$tag_types as $tag) {
571
- $in_flag[$tag] = $flags === NULL || ($flags & self::tag_bit($tag)) > 0;
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) {
589
- CrayonLog::debug('the_content');
590
-
591
- // Some themes make redundant queries and don't need extra work...
592
- if (strlen($the_content) == 0) {
593
- CrayonLog::debug('the_content blank');
594
- return $the_content;
595
- }
596
-
597
- global $post;
598
-
599
- // Go through queued posts and find crayons
600
- $post_id = strval($post->ID);
601
-
602
- if (self::$is_excerpt) {
603
- CrayonLog::debug('excerpt');
604
- if (CrayonGlobalSettings::val(CrayonSettings::EXCERPT_STRIP)) {
605
- CrayonLog::debug('excerpt strip');
606
- // Remove Crayon from content if we are displaying an excerpt
607
- $the_content = preg_replace(self::REGEX_WITH_ID, '', $the_content);
608
- }
609
- // Otherwise Crayon remains with ID and replaced later
610
- return $the_content;
611
- }
612
-
613
- // Find if this post has Crayons
614
- if ( array_key_exists($post_id, self::$post_queue) ) {
615
- // XXX We want the plain post content, no formatting
616
- $the_content_original = $the_content;
617
-
618
- // Replacing may cause <p> tags to become disjoint with a <div> inside them, close and reopen them if needed
619
- $the_content = preg_replace_callback('#' . self::REGEX_BETWEEN_PARAGRAPH_SIMPLE . '#msi', 'CrayonWP::add_paragraphs', $the_content);
620
- // Loop through Crayons
621
- $post_in_queue = self::$post_queue[$post_id];
622
-
623
- foreach ($post_in_queue as $id=>$v) {
624
- $atts = $v['atts'];
625
- $content = $v['code']; // The code we replace post content with
626
- $crayon = self::shortcode($atts, $content, $id);
627
- if (is_feed()) {
628
- // Convert the plain code to entities and put in a <pre></pre> tag
629
- $crayon_formatted = CrayonFormatter::plain_code($crayon->code(), $crayon->setting_val(CrayonSettings::DECODE));
630
- } else {
631
- // Apply shortcode to the content
632
- $crayon_formatted = $crayon->output(TRUE, FALSE);
633
- }
634
- // Replace the code with the Crayon
635
- CrayonLog::debug('the_content: id '.$post_id. ' has UID ' . $id . ' : ' . intval(stripos($the_content, $id) !== FALSE) );
636
- $the_content = CrayonUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $the_content, 1, $count);
637
- CrayonLog::debug('the_content: REPLACED for id '.$post_id. ' from len ' . strlen($the_content_original) . ' to ' . strlen($the_content));
638
- }
639
- }
640
-
641
- return $the_content;
642
- }
643
-
644
- public static function pre_comment_text($text) {
645
- global $comment;
646
- $comment_id = strval($comment->comment_ID);
647
- if ( array_key_exists($comment_id, self::$comment_captures) ) {
648
- // Replace with IDs now that we need to
649
- $text = self::$comment_captures[$comment_id];
650
- }
651
- return $text;
652
- }
653
-
654
- public static function comment_text($text) {
655
- global $comment;
656
- $comment_id = strval($comment->comment_ID);
657
- // Find if this post has Crayons
658
- if ( array_key_exists($comment_id, self::$comment_queue) ) {
659
- // XXX We want the plain post content, no formatting
660
- $the_content_original = $text;
661
- // Loop through Crayons
662
- $post_in_queue = self::$comment_queue[$comment_id];
663
-
664
- foreach ($post_in_queue as $id=>$v) {
665
- $atts = $v['atts'];
666
- $content = $v['code']; // The code we replace post content with
667
- $crayon = self::shortcode($atts, $content, $id);
668
- $crayon_formatted = $crayon->output(TRUE, FALSE);
669
- // Replacing may cause <p> tags to become disjoint with a <div> inside them, close and reopen them if needed
670
- if (!$crayon->is_inline()) {
671
- $text = preg_replace_callback('#' . self::REGEX_BETWEEN_PARAGRAPH_SIMPLE . '#msi', 'CrayonWP::add_paragraphs', $text);
672
- }
673
- // Replace the code with the Crayon
674
- $text = CrayonUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $text, 1, $text);
675
- }
676
- }
677
- return $text;
678
- }
679
-
680
- public static function add_paragraphs($capture) {
681
- if (count($capture) != 4) {
682
- CrayonLog::debug('add_paragraphs: 0');
683
- return $capture[0];
684
- }
685
- $capture[2] = preg_replace('#(?:<\s*br\s*/\s*>\s*)?(\[\s*crayon-\w+/\])(?:<\s*br\s*/\s*>\s*)?#msi', '</p>$1<p>', $capture[2]);
686
- // If [crayon appears right after <p> then we will generate <p></p>, remove all these
687
- $paras = $capture[1].$capture[2].$capture[3];
688
- return $paras;
689
- }
690
-
691
- // Remove Crayons from the_excerpt
692
- public static function the_excerpt($the_excerpt) {
693
- CrayonLog::debug('excerpt');
694
- global $post;
695
- if (!empty($post->post_excerpt)) {
696
- // Use custom excerpt if defined
697
- $the_excerpt = wpautop($post->post_excerpt);
698
- } else {
699
- // Pass wp_trim_excerpt('') to gen from content (and remove [crayons])
700
- $the_excerpt = wpautop(wp_trim_excerpt(''));
701
- }
702
- // XXX Returning "" may cause it to default to full contents...
703
- return $the_excerpt . ' ';
704
- }
705
-
706
- // Refactored, used to capture pre and span tags which have settings in class attribute
707
- public static function class_tag($matches) {
708
- // If class exists, atts is not captured
709
- $pre_class = $matches[1];
710
- $quotes = $matches[2];
711
- $class = $matches[3];
712
- $post_class = $matches[4];
713
- $atts = $matches[5];
714
- $content = $matches[6];
715
-
716
- // If we find a crayon=false in the attributes, or a crayon[:_]false in the class, then we should not capture
717
- $ignore_regex_atts = '#crayon\s*=\s*(["\'])\s*(false|no|0)\s*\1#msi';
718
- $ignore_regex_class = '#crayon\s*[:_]\s*(false|no|0)#msi';
719
- if (preg_match($ignore_regex_atts, $atts) !== 0 ||
720
- preg_match($ignore_regex_class, $class) !== 0 ) {
721
- return $matches[0];
722
- }
723
-
724
- if (!empty($class)) {
725
- // crayon-inline is turned into inline="1"
726
- $class = preg_replace('#'.self::REGEX_INLINE_CLASS.'#mi', 'inline="1"', $class);
727
- // "setting[:_]value" style settings in the class attribute
728
- $class = preg_replace('#\b([A-Za-z-]+)[_:](\S+)#msi', '$1='.$quotes.'$2'.$quotes, $class);
729
- }
730
-
731
- // data-url is turned into url=""
732
- if (!empty($post_class)) {
733
- $post_class = preg_replace('#\bdata-url\s*=#mi', 'url=', $post_class);
734
- }
735
- if (!empty($pre_class)) {
736
- $pre_class = preg_replace('#\bdata-url\s*=#mi', 'url=', $post_class);
737
- }
738
-
739
- if (!empty($class)) {
740
- return "[crayon $pre_class $class $post_class]{$content}[/crayon]";
741
- } else {
742
- return "[crayon $atts]{$content}[/crayon]";
743
- }
744
- }
745
-
746
- // Capture span tag and extract settings from the class attribute, if present.
747
- public static function span_tag($matches) {
748
- // Only use <span> tags with crayon-inline class
749
- if (preg_match('#'.self::REGEX_INLINE_CLASS.'#mi', $matches[3])) {
750
- // no $atts
751
- $matches[6] = $matches[5];
752
- $matches[5] = '';
753
- return self::class_tag($matches);
754
- } else {
755
- // Don't turn regular <span>s into Crayons
756
- return $matches[0];
757
- }
758
- }
759
-
760
- // Capture pre tag and extract settings from the class attribute, if present.
761
- public static function pre_tag($matches) {
762
- return self::class_tag($matches);
763
- }
764
-
765
- // Check if the $ notation has been used to ignore [crayon] tags within posts and remove all matches
766
- // Can also remove if used without $ as a regular crayon
767
- public static function crayon_remove_ignore($the_content, $ignore_flag = '$') {
768
- if ($ignore_flag == FALSE) {
769
- $ignore_flag = '';
770
- }
771
- $ignore_flag_regex = preg_quote($ignore_flag);
772
-
773
- $the_content = preg_replace('#'.$ignore_flag_regex.'(\s*\[\s*crayon)#msi', '$1', $the_content);
774
- $the_content = preg_replace('#(crayon\s*\])\s*\$#msi', '$1', $the_content);
775
-
776
- if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_PRE)) {
777
- $the_content = str_ireplace(array($ignore_flag.'<pre', 'pre>'.$ignore_flag), array('<pre', 'pre>'), $the_content);
778
- // Remove any <code> tags wrapping around the whole code, since we won't needed them
779
- $the_content = preg_replace('#(^\s*<\s*code[^>]*>)|(<\s*/\s*code[^>]*>\s*$)#msi', '', $the_content);
780
- }
781
- if (CrayonGlobalSettings::val(CrayonSettings::PLAIN_TAG)) {
782
- $the_content = str_ireplace(array($ignore_flag.'[plain', 'plain]'.$ignore_flag), array('[plain', 'plain]'), $the_content);
783
- }
784
- if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG) ||
785
- CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG)) {
786
- self::init_tags_regex();
787
- // $the_content = preg_replace('#'.$ignore_flag_regex.'\s*([\[\{])\s*('. self::$alias_regex .')#', '$1$2', $the_content);
788
- // $the_content = preg_replace('#('. self::$alias_regex .')\s*([\]\}])\s*'.$ignore_flag_regex.'#', '$1$2', $the_content);
789
- $the_content = preg_replace('#'.$ignore_flag_regex.'(\s*[\[\{]\s*('. self::$alias_regex .')[^\]]*[\]\}])#', '$1', $the_content);
790
- }
791
- if (CrayonGlobalSettings::val(CrayonSettings::BACKQUOTE)) {
792
- $the_content = str_ireplace('\\`', '`', $the_content);
793
- }
794
- return $the_content;
795
- }
796
-
797
- public static function wp_head() {
798
- CrayonLog::debug('head');
799
-
800
- self::$wp_head = TRUE;
801
- if (!self::$enqueued) {
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();
810
- }
811
- }
812
- // Enqueue Theme CSS
813
- if (CrayonGlobalSettings::val(CrayonSettings::ENQUEUE_THEMES)) {
814
- self::crayon_theme_css();
815
- }
816
- // Enqueue Font CSS
817
- if (CrayonGlobalSettings::val(CrayonSettings::ENQUEUE_FONTS)) {
818
- self::crayon_font_css();
819
- }
820
- }
821
-
822
- public static function save_post($update_id, $post) {
823
- // if (wp_is_post_revision($id)) {
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() {
870
- global $CRAYON_VERSION;
871
- $css = CrayonResources::themes()->get_used_css();
872
- foreach ($css as $theme=>$url) {
873
- wp_enqueue_style('crayon-theme-'.$theme, $url, array(), $CRAYON_VERSION);
874
- }
875
- }
876
-
877
- public static function crayon_font_css() {
878
- global $CRAYON_VERSION;
879
- $css = CrayonResources::fonts()->get_used_css();
880
- foreach ($css as $font_id=>$url) {
881
- wp_enqueue_style('crayon-font-'.$font_id, $url, array(), $CRAYON_VERSION);
882
- }
883
- }
884
-
885
- public static function init($request) {
886
- CrayonLog::debug('init');
887
- crayon_load_plugin_textdomain();
888
- }
889
-
890
- public static function init_ajax() {
891
- add_action('wp_ajax_crayon-ajax', 'CrayonWP::ajax');
892
- add_action('wp_ajax_crayon-tag-editor', 'CrayonTagEditorWP::content');
893
- add_action('wp_ajax_crayon-show-posts', 'CrayonSettingsWP::show_posts');
894
- add_action('wp_ajax_crayon-show-langs', 'CrayonSettingsWP::show_langs');
895
- add_action('wp_ajax_crayon-show-preview', 'CrayonSettingsWP::show_preview');
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();
989
- }
990
-
991
- public static function uninstall() {
992
-
993
- }
994
-
995
- public static function update() {
996
- global $CRAYON_VERSION;
997
- CrayonSettingsWP::load_settings(TRUE);
998
- $settings = CrayonSettingsWP::get_settings();
999
- if ($settings === NULL || !isset($settings[CrayonSettings::VERSION])) {
1000
- return;
1001
- }
1002
-
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
-
1038
- public static function basename() {
1039
- return plugin_basename(__FILE__);
1040
- }
1041
-
1042
- // This should never be called through AJAX, only server side, since WP will not be loaded
1043
- public static function wp_load_path() {
1044
- if (defined('ABSPATH')) {
1045
- return ABSPATH . 'wp-load.php';
1046
- } else {
1047
- CrayonLog::syslog('wp_load_path could not find value for ABSPATH');
1048
- }
1049
- }
1050
-
1051
- public static function pre_excerpt($e) {
1052
- CrayonLog::debug('pre_excerpt');
1053
- self::$is_excerpt = TRUE;
1054
- return $e;
1055
- }
1056
-
1057
- public static function post_excerpt($e) {
1058
- CrayonLog::debug('post_excerpt');
1059
- self::$is_excerpt = FALSE;
1060
- $e = self::the_content($e);
1061
- return $e;
1062
- }
1063
-
1064
- public static function post_get_excerpt($e) {
1065
- CrayonLog::debug('post_get_excerpt');
1066
- self::$is_excerpt = FALSE;
1067
- return $e;
1068
- }
1069
-
1070
- /**
1071
- * Converts Crayon tags found in WP to <pre> form.
1072
- * XXX: This will alter blog content, so backup before calling.
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'];
1097
- wp_update_post($post_obj);
1098
- CrayonLog::syslog("Converted Crayons in post ID $postID to pre tags", 'CONVERT');
1099
-
1100
- if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
1101
- $comments = get_comments(array('post_id' => $postID));
1102
- foreach ($comments as $comment) {
1103
- $commentID = $comment->comment_ID;
1104
- $comment_captures = self::capture_crayons($commentID, $comment->comment_content, array(CrayonSettings::DECODE => TRUE), $args);
1105
-
1106
- $comment_obj = array();
1107
- $comment_obj['comment_ID'] = $commentID;
1108
- $comment_obj['comment_content'] = $comment_captures['content'];
1109
- wp_update_comment($comment_obj);
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
 
1125
  }
1126
 
1127
  // Only if WP is loaded
1128
  if (defined('ABSPATH')) {
1129
- if (!is_admin()) {
1130
- register_activation_hook(__FILE__, 'CrayonWP::install');
1131
- register_deactivation_hook(__FILE__, 'CrayonWP::uninstall');
1132
-
1133
- // Filters and Actions
1134
-
1135
- add_filter('init', 'CrayonWP::init');
1136
-
1137
- CrayonSettingsWP::load_settings(TRUE);
1138
- if (CrayonGlobalSettings::val(CrayonSettings::MAIN_QUERY)) {
1139
- add_action('wp', 'CrayonWP::wp', 100);
1140
- } else {
1141
- add_filter('the_posts', 'CrayonWP::the_posts', 100);
1142
- }
1143
-
1144
- // XXX Some themes like to play with the content, make sure we replace after they're done
1145
- add_filter('the_content', 'CrayonWP::the_content', 100);
1146
-
1147
- // Highlight bbPress content
1148
- add_filter('bbp_get_reply_content', 'CrayonWP::highlight', 100);
1149
- add_filter('bbp_get_topic_content', 'CrayonWP::highlight', 100);
1150
- add_filter('bbp_get_forum_content', 'CrayonWP::highlight', 100);
1151
- add_filter('bbp_get_topic_excerpt', 'CrayonWP::highlight', 100);
1152
-
1153
- if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
1154
- /* XXX This is called first to match Crayons, then higher priority replaces after other filters.
1155
- Prevents Crayon from being formatted by the filters, and also keeps original comment formatting. */
1156
- add_filter('comment_text', 'CrayonWP::pre_comment_text', 1);
1157
- add_filter('comment_text', 'CrayonWP::comment_text', 100);
1158
- }
1159
-
1160
- // This ensures Crayons are not formatted by WP filters. Other plugins should specify priorities between 1 and 100.
1161
- add_filter('get_the_excerpt', 'CrayonWP::pre_excerpt', 1);
1162
- add_filter('get_the_excerpt', 'CrayonWP::post_get_excerpt', 100);
1163
- add_filter('the_excerpt', 'CrayonWP::post_excerpt', 100);
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);
1171
- if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
1172
- //add_action('comment_post', 'CrayonWP::save_comment', 10, 2);
1173
- add_action('edit_comment', 'CrayonWP::save_comment', 10, 2);
1174
- }
1175
- add_filter('init', 'CrayonWP::init_ajax');
1176
- }
1177
  }
1178
 
1179
  ?>
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.17
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  Text Domain: crayon-syntax-highlighter
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')) {
37
+ // Used to get plugin version info
38
+ require_once(ABSPATH . 'wp-admin/includes/plugin.php');
39
+ crayon_set_info(get_plugin_data(__FILE__));
40
  }
41
 
42
  /* The plugin class that manages all other classes and integrates Crayon with WP */
43
  class CrayonWP {
44
+ // Properties and Constants ===============================================
45
+
46
+ // Associative array, keys are post IDs as strings and values are number of crayons parsed as ints
47
+ private static $post_queue = array();
48
+ // Ditto for comments
49
+ private static $comment_queue = array();
50
+ private static $post_captures = array();
51
+ private static $comment_captures = array();
52
+ // Whether we are displaying an excerpt
53
+ private static $is_excerpt = FALSE;
54
+ // Whether we have added styles and scripts
55
+ private static $enqueued = FALSE;
56
+ // Whether we have already printed the wp head
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(
67
+ CrayonSettings::CAPTURE_MINI_TAG,
68
+ CrayonSettings::CAPTURE_PRE,
69
+ CrayonSettings::INLINE_TAG,
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="" /]
78
+ const REGEX_TAG = '(?:\[\s*crayon(?:-(\w+))?\b([^\]]*)\](.*?)\[\s*/\s*crayon\s*\])'; // [crayon atts=""] ... [/crayon]
79
+ const REGEX_INLINE_CLASS = '\bcrayon-inline\b';
80
+
81
+ const REGEX_CLOSED_NO_CAPTURE = '(?:\[\s*crayon\b[^\]]*/\])';
82
+ const REGEX_TAG_NO_CAPTURE = '(?:\[\s*crayon\b[^\]]*\].*?\[/crayon\])';
83
+
84
+ const REGEX_QUICK_CAPTURE = '(?:\[\s*crayon[^\]]*\].*?\[\s*/\s*crayon\s*\])|(?:\[\s*crayon[^\]]*/\s*\])';
85
+
86
+ const REGEX_BETWEEN_PARAGRAPH = '<p[^<]*>(?:[^<]*<(?!/?p(\s+[^>]*)?>)[^>]+(\s+[^>]*)?>)*[^<]*((?:\[\s*crayon[^\]]*\].*?\[\s*/\s*crayon\s*\])|(?:\[\s*crayon[^\]]*/\s*\]))(?:[^<]*<(?!/?p(\s+[^>]*)?>)[^>]+(\s+[^>]*)?>)*[^<]*</p[^<]*>';
87
+ const REGEX_BETWEEN_PARAGRAPH_SIMPLE = '(<p(?:\s+[^>]*)?>)(.*?)(</p(?:\s+[^>]*)?>)';
88
+
89
+ // For [crayon-id/]
90
+ const REGEX_BR_BEFORE = '#<\s*br\s*/?\s*>\s*(\[\s*crayon-\w+\])#msi';
91
+ const REGEX_BR_AFTER = '#(\[\s*crayon-\w+\])\s*<\s*br\s*/?\s*>#msi';
92
+
93
+ const REGEX_ID = '#(?<!\$)\[\s*crayon#mi';
94
+ //const REGEX_WITH_ID = '#(\[\s*crayon-\w+)\b([^\]]*["\'])(\s*/?\s*\])#mi';
95
+ const REGEX_WITH_ID = '#\[\s*(crayon-\w+)\b[^\]]*\]#mi';
96
+
97
+ const MODE_NORMAL = 0, MODE_JUST_CODE = 1, MODE_PLAIN_CODE = 2;
98
+
99
+
100
+ //const TAGS = array(CrayonSettings::CAPTURE_MINI_TAG => 1 | 1);
101
+
102
+ // Public Methods =========================================================
103
+
104
+ public static function post_captures() {
105
+ return self::$post_queue;
106
+ }
107
+
108
+ // Methods ================================================================
109
+
110
+ private function __construct() {
111
+ }
112
+
113
+ public static function regex() {
114
+ return '#(?<!\$)(?:' . self::REGEX_CLOSED . '|' . self::REGEX_TAG . ')(?!\$)#msi';
115
+ }
116
+
117
+ public static function regex_with_id($id) {
118
+ return '#\[\s*(crayon-' . $id . ')\b[^\]]*\]#mi';
119
+ }
120
+
121
+ public static function regex_no_capture() {
122
+ return '#(?<!\$)(?:' . self::REGEX_CLOSED_NO_CAPTURE . '|' . self::REGEX_TAG_NO_CAPTURE . ')(?!\$)#msi';
123
+ }
124
+
125
+ /**
126
+ * Adds the actual Crayon instance.
127
+ * $mode can be: 0 = return crayon content, 1 = return only code, 2 = return only plain code
128
+ */
129
+ public static function shortcode($atts, $content = NULL, $id = NULL) {
130
+ CrayonLog::debug('shortcode');
131
+
132
+ // Load attributes from shortcode
133
+ $allowed_atts = array('url' => NULL, 'lang' => NULL, 'title' => NULL, 'mark' => NULL, 'range' => NULL, 'inline' => NULL);
134
+ $filtered_atts = shortcode_atts($allowed_atts, $atts);
135
+
136
+ // Clean attributes
137
+ $keys = array_keys($filtered_atts);
138
+ for ($i = 0; $i < count($keys); $i++) {
139
+ $key = $keys[$i];
140
+ $value = $filtered_atts[$key];
141
+ if ($value !== NULL) {
142
+ $filtered_atts[$key] = trim(strip_tags($value));
143
+ }
144
+ }
145
+
146
+ // Contains all other attributes not found in allowed, used to override global settings
147
+ $extra_attr = array();
148
+ if (!empty($atts)) {
149
+ $extra_attr = array_diff_key($atts, $allowed_atts);
150
+ $extra_attr = CrayonSettings::smart_settings($extra_attr);
151
+ }
152
+ $url = $lang = $title = $mark = $range = $inline = '';
153
+ extract($filtered_atts);
154
+
155
+ $crayon = self::instance($extra_attr, $id);
156
+
157
+ // Set URL
158
+ $crayon->url($url);
159
+ $crayon->code($content);
160
+ // Set attributes, should be set after URL to allow language auto detection
161
+ $crayon->language($lang);
162
+ $crayon->title($title);
163
+ $crayon->marked($mark);
164
+ $crayon->range($range);
165
+
166
+ $crayon->is_inline($inline);
167
+
168
+ // Determine if we should highlight
169
+ $highlight = array_key_exists('highlight', $atts) ? CrayonUtil::str_to_bool($atts['highlight'], FALSE) : TRUE;
170
+ $crayon->is_highlighted($highlight);
171
+ return $crayon;
172
+ }
173
+
174
+ /* Returns Crayon instance */
175
+ public static function instance($extra_attr = array(), $id = NULL) {
176
+ CrayonLog::debug('instance');
177
+
178
+ // Create Crayon
179
+ $crayon = new CrayonHighlighter();
180
+
181
+ /* Load settings and merge shortcode attributes which will override any existing.
182
+ * Stores the other shortcode attributes as settings in the crayon. */
183
+ if (!empty($extra_attr)) {
184
+ $crayon->settings($extra_attr);
185
+ }
186
+ if (!empty($id)) {
187
+ $crayon->id($id);
188
+ }
189
+
190
+ return $crayon;
191
+ }
192
+
193
+ /* For manually highlighting code, useful for other PHP contexts */
194
+ public static function highlight($code) {
195
+ $crayon_str = '';
196
+
197
+ $captures = CrayonWP::capture_crayons(0, $code);
198
+ $the_captures = $captures['capture'];
199
+ $the_content = $captures['content'];
200
+ foreach ($the_captures as $capture) {
201
+ $id = $capture['id'];
202
+ $atts = $capture['atts'];
203
+ $no_enqueue = array(
204
+ CrayonSettings::ENQUEUE_THEMES => FALSE,
205
+ CrayonSettings::ENQUEUE_FONTS => FALSE);
206
+ $atts = array_merge($atts, $no_enqueue);
207
+ $code = $capture['code'];
208
+ $crayon = CrayonWP::shortcode($atts, $code, $id);
209
+ $crayon_formatted = $crayon->output(TRUE, FALSE);
210
+ $the_content = CrayonUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $the_content, 1, $count);
211
+ }
212
+
213
+ return $the_content;
214
+ }
215
+
216
+ /* Uses the main query */
217
+ public static function wp() {
218
+ CrayonLog::debug('wp (global)');
219
+
220
+ global $wp_the_query;
221
+ $posts = $wp_the_query->posts;
222
+ self::the_posts($posts);
223
+ }
224
+
225
+ // TODO put args into an array
226
+ public static function capture_crayons($wp_id, $wp_content, $extra_settings = array(), $args = array()) {
227
+ extract($args);
228
+ CrayonUtil::set_var($callback, NULL);
229
+ CrayonUtil::set_var($ignore, TRUE);
230
+ CrayonUtil::set_var($preserve_atts, FALSE);
231
+ CrayonUtil::set_var($flags, NULL);
232
+
233
+ // Will contain captured crayons and altered $wp_content
234
+ $capture = array('capture' => array(), 'content' => $wp_content, 'has_captured' => FALSE);
235
+
236
+ // Flags for which Crayons to convert
237
+ $in_flag = self::in_flag($flags);
238
+
239
+ CrayonLog::debug('capture for id ' . $wp_id . ' len ' . strlen($wp_content));
240
+
241
+ // Convert <pre> tags to crayon tags, if needed
242
+ if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_PRE) && $in_flag[CrayonSettings::CAPTURE_PRE]) {
243
+ // XXX This will fail if <pre></pre> is used inside another <pre></pre>
244
+ $wp_content = preg_replace_callback('#(?<!\$)<\s*pre(?=(?:([^>]*)\bclass\s*=\s*(["\'])(.*?)\2([^>]*))?)([^>]*)>(.*?)<\s*/\s*pre\s*>#msi', 'CrayonWP::pre_tag', $wp_content);
245
+ }
246
+
247
+ // Convert mini [php][/php] tags to crayon tags, if needed
248
+ if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG) && $in_flag[CrayonSettings::CAPTURE_MINI_TAG]) {
249
+ $wp_content = preg_replace('#(?<!\$)\[\s*(' . self::$alias_regex . ')\b([^\]]*)\](.*?)\[\s*/\s*(?:\1)\s*\](?!\$)#msi', '[crayon lang="\1" \2]\3[/crayon]', $wp_content);
250
+ $wp_content = preg_replace('#(?<!\$)\[\s*(' . self::$alias_regex . ')\b([^\]]*)/\s*\](?!\$)#msi', '[crayon lang="\1" \2 /]', $wp_content);
251
+ }
252
+
253
+ // Convert inline {php}{/php} tags to crayon tags, if needed
254
+ if (CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG) && $in_flag[CrayonSettings::INLINE_TAG]) {
255
+ $wp_content = preg_replace('#(?<!\$)\{\s*(' . self::$alias_regex . ')\b([^\}]*)\}(.*?)\{/(?:\1)\}(?!\$)#msi', '[crayon lang="\1" inline="true" \2]\3[/crayon]', $wp_content);
256
+ // Convert <span class="crayon-inline"> tags to inline crayon tags
257
+ $wp_content = preg_replace_callback('#(?<!\$)<\s*span([^>]*)\bclass\s*=\s*(["\'])(.*?)\2([^>]*)>(.*?)<\s*/\s*span\s*>#msi', 'CrayonWP::span_tag', $wp_content);
258
+ }
259
+
260
+ // Convert [plain] tags into <pre><code></code></pre>, if needed
261
+ if (CrayonGlobalSettings::val(CrayonSettings::PLAIN_TAG) && $in_flag[CrayonSettings::PLAIN_TAG]) {
262
+ $wp_content = preg_replace_callback('#(?<!\$)\[\s*plain\s*\](.*?)\[\s*/\s*plain\s*\]#msi', 'CrayonFormatter::plain_code', $wp_content);
263
+ }
264
+
265
+ // Add IDs to the Crayons
266
+ CrayonLog::debug('capture adding id ' . $wp_id . ' , now has len ' . strlen($wp_content));
267
+ $wp_content = preg_replace_callback(self::REGEX_ID, 'CrayonWP::add_crayon_id', $wp_content);
268
+
269
+ CrayonLog::debug('capture added id ' . $wp_id . ' : ' . strlen($wp_content));
270
+
271
+ // Only include if a post exists with Crayon tag
272
+ preg_match_all(self::regex(), $wp_content, $matches);
273
+
274
+ CrayonLog::debug('capture ignore for id ' . $wp_id . ' : ' . strlen($capture['content']) . ' vs ' . strlen($wp_content));
275
+
276
+ if (count($matches[0]) != 0) {
277
+
278
+ // Crayons found! Load settings first to ensure global settings loaded
279
+ CrayonSettingsWP::load_settings();
280
+ $capture['has_captured'] = TRUE;
281
+
282
+ CrayonLog::debug('CAPTURED FOR ID ' . $wp_id);
283
+
284
+ $full_matches = $matches[0];
285
+ $closed_ids = $matches[1];
286
+ $closed_atts = $matches[2];
287
+ $open_ids = $matches[3];
288
+ $open_atts = $matches[4];
289
+ $contents = $matches[5];
290
+
291
+ // Make sure we enqueue the styles/scripts
292
+ $enqueue = TRUE;
293
+
294
+ for ($i = 0; $i < count($full_matches); $i++) {
295
+ // Get attributes
296
+ if (!empty($closed_atts[$i])) {
297
+ $atts = $closed_atts[$i];
298
+ } else if (!empty($open_atts[$i])) {
299
+ $atts = $open_atts[$i];
300
+ } else {
301
+ $atts = '';
302
+ }
303
+
304
+ // Capture attributes
305
+ preg_match_all('#([^="\'\s]+)[\t ]*=[\t ]*("|\')(.*?)\2#', $atts, $att_matches);
306
+ // Add extra attributes
307
+ $atts_array = $extra_settings;
308
+ if (count($att_matches[0]) != 0) {
309
+ for ($j = 0; $j < count($att_matches[1]); $j++) {
310
+ $atts_array[trim(strtolower($att_matches[1][$j]))] = trim($att_matches[3][$j]);
311
+ }
312
+ }
313
+
314
+ // Capture theme
315
+ $theme_id = array_key_exists(CrayonSettings::THEME, $atts_array) ? $atts_array[CrayonSettings::THEME] : '';
316
+ $theme = CrayonResources::themes()->get($theme_id);
317
+ // If theme not found, use fallbacks
318
+ if (!$theme) {
319
+ // Given theme is invalid, try global setting
320
+ $theme_id = CrayonGlobalSettings::val(CrayonSettings::THEME);
321
+ $theme = CrayonResources::themes()->get($theme_id);
322
+ if (!$theme) {
323
+ // Global setting is invalid, fall back to default
324
+ $theme = CrayonResources::themes()->get_default();
325
+ $theme_id = CrayonThemes::DEFAULT_THEME;
326
+ }
327
+ }
328
+ // If theme is now valid, change the array
329
+ if ($theme) {
330
+ if (!$preserve_atts || isset($atts_array[CrayonSettings::THEME])) {
331
+ $atts_array[CrayonSettings::THEME] = $theme_id;
332
+ }
333
+ $theme->used(TRUE);
334
+ }
335
+
336
+ // Capture font
337
+ $font_id = array_key_exists(CrayonSettings::FONT, $atts_array) ? $atts_array[CrayonSettings::FONT] : '';
338
+ $font = CrayonResources::fonts()->get($font_id);
339
+ // If font not found, use fallbacks
340
+ if (!$font) {
341
+ // Given font is invalid, try global setting
342
+ $font_id = CrayonGlobalSettings::val(CrayonSettings::FONT);
343
+ $font = CrayonResources::fonts()->get($font_id);
344
+ if (!$font) {
345
+ // Global setting is invalid, fall back to default
346
+ $font = CrayonResources::fonts()->get_default();
347
+ $font_id = CrayonFonts::DEFAULT_FONT;
348
+ }
349
+ }
350
+
351
+ // If font is now valid, change the array
352
+ if ($font /* != NULL && $font_id != CrayonFonts::DEFAULT_FONT*/) {
353
+ if (!$preserve_atts || isset($atts_array[CrayonSettings::FONT])) {
354
+ $atts_array[CrayonSettings::FONT] = $font_id;
355
+ }
356
+ $font->used(TRUE);
357
+ }
358
+
359
+ // Add array of atts and content to post queue with key as post ID
360
+ // XXX If at this point no ID is added we have failed!
361
+ $id = !empty($open_ids[$i]) ? $open_ids[$i] : $closed_ids[$i];
362
+ //if ($ignore) {
363
+ $code = self::crayon_remove_ignore($contents[$i]);
364
+ //}
365
+ $c = array('post_id' => $wp_id, 'atts' => $atts_array, 'code' => $code);
366
+ $capture['capture'][$id] = $c;
367
+ CrayonLog::debug('capture finished for post id ' . $wp_id . ' crayon-id ' . $id . ' atts: ' . count($atts_array) . ' code: ' . strlen($code));
368
+ $is_inline = isset($atts_array['inline']) && CrayonUtil::str_to_bool($atts_array['inline'], FALSE) ? '-i' : '';
369
+ if ($callback === NULL) {
370
+ $wp_content = str_replace($full_matches[$i], '[crayon-' . $id . $is_inline . '/]', $wp_content);
371
+ } else {
372
+ $wp_content = call_user_func($callback, $c, $full_matches[$i], $id, $is_inline, $wp_content);
373
+ }
374
+ }
375
+
376
+ }
377
+
378
+ if ($ignore) {
379
+ // We need to escape ignored Crayons, since they won't be captured
380
+ // XXX Do this after replacing the Crayon with the shorter ID tag, otherwise $full_matches will be different from $wp_content
381
+ $wp_content = self::crayon_remove_ignore($wp_content);
382
+ }
383
+
384
+ // Convert `` backquote tags into <code></code>, if needed
385
+ // XXX Some code may contain `` so must do it after all Crayons are captured
386
+ if (CrayonGlobalSettings::val(CrayonSettings::BACKQUOTE)) {
387
+ $wp_content = preg_replace('#(?<!\\\\)`([^`]*)`#msi', '<code>$1</code>', $wp_content);
388
+ }
389
+
390
+ $capture['content'] = $wp_content;
391
+ return $capture;
392
+ }
393
+
394
+ /* Search for Crayons in posts and queue them for creation */
395
+ public static function the_posts($posts) {
396
+ CrayonLog::debug('the_posts');
397
+
398
+ // Whether to enqueue syles/scripts
399
+ $enqueue = FALSE;
400
+ CrayonSettingsWP::load_settings(TRUE); // Load just the settings from db, for now
401
+
402
+ self::init_tags_regex();
403
+ $crayon_posts = CrayonSettingsWP::load_posts(); // Loads posts containing crayons
404
+
405
+ // Search for shortcode in posts
406
+ foreach ($posts as $post) {
407
+ $wp_id = $post->ID;
408
+ if (!in_array($wp_id, $crayon_posts)) {
409
+ // If we get query for a page, then that page might have a template and load more posts containing Crayons
410
+ // By this state, we would be unable to enqueue anything (header already written).
411
+ if (CrayonGlobalSettings::val(CrayonSettings::SAFE_ENQUEUE) && is_page($wp_id)) {
412
+ CrayonGlobalSettings::set(CrayonSettings::ENQUEUE_THEMES, false);
413
+ CrayonGlobalSettings::set(CrayonSettings::ENQUEUE_FONTS, false);
414
+ }
415
+ // Only include crayon posts
416
+ continue;
417
+ }
418
+
419
+ $id_str = strval($wp_id);
420
+
421
+ if (wp_is_post_revision($wp_id)) {
422
+ // Ignore post revisions, use the parent, which has the updated post content
423
+ continue;
424
+ }
425
+
426
+ if (isset(self::$post_captures[$id_str])) {
427
+ // Don't capture twice
428
+ // XXX post->post_content is reset each loop, replace content
429
+ // Doing this might cause content changed by other plugins between the last loop
430
+ // to fail, so be cautious
431
+ $post->post_content = self::$post_captures[$id_str];
432
+ continue;
433
+ }
434
+ // Capture post Crayons
435
+ $captures = self::capture_crayons(intval($post->ID), $post->post_content);
436
+
437
+ // XXX Careful not to undo changes by other plugins
438
+ // XXX Must replace to remove $ for ignored Crayons
439
+ $post->post_content = $captures['content'];
440
+ self::$post_captures[$id_str] = $captures['content'];
441
+ if ($captures['has_captured'] === TRUE) {
442
+ $enqueue = TRUE;
443
+ self::$post_queue[$id_str] = array();
444
+ foreach ($captures['capture'] as $capture_id => $capture_content) {
445
+ self::$post_queue[$id_str][$capture_id] = $capture_content;
446
+ }
447
+ }
448
+
449
+ // Search for shortcode in comments
450
+ if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
451
+ $comments = get_comments(array('post_id' => $post->ID));
452
+ foreach ($comments as $comment) {
453
+ $id_str = strval($comment->comment_ID);
454
+ if (isset(self::$comment_queue[$id_str])) {
455
+ // Don't capture twice
456
+ continue;
457
+ }
458
+ // Capture comment Crayons, decode their contents if decode not specified
459
+ $captures = self::capture_crayons($comment->comment_ID, $comment->comment_content, array(CrayonSettings::DECODE => TRUE));
460
+ self::$comment_captures[$id_str] = $captures['content'];
461
+ if ($captures['has_captured'] === TRUE) {
462
+ $enqueue = TRUE;
463
+ self::$comment_queue[$id_str] = array();
464
+ foreach ($captures['capture'] as $capture_id => $capture_content) {
465
+ self::$comment_queue[$id_str][$capture_id] = $capture_content;
466
+ }
467
+ }
468
+ }
469
+ }
470
+ }
471
+
472
+ if (!is_admin() && $enqueue && !self::$enqueued) {
473
+ // Crayons have been found and we enqueue efficiently
474
+ self::enqueue_resources();
475
+ }
476
+
477
+ return $posts;
478
+ }
479
+
480
+ private static function add_crayon_id($content) {
481
+ $uid = $content[0] . '-' . uniqid();
482
+ CrayonLog::debug('add_crayon_id ' . $uid);
483
+ return $uid;
484
+ }
485
+
486
+ private static function get_crayon_id() {
487
+ return self::$next_id++;
488
+ }
489
+
490
+ private static function enqueue_resources() {
491
+ CrayonLog::debug('enqueue');
492
+ global $CRAYON_VERSION;
493
+ wp_enqueue_style('crayon_style', plugins_url(CRAYON_STYLE, __FILE__), array(), $CRAYON_VERSION);
494
+ wp_enqueue_style('crayon_global_style', plugins_url(CRAYON_STYLE_GLOBAL, __FILE__), array(), $CRAYON_VERSION);
495
+ wp_enqueue_script('crayon_util_js', plugins_url(CRAYON_JS_UTIL, __FILE__), array('jquery'), $CRAYON_VERSION);
496
+ CrayonSettingsWP::other_scripts();
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
+
516
+ if (($in_flag[CrayonSettings::CAPTURE_MINI_TAG] && CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG)) ||
517
+ ($in_flag[CrayonSettings::INLINE_TAG] && CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG))
518
+ ) {
519
+ $aliases = CrayonResources::langs()->ids_and_aliases();
520
+ for ($i = 0; $i < count($aliases); $i++) {
521
+ $alias = $aliases[$i];
522
+ $alias_regex = CrayonUtil::esc_hash(CrayonUtil::esc_regex($alias));
523
+ if ($i != count($aliases) - 1) {
524
+ $alias_regex .= '|';
525
+ }
526
+ self::$alias_regex .= $alias_regex;
527
+ }
528
+ }
529
+
530
+ // Add other tags
531
+ $tags_regex = '#(?<!\$)(?:(\s*\[\s*crayon\b)';
532
+
533
+ $tag_regexes = array(
534
+ CrayonSettings::CAPTURE_MINI_TAG => '([\[]\s*(' . self::$alias_regex . ')\b)',
535
+ CrayonSettings::CAPTURE_PRE => '(<\s*pre\b)',
536
+ CrayonSettings::INLINE_TAG => '(' . self::REGEX_INLINE_CLASS . ')' . '|([\{]\s*(' . self::$alias_regex . '))',
537
+ CrayonSettings::PLAIN_TAG => '(\s*\[\s*plain\b)',
538
+ CrayonSettings::BACKQUOTE => '(`[^`]*`)'
539
+ );
540
+
541
+ foreach ($tag_regexes as $tag => $regex) {
542
+ if ($in_flag[$tag] && CrayonGlobalSettings::val($tag)) {
543
+ $tags_regex .= '|' . $regex;
544
+ }
545
+ }
546
+ $tags_regex .= ')#msi';
547
+ }
548
+ }
549
+
550
+ private static function init_tag_bits() {
551
+ if (count(self::$tag_bits) == 0) {
552
+ $values = array();
553
+ for ($i = 0; $i < count(self::$tag_types); $i++) {
554
+ $j = pow(2, $i);
555
+ self::$tag_bits[self::$tag_types[$i]] = $j;
556
+ }
557
+ }
558
+ }
559
+
560
+ public static function tag_bit($tag) {
561
+ self::init_tag_bits();
562
+ if (isset(self::$tag_bits[$tag])) {
563
+ return self::$tag_bits[$tag];
564
+ } else {
565
+ return null;
566
+ }
567
+ }
568
+
569
+ public static function in_flag($flags) {
570
+ $in_flag = array();
571
+ foreach (self::$tag_types as $tag) {
572
+ $in_flag[$tag] = $flags === NULL || ($flags & self::tag_bit($tag)) > 0;
573
+ }
574
+ return $in_flag;
575
+ }
576
+
577
+ private static function init_legacy_tag_bits() {
578
+ if (self::$legacy_flags === NULL) {
579
+ self::$legacy_flags = self::tag_bit(CrayonSettings::CAPTURE_MINI_TAG) |
580
+ self::tag_bit(CrayonSettings::INLINE_TAG) |
581
+ self::tag_bit(CrayonSettings::PLAIN_TAG);
582
+ }
583
+ if (self::$tags_regex_legacy === "") {
584
+ self::init_tags_regex(TRUE, self::$legacy_flags, self::$tags_regex_legacy);
585
+ }
586
+ }
587
+
588
+ // Add Crayon into the_content
589
+ public static function the_content($the_content) {
590
+ CrayonLog::debug('the_content');
591
+
592
+ // Some themes make redundant queries and don't need extra work...
593
+ if (strlen($the_content) == 0) {
594
+ CrayonLog::debug('the_content blank');
595
+ return $the_content;
596
+ }
597
+
598
+ global $post;
599
+
600
+ // Go through queued posts and find crayons
601
+ $post_id = strval($post->ID);
602
+
603
+ if (self::$is_excerpt) {
604
+ CrayonLog::debug('excerpt');
605
+ if (CrayonGlobalSettings::val(CrayonSettings::EXCERPT_STRIP)) {
606
+ CrayonLog::debug('excerpt strip');
607
+ // Remove Crayon from content if we are displaying an excerpt
608
+ $the_content = preg_replace(self::REGEX_WITH_ID, '', $the_content);
609
+ }
610
+ // Otherwise Crayon remains with ID and replaced later
611
+ return $the_content;
612
+ }
613
+
614
+ // Find if this post has Crayons
615
+ if (array_key_exists($post_id, self::$post_queue)) {
616
+ // XXX We want the plain post content, no formatting
617
+ $the_content_original = $the_content;
618
+
619
+ // Replacing may cause <p> tags to become disjoint with a <div> inside them, close and reopen them if needed
620
+ $the_content = preg_replace_callback('#' . self::REGEX_BETWEEN_PARAGRAPH_SIMPLE . '#msi', 'CrayonWP::add_paragraphs', $the_content);
621
+ // Loop through Crayons
622
+ $post_in_queue = self::$post_queue[$post_id];
623
+
624
+ foreach ($post_in_queue as $id => $v) {
625
+ $atts = $v['atts'];
626
+ $content = $v['code']; // The code we replace post content with
627
+ $crayon = self::shortcode($atts, $content, $id);
628
+ if (is_feed()) {
629
+ // Convert the plain code to entities and put in a <pre></pre> tag
630
+ $crayon_formatted = CrayonFormatter::plain_code($crayon->code(), $crayon->setting_val(CrayonSettings::DECODE));
631
+ } else {
632
+ // Apply shortcode to the content
633
+ $crayon_formatted = $crayon->output(TRUE, FALSE);
634
+ }
635
+ // Replace the code with the Crayon
636
+ CrayonLog::debug('the_content: id ' . $post_id . ' has UID ' . $id . ' : ' . intval(stripos($the_content, $id) !== FALSE));
637
+ $the_content = CrayonUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $the_content, 1, $count);
638
+ CrayonLog::debug('the_content: REPLACED for id ' . $post_id . ' from len ' . strlen($the_content_original) . ' to ' . strlen($the_content));
639
+ }
640
+ }
641
+
642
+ return $the_content;
643
+ }
644
+
645
+ public static function pre_comment_text($text) {
646
+ global $comment;
647
+ $comment_id = strval($comment->comment_ID);
648
+ if (array_key_exists($comment_id, self::$comment_captures)) {
649
+ // Replace with IDs now that we need to
650
+ $text = self::$comment_captures[$comment_id];
651
+ }
652
+ return $text;
653
+ }
654
+
655
+ public static function comment_text($text) {
656
+ global $comment;
657
+ $comment_id = strval($comment->comment_ID);
658
+ // Find if this post has Crayons
659
+ if (array_key_exists($comment_id, self::$comment_queue)) {
660
+ // XXX We want the plain post content, no formatting
661
+ $the_content_original = $text;
662
+ // Loop through Crayons
663
+ $post_in_queue = self::$comment_queue[$comment_id];
664
+
665
+ foreach ($post_in_queue as $id => $v) {
666
+ $atts = $v['atts'];
667
+ $content = $v['code']; // The code we replace post content with
668
+ $crayon = self::shortcode($atts, $content, $id);
669
+ $crayon_formatted = $crayon->output(TRUE, FALSE);
670
+ // Replacing may cause <p> tags to become disjoint with a <div> inside them, close and reopen them if needed
671
+ if (!$crayon->is_inline()) {
672
+ $text = preg_replace_callback('#' . self::REGEX_BETWEEN_PARAGRAPH_SIMPLE . '#msi', 'CrayonWP::add_paragraphs', $text);
673
+ }
674
+ // Replace the code with the Crayon
675
+ $text = CrayonUtil::preg_replace_escape_back(self::regex_with_id($id), $crayon_formatted, $text, 1, $text);
676
+ }
677
+ }
678
+ return $text;
679
+ }
680
+
681
+ public static function add_paragraphs($capture) {
682
+ if (count($capture) != 4) {
683
+ CrayonLog::debug('add_paragraphs: 0');
684
+ return $capture[0];
685
+ }
686
+ $capture[2] = preg_replace('#(?:<\s*br\s*/\s*>\s*)?(\[\s*crayon-\w+/\])(?:<\s*br\s*/\s*>\s*)?#msi', '</p>$1<p>', $capture[2]);
687
+ // If [crayon appears right after <p> then we will generate <p></p>, remove all these
688
+ $paras = $capture[1] . $capture[2] . $capture[3];
689
+ return $paras;
690
+ }
691
+
692
+ // Remove Crayons from the_excerpt
693
+ public static function the_excerpt($the_excerpt) {
694
+ CrayonLog::debug('excerpt');
695
+ global $post;
696
+ if (!empty($post->post_excerpt)) {
697
+ // Use custom excerpt if defined
698
+ $the_excerpt = wpautop($post->post_excerpt);
699
+ } else {
700
+ // Pass wp_trim_excerpt('') to gen from content (and remove [crayons])
701
+ $the_excerpt = wpautop(wp_trim_excerpt(''));
702
+ }
703
+ // XXX Returning "" may cause it to default to full contents...
704
+ return $the_excerpt . ' ';
705
+ }
706
+
707
+ // Refactored, used to capture pre and span tags which have settings in class attribute
708
+ public static function class_tag($matches) {
709
+ // If class exists, atts is not captured
710
+ $pre_class = $matches[1];
711
+ $quotes = $matches[2];
712
+ $class = $matches[3];
713
+ $post_class = $matches[4];
714
+ $atts = $matches[5];
715
+ $content = $matches[6];
716
+
717
+ // If we find a crayon=false in the attributes, or a crayon[:_]false in the class, then we should not capture
718
+ $ignore_regex_atts = '#crayon\s*=\s*(["\'])\s*(false|no|0)\s*\1#msi';
719
+ $ignore_regex_class = '#crayon\s*[:_]\s*(false|no|0)#msi';
720
+ if (preg_match($ignore_regex_atts, $atts) !== 0 ||
721
+ preg_match($ignore_regex_class, $class) !== 0
722
+ ) {
723
+ return $matches[0];
724
+ }
725
+
726
+ if (!empty($class)) {
727
+ // crayon-inline is turned into inline="1"
728
+ $class = preg_replace('#' . self::REGEX_INLINE_CLASS . '#mi', 'inline="1"', $class);
729
+ // "setting[:_]value" style settings in the class attribute
730
+ $class = preg_replace('#\b([A-Za-z-]+)[_:](\S+)#msi', '$1=' . $quotes . '$2' . $quotes, $class);
731
+ }
732
+
733
+ // data-url is turned into url=""
734
+ if (!empty($post_class)) {
735
+ $post_class = preg_replace('#\bdata-url\s*=#mi', 'url=', $post_class);
736
+ }
737
+ if (!empty($pre_class)) {
738
+ $pre_class = preg_replace('#\bdata-url\s*=#mi', 'url=', $post_class);
739
+ }
740
+
741
+ if (!empty($class)) {
742
+ return "[crayon $pre_class $class $post_class]{$content}[/crayon]";
743
+ } else {
744
+ return "[crayon $atts]{$content}[/crayon]";
745
+ }
746
+ }
747
+
748
+ // Capture span tag and extract settings from the class attribute, if present.
749
+ public static function span_tag($matches) {
750
+ // Only use <span> tags with crayon-inline class
751
+ if (preg_match('#' . self::REGEX_INLINE_CLASS . '#mi', $matches[3])) {
752
+ // no $atts
753
+ $matches[6] = $matches[5];
754
+ $matches[5] = '';
755
+ return self::class_tag($matches);
756
+ } else {
757
+ // Don't turn regular <span>s into Crayons
758
+ return $matches[0];
759
+ }
760
+ }
761
+
762
+ // Capture pre tag and extract settings from the class attribute, if present.
763
+ public static function pre_tag($matches) {
764
+ return self::class_tag($matches);
765
+ }
766
+
767
+ // Check if the $ notation has been used to ignore [crayon] tags within posts and remove all matches
768
+ // Can also remove if used without $ as a regular crayon
769
+ public static function crayon_remove_ignore($the_content, $ignore_flag = '$') {
770
+ if ($ignore_flag == FALSE) {
771
+ $ignore_flag = '';
772
+ }
773
+ $ignore_flag_regex = preg_quote($ignore_flag);
774
+
775
+ $the_content = preg_replace('#' . $ignore_flag_regex . '(\s*\[\s*crayon)#msi', '$1', $the_content);
776
+ $the_content = preg_replace('#(crayon\s*\])\s*\$#msi', '$1', $the_content);
777
+
778
+ if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_PRE)) {
779
+ $the_content = str_ireplace(array($ignore_flag . '<pre', 'pre>' . $ignore_flag), array('<pre', 'pre>'), $the_content);
780
+ // Remove any <code> tags wrapping around the whole code, since we won't needed them
781
+ $the_content = preg_replace('#(^\s*<\s*code[^>]*>)|(<\s*/\s*code[^>]*>\s*$)#msi', '', $the_content);
782
+ }
783
+ if (CrayonGlobalSettings::val(CrayonSettings::PLAIN_TAG)) {
784
+ $the_content = str_ireplace(array($ignore_flag . '[plain', 'plain]' . $ignore_flag), array('[plain', 'plain]'), $the_content);
785
+ }
786
+ if (CrayonGlobalSettings::val(CrayonSettings::CAPTURE_MINI_TAG) ||
787
+ CrayonGlobalSettings::val(CrayonSettings::INLINE_TAG)
788
+ ) {
789
+ self::init_tags_regex();
790
+ // $the_content = preg_replace('#'.$ignore_flag_regex.'\s*([\[\{])\s*('. self::$alias_regex .')#', '$1$2', $the_content);
791
+ // $the_content = preg_replace('#('. self::$alias_regex .')\s*([\]\}])\s*'.$ignore_flag_regex.'#', '$1$2', $the_content);
792
+ $the_content = preg_replace('#' . $ignore_flag_regex . '(\s*[\[\{]\s*(' . self::$alias_regex . ')[^\]]*[\]\}])#', '$1', $the_content);
793
+ }
794
+ if (CrayonGlobalSettings::val(CrayonSettings::BACKQUOTE)) {
795
+ $the_content = str_ireplace('\\`', '`', $the_content);
796
+ }
797
+ return $the_content;
798
+ }
799
+
800
+ public static function wp_head() {
801
+ CrayonLog::debug('head');
802
+
803
+ self::$wp_head = TRUE;
804
+ if (!self::$enqueued) {
805
+ CrayonLog::debug('head: missed enqueue');
806
+ // We have missed our chance to check before enqueuing. Use setting to either load always or only in the_post
807
+ CrayonSettingsWP::load_settings(TRUE); // Ensure settings are loaded
808
+ // If we need the tag editor loaded at all times, we must enqueue at all times
809
+ if (!CrayonGlobalSettings::val(CrayonSettings::EFFICIENT_ENQUEUE) || CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_FRONT)) {
810
+ CrayonLog::debug('head: force enqueue');
811
+ // Efficient enqueuing disabled, always load despite enqueuing or not in the_post
812
+ self::enqueue_resources();
813
+ }
814
+ }
815
+ // Enqueue Theme CSS
816
+ if (CrayonGlobalSettings::val(CrayonSettings::ENQUEUE_THEMES)) {
817
+ self::crayon_theme_css();
818
+ }
819
+ // Enqueue Font CSS
820
+ if (CrayonGlobalSettings::val(CrayonSettings::ENQUEUE_FONTS)) {
821
+ self::crayon_font_css();
822
+ }
823
+ }
824
+
825
+ public static function save_post($update_id, $post) {
826
+ // if (wp_is_post_revision($id)) {
827
+ // // Ignore revisions
828
+ // return;
829
+ // }
830
+ self::refresh_post($post);
831
+ }
832
+
833
+ public static function refresh_post($post, $refresh_legacy = TRUE) {
834
+ $postID = $post->ID;
835
+ if (CrayonWP::scan_post($post)) {
836
+ CrayonSettingsWP::add_post($postID);
837
+ if ($refresh_legacy) {
838
+ if (self::scan_legacy_post($post)) {
839
+ CrayonSettingsWP::add_legacy_post($postID);
840
+ } else {
841
+ CrayonSettingsWP::remove_legacy_post($postID);
842
+ }
843
+ }
844
+ } else {
845
+ CrayonSettingsWP::remove_post($postID);
846
+ CrayonSettingsWP::remove_legacy_post($postID);
847
+ }
848
+ }
849
+
850
+ public static function refresh_posts() {
851
+ CrayonSettingsWP::remove_posts();
852
+ CrayonSettingsWP::remove_legacy_posts();
853
+ foreach (CrayonWP::get_posts() as $post) {
854
+ self::refresh_post($post);
855
+ }
856
+ }
857
+
858
+ public static function save_comment($id, $is_spam = NULL, $comment = NULL) {
859
+ self::init_tags_regex();
860
+ if ($comment === NULL) {
861
+ $comment = get_comment($id);
862
+ }
863
+ $content = $comment->comment_content;
864
+ $post_id = $comment->comment_post_ID;
865
+ $found = preg_match(self::$tags_regex, $content);
866
+ if ($found) {
867
+ CrayonSettingsWP::add_post($post_id);
868
+ }
869
+ return $found;
870
+ }
871
+
872
+ public static function crayon_theme_css() {
873
+ global $CRAYON_VERSION;
874
+ $css = CrayonResources::themes()->get_used_css();
875
+ foreach ($css as $theme => $url) {
876
+ wp_enqueue_style('crayon-theme-' . $theme, $url, array(), $CRAYON_VERSION);
877
+ }
878
+ }
879
+
880
+ public static function crayon_font_css() {
881
+ global $CRAYON_VERSION;
882
+ $css = CrayonResources::fonts()->get_used_css();
883
+ foreach ($css as $font_id => $url) {
884
+ wp_enqueue_style('crayon-font-' . $font_id, $url, array(), $CRAYON_VERSION);
885
+ }
886
+ }
887
+
888
+ public static function init($request) {
889
+ CrayonLog::debug('init');
890
+ crayon_load_plugin_textdomain();
891
+ }
892
+
893
+ public static function init_ajax() {
894
+ add_action('wp_ajax_crayon-ajax', 'CrayonWP::ajax');
895
+ add_action('wp_ajax_crayon-tag-editor', 'CrayonTagEditorWP::content');
896
+ add_action('wp_ajax_crayon-show-posts', 'CrayonSettingsWP::show_posts');
897
+ add_action('wp_ajax_crayon-show-langs', 'CrayonSettingsWP::show_langs');
898
+ add_action('wp_ajax_crayon-show-preview', 'CrayonSettingsWP::show_preview');
899
+ }
900
+
901
+ public static function ajax() {
902
+ $allowed = array(CrayonSettings::HIDE_HELP);
903
+ foreach ($allowed as $allow) {
904
+ if (array_key_exists($allow, $_GET)) {
905
+ CrayonGlobalSettings::set($allow, $_GET[$allow]);
906
+ CrayonSettingsWP::save_settings();
907
+ }
908
+ }
909
+ }
910
+
911
+ public static function get_posts() {
912
+ $query = new WP_Query(array('post_type' => 'any', 'suppress_filters' => TRUE, 'posts_per_page' => '-1'));
913
+ return $query->posts;
914
+ }
915
+
916
+ /**
917
+ * Return an array of post IDs where crayons occur.
918
+ * Comments are ignored by default.
919
+ */
920
+ public static function scan_posts($check_comments = FALSE) {
921
+ $crayon_posts = array();
922
+ foreach (self::get_posts() as $post) {
923
+ if (self::scan_post($post)) {
924
+ $crayon_posts[] = $post->ID;
925
+ }
926
+ }
927
+ return $crayon_posts;
928
+ }
929
+
930
+ public static function scan_legacy_posts($init_regex = TRUE, $check_comments = FALSE) {
931
+ if ($init_regex) {
932
+ // We can skip this if needed
933
+ self::init_tags_regex();
934
+ }
935
+ $crayon_posts = array();
936
+ foreach (self::get_posts() as $post) {
937
+ if (self::scan_legacy_post($post)) { // TODO this part is different
938
+ $crayon_posts[] = $post->ID;
939
+ }
940
+ }
941
+ return $crayon_posts;
942
+ }
943
+
944
+ /**
945
+ * Returns TRUE if a given post contains a Crayon tag
946
+ */
947
+ public static function scan_post($post, $scan_comments = TRUE, $tags_regex = NULL) {
948
+ if ($tags_regex === NULL) {
949
+ self::init_tags_regex();
950
+ $tags_regex = self::$tags_regex;
951
+ }
952
+
953
+ $id = $post->ID;
954
+ if (preg_match($tags_regex, $post->post_content)) {
955
+ return TRUE;
956
+ } else if ($scan_comments) {
957
+ CrayonSettingsWP::load_settings(TRUE);
958
+ if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
959
+ $comments = get_comments(array('post_id' => $id));
960
+ foreach ($comments as $comment) {
961
+ if (self::scan_comment($comment, $tags_regex)) {
962
+ return TRUE;
963
+ }
964
+ }
965
+ }
966
+ }
967
+ return FALSE;
968
+ }
969
+
970
+ public static function scan_legacy_post($post, $scan_comments = TRUE) {
971
+ self::init_legacy_tag_bits();
972
+ return self::scan_post($post, $scan_comments, self::$tags_regex_legacy);
973
+ }
974
+
975
+ /**
976
+ * Returns TRUE if the comment contains a Crayon tag
977
+ */
978
+ public static function scan_comment($comment, $tags_regex = NULL) {
979
+ if ($tags_regex === NULL) {
980
+ self::init_tags_regex();
981
+ $tags_regex = self::$tags_regex;
982
+ }
983
+ if (preg_match($tags_regex, $comment->comment_content)) {
984
+ return TRUE;
985
+ } else {
986
+ return FALSE;
987
+ }
988
+ }
989
+
990
+ public static function install() {
991
+ self::update();
992
+ }
993
+
994
+ public static function uninstall() {
995
+
996
+ }
997
+
998
+ public static function update() {
999
+ global $CRAYON_VERSION;
1000
+ CrayonSettingsWP::load_settings(TRUE);
1001
+ $settings = CrayonSettingsWP::get_settings();
1002
+ if ($settings === NULL || !isset($settings[CrayonSettings::VERSION])) {
1003
+ return;
1004
+ }
1005
+
1006
+ $version = $settings[CrayonSettings::VERSION];
1007
+
1008
+ // Only upgrade if the version differs
1009
+ if ($version != $CRAYON_VERSION) {
1010
+ $defaults = CrayonSettings::get_defaults_array();
1011
+ $touched = FALSE;
1012
+
1013
+ // Upgrade database and settings
1014
+
1015
+ if (CrayonUtil::version_compare($version, '1.7.21') < 0) {
1016
+ $settings[CrayonSettings::SCROLL] = $defaults[CrayonSettings::SCROLL];
1017
+ $touched = TRUE;
1018
+ }
1019
+
1020
+ if (CrayonUtil::version_compare($version, '1.7.23') < 0 && $settings[CrayonSettings::FONT] == 'theme-font') {
1021
+ $settings[CrayonSettings::FONT] = $defaults[CrayonSettings::FONT];
1022
+ $touched = TRUE;
1023
+ }
1024
+
1025
+ if (CrayonUtil::version_compare($version, '1.14') < 0) {
1026
+ CrayonLog::syslog("Updated to v1.14: Font size enabled");
1027
+ $settings[CrayonSettings::FONT_SIZE_ENABLE] = true;
1028
+ }
1029
+
1030
+ // Save new version
1031
+ $settings[CrayonSettings::VERSION] = $CRAYON_VERSION;
1032
+ CrayonSettingsWP::save_settings($settings);
1033
+ CrayonLog::syslog("Updated from $version to $CRAYON_VERSION");
1034
+
1035
+ // Refresh to show new settings
1036
+ header('Location: ' . CrayonUtil::current_url());
1037
+ exit();
1038
+ }
1039
+ }
1040
+
1041
+ public static function basename() {
1042
+ return plugin_basename(__FILE__);
1043
+ }
1044
+
1045
+ // This should never be called through AJAX, only server side, since WP will not be loaded
1046
+ public static function wp_load_path() {
1047
+ if (defined('ABSPATH')) {
1048
+ return ABSPATH . 'wp-load.php';
1049
+ } else {
1050
+ CrayonLog::syslog('wp_load_path could not find value for ABSPATH');
1051
+ }
1052
+ }
1053
+
1054
+ public static function pre_excerpt($e) {
1055
+ CrayonLog::debug('pre_excerpt');
1056
+ self::$is_excerpt = TRUE;
1057
+ return $e;
1058
+ }
1059
+
1060
+ public static function post_excerpt($e) {
1061
+ CrayonLog::debug('post_excerpt');
1062
+ self::$is_excerpt = FALSE;
1063
+ $e = self::the_content($e);
1064
+ return $e;
1065
+ }
1066
+
1067
+ public static function post_get_excerpt($e) {
1068
+ CrayonLog::debug('post_get_excerpt');
1069
+ self::$is_excerpt = FALSE;
1070
+ return $e;
1071
+ }
1072
+
1073
+ /**
1074
+ * Converts Crayon tags found in WP to <pre> form.
1075
+ * XXX: This will alter blog content, so backup before calling.
1076
+ * XXX: Do NOT call this while updating posts or comments, it may cause an infinite loop or fail
1077
+ */
1078
+ public static function convert_tags($just_check = FALSE) {
1079
+ $crayon_posts = CrayonSettingsWP::load_legacy_posts();
1080
+ if ($crayon_posts === NULL) {
1081
+ return;
1082
+ }
1083
+
1084
+ self::init_legacy_tag_bits();
1085
+ $args = array(
1086
+ 'callback' => 'CrayonWP::capture_replace_pre',
1087
+ 'ignore' => FALSE,
1088
+ 'preserve_atts' => TRUE,
1089
+ 'flags' => self::$legacy_flags
1090
+ );
1091
+
1092
+ foreach ($crayon_posts as $postID) {
1093
+ $post = get_post($postID);
1094
+ $post_content = $post->post_content;
1095
+ $post_captures = self::capture_crayons($postID, $post_content, array(), $args);
1096
+
1097
+ $post_obj = array();
1098
+ $post_obj['ID'] = $postID;
1099
+ $post_obj['post_content'] = $post_captures['content'];
1100
+ wp_update_post($post_obj);
1101
+ CrayonLog::syslog("Converted Crayons in post ID $postID to pre tags", 'CONVERT');
1102
+
1103
+ if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
1104
+ $comments = get_comments(array('post_id' => $postID));
1105
+ foreach ($comments as $comment) {
1106
+ $commentID = $comment->comment_ID;
1107
+ $comment_captures = self::capture_crayons($commentID, $comment->comment_content, array(CrayonSettings::DECODE => TRUE), $args);
1108
+
1109
+ $comment_obj = array();
1110
+ $comment_obj['comment_ID'] = $commentID;
1111
+ $comment_obj['comment_content'] = $comment_captures['content'];
1112
+ wp_update_comment($comment_obj);
1113
+ CrayonLog::syslog("Converted Crayons in post ID $postID, comment ID $commentID to pre tags", 'CONVERT');
1114
+ }
1115
+ }
1116
+ }
1117
+
1118
+ self::refresh_posts();
1119
+ }
1120
+
1121
+ // Used as capture_crayons callback
1122
+ public static function capture_replace_pre($capture, $original, $id, $is_inline, $wp_content) {
1123
+ $atts = array();
1124
+ $atts['class'] = CrayonUtil::html_attributes($capture['atts'], CrayonGlobalSettings::val_str(CrayonSettings::ATTR_SEP), '');
1125
+ return str_replace($original, CrayonUtil::html_element('pre', $capture['code'], $atts), $wp_content);
1126
+ }
1127
 
1128
  }
1129
 
1130
  // Only if WP is loaded
1131
  if (defined('ABSPATH')) {
1132
+ if (!is_admin()) {
1133
+ register_activation_hook(__FILE__, 'CrayonWP::install');
1134
+ register_deactivation_hook(__FILE__, 'CrayonWP::uninstall');
1135
+
1136
+ // Filters and Actions
1137
+
1138
+ add_filter('init', 'CrayonWP::init');
1139
+
1140
+ CrayonSettingsWP::load_settings(TRUE);
1141
+ if (CrayonGlobalSettings::val(CrayonSettings::MAIN_QUERY)) {
1142
+ add_action('wp', 'CrayonWP::wp', 100);
1143
+ } else {
1144
+ add_filter('the_posts', 'CrayonWP::the_posts', 100);
1145
+ }
1146
+
1147
+ // XXX Some themes like to play with the content, make sure we replace after they're done
1148
+ add_filter('the_content', 'CrayonWP::the_content', 100);
1149
+
1150
+ // Highlight bbPress content
1151
+ add_filter('bbp_get_reply_content', 'CrayonWP::highlight', 100);
1152
+ add_filter('bbp_get_topic_content', 'CrayonWP::highlight', 100);
1153
+ add_filter('bbp_get_forum_content', 'CrayonWP::highlight', 100);
1154
+ add_filter('bbp_get_topic_excerpt', 'CrayonWP::highlight', 100);
1155
+
1156
+ if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
1157
+ /* XXX This is called first to match Crayons, then higher priority replaces after other filters.
1158
+ Prevents Crayon from being formatted by the filters, and also keeps original comment formatting. */
1159
+ add_filter('comment_text', 'CrayonWP::pre_comment_text', 1);
1160
+ add_filter('comment_text', 'CrayonWP::comment_text', 100);
1161
+ }
1162
+
1163
+ // This ensures Crayons are not formatted by WP filters. Other plugins should specify priorities between 1 and 100.
1164
+ add_filter('get_the_excerpt', 'CrayonWP::pre_excerpt', 1);
1165
+ add_filter('get_the_excerpt', 'CrayonWP::post_get_excerpt', 100);
1166
+ add_filter('the_excerpt', 'CrayonWP::post_excerpt', 100);
1167
+
1168
+ add_action('template_redirect', 'CrayonWP::wp_head');
1169
+ } else {
1170
+ // Update between versions
1171
+ CrayonWP::update();
1172
+ // For marking a post as containing a Crayon
1173
+ add_action('save_post', 'CrayonWP::save_post', 10, 2);
1174
+ if (CrayonGlobalSettings::val(CrayonSettings::COMMENTS)) {
1175
+ add_action('comment_post', 'CrayonWP::save_comment', 10, 2);
1176
+ add_action('edit_comment', 'CrayonWP::save_comment', 10, 2);
1177
+ }
1178
+ add_filter('init', 'CrayonWP::init_ajax');
1179
+ }
1180
  }
1181
 
1182
  ?>
css/admin_style.css CHANGED
@@ -209,7 +209,7 @@
209
  vertical-align: top;
210
  }
211
 
212
- #gmail-icon, #twitter-icon, #donate-icon {
213
  width: 24px;
214
  height: 24px;
215
  display: inline-block;
@@ -219,10 +219,18 @@
219
  #twitter-icon {
220
  background: url(images/twitter.png);
221
  }
222
-
223
  #gmail-icon {
224
  background: url(images/google.png);
225
  }
 
 
 
 
 
 
 
 
 
226
 
227
  #donate-icon {
228
  background: url(images/donate.png);
209
  vertical-align: top;
210
  }
211
 
212
+ .small-icon {
213
  width: 24px;
214
  height: 24px;
215
  display: inline-block;
219
  #twitter-icon {
220
  background: url(images/twitter.png);
221
  }
 
222
  #gmail-icon {
223
  background: url(images/google.png);
224
  }
225
+ #docs-icon {
226
+ background: url(images/docs.png);
227
+ }
228
+ #git-icon {
229
+ background: url(images/github.png);
230
+ }
231
+ #wp-icon {
232
+ background: url(images/wordpress-blue.png);
233
+ }
234
 
235
  #donate-icon {
236
  background: url(images/donate.png);
css/crayon_style.css CHANGED
@@ -181,11 +181,16 @@ coloring etc.
181
  background-image: url('images/toolbar/plain.png');
182
  }
183
 
184
- /* Plain Button */
185
  .crayon-toolbar a.crayon-button.crayon-wrap-button {
186
  background-image: url('images/toolbar/wrap.png');
187
  }
188
 
 
 
 
 
 
189
  /* Copy Button */
190
  .crayon-toolbar a.crayon-button.crayon-copy-button {
191
  background-image: url('images/toolbar/copy.png');
@@ -320,24 +325,27 @@ This has been disabled to allow more flexibility in changing font sizes.
320
  line-height: 15px !important;
321
  }
322
  */
323
- .crayon-syntax .crayon-num,
324
- .crayon-syntax .crayon-line {
325
- /*height: 15px;*/
326
- }
327
  .crayon-syntax.crayon-wrapped .crayon-line {
328
  /* min-height: 15px;*/
329
  height: auto;
330
- }
331
 
332
  .crayon-syntax .crayon-num,
333
- .crayon-syntax .crayon-line,
334
  .crayon-syntax .crayon-toolbar *,
335
  .crayon-syntax .crayon-pre * {
336
  font-family: inherit;
337
  font-size: inherit !important;
338
  line-height: inherit !important;
339
  font-weight: inherit !important;
340
- }
 
 
 
 
 
 
 
341
  .crayon-syntax .crayon-toolbar .crayon-tools,
342
  .crayon-syntax .crayon-toolbar .crayon-tools * {
343
  height: inherit !important;
@@ -383,6 +391,10 @@ This has been disabled to allow more flexibility in changing font sizes.
383
  white-space: pre-wrap;
384
  }
385
 
 
 
 
 
386
  /* End Code ======================== */
387
 
388
  /* End AK Code Table ============================================= */
181
  background-image: url('images/toolbar/plain.png');
182
  }
183
 
184
+ /* Wrap Button */
185
  .crayon-toolbar a.crayon-button.crayon-wrap-button {
186
  background-image: url('images/toolbar/wrap.png');
187
  }
188
 
189
+ /* Expand Button */
190
+ .crayon-toolbar a.crayon-button.crayon-expand-button {
191
+ background-image: url('images/toolbar/expand.png');
192
+ }
193
+
194
  /* Copy Button */
195
  .crayon-toolbar a.crayon-button.crayon-copy-button {
196
  background-image: url('images/toolbar/copy.png');
325
  line-height: 15px !important;
326
  }
327
  */
 
 
 
 
328
  .crayon-syntax.crayon-wrapped .crayon-line {
329
  /* min-height: 15px;*/
330
  height: auto;
331
+ }
332
 
333
  .crayon-syntax .crayon-num,
334
+ .crayon-syntax .crayon-pre .crayon-line,
335
  .crayon-syntax .crayon-toolbar *,
336
  .crayon-syntax .crayon-pre * {
337
  font-family: inherit;
338
  font-size: inherit !important;
339
  line-height: inherit !important;
340
  font-weight: inherit !important;
341
+ }
342
+
343
+ .crayon-syntax .crayon-pre .crayon-line span {
344
+ display: inline-block;
345
+ *display: inline;
346
+ zoom: 1;
347
+ }
348
+
349
  .crayon-syntax .crayon-toolbar .crayon-tools,
350
  .crayon-syntax .crayon-toolbar .crayon-tools * {
351
  height: inherit !important;
391
  white-space: pre-wrap;
392
  }
393
 
394
+ .bbp-body .crayon-syntax {
395
+ clear: none !important;
396
+ }
397
+
398
  /* End Code ======================== */
399
 
400
  /* End AK Code Table ============================================= */
css/images/docs.png ADDED
Binary file
css/images/github.png ADDED
Binary file
css/images/toolbar/copy.png CHANGED
Binary file
css/images/toolbar/copy@2x.png ADDED
Binary file
css/images/toolbar/expand.png ADDED
Binary file
css/images/toolbar/expand@2x.png ADDED
Binary file
css/images/toolbar/nums.png CHANGED
Binary file
css/images/toolbar/nums@2x.png ADDED
Binary file
css/images/toolbar/plain.png CHANGED
Binary file
css/images/toolbar/plain@2x.png ADDED
Binary file
css/images/toolbar/plus.png CHANGED
Binary file
css/images/toolbar/plus@2x.png ADDED
Binary file
css/images/toolbar/popup.png CHANGED
Binary file
css/images/toolbar/popup@2x.png ADDED
Binary file
css/images/toolbar/wrap.png CHANGED
Binary file
css/images/toolbar/wrap@2x.png ADDED
Binary file
css/images/wordpress-blue.png ADDED
Binary file
global.php CHANGED
@@ -24,6 +24,8 @@ $CRAYON_DONATE = 'http://bit.ly/crayondonate';
24
  $CRAYON_WEBSITE = 'http://ak.net84.net/projects/crayon-syntax-highlighter';
25
  $CRAYON_EMAIL = 'crayon.syntax@gmail.com';
26
  $CRAYON_TWITTER = 'http://twitter.com/crayonsyntax';
 
 
27
 
28
  // XXX Used to name the class
29
 
@@ -72,7 +74,6 @@ 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');
24
  $CRAYON_WEBSITE = 'http://ak.net84.net/projects/crayon-syntax-highlighter';
25
  $CRAYON_EMAIL = 'crayon.syntax@gmail.com';
26
  $CRAYON_TWITTER = 'http://twitter.com/crayonsyntax';
27
+ $CRAYON_GIT = 'http://github.com/aramkocharyan/crayon-syntax-highlighter/';
28
+ $CRAYON_PLUGIN_WP = 'http://wordpress.org/extend/plugins/crayon-syntax-highlighter/';
29
 
30
  // XXX Used to name the class
31
 
74
  define('CRAYON_JS_UTIL', CRAYON_JS_DIR . 'util.js');
75
  define('CRAYON_CSSJSON_JS', CRAYON_JS_DIR . 'cssjson.js');
76
  define('CRAYON_JS_FANCYBOX', CRAYON_JS_DIR . 'fancybox/jquery.fancybox.init.pack.js');
 
77
  define('CRAYON_CSS_FANCYBOX', CRAYON_JS_DIR . 'fancybox/jquery.fancybox.css');
78
  define('CRAYON_CSS_JQUERY_UI', CRAYON_JS_DIR . 'jquery-ui/jquery-ui.css');
79
  define('CRAYON_JS_JQUERY_UI', CRAYON_JS_DIR . 'jquery-ui/jquery-ui.js');
js/crayon.js CHANGED
@@ -1,6 +1,6 @@
1
  // Crayon Syntax Highlighter JavaScript
2
 
3
- (function($) {
4
 
5
  // BEGIN AUXILIARY FUNCTIONS
6
 
@@ -8,7 +8,7 @@
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
@@ -57,29 +57,31 @@
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-') {
@@ -108,6 +110,7 @@
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);
@@ -123,6 +126,7 @@
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;
@@ -142,7 +146,9 @@
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;
@@ -151,19 +157,33 @@
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
  });
@@ -171,6 +191,15 @@
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);
@@ -182,7 +211,8 @@
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');
187
  var line = $('#' + line_id);
188
  var height = line.style('height');
@@ -200,25 +230,33 @@
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
@@ -235,8 +273,12 @@
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);
@@ -246,21 +288,33 @@
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) {
@@ -268,24 +322,40 @@
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
 
@@ -298,10 +368,10 @@
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
  }
@@ -310,11 +380,11 @@
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
  }
@@ -329,7 +399,7 @@
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');
@@ -349,15 +419,15 @@
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) {
@@ -369,23 +439,32 @@
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';
@@ -396,7 +475,7 @@
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
  }
@@ -415,7 +494,7 @@
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
  }
@@ -426,7 +505,19 @@
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;
@@ -435,7 +526,7 @@
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') {
@@ -452,7 +543,7 @@
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);
@@ -468,13 +559,13 @@
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
  }
@@ -482,7 +573,7 @@
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
 
@@ -527,12 +618,12 @@
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) {
@@ -562,7 +653,7 @@
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;
@@ -610,7 +701,7 @@
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) {
@@ -621,20 +712,28 @@
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) {
@@ -643,7 +742,7 @@
643
  }, 200);
644
  };
645
 
646
- var fix_table_width = function(uid) {
647
  if (typeof crayon[uid] == 'undefined') {
648
  make_uid(uid);
649
  return false;
@@ -651,7 +750,7 @@
651
  };
652
 
653
  // Convert '-10px' to -10
654
- var px_to_int = function(pixels) {
655
  if (typeof pixels != 'string') {
656
  return 0;
657
  }
@@ -663,7 +762,7 @@
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
  }
@@ -677,7 +776,7 @@
677
  }
678
  };
679
 
680
- var update_wrap_button = function(uid) {
681
  if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].wrapped == 'undefined') {
682
  return;
683
  }
@@ -691,7 +790,22 @@
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
  }
@@ -706,7 +820,7 @@
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) {
@@ -721,7 +835,104 @@
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
  }
@@ -731,57 +942,75 @@
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) {
@@ -795,14 +1024,13 @@
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') {
@@ -816,7 +1044,7 @@
816
  return x * crayon[uid].time;
817
  };
818
 
819
- var isNumber = function(x) {
820
  return typeof x == 'number';
821
  };
822
 
1
  // Crayon Syntax Highlighter JavaScript
2
 
3
+ (function ($) {
4
 
5
  // BEGIN AUXILIARY FUNCTIONS
6
 
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
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_EXPAND_BUTTON = '.crayon-expand-button';
61
  var CRAYON_POPUP_BUTTON = '.crayon-popup-button';
62
  var CRAYON_COPY_BUTTON = '.crayon-copy-button';
63
  var CRAYON_PLAIN_BUTTON = '.crayon-plain-button';
64
 
65
+ $(document).ready(function () {
66
  CrayonSyntax.init();
67
  });
68
 
69
+ CrayonSyntax = new function () {
70
+ var base = this;
71
  var crayon = new Object();
72
  var currUID = 0;
73
 
74
+ base.init = function () {
75
  if (typeof crayon == 'undefined') {
76
  crayon = new Object();
77
  }
78
 
79
+ $(CRAYON_SYNTAX).each(function () {
80
+ base.process(this);
81
  });
82
  };
83
 
84
+ base.process = function (c, replace) {
85
  c = $(c);
86
  var uid = c.attr('id');
87
  if (uid == 'crayon-') {
110
  var nums_content = c.find(CRAYON_NUMS_CONTENT);
111
  var nums_button = c.find(CRAYON_NUMS_BUTTON);
112
  var wrap_button = c.find(CRAYON_WRAP_BUTTON);
113
+ var expand_button = c.find(CRAYON_EXPAND_BUTTON);
114
  var popup_button = c.find(CRAYON_POPUP_BUTTON);
115
  var copy_button = c.find(CRAYON_COPY_BUTTON);
116
  var plain_button = c.find(CRAYON_PLAIN_BUTTON);
126
  crayon[uid].nums_content = nums_content;
127
  crayon[uid].nums_button = nums_button;
128
  crayon[uid].wrap_button = wrap_button;
129
+ crayon[uid].expand_button = expand_button;
130
  crayon[uid].popup_button = popup_button;
131
  crayon[uid].copy_button = copy_button;
132
  crayon[uid].plain_button = plain_button;
146
  'height': main_style && main_style.height || '',
147
  'max-height': main_style && main_style.maxHeight || '',
148
  'min-height': main_style && main_style.minHeight || '',
149
+ 'width': main_style && main_style.width || '',
150
+ 'max-width': main_style && main_style.maxWidth || '',
151
+ 'min-width': main_style && main_style.minWidth || ''
152
  };
153
 
154
  var load_timer;
157
  crayon[uid].scroll_block_fix = false;
158
 
159
  // Register click events
160
+ nums_button.click(function () {
161
+ CrayonSyntax.toggle_nums(uid);
162
+ });
163
+ wrap_button.click(function () {
164
+ CrayonSyntax.toggle_wrap(uid);
165
+ });
166
+ expand_button.click(function () {
167
+ CrayonSyntax.toggle_expand(uid);
168
+ });
169
+ plain_button.click(function () {
170
+ CrayonSyntax.toggle_plain(uid);
171
+ });
172
+ copy_button.click(function () {
173
+ CrayonSyntax.copy_plain(uid);
174
+ });
175
+
176
+ // Enable retina if supported
177
+ retina(uid);
178
 
179
+ var load_func = function () {
180
  if (main.height() < 30) {
181
  crayon[uid].scroll_block_fix = true;
182
  }
183
 
184
  // If nums hidden by default
185
  if (nums.filter('[data-settings~="hide"]').length != 0) {
186
+ nums_content.ready(function () {
187
  console_log('function' + uid);
188
  CrayonSyntax.toggle_nums(uid, true, true);
189
  });
191
  update_nums_button(uid);
192
  }
193
 
194
+ if (typeof crayon[uid].expanded == 'undefined') {
195
+ // Determine if we should enable code expanding toggling
196
+ if (Math.abs(crayon[uid].main.width() - crayon[uid].table.width()) < 10) {
197
+ crayon[uid].expand_button.hide();
198
+ } else {
199
+ crayon[uid].expand_button.show();
200
+ }
201
+ }
202
+
203
  // TODO If width has changed or timeout, stop timer
204
  if (/*last_num_width != nums.width() ||*/ i == 5) {
205
  clearInterval(load_timer);
211
  load_timer = setInterval(load_func, 300);
212
  fix_scroll_blank(uid);
213
 
214
+ // Add ref to num for each line
215
+ $(CRAYON_NUM, crayon[uid]).each(function () {
216
  var line_id = $(this).attr('data-line');
217
  var line = $('#' + line_id);
218
  var height = line.style('height');
230
 
231
  // Used to hide info
232
  if (!touchscreen) {
233
+ main.click(function () {
234
+ crayon_info(uid, '', false);
235
+ });
236
+ plain.click(function () {
237
+ crayon_info(uid, '', false);
238
+ });
239
+ info.click(function () {
240
+ crayon_info(uid, '', false);
241
+ });
242
  }
243
 
244
  // Used for code popup
245
+ if (c.filter('[data-settings~="no-popup"]').length == 0) {
246
+ crayon[uid].popup_settings = popupWindow(popup_button, {
247
+ height: screen.height - 200,
248
+ width: screen.width - 100,
249
+ top: 75,
250
+ left: 50,
251
+ scrollbars: 1,
252
+ windowURL: '',
253
+ data: '' // Data overrides URL
254
+ }, function () {
255
+ code_popup(uid);
256
+ }, function () {
257
+ //console_log('after');
258
+ });
259
+ }
260
 
261
  plain.css('opacity', 0);
262
  // If a toolbar with mouseover was found
273
  toolbar.css('z-index', 2);
274
  // Hide on single click when overlayed
275
  if (toolbar.filter('[data-settings~="hide"]').length != 0) {
276
+ main.click(function () {
277
+ toolbar_toggle(uid, undefined, undefined, 0);
278
+ });
279
+ plain.click(function () {
280
+ toolbar_toggle(uid, false, undefined, 0);
281
+ });
282
  }
283
  } else {
284
  toolbar.css('z-index', 4);
288
  crayon[uid].toolbar_delay = 500;
289
  }
290
  // Use .hover() for chrome, but in firefox mouseover/mouseout worked best
291
+ c.mouseenter(function () {
292
+ toolbar_toggle(uid, true);
293
+ })
294
+ .mouseleave(function () {
295
+ toolbar_toggle(uid, false);
296
+ });
297
  } else if (touchscreen) {
298
  toolbar.show();
299
  }
300
+
301
  // Plain show events
302
  if (plain.length != 0 && !touchscreen) {
303
  if (plain.filter('[data-settings~="dblclick"]').length != 0) {
304
+ main.dblclick(function () {
305
+ CrayonSyntax.toggle_plain(uid);
306
+ });
307
  } else if (plain.filter('[data-settings~="click"]').length != 0) {
308
+ main.click(function () {
309
+ CrayonSyntax.toggle_plain(uid);
310
+ });
311
  } else if (plain.filter('[data-settings~="mouseover"]').length != 0) {
312
+ c.mouseenter(function () {
313
+ CrayonSyntax.toggle_plain(uid, true);
314
+ })
315
+ .mouseleave(function () {
316
+ CrayonSyntax.toggle_plain(uid, false);
317
+ });
318
  nums_button.hide();
319
  }
320
  if (plain.filter('[data-settings~="show-plain-default"]').length != 0) {
322
  CrayonSyntax.toggle_plain(uid, true);
323
  }
324
  }
325
+
326
  // Scrollbar show events
327
+ var expand = c.filter('[data-settings~="expand"]').length != 0;
328
+ // crayon[uid].mouse_expand = expand;
329
  if (!touchscreen && c.filter('[data-settings~="scroll-mouseover"]').length != 0) {
330
  // Disable on touchscreen devices and when set to mouseover
331
  main.css('overflow', 'hidden');
332
  plain.css('overflow', 'hidden');
333
+ if (!expand) {
334
+ c.mouseenter(function () {
335
+ toggle_scroll(uid, true, expand);
336
+ })
337
+ .mouseleave(function () {
338
+ toggle_scroll(uid, false, expand);
339
+ });
340
+ }
341
+ }
342
 
343
+ if (expand) {
344
+ c.mouseenter(function () {
345
+ toggle_expand(uid, true);
346
+ })
347
+ .mouseleave(function () {
348
+ toggle_expand(uid, false);
349
+ });
350
  }
351
+
352
  // Disable animations
353
+ if (c.filter('[data-settings~="disable-anim"]').length != 0) {
354
  crayon[uid].time = 0;
355
  }
356
 
357
  // Wrap
358
+ if (c.filter('[data-settings~="wrap"]').length != 0) {
359
  crayon[uid].wrapped = true;
360
  }
361
 
368
  update_wrap(uid);
369
  };
370
 
371
+ var make_uid = function (uid) {
372
  console_log(crayon);
373
  if (typeof crayon[uid] == 'undefined') {
374
+ crayon[uid] = $('#' + uid);
375
  console_log('make ' + uid);
376
  return true;
377
  }
380
  return false;
381
  };
382
 
383
+ var getUID = function () {
384
  return currUID++;
385
  };
386
 
387
+ var code_popup = function (uid) {
388
  if (typeof crayon[uid] == 'undefined') {
389
  return make_uid(uid);
390
  }
399
 
400
  // Unwrap
401
  if (crayon[uid].wrapped) {
402
+ $(CRAYON_NUM, clone).each(function () {
403
  var line_id = $(this).attr('data-line');
404
  var line = $('#' + line_id);
405
  var height = line.attr('data-height');
419
  code = clone.find(CRAYON_MAIN);
420
  }
421
 
422
+ settings.data = base.get_all_css() + '<body class="crayon-popup-window" style="padding:0; margin:0;"><div class="' + clone.attr('class') +
423
  ' crayon-popup">' + remove_css_inline(get_jquery_str(code)) + '</div></body>';
424
  };
425
 
426
+ var get_jquery_str = function (object) {
427
  return $('<div>').append(object.clone()).remove().html();
428
  };
429
 
430
+ var remove_css_inline = function (string) {
431
  var reStyle = /style\s*=\s*"([^"]+)"/gmi;
432
  var match = null;
433
  while ((match = reStyle.exec(string)) != null) {
439
  };
440
 
441
  // Get all CSS on the page as a string
442
+ base.get_all_css = function () {
443
  var css_str = '';
444
+ var css = $('link[rel="stylesheet"]');
445
+ var filtered = [];
446
+ if (css.length == 1) {
447
+ // For minified CSS, only allow a single file
448
+ filtered = css;
449
+ } else {
450
+ // Filter all others for Crayon CSS
451
+ filtered = css.filter('[href*="crayon-syntax-highlighter"]');
452
+ }
453
+ filtered.each(function () {
454
  var string = get_jquery_str($(this));
455
  css_str += string;
456
  });
457
  return css_str;
458
  };
459
 
460
+ base.copy_plain = function (uid, hover) {
461
  if (typeof crayon[uid] == 'undefined') {
462
  return make_uid(uid);
463
  }
464
 
465
  var plain = crayon[uid].plain;
466
 
467
+ base.toggle_plain(uid, true, true);
468
  toolbar_toggle(uid, true);
469
 
470
  key = crayon[uid].mac ? '\u2318' : 'CTRL';
475
  return false;
476
  };
477
 
478
+ var crayon_info = function (uid, text, show) {
479
  if (typeof crayon[uid] == 'undefined') {
480
  return make_uid(uid);
481
  }
494
  info.css('margin-top', -info.height());
495
  info.show();
496
  crayon_slide(uid, info, true);
497
+ setTimeout(function () {
498
  crayon_slide(uid, info, false);
499
  }, 5000);
500
  }
505
 
506
  };
507
 
508
+ var retina = function (uid) {
509
+ if (window.devicePixelRatio > 1) {
510
+ var buttons = $('.crayon-button', crayon[uid].toolbar);
511
+ buttons.each(function () {
512
+ var lowres = $(this).css('background-image');
513
+ var highres = lowres.replace(/\.(?=[^\.]+$)/g, '@2x.');
514
+ $(this).css('background-size', '48px 16px');
515
+ $(this).css('background-image', highres);
516
+ });
517
+ }
518
+ };
519
+
520
+ var crayon_is_slide_hidden = function (object) {
521
  var object_neg_height = '-' + object.height() + 'px';
522
  if (object.css('margin-top') == object_neg_height || object.css('display') == 'none') {
523
  return true;
526
  }
527
  };
528
 
529
+ var crayon_slide = function (uid, object, show, anim_time, hide_delay) {
530
  var object_neg_height = '-' + object.height() + 'px';
531
 
532
  if (typeof show == 'undefined') {
543
  if (anim_time == false) {
544
  anim_time = false;
545
  }
546
+ if (typeof hide_delay == 'undefined') {
547
  hide_delay = 0;
548
  }
549
  object.stop(true);
559
  }
560
  object.animate({
561
  marginTop: object_neg_height
562
+ }, animt(anim_time, uid), function () {
563
  object.hide();
564
  });
565
  }
566
  };
567
 
568
+ base.toggle_plain = function (uid, hover, select) {
569
  if (typeof crayon[uid] == 'undefined') {
570
  return make_uid(uid);
571
  }
573
  var main = crayon[uid].main;
574
  var plain = crayon[uid].plain;
575
 
576
+ if ((main.is(':animated') || plain.is(':animated')) && typeof hover == 'undefined') {
577
  return;
578
  }
579
 
618
  // Show hidden, hide visible
619
  visible.stop(true);
620
  visible.fadeTo(animt(500, uid), 0,
621
+ function () {
622
  visible.css('z-index', 0);
623
  });
624
  hidden.stop(true);
625
  hidden.fadeTo(animt(500, uid), 1,
626
+ function () {
627
  hidden.css('z-index', 1);
628
  // Give focus to plain code
629
  if (hidden == plain) {
653
  return false;
654
  };
655
 
656
+ base.toggle_nums = function (uid, hide, instant) {
657
  if (typeof crayon[uid] == 'undefined') {
658
  make_uid(uid);
659
  return false;
701
  }
702
  crayon[uid].table.animate({
703
  marginLeft: num_margin
704
+ }, animt(200, uid), function () {
705
  if (typeof crayon[uid] != 'undefined') {
706
  update_nums_button(uid);
707
  if (!h_scroll_visible && !v_scroll_visible) {
712
  return false;
713
  };
714
 
715
+ base.toggle_wrap = function (uid) {
716
  crayon[uid].wrapped = !crayon[uid].wrapped;
717
  update_wrap(uid);
718
  };
719
 
720
+ base.toggle_expand = function (uid) {
721
+ var expand = !CrayonUtil.setDefault(crayon[uid].expanded, false);
722
+ toggle_expand(uid, expand);
723
+ };
724
+
725
+ var update_wrap = function (uid) {
726
  if (crayon[uid].wrapped) {
727
  crayon[uid].addClass(CRAYON_WRAPPED);
728
  } else {
729
  crayon[uid].removeClass(CRAYON_WRAPPED);
730
  }
731
  update_wrap_button(uid);
732
+ if (!crayon[uid].expanded) {
733
+ restore_dimensions(uid);
734
+ }
735
  crayon[uid].wrap_times = 0;
736
+ crayon[uid].wrap_timer = setInterval(function () {
737
  reconsile_lines(uid);
738
  crayon[uid].wrap_times++;
739
  if (crayon[uid].wrap_times == 5) {
742
  }, 200);
743
  };
744
 
745
+ var fix_table_width = function (uid) {
746
  if (typeof crayon[uid] == 'undefined') {
747
  make_uid(uid);
748
  return false;
750
  };
751
 
752
  // Convert '-10px' to -10
753
+ var px_to_int = function (pixels) {
754
  if (typeof pixels != 'string') {
755
  return 0;
756
  }
762
  }
763
  };
764
 
765
+ var update_nums_button = function (uid) {
766
  if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].nums_visible == 'undefined') {
767
  return;
768
  }
776
  }
777
  };
778
 
779
+ var update_wrap_button = function (uid) {
780
  if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].wrapped == 'undefined') {
781
  return;
782
  }
790
  }
791
  };
792
 
793
+ var update_expand_button = function (uid) {
794
+ if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].expanded == 'undefined') {
795
+ return;
796
+ }
797
+
798
+ if (crayon[uid].expanded) {
799
+ crayon[uid].expand_button.removeClass(UNPRESSED);
800
+ crayon[uid].expand_button.addClass(PRESSED);
801
+ } else {
802
+ // TODO doesn't work on iPhone
803
+ crayon[uid].expand_button.removeClass(PRESSED);
804
+ crayon[uid].expand_button.addClass(UNPRESSED);
805
+ }
806
+ };
807
+
808
+ var update_plain_button = function (uid) {
809
  if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].plain_visible == 'undefined') {
810
  return;
811
  }
820
  }
821
  };
822
 
823
+ var toolbar_toggle = function (uid, show, anim_time, hide_delay) {
824
  if (typeof crayon[uid] == 'undefined') {
825
  return make_uid(uid);
826
  } else if (!crayon[uid].toolbar_mouseover) {
835
  crayon_slide(uid, toolbar, show, anim_time, hide_delay);
836
  };
837
 
838
+ var initSize = function (uid) {
839
+ // Shared for scrollbars and expanding
840
+ crayon[uid].initialSize = {width: crayon[uid].width(), height: crayon[uid].height()};
841
+ };
842
+
843
+ var toggle_expand = function (uid, expand) {
844
+ if (typeof crayon[uid] == 'undefined') {
845
+ return make_uid(uid);
846
+ }
847
+ if (typeof expand == 'undefined') {
848
+ return;
849
+ }
850
+
851
+ var main = crayon[uid].main;
852
+ var plain = crayon[uid].plain;
853
+
854
+ if (expand) {
855
+ if (typeof crayon[uid].expanded == 'undefined') {
856
+ initSize(uid);
857
+ crayon[uid].finalSize = {width: crayon[uid].table.width(), height: crayon[uid].table.height()};
858
+ // Ensure we don't shrink
859
+ crayon[uid].finalSize.width = CrayonUtil.setMin(crayon[uid].finalSize.width, crayon[uid].initialSize.width);
860
+ crayon[uid].finalSize.height = CrayonUtil.setMin(crayon[uid].finalSize.height, crayon[uid].initialSize.height);
861
+ crayon[uid].diffSize = {
862
+ width: crayon[uid].finalSize.width - crayon[uid].initialSize.width,
863
+ height: crayon[uid].finalSize.height - crayon[uid].initialSize.height
864
+ };
865
+ crayon[uid].expandTime = CrayonUtil.setRange(crayon[uid].diffSize.width / 3, 300, 800);
866
+ crayon[uid].expanded = false;
867
+ }
868
+
869
+ var initialSize = crayon[uid].initialSize;
870
+ var diffSize = crayon[uid].diffSize;
871
+ var finalSize = crayon[uid].finalSize;
872
+
873
+ var expandHeight = {
874
+ 'height': 'auto',
875
+ 'min-height': 'none',
876
+ 'max-height': 'none'
877
+ };
878
+ var expandWidth = {
879
+ 'width': 'auto',
880
+ 'min-width': 'none',
881
+ 'max-width': 'none'
882
+ };
883
+ crayon[uid].height(crayon[uid].height());
884
+ crayon[uid].width(crayon[uid].width());
885
+ crayon[uid].css({
886
+ 'min-width': 'none',
887
+ 'max-width': 'none'
888
+ });
889
+ main.css(expandHeight);
890
+ main.css(expandWidth);
891
+ crayon[uid].stop(true);
892
+ crayon[uid].animate({
893
+ width: finalSize.width,
894
+ height: finalSize.height
895
+ }, animt(crayon[uid].expandTime, uid), function () {
896
+ crayon[uid].expanded = true;
897
+ update_expand_button(uid);
898
+ });
899
+ } else {
900
+ var initialSize = crayon[uid].initialSize;
901
+ var delay = crayon[uid].toolbar_delay;
902
+ if (initialSize) {
903
+ crayon[uid].stop(true);
904
+ if (!crayon[uid].expanded) {
905
+ crayon[uid].delay(delay);
906
+ }
907
+ crayon[uid].animate({
908
+ width: initialSize.width,
909
+ height: initialSize.height
910
+ }, animt(crayon[uid].expandTime, uid), function () {
911
+ expand_finish(uid);
912
+ });
913
+ } else {
914
+ setTimeout(function () {
915
+ expand_finish(uid);
916
+ }, delay);
917
+ }
918
+ }
919
+
920
+ reconsile_dimensions(uid);
921
+ if (expand) {
922
+ update_wrap(uid);
923
+ }
924
+ };
925
+
926
+ var expand_finish = function(uid) {
927
+ crayon[uid].expanded = false;
928
+ restore_dimensions(uid);
929
+ update_expand_button(uid);
930
+ if (crayon[uid].wrapped) {
931
+ update_wrap(uid);
932
+ }
933
+ };
934
+
935
+ var toggle_scroll = function (uid, show, expand) {
936
  if (typeof crayon[uid] == 'undefined') {
937
  return make_uid(uid);
938
  }
942
 
943
  var main = crayon[uid].main;
944
  var plain = crayon[uid].plain;
945
+
946
+ if (typeof crayon[uid].initialSize == 'undefined') {
947
+ initSize(uid);
948
+ }
949
+
950
  if (show) {
951
+ main.height(main.height());
952
+ plain.height(plain.height());
953
+ // Show scrollbars
954
  main.css('overflow', 'auto');
955
  plain.css('overflow', 'auto');
956
  if (typeof crayon[uid].top != 'undefined') {
957
  visible = (main.css('z-index') == 1 ? main : plain);
958
  // Browser will not render until scrollbar moves, move it manually
959
+ visible.scrollTop(crayon[uid].top - 1);
960
  visible.scrollTop(crayon[uid].top);
961
+ visible.scrollLeft(crayon[uid].left - 1);
962
  visible.scrollLeft(crayon[uid].left);
963
  }
 
 
964
  } else {
965
+ // Hide scrollbars
966
  visible = (main.css('z-index') == 1 ? main : plain);
967
  crayon[uid].top = visible.scrollTop();
968
  crayon[uid].left = visible.scrollLeft();
969
  main.css('overflow', 'hidden');
970
  plain.css('overflow', 'hidden');
971
+ // main.height(crayon[uid].initialSize.height);
972
+ // plain.height(crayon[uid].initialSize.height);
973
+
974
+ if (!crayon[uid].expanded) {
975
+ restore_dimensions(uid);
976
+ }
977
+
978
+ //restore_dimensions(uid);
979
  }
980
  // Register that overflow has changed
981
  crayon[uid].scroll_changed = true;
982
  fix_scroll_blank(uid);
 
983
  };
984
 
985
  /* Fix weird draw error, causes blank area to appear where scrollbar once was. */
986
+ var fix_scroll_blank = function (uid) {
987
  // Scrollbar draw error in Chrome
988
  crayon[uid].table.style('width', '100%', 'important');
989
+ var redraw = setTimeout(function () {
990
  crayon[uid].table.style('width', '');
991
  clearInterval(redraw);
992
  }, 10);
993
  };
994
 
995
+ var restore_dimensions = function (uid) {
996
+ // Restore dimensions
997
+ var main = crayon[uid].main;
998
+ var main_style = crayon[uid].main_style;
999
+ main.css(main_style);
1000
+ // Width styles also apply to crayon
1001
+ crayon[uid].css('height', 'auto');
1002
+ crayon[uid].css('width', main_style['width']);
1003
+ crayon[uid].css('max-width', main_style['max-width']);
1004
+ crayon[uid].css('min-width', main_style['min-width']);
1005
+ };
1006
+
1007
+ var reconsile_dimensions = function (uid) {
1008
  // Reconsile dimensions
1009
  crayon[uid].plain.height(crayon[uid].main.height());
1010
  };
1011
 
1012
+ var reconsile_lines = function (uid) {
1013
+ $(CRAYON_NUM, crayon[uid]).each(function () {
1014
  var line_id = $(this).attr('data-line');
1015
  var line = $('#' + line_id);
1016
  if (crayon[uid].wrapped) {
1024
  line.css('height', height);
1025
  $(this).css('height', height);
1026
  }
1027
+ //line.css('height', line.css('line-height'));
1028
+ //console.log(line.css('line-height'));
1029
  }
1030
  });
 
 
 
1031
  };
1032
 
1033
+ var animt = function (x, uid) {
1034
  if (x == 'fast') {
1035
  x = 200;
1036
  } else if (x == 'slow') {
1044
  return x * crayon[uid].time;
1045
  };
1046
 
1047
+ var isNumber = function (x) {
1048
  return typeof x == 'number';
1049
  };
1050
 
js/fancybox/fancybox_init.js DELETED
@@ -1,8 +0,0 @@
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/util.js CHANGED
@@ -4,11 +4,19 @@ var jQueryCrayon = jQuery;
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');
@@ -23,6 +31,47 @@ var CRAYON_DEBUG = false;
23
  return $(base.addPrefixToID(id));
24
  };
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  };
27
 
28
  })(jQueryCrayon);
@@ -114,21 +163,3 @@ var CrayonSyntaxUtil = new function() {
114
  return ext;
115
  };
116
  };
117
-
118
- // http://stackoverflow.com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-were-bound-any-way-around-t
119
-
120
- // [name] is the name of the event "click", "mouseover", ..
121
- // same as you'd pass it to bind()
122
- // [fn] is the handler function
123
- jQueryCrayon.fn.bindFirst = function(name, fn) {
124
- // bind as you normally would
125
- // don't want to miss out on any jQuery magic
126
- this.bind(name, fn);
127
- // Thanks to a comment by @Martin, adding support for
128
- // namespaced events too.
129
- var handlers = this.data('events')[name.split('.')[0]];
130
- // take out the handler we just inserted from the end
131
- var handler = handlers.pop();
132
- // move it at the beginning
133
- handlers.splice(0, 0, handler);
134
- };
4
  var CRAYON_DEBUG = false;
5
 
6
  (function ($) {
7
+
8
+ $(document).ready(function() {
9
+ CrayonUtil.init();
10
+ });
11
 
12
  CrayonUtil = new function() {
13
 
14
  var base = this;
15
+ var settings = null;
16
+
17
+ base.init = function() {
18
+ settings = CrayonSyntaxSettings;
19
+ };
20
 
21
  base.addPrefixToID = function (id) {
22
  return id.replace(/^([#.])?(.*)$/, '$1' + settings.prefix + '$2');
31
  return $(base.addPrefixToID(id));
32
  };
33
 
34
+ base.setDefault = function (v, d) {
35
+ return (typeof v == 'undefined') ? d : v;
36
+ };
37
+
38
+ base.setMax = function (v, max) {
39
+ return v <= max ? v : max;
40
+ };
41
+
42
+ base.setMin = function (v, min) {
43
+ return v >= min ? v : min;
44
+ };
45
+
46
+ base.setRange = function (v, min, max) {
47
+ return base.setMax(base.setMin(v, min), max);
48
+ };
49
+
50
+ base.initFancybox = function() {
51
+ if (fancyboxInit) {
52
+ // Initialise a custom version of Fancybox to avoid conflicting
53
+ fancyboxInit(window, document, $, 'crayonFancybox');
54
+ }
55
+ }
56
+
57
+ };
58
+
59
+ // http://stackoverflow.com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-were-bound-any-way-around-t
60
+
61
+ // [name] is the name of the event "click", "mouseover", ..
62
+ // same as you'd pass it to bind()
63
+ // [fn] is the handler function
64
+ $.fn.bindFirst = function(name, fn) {
65
+ // bind as you normally would
66
+ // don't want to miss out on any jQuery magic
67
+ this.bind(name, fn);
68
+ // Thanks to a comment by @Martin, adding support for
69
+ // namespaced events too.
70
+ var handlers = this.data('events')[name.split('.')[0]];
71
+ // take out the handler we just inserted from the end
72
+ var handler = handlers.pop();
73
+ // move it at the beginning
74
+ handlers.splice(0, 0, handler);
75
  };
76
 
77
  })(jQueryCrayon);
163
  return ext;
164
  };
165
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
langs/yaml/operator.txt CHANGED
@@ -5,6 +5,7 @@
5
  ,
6
  ---
7
  :
 
8
  >
9
  |
10
  .
5
  ,
6
  ---
7
  :
8
+ <
9
  >
10
  |
11
  .
langs/yaml/yaml.txt CHANGED
@@ -3,16 +3,17 @@
3
  # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
 
5
  NAME YAML
6
- VERSION 1.8.1
7
- ALLOW_MIXED NO
8
 
9
- COMMENT #.*?$
10
- QUOTED:IDENTIFIER ("[^"]*")|('[^']*')
11
- VALUES:IDENTIFIER \[[^\]]*\]
12
-
13
- LIST_KEY:STRING ((\-\s*)?[\w-]+(?=\s*:))|(\-\s*(?=\{))
14
- TAG %(\w+)
15
- ANCHOR:CONSTANT &\w+
16
- REF:ENTITY \*\w+
17
- OPERATOR (?alt:operator.txt)
18
- SYMBOL (?default)
 
3
  # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
 
5
  NAME YAML
6
+ VERSION 1.8.1
7
+ ALLOW_MIXED NO
8
 
9
+ COMMENT #.*?$
10
+ QUOTED:IDENTIFIER ("[^"]*")|('[^']*')
11
+ VALUES:IDENTIFIER \[[^\]]*\]
12
+
13
+ DEFAULT (:([^\{\}<>:,\n]*))
14
+ LIST_KEY:STRING ((\-\s*)?[\w-\\]+(?=\s*:))|(\-\s*(?=\{))
15
+ TAG %(\w+)
16
+ ANCHOR:CONSTANT &\w+
17
+ REF:ENTITY \*\w+
18
+ OPERATOR (?alt:operator.txt)
19
+ SYMBOL (?default)
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=AW99E
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
 
@@ -22,6 +22,7 @@ It also supports some neat features like:
22
  * Copy/paste code
23
  * Open code in a new window (popup)
24
  * Line wrapping
 
25
  * bbPress 2 support
26
  * <a href="http://bit.ly/ReRr0i" target="_blank">Converting legacy code in blog posts/comments to &lt;pre&gt;</a>
27
  * Remote request caching
@@ -38,6 +39,7 @@ It also supports some neat features like:
38
  * Tab sizes
39
  * Code title
40
  * Toggled toolbar
 
41
  * Striped lines
42
  * Line marking (for important lines)
43
  * <a href="http://ak.net84.net/crayon/line-ranges-in-crayon/" target="_blank">Line ranges (showing only parts of the code)</a>
@@ -111,12 +113,13 @@ See the <a href="http://ak.net84.net/projects/crayon-language-file-specification
111
 
112
  * Chinese (Simplified, thanks to <a href="http://smerpup.com/" target="_blank">Dezhi Liu</a> & <a href="http://neverno.me/" target="_blank">Jash Yin</a>)
113
  * Dutch (thanks to <a href="https://twitter.com/#!/chilionsnoek" target="_blank">Chilion Snoek</a>)
114
- * French
115
  * German (thanks to <a href="http://www.technologyblog.de/" target="_blank">Stephan Knau&szlig;</a>)
116
  * Italian (thanks to <a href="http://www.federicobellucci.net/" target="_blank">Federico Bellucci</a>)
 
117
  * Lithuanian (thanks to <a href="http://www.host1free.com" target="_blank">Vincent G</a>)
 
118
  * Spanish (thanks to <a href="http://www.hbravo.com/" target="_blank">Hermann Bravo</a>)
119
- * Japanese (thanks to <a href="https://twitter.com/#!/west_323" target="_blank">@west_323</a>)
120
  * Russian (thanks to <a href="http://simplelib.com" target="_blank">Minimus</a> & <a href="http://atlocal.net/" target="_blank">Di_Skyer</a>)
121
  * Turkish (thanks to <a href="http://hakanertr.wordpress.com" target="_blank">Hakan</a>)
122
  * Help from translators at improving/adding to this list greatly appreciated!
@@ -140,7 +143,7 @@ These are helpful for discovering new features.
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>
@@ -167,6 +170,7 @@ A handful of articles from others written about Crayon, thanks guys!
167
 
168
  Thanks to all those who donate to my project, your support keeps the Crayons going!
169
 
 
170
  * Jack Fruh, (http://basementjack.com/), USA
171
  * Ross Barbieri, USA
172
  * Will, Simple Phishing Toolkit (http://www.sptoolkit.com/), USA
@@ -251,6 +255,40 @@ Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
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.
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.5
8
+ Stable tag: 1.17
9
 
10
  Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
11
 
22
  * Copy/paste code
23
  * Open code in a new window (popup)
24
  * Line wrapping
25
+ * Code expanding
26
  * bbPress 2 support
27
  * <a href="http://bit.ly/ReRr0i" target="_blank">Converting legacy code in blog posts/comments to &lt;pre&gt;</a>
28
  * Remote request caching
39
  * Tab sizes
40
  * Code title
41
  * Toggled toolbar
42
+ * Retina buttons
43
  * Striped lines
44
  * Line marking (for important lines)
45
  * <a href="http://ak.net84.net/crayon/line-ranges-in-crayon/" target="_blank">Line ranges (showing only parts of the code)</a>
113
 
114
  * Chinese (Simplified, thanks to <a href="http://smerpup.com/" target="_blank">Dezhi Liu</a> & <a href="http://neverno.me/" target="_blank">Jash Yin</a>)
115
  * Dutch (thanks to <a href="https://twitter.com/#!/chilionsnoek" target="_blank">Chilion Snoek</a>)
116
+ * French (thanks to <a href="http://tech.dupeu.pl" target="_blank">Victor Felder</a>)
117
  * German (thanks to <a href="http://www.technologyblog.de/" target="_blank">Stephan Knau&szlig;</a>)
118
  * Italian (thanks to <a href="http://www.federicobellucci.net/" target="_blank">Federico Bellucci</a>)
119
+ * Japanese (thanks to <a href="https://twitter.com/#!/west_323" target="_blank">@west_323</a>)
120
  * Lithuanian (thanks to <a href="http://www.host1free.com" target="_blank">Vincent G</a>)
121
+ * Portuguese (thanks to <a href="http://www.adonai.eti.br" target="_blank">Adonai S. Canez</a>)
122
  * Spanish (thanks to <a href="http://www.hbravo.com/" target="_blank">Hermann Bravo</a>)
 
123
  * Russian (thanks to <a href="http://simplelib.com" target="_blank">Minimus</a> & <a href="http://atlocal.net/" target="_blank">Di_Skyer</a>)
124
  * Turkish (thanks to <a href="http://hakanertr.wordpress.com" target="_blank">Hakan</a>)
125
  * Help from translators at improving/adding to this list greatly appreciated!
143
  A handful of articles from others written about Crayon, thanks guys!
144
 
145
  * <a href="http://icrunched.co/top-5-syntax-highlighter-wordpress-plugins/" target="_blank">Top 5 Syntax Highlighter WordPress Plugins</a>
146
+ * <a href="http://themesplugins.com/wordpress-Plugin/add-php-java-html-codes-posts-pages/" target="_blank">Crayon Syntax Highlighter � Plugin</a>
147
  * <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>
148
  * <a href="http://www.techbrunch.fr/informations/plugin-wordpress-afficher-code-source/" target="_blank">The ultimate plugin for displaying code in WordPress (French)</a>
149
  * <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>
170
 
171
  Thanks to all those who donate to my project, your support keeps the Crayons going!
172
 
173
+ * Johannes Luijten, (http://www.tweaking4all.com/, http://www.weethet.nl/), USA
174
  * Jack Fruh, (http://basementjack.com/), USA
175
  * Ross Barbieri, USA
176
  * Will, Simple Phishing Toolkit (http://www.sptoolkit.com/), USA
255
 
256
  == Changelog ==
257
 
258
+ = 1.17 =
259
+ * ADDED:
260
+ * Selected text in the TinyMCE editor is now added into the code box of the Tag Editor
261
+ * Retina buttons for the toolbar
262
+ * Support for Wordpress 3.5
263
+ * FIXED:
264
+ * Removed fancybox_init.js and integrated into util.js, other minor improvements in loading Tag Editor
265
+ * Disabling popup now removes the JS resource
266
+ * Refactored Tag Editor functions
267
+ * Display Tag Editor settings on the frontend wasn't working
268
+ * Removed contextual help and added more useful links, including online help
269
+ * Checkboxes have labels instead of spans thanks to https://github.com/toszcze
270
+ * Undefined php variable fix thanks to https://github.com/toszcze
271
+ * Dimension fixes in js on hover
272
+ * On iOS the fonts appeared larger for code than for line numbers.
273
+ * Expanding code shrunk instead if the toolbar was visible
274
+ * Updated Turkish
275
+
276
+ = 1.16 =
277
+ * ADDED:
278
+ * Expanding code beyond the page border on mouseover - enable the setting under Settings > Crayon > Code.
279
+ * Expanding the code is delayed in the same way using the toolbar delay setting.
280
+ * French translation
281
+ * Portuguese translation
282
+ * FIXED:
283
+ * Carriage returns and new line characters were being treated differently and not being detected correctly. I'm using a new regex which detects both and also captures the line content: (?:^|(?<=\r\n|\n))[^\r\n]*
284
+ * JS variable bugs when minifying with W3 Total Cache
285
+ * CSS did not load in newly opened code window if minified
286
+ * Saved comments did not capture Crayons until they were updated or the post list was refreshed in settings
287
+ * Posts in settings are sorted now descending based on modified date
288
+ * bbPress posts showed Crayons on the bottom of posts irrespective of their position in the post content.
289
+ * Toggle plain code button appeared when plain code was disabled
290
+ * Updated Turkish translation
291
+
292
  = 1.15 =
293
  * ADDED:
294
  * 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.
themes/classic/classic.css CHANGED
@@ -24,10 +24,10 @@ Author URI: http://ak.net84.net/
24
  }
25
 
26
  /* Line Numbers */
27
- .crayon-theme-classic .crayon-nums {
28
  background: #dfefff !important;
29
  color: #5499de !important;
30
- border-right: 1px solid #b3d3f3 !important;
31
  }
32
 
33
  /* Selection */
@@ -49,11 +49,9 @@ Author URI: http://ak.net84.net/
49
  /* Striped Lines */
50
  .crayon-theme-classic .crayon-striped-line {
51
  background: #f7f7f7 !important;
52
- border: 1px #CCC !important;
53
  }
54
  .crayon-theme-classic .crayon-striped-num {
55
  background: #c8e1fa !important;
56
- border: 1px #CCC !important;
57
  color: #317cc5 !important;
58
  }
59
 
24
  }
25
 
26
  /* Line Numbers */
27
+ .crayon-theme-classic .crayon-table .crayon-nums {
28
  background: #dfefff !important;
29
  color: #5499de !important;
30
+ /* border-right: 1px solid #b3d3f3 !important; */
31
  }
32
 
33
  /* Selection */
49
  /* Striped Lines */
50
  .crayon-theme-classic .crayon-striped-line {
51
  background: #f7f7f7 !important;
 
52
  }
53
  .crayon-theme-classic .crayon-striped-num {
54
  background: #c8e1fa !important;
 
55
  color: #317cc5 !important;
56
  }
57
 
trans/crayon-syntax-highlighter-fr_FR.mo CHANGED
Binary file
trans/crayon-syntax-highlighter-fr_FR.po CHANGED
@@ -2,818 +2,965 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: crayon-syntax-highlighter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-05-06 12:08+1000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: French\n"
14
- "X-Poedit-Country: FRANCE\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;crayon__;crayon_n;crayon_e\n"
 
 
17
  "X-Poedit-Basepath: .\n"
18
  "X-Textdomain-Support: yes\n"
 
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Poedit-SearchPath-1: ..\n"
21
 
22
  # @ crayon-syntax-highlighter
23
- #: ../crayon_formatter.class.php:266
24
  msgid "Toggle Plain Code"
25
- msgstr "Basculer code plaine"
26
 
27
  # @ crayon-syntax-highlighter
28
- #: ../crayon_formatter.class.php:268
 
 
 
 
 
 
29
  #, php-format
30
  msgid "Press %s to Copy, %s to Paste"
31
- msgstr "Presse %s à Copier, Coller à %s"
32
 
33
  # @ crayon-syntax-highlighter
34
- #: ../crayon_formatter.class.php:268
35
  msgid "Copy Plain Code"
36
- msgstr "Copier le code ordinaire"
37
 
38
  # @ crayon-syntax-highlighter
39
- #: ../crayon_formatter.class.php:270
40
  msgid "Open Code In New Window"
41
- msgstr "Code dans la nouvelle fenêtre"
42
 
43
  # @ crayon-syntax-highlighter
44
- #: ../crayon_formatter.class.php:273
45
  msgid "Toggle Line Numbers"
46
- msgstr "Numéros de ligne Basculer"
47
 
48
  # @ crayon-syntax-highlighter
49
  #: ../crayon_formatter.class.php:279
50
  msgid "Contains Mixed Languages"
51
- msgstr "Contient un mélange de langues"
52
 
53
  # @ crayon-syntax-highlighter
54
- #: ../crayon_settings.class.php:138
55
  msgid "Hourly"
56
- msgstr "Horaires"
57
 
58
  # @ crayon-syntax-highlighter
59
- #: ../crayon_settings.class.php:138
60
  msgid "Daily"
61
- msgstr "Daily"
62
 
63
  # @ crayon-syntax-highlighter
64
- #: ../crayon_settings.class.php:139
65
  msgid "Weekly"
66
- msgstr "Hebdomadaire"
67
 
68
  # @ crayon-syntax-highlighter
69
- #: ../crayon_settings.class.php:139
70
  msgid "Monthly"
71
- msgstr "Mensuel"
72
 
73
  # @ crayon-syntax-highlighter
74
- #: ../crayon_settings.class.php:140
75
  msgid "Immediately"
76
- msgstr "Immédiatement"
77
 
78
  # @ crayon-syntax-highlighter
79
- #: ../crayon_settings.class.php:150
80
- #: ../crayon_settings.class.php:154
81
  msgid "Max"
82
  msgstr "Max"
83
 
84
  # @ crayon-syntax-highlighter
85
- #: ../crayon_settings.class.php:150
86
- #: ../crayon_settings.class.php:154
87
  msgid "Min"
88
  msgstr "Min"
89
 
90
  # @ crayon-syntax-highlighter
91
- #: ../crayon_settings.class.php:150
92
- #: ../crayon_settings.class.php:154
93
  msgid "Static"
94
  msgstr "Statique"
95
 
96
  # @ crayon-syntax-highlighter
97
- #: ../crayon_settings.class.php:152
98
- #: ../crayon_settings.class.php:156
99
- #: ../crayon_settings_wp.class.php:541
100
- #: ../crayon_settings_wp.class.php:550
101
- #: ../crayon_settings_wp.class.php:649
102
  msgid "Pixels"
103
  msgstr "Pixels"
104
 
105
  # @ crayon-syntax-highlighter
106
- #: ../crayon_settings.class.php:152
107
- #: ../crayon_settings.class.php:156
108
  msgid "Percent"
109
- msgstr "Pour cent"
110
 
111
  # @ crayon-syntax-highlighter
112
- #: ../crayon_settings.class.php:165
113
  msgid "None"
114
  msgstr "Aucun"
115
 
116
  # @ crayon-syntax-highlighter
117
- #: ../crayon_settings.class.php:165
118
  msgid "Left"
119
  msgstr "Gauche"
120
 
121
  # @ crayon-syntax-highlighter
122
- #: ../crayon_settings.class.php:165
123
  msgid "Center"
124
  msgstr "Centre"
125
 
126
  # @ crayon-syntax-highlighter
127
- #: ../crayon_settings.class.php:165
128
  msgid "Right"
129
  msgstr "Droite"
130
 
131
  # @ crayon-syntax-highlighter
132
- #: ../crayon_settings.class.php:167
133
- #: ../crayon_settings.class.php:189
134
  msgid "On MouseOver"
135
- msgstr "Sur MouseOver"
136
 
137
  # @ crayon-syntax-highlighter
138
- #: ../crayon_settings.class.php:167
139
- #: ../crayon_settings.class.php:173
140
  msgid "Always"
141
  msgstr "Toujours"
142
 
143
  # @ crayon-syntax-highlighter
144
- #: ../crayon_settings.class.php:167
145
- #: ../crayon_settings.class.php:173
146
  msgid "Never"
147
  msgstr "Jamais"
148
 
149
  # @ crayon-syntax-highlighter
150
- #: ../crayon_settings.class.php:173
151
  msgid "When Found"
152
- msgstr "Une fois trouvé"
153
 
154
  # @ crayon-syntax-highlighter
155
- #: ../crayon_settings.class.php:189
156
  msgid "On Double Click"
157
- msgstr "Le double-clic"
158
 
159
  # @ crayon-syntax-highlighter
160
- #: ../crayon_settings.class.php:189
161
  msgid "On Single Click"
162
- msgstr "Le Single Cliquez"
163
 
164
  # @ crayon-syntax-highlighter
165
- #: ../crayon_settings.class.php:189
166
  msgid "Disable Mouse Events"
167
  msgstr "Désactiver les événements souris"
168
 
169
  # @ crayon-syntax-highlighter
170
- #: ../crayon_settings.class.php:196
171
  msgid "An error has occurred. Please try again later."
172
- msgstr "Une erreur s'est produite. S'il vous plaît essayez de nouveau plus tard."
173
 
174
  # @ crayon-syntax-highlighter
175
- #: ../crayon_settings_wp.class.php:44
176
- #: ../crayon_settings_wp.class.php:118
177
- #: ../crayon_settings_wp.class.php:802
178
  msgid "Settings"
179
- msgstr "Réglages"
180
 
181
  # @ crayon-syntax-highlighter
182
- #: ../crayon_settings_wp.class.php:99
183
  msgid "You do not have sufficient permissions to access this page."
184
- msgstr "Vous n'avez pas les autorisations suffisantes pour accéder à cette page."
185
 
186
  # @ crayon-syntax-highlighter
187
- #: ../crayon_settings_wp.class.php:130
188
  msgid "Save Changes"
189
  msgstr "Enregistrer les modifications"
190
 
191
  # @ crayon-syntax-highlighter
192
- #: ../crayon_settings_wp.class.php:136
193
  msgid "Reset Settings"
194
  msgstr "Réinitialiser les paramètres"
195
 
196
  # @ crayon-syntax-highlighter
197
- #: ../crayon_settings_wp.class.php:301
198
  msgid "General"
199
  msgstr "Général"
200
 
201
  # @ crayon-syntax-highlighter
202
- #: ../crayon_settings_wp.class.php:302
203
  msgid "Theme"
204
- msgstr "Theme"
205
 
206
  # @ crayon-syntax-highlighter
207
- #: ../crayon_settings_wp.class.php:303
208
  msgid "Font"
209
- msgstr "Son"
210
 
211
  # @ crayon-syntax-highlighter
212
- #: ../crayon_settings_wp.class.php:304
213
  msgid "Metrics"
214
- msgstr "Mesures"
215
 
216
  # @ crayon-syntax-highlighter
217
- #: ../crayon_settings_wp.class.php:305
218
  msgid "Toolbar"
219
  msgstr "Barre d'outils"
220
 
221
  # @ crayon-syntax-highlighter
222
- #: ../crayon_settings_wp.class.php:306
223
  msgid "Lines"
224
  msgstr "Lignes"
225
 
226
  # @ crayon-syntax-highlighter
227
- #: ../crayon_settings_wp.class.php:307
 
228
  msgid "Code"
229
  msgstr "Code"
230
 
231
  # @ crayon-syntax-highlighter
232
- #: ../crayon_settings_wp.class.php:308
233
  msgid "Tags"
234
  msgstr "Mots-clés"
235
 
236
  # @ crayon-syntax-highlighter
237
- #: ../crayon_settings_wp.class.php:309
238
  msgid "Languages"
239
- msgstr "Langues"
240
 
241
  # @ crayon-syntax-highlighter
242
- #: ../crayon_settings_wp.class.php:310
243
  msgid "Files"
244
  msgstr "Fichiers"
245
 
 
 
 
 
246
  # @ crayon-syntax-highlighter
247
- #: ../crayon_settings_wp.class.php:311
248
  msgid "Tag Editor"
249
  msgstr "Éditeur de Tag"
250
 
251
  # @ crayon-syntax-highlighter
252
- #: ../crayon_settings_wp.class.php:312
253
  msgid "Misc"
254
  msgstr "Divers"
255
 
256
  # @ crayon-syntax-highlighter
257
- #: ../crayon_settings_wp.class.php:315
258
  msgid "Debug"
259
  msgstr "Débogage"
260
 
261
  # @ crayon-syntax-highlighter
262
- #: ../crayon_settings_wp.class.php:316
263
  msgid "Errors"
264
  msgstr "Erreurs"
265
 
266
  # @ crayon-syntax-highlighter
267
- #: ../crayon_settings_wp.class.php:317
268
  msgid "Log"
269
- msgstr "Connexion"
270
 
271
  # @ crayon-syntax-highlighter
272
- #: ../crayon_settings_wp.class.php:320
273
  msgid "About"
274
  msgstr "À propos"
275
 
276
  # @ crayon-syntax-highlighter
277
- #: ../crayon_settings_wp.class.php:503
278
  msgid "Crayon Help"
279
  msgstr "Aide Crayon"
280
 
281
  # @ crayon-syntax-highlighter
282
- #: ../crayon_settings_wp.class.php:518
283
  msgid "Height"
284
  msgstr "Hauteur"
285
 
286
  # @ crayon-syntax-highlighter
287
- #: ../crayon_settings_wp.class.php:524
288
  msgid "Width"
289
  msgstr "Largeur"
290
 
291
  # @ crayon-syntax-highlighter
292
- #: ../crayon_settings_wp.class.php:530
293
  msgid "Top Margin"
294
  msgstr "Marge supérieure"
295
 
296
  # @ crayon-syntax-highlighter
297
- #: ../crayon_settings_wp.class.php:531
298
  msgid "Bottom Margin"
299
- msgstr "La marge du bas"
300
 
301
  # @ crayon-syntax-highlighter
302
- #: ../crayon_settings_wp.class.php:532
303
- #: ../crayon_settings_wp.class.php:537
304
  msgid "Left Margin"
305
- msgstr "Marge de gauche"
306
 
307
  # @ crayon-syntax-highlighter
308
- #: ../crayon_settings_wp.class.php:533
309
- #: ../crayon_settings_wp.class.php:537
310
  msgid "Right Margin"
311
  msgstr "Marge droite"
312
 
313
  # @ crayon-syntax-highlighter
314
- #: ../crayon_settings_wp.class.php:543
315
  msgid "Horizontal Alignment"
316
  msgstr "Alignement horizontal"
317
 
318
  # @ crayon-syntax-highlighter
319
- #: ../crayon_settings_wp.class.php:546
320
  msgid "Allow floating elements to surround Crayon"
321
- msgstr "Autoriser des éléments flottants pour encercler Crayon"
322
 
323
  # @ crayon-syntax-highlighter
324
- #: ../crayon_settings_wp.class.php:548
325
  msgid "Inline Margin"
326
- msgstr "Marge en ligne"
327
 
328
  # @ crayon-syntax-highlighter
329
- #: ../crayon_settings_wp.class.php:556
330
  msgid "Display the Toolbar"
331
  msgstr "Afficher la barre d'outils"
332
 
333
  # @ crayon-syntax-highlighter
334
- #: ../crayon_settings_wp.class.php:559
335
  msgid "Overlay the toolbar on code rather than push it down when possible"
336
- msgstr "Superposition de la barre d'outils sur le code plutôt que de le pousser vers le bas si possible"
 
 
337
 
338
  # @ crayon-syntax-highlighter
339
- #: ../crayon_settings_wp.class.php:560
340
  msgid "Toggle the toolbar on single click when it is overlayed"
341
  msgstr "Basculer la barre d'outils sur simple clic quand il est superposé"
342
 
343
  # @ crayon-syntax-highlighter
344
- #: ../crayon_settings_wp.class.php:561
345
  msgid "Delay hiding the toolbar on MouseOut"
346
- msgstr "Retard cacher la barre d'outils sur le MouseOut"
 
347
 
348
  # @ crayon-syntax-highlighter
349
- #: ../crayon_settings_wp.class.php:563
350
  msgid "Display the title when provided"
351
  msgstr "Afficher le titre lorsqu'il est fourni"
352
 
353
  # @ crayon-syntax-highlighter
354
- #: ../crayon_settings_wp.class.php:564
355
  msgid "Display the language"
356
- msgstr "Affichage de la langue"
357
 
358
  # @ crayon-syntax-highlighter
359
- #: ../crayon_settings_wp.class.php:571
360
  msgid "Display striped code lines"
361
- msgstr "Affichage des lignes de code rayée"
362
 
363
  # @ crayon-syntax-highlighter
364
- #: ../crayon_settings_wp.class.php:572
365
  msgid "Enable line marking for important lines"
366
- msgstr "Activer la ligne de marquage des lignes importantes"
 
 
 
 
367
 
368
  # @ crayon-syntax-highlighter
369
- #: ../crayon_settings_wp.class.php:573
370
  msgid "Display line numbers by default"
371
  msgstr "Afficher les numéros de ligne par défaut"
372
 
373
  # @ crayon-syntax-highlighter
374
- #: ../crayon_settings_wp.class.php:574
375
  msgid "Enable line number toggling"
376
- msgstr "Activer basculer le numéro de ligne"
 
 
 
 
 
 
377
 
378
  # @ crayon-syntax-highlighter
379
- #: ../crayon_settings_wp.class.php:575
 
 
 
 
 
 
380
  msgid "Start line numbers from"
381
- msgstr "Démarrer à partir des numéros de ligne"
382
 
383
  # @ crayon-syntax-highlighter
384
- #: ../crayon_settings_wp.class.php:585
385
  msgid "When no language is provided, use the fallback"
386
- msgstr "Lorsque aucune langue n'est fourni, utilisez le repli"
387
 
388
  # @ crayon-syntax-highlighter
389
- #: ../crayon_settings_wp.class.php:591
390
  #, php-format
391
  msgid "%d language has been detected."
392
- msgstr "%s langue a été détectée."
393
 
394
  # @ crayon-syntax-highlighter
395
- #: ../crayon_settings_wp.class.php:592
396
  msgid "Parsing was successful"
397
- msgstr "Parsing a réussi"
398
 
399
  # @ crayon-syntax-highlighter
400
- #: ../crayon_settings_wp.class.php:592
401
  msgid "Parsing was unsuccessful"
402
- msgstr "Parsing a échoué"
403
 
404
  # @ crayon-syntax-highlighter
405
- #: ../crayon_settings_wp.class.php:598
406
  #, php-format
407
  msgid "The selected language with id %s could not be loaded"
408
- msgstr "La langue sélectionnée avec id %s ne pouvait pas être chargé"
409
 
410
  # @ crayon-syntax-highlighter
411
- #: ../crayon_settings_wp.class.php:602
412
  msgid "Show Languages"
413
- msgstr "Voir langues"
 
 
 
 
 
 
 
 
 
 
 
 
414
 
415
  # @ crayon-syntax-highlighter
416
- #: ../crayon_settings_wp.class.php:621
417
- msgid "Loading..."
418
- msgstr "Chargement..."
 
 
 
 
 
 
 
 
 
419
 
420
  # @ crayon-syntax-highlighter
421
- #: ../crayon_settings_wp.class.php:621
422
- #: ../crayon_settings_wp.class.php:804
423
- msgid "Theme Editor"
424
- msgstr "Éditeur de thème"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
 
426
  # @ crayon-syntax-highlighter
427
- #: ../crayon_settings_wp.class.php:626
428
  #, php-format
429
- msgid "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 are marked."
430
- msgstr "Changer la %1$slangue de repli%2$s pour changer le code d'échantillon. Lignes 5-7 sont marquées."
 
 
 
 
431
 
432
  # @ crayon-syntax-highlighter
433
- #: ../crayon_settings_wp.class.php:630
434
  msgid "Enable Live Preview"
435
- msgstr "Activer l'aperçu en direct"
436
 
437
  # @ crayon-syntax-highlighter
438
- #: ../crayon_settings_wp.class.php:632
439
  msgid "Enqueue themes in the header (more efficient)."
440
- msgstr "Enqueue thèmes dans l'en-tête (plus efficace)."
441
 
442
  # @ crayon-syntax-highlighter
443
- #: ../crayon_settings_wp.class.php:632
444
- #: ../crayon_settings_wp.class.php:658
445
- #: ../crayon_settings_wp.class.php:683
446
- #: ../crayon_settings_wp.class.php:690
447
- #: ../crayon_settings_wp.class.php:691
448
- #: ../crayon_settings_wp.class.php:692
449
- #: ../crayon_settings_wp.class.php:693
450
- #: ../crayon_settings_wp.class.php:694
451
- #: ../crayon_settings_wp.class.php:695
452
- #: ../crayon_settings_wp.class.php:709
453
- #: ../crayon_settings_wp.class.php:716
454
- #: ../crayon_settings_wp.class.php:717
455
- msgid "?"
456
- msgstr ""
457
-
458
- # @ crayon-syntax-highlighter
459
- #: ../crayon_settings_wp.class.php:635
460
  #, php-format
461
  msgid "The selected theme with id %s could not be loaded"
462
- msgstr "Le thème choisi avec id %s ne pouvait pas être chargé"
463
 
464
  # @ crayon-syntax-highlighter
465
- #: ../crayon_settings_wp.class.php:647
466
  msgid "Custom Font Size"
467
- msgstr "Taille du texte personnalisé"
468
 
469
  # @ crayon-syntax-highlighter
470
- #: ../crayon_settings_wp.class.php:652
471
  #, php-format
472
  msgid "The selected font with id %s could not be loaded"
473
- msgstr "La police sélectionnée avec id %s ne pouvait pas être chargé"
474
 
475
  # @ crayon-syntax-highlighter
476
- #: ../crayon_settings_wp.class.php:658
477
  msgid "Enqueue fonts in the header (more efficient)."
478
- msgstr "Enqueue polices de caractères dans l'en-tête (plus efficace)."
479
 
480
  # @ crayon-syntax-highlighter
481
- #: ../crayon_settings_wp.class.php:663
482
  msgid "Enable plain code view and display"
483
- msgstr "Activer le mode code clair et d'affichage"
484
 
485
  # @ crayon-syntax-highlighter
486
- #: ../crayon_settings_wp.class.php:666
487
  msgid "Enable plain code toggling"
488
- msgstr "Activer le code basculer plaine"
489
 
490
  # @ crayon-syntax-highlighter
491
- #: ../crayon_settings_wp.class.php:667
492
  msgid "Show the plain code by default"
493
  msgstr "Montrer le code brut par défaut"
494
 
495
  # @ crayon-syntax-highlighter
496
- #: ../crayon_settings_wp.class.php:668
497
  msgid "Enable code copy/paste"
498
- msgstr "Activer copiez le code/coller"
499
 
500
  # @ crayon-syntax-highlighter
501
- #: ../crayon_settings_wp.class.php:670
502
  msgid "Enable opening code in a window"
503
- msgstr "Activer code d'ouverture dans une fenêtre"
504
 
505
  # @ crayon-syntax-highlighter
506
- #: ../crayon_settings_wp.class.php:671
507
  msgid "Always display scrollbars"
508
  msgstr "Toujours afficher les barres de défilement"
509
 
510
  # @ crayon-syntax-highlighter
511
- #: ../crayon_settings_wp.class.php:672
512
- msgid "Tab size in spaces"
513
- msgstr "Taille des tabulations dans les espaces"
514
-
515
- # @ crayon-syntax-highlighter
516
- #: ../crayon_settings_wp.class.php:677
517
  msgid "Decode HTML entities in code"
518
- msgstr "Décoder des entités HTML dans le code"
519
 
520
  # @ crayon-syntax-highlighter
521
- #: ../crayon_settings_wp.class.php:679
522
  msgid "Decode HTML entities in attributes"
523
- msgstr "Décoder des entités HTML dans les attributs"
524
 
525
  # @ crayon-syntax-highlighter
526
- #: ../crayon_settings_wp.class.php:681
527
  msgid "Remove whitespace surrounding the shortcode content"
528
- msgstr "Enlevez les espaces entourant le contenu shortcode"
529
 
530
  # @ crayon-syntax-highlighter
531
- #: ../crayon_settings_wp.class.php:683
532
  msgid "Allow Mixed Language Highlighting with delimiters and tags."
533
- msgstr "Autoriser Soulignant langue mélangée avec des délimiteurs et des tags."
534
 
535
  # @ crayon-syntax-highlighter
536
- #: ../crayon_settings_wp.class.php:685
537
  msgid "Show Mixed Language Icon (+)"
538
- msgstr "Afficher l'icône Langue mixte (+)"
539
 
540
  # @ crayon-syntax-highlighter
541
- #: ../crayon_settings_wp.class.php:690
 
 
 
 
 
 
 
 
 
 
 
 
 
542
  msgid "Capture Mini Tags like [php][/php] as Crayons."
543
- msgstr "Capturez Balises Mini tels que [php][/php] Crayons."
544
 
545
  # @ crayon-syntax-highlighter
546
- #: ../crayon_settings_wp.class.php:691
547
  msgid "Capture Inline Tags like {php}{/php} inside sentences."
548
- msgstr "Capturez Mots Inline comme {php} {/php} à l'intérieur des phrases."
549
 
550
  # @ crayon-syntax-highlighter
551
- #: ../crayon_settings_wp.class.php:692
552
  msgid "Wrap Inline Tags"
553
- msgstr "Wrap Balises Inline"
554
 
555
  # @ crayon-syntax-highlighter
556
- #: ../crayon_settings_wp.class.php:693
557
  msgid "Capture `backquotes` as &lt;code&gt;"
558
- msgstr "Capturez `apostrophes inverses` as &lt;code&gt;"
559
 
560
  # @ crayon-syntax-highlighter
561
- #: ../crayon_settings_wp.class.php:694
562
  msgid "Capture &lt;pre&gt; tags as Crayons"
563
- msgstr "Capturez balises &lt;pre&gt; que Crayons"
564
 
565
  # @ crayon-syntax-highlighter
566
- #: ../crayon_settings_wp.class.php:695
567
  msgid "Enable [plain][/plain] tag."
568
- msgstr "Activer tag [plain][/plain]."
569
 
570
  # @ crayon-syntax-highlighter
571
- #: ../crayon_settings_wp.class.php:700
572
- msgid "When loading local files and a relative path is given for the URL, use the absolute path"
573
- msgstr "Lors du chargement des fichiers locaux et un chemin relatif est donné pour l'URL, utilisez le chemin absolu"
 
 
 
 
574
 
575
  # @ crayon-syntax-highlighter
576
- #: ../crayon_settings_wp.class.php:703
577
  msgid "Followed by your relative URL."
578
  msgstr "Suivi de votre URL relative."
579
 
 
 
 
 
 
 
 
 
580
  # @ crayon-syntax-highlighter
581
- #: ../crayon_settings_wp.class.php:707
582
  #, php-format
583
- msgid "Use %s to separate setting names from values in the &lt;pre&gt; class attribute"
584
- msgstr "Utilisez %s pour séparer les noms de paramètres à partir des valeurs de la &lt;pre&gt; attribut de classe"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
585
 
586
  # @ crayon-syntax-highlighter
587
- #: ../crayon_settings_wp.class.php:713
588
  msgid "Clear the cache used to store remote code requests"
589
- msgstr "Vider le cache utilisé pour stocker les demandes de code à distance"
590
 
591
  # @ crayon-syntax-highlighter
592
- #: ../crayon_settings_wp.class.php:715
593
  msgid "Clear Now"
594
- msgstr "Effacer maintenant"
595
 
596
  # @ crayon-syntax-highlighter
597
- #: ../crayon_settings_wp.class.php:716
598
  msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
599
- msgstr "Tentative de chargement CSS Crayon et JavaScript seulement quand c'est nécessaire"
 
600
 
601
  # @ crayon-syntax-highlighter
602
- #: ../crayon_settings_wp.class.php:717
603
  msgid "Disable enqueuing for page templates that may contain The Loop."
604
- msgstr "Désactiver enqueuing pour les modèles de page qui peut contenir la boucle."
605
 
606
  # @ crayon-syntax-highlighter
607
- #: ../crayon_settings_wp.class.php:718
608
  msgid "Allow Crayons inside comments"
609
- msgstr "Permettez-Crayons à l'intérieur de commentaires"
610
 
611
- #: ../crayon_settings_wp.class.php:719
612
  msgid "Remove Crayons from excerpts"
613
- msgstr "Retirer Crayons à partir d'extraits"
614
 
615
  # @ crayon-syntax-highlighter
616
- #: ../crayon_settings_wp.class.php:720
617
  msgid "Load Crayons only from the main Wordpress query"
618
- msgstr "Crayons Charge seulement de la requête principale Wordpress"
619
 
620
  # @ crayon-syntax-highlighter
621
- #: ../crayon_settings_wp.class.php:721
622
  msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
623
- msgstr "Désactiver les gestes de souris pour les appareils à écran tactile (ex. MouseOver)"
 
 
624
 
625
  # @ crayon-syntax-highlighter
626
- #: ../crayon_settings_wp.class.php:722
627
  msgid "Disable animations"
628
  msgstr "Désactiver les animations"
629
 
630
  # @ crayon-syntax-highlighter
631
- #: ../crayon_settings_wp.class.php:723
632
  msgid "Disable runtime stats"
633
- msgstr "Désactiver l'exécution stats"
634
 
635
  # @ crayon-syntax-highlighter
636
- #: ../crayon_settings_wp.class.php:729
637
  msgid "Log errors for individual Crayons"
638
- msgstr "Connexion pour les erreurs individuelles Crayons"
639
 
640
  # @ crayon-syntax-highlighter
641
- #: ../crayon_settings_wp.class.php:730
642
  msgid "Log system-wide errors"
643
- msgstr "Connexion échelle du système des erreurs"
644
 
645
  # @ crayon-syntax-highlighter
646
- #: ../crayon_settings_wp.class.php:731
647
  msgid "Display custom message for errors"
648
  msgstr "Afficher un message personnalisé pour les erreurs"
649
 
650
  # @ crayon-syntax-highlighter
651
- #: ../crayon_settings_wp.class.php:743
652
  msgid "Show Log"
653
  msgstr "Afficher le journal"
654
 
655
  # @ crayon-syntax-highlighter
656
- #: ../crayon_settings_wp.class.php:743
657
  msgid "Hide Log"
658
- msgstr "Cacher Connexion"
659
 
660
  # @ crayon-syntax-highlighter
661
- #: ../crayon_settings_wp.class.php:745
662
  msgid "Clear Log"
663
- msgstr "Effacer le journal"
664
 
665
  # @ crayon-syntax-highlighter
666
- #: ../crayon_settings_wp.class.php:746
667
  msgid "Email Admin"
668
- msgstr "Admin Email"
669
 
670
  # @ crayon-syntax-highlighter
671
- #: ../crayon_settings_wp.class.php:748
672
  msgid "Email Developer"
673
- msgstr "Développeur Email"
674
 
675
  # @ crayon-syntax-highlighter
676
- #: ../crayon_settings_wp.class.php:750
677
  msgid "The log is currently empty."
678
- msgstr "Le journal est actuellement vide."
679
 
680
  # @ crayon-syntax-highlighter
681
- #: ../crayon_settings_wp.class.php:752
682
  msgid "The log file exists and is writable."
683
  msgstr "Le fichier journal existe et est accessible en écriture."
684
 
685
  # @ crayon-syntax-highlighter
686
- #: ../crayon_settings_wp.class.php:752
687
  msgid "The log file exists and is not writable."
688
- msgstr "Le fichier journal existe et n'est pas accessible en écriture."
689
 
690
  # @ crayon-syntax-highlighter
691
- #: ../crayon_settings_wp.class.php:754
692
  msgid "The log file does not exist and is not writable."
693
- msgstr "Le fichier journal n'existe pas et n'est pas modifiable."
694
 
695
  # @ crayon-syntax-highlighter
696
- #: ../crayon_settings_wp.class.php:764
697
  msgid "Version"
698
  msgstr "Version"
699
 
700
  # @ crayon-syntax-highlighter
701
- #: ../crayon_settings_wp.class.php:766
702
  msgid "Developer"
703
  msgstr "Développeur"
704
 
705
  # @ crayon-syntax-highlighter
706
- #: ../crayon_settings_wp.class.php:767
707
  msgid "Translators"
708
  msgstr "Traducteurs"
709
 
710
  # @ crayon-syntax-highlighter
711
- #: ../crayon_settings_wp.class.php:790
712
- msgid "The result of innumerable hours of hard work over many months. It's an ongoing project, keep me motivated!"
713
- msgstr "Le résultat de nombreuses heures de dur labeur sur plusieurs mois. C'est un projet en cours, me garder motivé!"
 
 
 
 
 
 
 
 
 
714
 
715
  # @ crayon-syntax-highlighter
716
- #: ../crayon_settings_wp.class.php:806
717
  msgid "Donate"
718
  msgstr "Faire un don"
719
 
720
  # @ crayon-syntax-highlighter
721
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:57
722
  msgid "Add Crayon Code"
723
- msgstr "Ajouter code Crayon"
724
 
725
  # @ crayon-syntax-highlighter
726
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:58
727
  msgid "Edit Crayon Code"
728
  msgstr "Modifier le code Crayon"
729
 
730
  # @ crayon-syntax-highlighter
731
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:59
732
  msgid "Add"
733
  msgstr "Ajouter"
734
 
735
  # @ crayon-syntax-highlighter
736
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:60
737
  msgid "Save"
738
- msgstr "Sauver"
739
 
740
- # @ crayon-syntax-highlighter
741
- #: ../util/tag-editor/crayon_te_content.php:65
742
- msgid "Title"
743
- msgstr "Titre"
744
 
745
- #: ../util/tag-editor/crayon_te_content.php:67
 
 
 
 
746
  msgid "A short description"
747
  msgstr "Une brève description"
748
 
749
  # @ crayon-syntax-highlighter
750
- #: ../util/tag-editor/crayon_te_content.php:70
751
  msgid "Inline"
752
  msgstr "Inline"
753
 
754
  # @ crayon-syntax-highlighter
755
- #: ../util/tag-editor/crayon_te_content.php:75
 
 
 
 
 
 
756
  msgid "Language"
757
- msgstr "Langue"
 
 
 
 
 
 
 
 
 
758
 
759
  # @ crayon-syntax-highlighter
760
- #: ../util/tag-editor/crayon_te_content.php:78
761
  msgid "Marked Lines"
762
- msgstr "Lignes Marquées"
763
 
764
- #: ../util/tag-editor/crayon_te_content.php:79
765
  msgid "(e.g. 1,2,3-5)"
766
  msgstr "(par exemple 1,2,3-5)"
767
 
768
  # @ crayon-syntax-highlighter
769
- #: ../util/tag-editor/crayon_te_content.php:82
770
- msgid "Disable Highlighting"
771
- msgstr "Désactiver la Surbrillance"
772
-
773
- # @ crayon-syntax-highlighter
774
- #: ../util/tag-editor/crayon_te_content.php:87
775
  msgid "Clear"
776
  msgstr "Effacer"
777
 
778
  # @ crayon-syntax-highlighter
779
- #: ../util/tag-editor/crayon_te_content.php:88
780
  msgid "Paste your code here, or type it in manually."
781
- msgstr "Collez votre code ici, ou tapez manuellement."
782
 
783
- #: ../util/tag-editor/crayon_te_content.php:91
784
  msgid "URL"
785
  msgstr ""
786
 
787
- #: ../util/tag-editor/crayon_te_content.php:93
788
  msgid "Relative local path or absolute URL"
789
- msgstr "Relative chemin d'accès local ou une URL absolue"
790
 
791
- #: ../util/tag-editor/crayon_te_content.php:96
792
- msgid "If the URL fails to load, the code above will be shown instead. If no code exists, an error is shown."
793
- msgstr "Si l'URL ne parvient pas à charger, le code ci-dessus sera affiché à la place. Si aucun code existe, une erreur s'affiche."
 
 
 
 
794
 
795
- #: ../util/tag-editor/crayon_te_content.php:98
796
  #, php-format
797
- msgid "If a relative local path is given it will be appended to %s - which is defined in %sCrayon &gt; Settings &gt; Files%s."
798
- msgstr "Si un chemin relatif locale est donné, il sera ajouté à %s - qui est défini dans %sCrayon &gt; Paramètres &gt; Fichiers%s."
 
 
 
 
799
 
800
  # @ crayon-syntax-highlighter
801
- #: ../util/tag-editor/crayon_te_content.php:117
802
  msgid "Change the following settings to override their global values."
803
- msgstr "Modifiez les paramètres suivants pour remplacer leurs valeurs globales."
 
804
 
805
  # @ crayon-syntax-highlighter
806
- #: ../util/tag-editor/crayon_te_content.php:119
807
  msgid "Only changes (shown yellow) are applied."
808
- msgstr "Seules les modifications (montré en jaune) sont appliquées."
809
 
810
- #: ../util/tag-editor/crayon_te_content.php:121
811
  #, php-format
812
- msgid "Future changes to the global settings under %sCrayon &gt; Settings%s won't affect overridden settings."
813
- msgstr "Les modifications futures des paramètres globaux au titre de %sCrayon &gt; Paramètres%s n'affectera pas paramètres substitués."
 
 
 
 
814
 
815
  # @ crayon-syntax-highlighter
816
- #: ../util/theme-editor/editor.php:16
817
- msgid "Back To Settings"
818
- msgstr "Retour aux réglages"
819
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: crayon-syntax-highlighter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-12-04 14:02+1000\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
+ "Language: fr_FR\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
 
14
  "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
17
+ "crayon__;crayon_n;crayon_e\n"
18
  "X-Poedit-Basepath: .\n"
19
  "X-Textdomain-Support: yes\n"
20
+ "X-Generator: Poedit 1.5.3\n"
21
  "X-Poedit-SearchPath-0: .\n"
22
  "X-Poedit-SearchPath-1: ..\n"
23
 
24
  # @ crayon-syntax-highlighter
25
+ #: ../crayon_formatter.class.php:269
26
  msgid "Toggle Plain Code"
27
+ msgstr "Basculer vers code brut"
28
 
29
  # @ crayon-syntax-highlighter
30
+ #: ../crayon_formatter.class.php:270
31
+ #, fuzzy
32
+ msgid "Toggle Line Wrap"
33
+ msgstr "Afficher/cacher numéros de lignes"
34
+
35
+ # @ crayon-syntax-highlighter
36
+ #: ../crayon_formatter.class.php:272
37
  #, php-format
38
  msgid "Press %s to Copy, %s to Paste"
39
+ msgstr "Faites %s pour copier, %s pour coller"
40
 
41
  # @ crayon-syntax-highlighter
42
+ #: ../crayon_formatter.class.php:272
43
  msgid "Copy Plain Code"
44
+ msgstr "Copier le code brut"
45
 
46
  # @ crayon-syntax-highlighter
47
+ #: ../crayon_formatter.class.php:274
48
  msgid "Open Code In New Window"
49
+ msgstr "Ouvrir le code dans une nouvelle fenêtre"
50
 
51
  # @ crayon-syntax-highlighter
52
+ #: ../crayon_formatter.class.php:276
53
  msgid "Toggle Line Numbers"
54
+ msgstr "Afficher/cacher numéros de lignes"
55
 
56
  # @ crayon-syntax-highlighter
57
  #: ../crayon_formatter.class.php:279
58
  msgid "Contains Mixed Languages"
59
+ msgstr "Contient des langages mélangés"
60
 
61
  # @ crayon-syntax-highlighter
62
+ #: ../crayon_settings.class.php:143
63
  msgid "Hourly"
64
+ msgstr "une fois par heure"
65
 
66
  # @ crayon-syntax-highlighter
67
+ #: ../crayon_settings.class.php:143
68
  msgid "Daily"
69
+ msgstr "une fois par jour"
70
 
71
  # @ crayon-syntax-highlighter
72
+ #: ../crayon_settings.class.php:144
73
  msgid "Weekly"
74
+ msgstr "une fois par semaine"
75
 
76
  # @ crayon-syntax-highlighter
77
+ #: ../crayon_settings.class.php:144
78
  msgid "Monthly"
79
+ msgstr "une fois par mois"
80
 
81
  # @ crayon-syntax-highlighter
82
+ #: ../crayon_settings.class.php:145
83
  msgid "Immediately"
84
+ msgstr "immédiatement"
85
 
86
  # @ crayon-syntax-highlighter
87
+ #: ../crayon_settings.class.php:155 ../crayon_settings.class.php:159
 
88
  msgid "Max"
89
  msgstr "Max"
90
 
91
  # @ crayon-syntax-highlighter
92
+ #: ../crayon_settings.class.php:155 ../crayon_settings.class.php:159
 
93
  msgid "Min"
94
  msgstr "Min"
95
 
96
  # @ crayon-syntax-highlighter
97
+ #: ../crayon_settings.class.php:155 ../crayon_settings.class.php:159
 
98
  msgid "Static"
99
  msgstr "Statique"
100
 
101
  # @ crayon-syntax-highlighter
102
+ #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
103
+ #: ../crayon_settings_wp.class.php:676 ../crayon_settings_wp.class.php:685
104
+ #: ../crayon_settings_wp.class.php:931
 
 
105
  msgid "Pixels"
106
  msgstr "Pixels"
107
 
108
  # @ crayon-syntax-highlighter
109
+ #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
 
110
  msgid "Percent"
111
+ msgstr "Pourcent"
112
 
113
  # @ crayon-syntax-highlighter
114
+ #: ../crayon_settings.class.php:170
115
  msgid "None"
116
  msgstr "Aucun"
117
 
118
  # @ crayon-syntax-highlighter
119
+ #: ../crayon_settings.class.php:170
120
  msgid "Left"
121
  msgstr "Gauche"
122
 
123
  # @ crayon-syntax-highlighter
124
+ #: ../crayon_settings.class.php:170
125
  msgid "Center"
126
  msgstr "Centre"
127
 
128
  # @ crayon-syntax-highlighter
129
+ #: ../crayon_settings.class.php:170
130
  msgid "Right"
131
  msgstr "Droite"
132
 
133
  # @ crayon-syntax-highlighter
134
+ #: ../crayon_settings.class.php:172 ../crayon_settings.class.php:196
 
135
  msgid "On MouseOver"
136
+ msgstr "Au survol"
137
 
138
  # @ crayon-syntax-highlighter
139
+ #: ../crayon_settings.class.php:172 ../crayon_settings.class.php:178
 
140
  msgid "Always"
141
  msgstr "Toujours"
142
 
143
  # @ crayon-syntax-highlighter
144
+ #: ../crayon_settings.class.php:172 ../crayon_settings.class.php:178
 
145
  msgid "Never"
146
  msgstr "Jamais"
147
 
148
  # @ crayon-syntax-highlighter
149
+ #: ../crayon_settings.class.php:178
150
  msgid "When Found"
151
+ msgstr "Si détecté"
152
 
153
  # @ crayon-syntax-highlighter
154
+ #: ../crayon_settings.class.php:196
155
  msgid "On Double Click"
156
+ msgstr "au double-clic"
157
 
158
  # @ crayon-syntax-highlighter
159
+ #: ../crayon_settings.class.php:196
160
  msgid "On Single Click"
161
+ msgstr "au clic"
162
 
163
  # @ crayon-syntax-highlighter
164
+ #: ../crayon_settings.class.php:196
165
  msgid "Disable Mouse Events"
166
  msgstr "Désactiver les événements souris"
167
 
168
  # @ crayon-syntax-highlighter
169
+ #: ../crayon_settings.class.php:203
170
  msgid "An error has occurred. Please try again later."
171
+ msgstr "Une erreur s'est produite. Veuillez ré-essayer plus tard."
172
 
173
  # @ crayon-syntax-highlighter
174
+ #: ../crayon_settings_wp.class.php:49 ../crayon_settings_wp.class.php:151
175
+ #: ../crayon_settings_wp.class.php:1109
176
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:241
177
  msgid "Settings"
178
+ msgstr "Paramètres"
179
 
180
  # @ crayon-syntax-highlighter
181
+ #: ../crayon_settings_wp.class.php:130
182
  msgid "You do not have sufficient permissions to access this page."
183
+ msgstr "Vous n'avez pas le droit d'accéder à cette page."
184
 
185
  # @ crayon-syntax-highlighter
186
+ #: ../crayon_settings_wp.class.php:166
187
  msgid "Save Changes"
188
  msgstr "Enregistrer les modifications"
189
 
190
  # @ crayon-syntax-highlighter
191
+ #: ../crayon_settings_wp.class.php:173
192
  msgid "Reset Settings"
193
  msgstr "Réinitialiser les paramètres"
194
 
195
  # @ crayon-syntax-highlighter
196
+ #: ../crayon_settings_wp.class.php:418
197
  msgid "General"
198
  msgstr "Général"
199
 
200
  # @ crayon-syntax-highlighter
201
+ #: ../crayon_settings_wp.class.php:419
202
  msgid "Theme"
203
+ msgstr "Thème"
204
 
205
  # @ crayon-syntax-highlighter
206
+ #: ../crayon_settings_wp.class.php:420
207
  msgid "Font"
208
+ msgstr "Police"
209
 
210
  # @ crayon-syntax-highlighter
211
+ #: ../crayon_settings_wp.class.php:421
212
  msgid "Metrics"
213
+ msgstr "Dimensions"
214
 
215
  # @ crayon-syntax-highlighter
216
+ #: ../crayon_settings_wp.class.php:422
217
  msgid "Toolbar"
218
  msgstr "Barre d'outils"
219
 
220
  # @ crayon-syntax-highlighter
221
+ #: ../crayon_settings_wp.class.php:423
222
  msgid "Lines"
223
  msgstr "Lignes"
224
 
225
  # @ crayon-syntax-highlighter
226
+ #: ../crayon_settings_wp.class.php:424
227
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:204
228
  msgid "Code"
229
  msgstr "Code"
230
 
231
  # @ crayon-syntax-highlighter
232
+ #: ../crayon_settings_wp.class.php:425
233
  msgid "Tags"
234
  msgstr "Mots-clés"
235
 
236
  # @ crayon-syntax-highlighter
237
+ #: ../crayon_settings_wp.class.php:426
238
  msgid "Languages"
239
+ msgstr "Langages"
240
 
241
  # @ crayon-syntax-highlighter
242
+ #: ../crayon_settings_wp.class.php:427
243
  msgid "Files"
244
  msgstr "Fichiers"
245
 
246
+ #: ../crayon_settings_wp.class.php:428
247
+ msgid "Posts"
248
+ msgstr ""
249
+
250
  # @ crayon-syntax-highlighter
251
+ #: ../crayon_settings_wp.class.php:429
252
  msgid "Tag Editor"
253
  msgstr "Éditeur de Tag"
254
 
255
  # @ crayon-syntax-highlighter
256
+ #: ../crayon_settings_wp.class.php:430
257
  msgid "Misc"
258
  msgstr "Divers"
259
 
260
  # @ crayon-syntax-highlighter
261
+ #: ../crayon_settings_wp.class.php:433
262
  msgid "Debug"
263
  msgstr "Débogage"
264
 
265
  # @ crayon-syntax-highlighter
266
+ #: ../crayon_settings_wp.class.php:434
267
  msgid "Errors"
268
  msgstr "Erreurs"
269
 
270
  # @ crayon-syntax-highlighter
271
+ #: ../crayon_settings_wp.class.php:435
272
  msgid "Log"
273
+ msgstr "Journal"
274
 
275
  # @ crayon-syntax-highlighter
276
+ #: ../crayon_settings_wp.class.php:438
277
  msgid "About"
278
  msgstr "À propos"
279
 
280
  # @ crayon-syntax-highlighter
281
+ #: ../crayon_settings_wp.class.php:638
282
  msgid "Crayon Help"
283
  msgstr "Aide Crayon"
284
 
285
  # @ crayon-syntax-highlighter
286
+ #: ../crayon_settings_wp.class.php:653
287
  msgid "Height"
288
  msgstr "Hauteur"
289
 
290
  # @ crayon-syntax-highlighter
291
+ #: ../crayon_settings_wp.class.php:659
292
  msgid "Width"
293
  msgstr "Largeur"
294
 
295
  # @ crayon-syntax-highlighter
296
+ #: ../crayon_settings_wp.class.php:665
297
  msgid "Top Margin"
298
  msgstr "Marge supérieure"
299
 
300
  # @ crayon-syntax-highlighter
301
+ #: ../crayon_settings_wp.class.php:666
302
  msgid "Bottom Margin"
303
+ msgstr "Marge inférieure"
304
 
305
  # @ crayon-syntax-highlighter
306
+ #: ../crayon_settings_wp.class.php:667 ../crayon_settings_wp.class.php:672
 
307
  msgid "Left Margin"
308
+ msgstr "Marge gauche"
309
 
310
  # @ crayon-syntax-highlighter
311
+ #: ../crayon_settings_wp.class.php:668 ../crayon_settings_wp.class.php:672
 
312
  msgid "Right Margin"
313
  msgstr "Marge droite"
314
 
315
  # @ crayon-syntax-highlighter
316
+ #: ../crayon_settings_wp.class.php:678
317
  msgid "Horizontal Alignment"
318
  msgstr "Alignement horizontal"
319
 
320
  # @ crayon-syntax-highlighter
321
+ #: ../crayon_settings_wp.class.php:681
322
  msgid "Allow floating elements to surround Crayon"
323
+ msgstr "Autoriser les éléments flottants à encercler Crayon"
324
 
325
  # @ crayon-syntax-highlighter
326
+ #: ../crayon_settings_wp.class.php:683
327
  msgid "Inline Margin"
328
+ msgstr "Marge inline"
329
 
330
  # @ crayon-syntax-highlighter
331
+ #: ../crayon_settings_wp.class.php:691
332
  msgid "Display the Toolbar"
333
  msgstr "Afficher la barre d'outils"
334
 
335
  # @ crayon-syntax-highlighter
336
+ #: ../crayon_settings_wp.class.php:694
337
  msgid "Overlay the toolbar on code rather than push it down when possible"
338
+ msgstr ""
339
+ "Superposition de la barre d'outils sur le code plutôt que de le pousser vers "
340
+ "le bas si possible"
341
 
342
  # @ crayon-syntax-highlighter
343
+ #: ../crayon_settings_wp.class.php:695
344
  msgid "Toggle the toolbar on single click when it is overlayed"
345
  msgstr "Basculer la barre d'outils sur simple clic quand il est superposé"
346
 
347
  # @ crayon-syntax-highlighter
348
+ #: ../crayon_settings_wp.class.php:696
349
  msgid "Delay hiding the toolbar on MouseOut"
350
+ msgstr ""
351
+ "Retarder la disparition de la barre d'outils lors de la sortie de la souris"
352
 
353
  # @ crayon-syntax-highlighter
354
+ #: ../crayon_settings_wp.class.php:698
355
  msgid "Display the title when provided"
356
  msgstr "Afficher le titre lorsqu'il est fourni"
357
 
358
  # @ crayon-syntax-highlighter
359
+ #: ../crayon_settings_wp.class.php:699
360
  msgid "Display the language"
361
+ msgstr "Affichage du langage"
362
 
363
  # @ crayon-syntax-highlighter
364
+ #: ../crayon_settings_wp.class.php:706
365
  msgid "Display striped code lines"
366
+ msgstr "Lignes colorées une ligne sur deux"
367
 
368
  # @ crayon-syntax-highlighter
369
+ #: ../crayon_settings_wp.class.php:707
370
  msgid "Enable line marking for important lines"
371
+ msgstr "Permettre la mise en évidence de lignes importantes"
372
+
373
+ #: ../crayon_settings_wp.class.php:708
374
+ msgid "Enable line ranges for showing only parts of code"
375
+ msgstr ""
376
 
377
  # @ crayon-syntax-highlighter
378
+ #: ../crayon_settings_wp.class.php:709
379
  msgid "Display line numbers by default"
380
  msgstr "Afficher les numéros de ligne par défaut"
381
 
382
  # @ crayon-syntax-highlighter
383
+ #: ../crayon_settings_wp.class.php:710
384
  msgid "Enable line number toggling"
385
+ msgstr "Permettre de basculer l'affichage des numéros de lignes"
386
+
387
+ # @ crayon-syntax-highlighter
388
+ #: ../crayon_settings_wp.class.php:711
389
+ #, fuzzy
390
+ msgid "Wrap lines by default"
391
+ msgstr "Afficher les numéros de ligne par défaut"
392
 
393
  # @ crayon-syntax-highlighter
394
+ #: ../crayon_settings_wp.class.php:712
395
+ #, fuzzy
396
+ msgid "Enable line wrap toggling"
397
+ msgstr "Permettre de basculer l'affichage des numéros de lignes"
398
+
399
+ # @ crayon-syntax-highlighter
400
+ #: ../crayon_settings_wp.class.php:713
401
  msgid "Start line numbers from"
402
+ msgstr "Numéroter les lignes à partir de"
403
 
404
  # @ crayon-syntax-highlighter
405
+ #: ../crayon_settings_wp.class.php:724
406
  msgid "When no language is provided, use the fallback"
407
+ msgstr "Lorsque aucun langage n'est spécifié, utiliser"
408
 
409
  # @ crayon-syntax-highlighter
410
+ #: ../crayon_settings_wp.class.php:730
411
  #, php-format
412
  msgid "%d language has been detected."
413
+ msgstr "%d langage a été détectée."
414
 
415
  # @ crayon-syntax-highlighter
416
+ #: ../crayon_settings_wp.class.php:731
417
  msgid "Parsing was successful"
418
+ msgstr "Parsing réussi"
419
 
420
  # @ crayon-syntax-highlighter
421
+ #: ../crayon_settings_wp.class.php:731
422
  msgid "Parsing was unsuccessful"
423
+ msgstr "Parsing échoué"
424
 
425
  # @ crayon-syntax-highlighter
426
+ #: ../crayon_settings_wp.class.php:737
427
  #, php-format
428
  msgid "The selected language with id %s could not be loaded"
429
+ msgstr "Le langage sélectionnée (id %s) n'a pas pu être chargé"
430
 
431
  # @ crayon-syntax-highlighter
432
+ #: ../crayon_settings_wp.class.php:740
433
  msgid "Show Languages"
434
+ msgstr "Voir les langages"
435
+
436
+ #: ../crayon_settings_wp.class.php:776
437
+ msgid "Show Crayon Posts"
438
+ msgstr ""
439
+
440
+ #: ../crayon_settings_wp.class.php:777
441
+ msgid "Refresh"
442
+ msgstr ""
443
+
444
+ #: ../crayon_settings_wp.class.php:793
445
+ msgid "ID"
446
+ msgstr ""
447
 
448
  # @ crayon-syntax-highlighter
449
+ #: ../crayon_settings_wp.class.php:793
450
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:182
451
+ msgid "Title"
452
+ msgstr "Titre"
453
+
454
+ #: ../crayon_settings_wp.class.php:793
455
+ msgid "Posted"
456
+ msgstr ""
457
+
458
+ #: ../crayon_settings_wp.class.php:793
459
+ msgid "Modifed"
460
+ msgstr ""
461
 
462
  # @ crayon-syntax-highlighter
463
+ #: ../crayon_settings_wp.class.php:793
464
+ #, fuzzy
465
+ msgid "Contains Legacy Tags?"
466
+ msgstr "Contient des langages mélangés"
467
+
468
+ #: ../crayon_settings_wp.class.php:806
469
+ msgid "Yes"
470
+ msgstr ""
471
+
472
+ # @ crayon-syntax-highlighter
473
+ #: ../crayon_settings_wp.class.php:806
474
+ #, fuzzy
475
+ msgid "No"
476
+ msgstr "Aucun"
477
+
478
+ #: ../crayon_settings_wp.class.php:890
479
+ msgid "Edit"
480
+ msgstr ""
481
+
482
+ #: ../crayon_settings_wp.class.php:890
483
+ msgid "Duplicate"
484
+ msgstr ""
485
+
486
+ #: ../crayon_settings_wp.class.php:890
487
+ msgid "Create"
488
+ msgstr ""
489
+
490
+ #: ../crayon_settings_wp.class.php:890
491
+ msgid "Delete"
492
+ msgstr ""
493
+
494
+ # @ crayon-syntax-highlighter
495
+ #: ../crayon_settings_wp.class.php:892
496
+ msgid "Loading..."
497
+ msgstr "Chargement..."
498
 
499
  # @ crayon-syntax-highlighter
500
+ #: ../crayon_settings_wp.class.php:907
501
  #, php-format
502
+ msgid ""
503
+ "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 "
504
+ "are marked."
505
+ msgstr ""
506
+ "Changer la %1$slangue de repli%2$s pour changer le code de prévisualisation. "
507
+ "Lignes 5-7 sont marquées."
508
 
509
  # @ crayon-syntax-highlighter
510
+ #: ../crayon_settings_wp.class.php:912
511
  msgid "Enable Live Preview"
512
+ msgstr "Activer l'aperçu live"
513
 
514
  # @ crayon-syntax-highlighter
515
+ #: ../crayon_settings_wp.class.php:914
516
  msgid "Enqueue themes in the header (more efficient)."
517
+ msgstr "Charger les thèmes dans l'en-tête (plus efficace)."
518
 
519
  # @ crayon-syntax-highlighter
520
+ #: ../crayon_settings_wp.class.php:917
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  #, php-format
522
  msgid "The selected theme with id %s could not be loaded"
523
+ msgstr "Le thème sélectionné (id %s) n'a pas pu être chargé"
524
 
525
  # @ crayon-syntax-highlighter
526
+ #: ../crayon_settings_wp.class.php:929
527
  msgid "Custom Font Size"
528
+ msgstr "Taille du texte personnalisée"
529
 
530
  # @ crayon-syntax-highlighter
531
+ #: ../crayon_settings_wp.class.php:934
532
  #, php-format
533
  msgid "The selected font with id %s could not be loaded"
534
+ msgstr "La police sélectionnée (id %s) n'a pas pu être chargée"
535
 
536
  # @ crayon-syntax-highlighter
537
+ #: ../crayon_settings_wp.class.php:940
538
  msgid "Enqueue fonts in the header (more efficient)."
539
+ msgstr "Charger les polices de caractères dans l'en-tête (plus efficace)."
540
 
541
  # @ crayon-syntax-highlighter
542
+ #: ../crayon_settings_wp.class.php:945
543
  msgid "Enable plain code view and display"
544
+ msgstr "Permettre la vue et l'affichage du code brut"
545
 
546
  # @ crayon-syntax-highlighter
547
+ #: ../crayon_settings_wp.class.php:948
548
  msgid "Enable plain code toggling"
549
+ msgstr "Permettre de basculer vers le code brut"
550
 
551
  # @ crayon-syntax-highlighter
552
+ #: ../crayon_settings_wp.class.php:949
553
  msgid "Show the plain code by default"
554
  msgstr "Montrer le code brut par défaut"
555
 
556
  # @ crayon-syntax-highlighter
557
+ #: ../crayon_settings_wp.class.php:950
558
  msgid "Enable code copy/paste"
559
+ msgstr "Permettre le copier/coller du code"
560
 
561
  # @ crayon-syntax-highlighter
562
+ #: ../crayon_settings_wp.class.php:952
563
  msgid "Enable opening code in a window"
564
+ msgstr "Permettre l'ouverture du code dans une nouvelle fenêtre"
565
 
566
  # @ crayon-syntax-highlighter
567
+ #: ../crayon_settings_wp.class.php:953
568
  msgid "Always display scrollbars"
569
  msgstr "Toujours afficher les barres de défilement"
570
 
571
  # @ crayon-syntax-highlighter
572
+ #: ../crayon_settings_wp.class.php:956
 
 
 
 
 
573
  msgid "Decode HTML entities in code"
574
+ msgstr "Décoder les entités HTML dans le code"
575
 
576
  # @ crayon-syntax-highlighter
577
+ #: ../crayon_settings_wp.class.php:958
578
  msgid "Decode HTML entities in attributes"
579
+ msgstr "Décoder les entités HTML dans les attributs"
580
 
581
  # @ crayon-syntax-highlighter
582
+ #: ../crayon_settings_wp.class.php:960
583
  msgid "Remove whitespace surrounding the shortcode content"
584
+ msgstr "Supprimer les espaces entourant le contenu des shortcode"
585
 
586
  # @ crayon-syntax-highlighter
587
+ #: ../crayon_settings_wp.class.php:962
588
  msgid "Allow Mixed Language Highlighting with delimiters and tags."
589
+ msgstr "Autoriser la coloration de codes mixtes délimiteurs et tags."
590
 
591
  # @ crayon-syntax-highlighter
592
+ #: ../crayon_settings_wp.class.php:964
593
  msgid "Show Mixed Language Icon (+)"
594
+ msgstr "Afficher l'icône langages mixtes (+)"
595
 
596
  # @ crayon-syntax-highlighter
597
+ #: ../crayon_settings_wp.class.php:966
598
+ msgid "Tab size in spaces"
599
+ msgstr "Taille des tabulations en espaces"
600
+
601
+ #: ../crayon_settings_wp.class.php:968
602
+ msgid "Blank lines before code:"
603
+ msgstr ""
604
+
605
+ #: ../crayon_settings_wp.class.php:970
606
+ msgid "Blank lines after code:"
607
+ msgstr ""
608
+
609
+ # @ crayon-syntax-highlighter
610
+ #: ../crayon_settings_wp.class.php:975
611
  msgid "Capture Mini Tags like [php][/php] as Crayons."
612
+ msgstr "Capturer les mini-balises telles que [php][/php]."
613
 
614
  # @ crayon-syntax-highlighter
615
+ #: ../crayon_settings_wp.class.php:976
616
  msgid "Capture Inline Tags like {php}{/php} inside sentences."
617
+ msgstr "Capturer les tags Inline comme {php} {/php} à l'intérieur des phrases."
618
 
619
  # @ crayon-syntax-highlighter
620
+ #: ../crayon_settings_wp.class.php:977
621
  msgid "Wrap Inline Tags"
622
+ msgstr "Les balises inline peuvent revenir à la ligne"
623
 
624
  # @ crayon-syntax-highlighter
625
+ #: ../crayon_settings_wp.class.php:978
626
  msgid "Capture `backquotes` as &lt;code&gt;"
627
+ msgstr "Capturer `accents graves` comme &lt;code&gt;"
628
 
629
  # @ crayon-syntax-highlighter
630
+ #: ../crayon_settings_wp.class.php:979
631
  msgid "Capture &lt;pre&gt; tags as Crayons"
632
+ msgstr "Capturer balises &lt;pre&gt;"
633
 
634
  # @ crayon-syntax-highlighter
635
+ #: ../crayon_settings_wp.class.php:980
636
  msgid "Enable [plain][/plain] tag."
637
+ msgstr "Activer tag [plain][/plain] pour le code brut."
638
 
639
  # @ crayon-syntax-highlighter
640
+ #: ../crayon_settings_wp.class.php:985
641
+ msgid ""
642
+ "When loading local files and a relative path is given for the URL, use the "
643
+ "absolute path"
644
+ msgstr ""
645
+ "Lors du chargement des fichiers locaux, si un chemin relatif est donné pour "
646
+ "l'URL, utiliser plutôt le chemin absolu"
647
 
648
  # @ crayon-syntax-highlighter
649
+ #: ../crayon_settings_wp.class.php:988
650
  msgid "Followed by your relative URL."
651
  msgstr "Suivi de votre URL relative."
652
 
653
+ #: ../crayon_settings_wp.class.php:995
654
+ msgid "Convert Legacy Tags"
655
+ msgstr ""
656
+
657
+ #: ../crayon_settings_wp.class.php:998
658
+ msgid "No Legacy Tags Found"
659
+ msgstr ""
660
+
661
  # @ crayon-syntax-highlighter
662
+ #: ../crayon_settings_wp.class.php:1003
663
  #, php-format
664
+ msgid ""
665
+ "Use %s to separate setting names from values in the &lt;pre&gt; class "
666
+ "attribute"
667
+ msgstr ""
668
+ "Utilisez %s pour séparer les noms de paramètres des valeurs dans l'attribut "
669
+ "class de la balise &lt;pre&gt;"
670
+
671
+ #: ../crayon_settings_wp.class.php:1006
672
+ msgid ""
673
+ "Display the Tag Editor in any TinyMCE instances on the frontend (e.g. "
674
+ "bbPress)"
675
+ msgstr ""
676
+
677
+ #: ../crayon_settings_wp.class.php:1007
678
+ msgid "Display Tag Editor settings on the frontend"
679
+ msgstr ""
680
 
681
  # @ crayon-syntax-highlighter
682
+ #: ../crayon_settings_wp.class.php:1011
683
  msgid "Clear the cache used to store remote code requests"
684
+ msgstr "Vider le cache stockant les demandes de codes distants"
685
 
686
  # @ crayon-syntax-highlighter
687
+ #: ../crayon_settings_wp.class.php:1013
688
  msgid "Clear Now"
689
+ msgstr "Vider maintenant"
690
 
691
  # @ crayon-syntax-highlighter
692
+ #: ../crayon_settings_wp.class.php:1014
693
  msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
694
+ msgstr ""
695
+ "Essayer de charger le CSS et Javascript de Crayon seulement quand nécessaire"
696
 
697
  # @ crayon-syntax-highlighter
698
+ #: ../crayon_settings_wp.class.php:1015
699
  msgid "Disable enqueuing for page templates that may contain The Loop."
700
+ msgstr "Ne pas mettre les scripts en en-tête de templates contenant The Loop."
701
 
702
  # @ crayon-syntax-highlighter
703
+ #: ../crayon_settings_wp.class.php:1016
704
  msgid "Allow Crayons inside comments"
705
+ msgstr "Autorisé la coloration dans les commentaires"
706
 
707
+ #: ../crayon_settings_wp.class.php:1017
708
  msgid "Remove Crayons from excerpts"
709
+ msgstr "Ne pas laisser Crayon colorer le code dans les extraits"
710
 
711
  # @ crayon-syntax-highlighter
712
+ #: ../crayon_settings_wp.class.php:1018
713
  msgid "Load Crayons only from the main Wordpress query"
714
+ msgstr "Ne charger Crayon qu'à partir de la requête Wordpress principale"
715
 
716
  # @ crayon-syntax-highlighter
717
+ #: ../crayon_settings_wp.class.php:1019
718
  msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
719
+ msgstr ""
720
+ "Désactiver les mouse gestures pour les appareils à écran tactile (ex. survol "
721
+ "de souris)"
722
 
723
  # @ crayon-syntax-highlighter
724
+ #: ../crayon_settings_wp.class.php:1020
725
  msgid "Disable animations"
726
  msgstr "Désactiver les animations"
727
 
728
  # @ crayon-syntax-highlighter
729
+ #: ../crayon_settings_wp.class.php:1021
730
  msgid "Disable runtime stats"
731
+ msgstr "Désactiver les statistiques de rendu"
732
 
733
  # @ crayon-syntax-highlighter
734
+ #: ../crayon_settings_wp.class.php:1027
735
  msgid "Log errors for individual Crayons"
736
+ msgstr "Journal d'erreurs individuelles Crayons"
737
 
738
  # @ crayon-syntax-highlighter
739
+ #: ../crayon_settings_wp.class.php:1028
740
  msgid "Log system-wide errors"
741
+ msgstr "Journal d'erreurs système"
742
 
743
  # @ crayon-syntax-highlighter
744
+ #: ../crayon_settings_wp.class.php:1029
745
  msgid "Display custom message for errors"
746
  msgstr "Afficher un message personnalisé pour les erreurs"
747
 
748
  # @ crayon-syntax-highlighter
749
+ #: ../crayon_settings_wp.class.php:1041
750
  msgid "Show Log"
751
  msgstr "Afficher le journal"
752
 
753
  # @ crayon-syntax-highlighter
754
+ #: ../crayon_settings_wp.class.php:1041
755
  msgid "Hide Log"
756
+ msgstr "Cacher le journal"
757
 
758
  # @ crayon-syntax-highlighter
759
+ #: ../crayon_settings_wp.class.php:1043
760
  msgid "Clear Log"
761
+ msgstr "Vider le journal"
762
 
763
  # @ crayon-syntax-highlighter
764
+ #: ../crayon_settings_wp.class.php:1044
765
  msgid "Email Admin"
766
+ msgstr "Email de l'admin"
767
 
768
  # @ crayon-syntax-highlighter
769
+ #: ../crayon_settings_wp.class.php:1046
770
  msgid "Email Developer"
771
+ msgstr "Email du développeur"
772
 
773
  # @ crayon-syntax-highlighter
774
+ #: ../crayon_settings_wp.class.php:1048
775
  msgid "The log is currently empty."
776
+ msgstr "Le journal est vide."
777
 
778
  # @ crayon-syntax-highlighter
779
+ #: ../crayon_settings_wp.class.php:1050
780
  msgid "The log file exists and is writable."
781
  msgstr "Le fichier journal existe et est accessible en écriture."
782
 
783
  # @ crayon-syntax-highlighter
784
+ #: ../crayon_settings_wp.class.php:1050
785
  msgid "The log file exists and is not writable."
786
+ msgstr "Le fichier journal existe mais n'est pas accessible en écriture."
787
 
788
  # @ crayon-syntax-highlighter
789
+ #: ../crayon_settings_wp.class.php:1052
790
  msgid "The log file does not exist and is not writable."
791
+ msgstr "Le fichier journal n'existe pas et ne peut pas être écrit."
792
 
793
  # @ crayon-syntax-highlighter
794
+ #: ../crayon_settings_wp.class.php:1062
795
  msgid "Version"
796
  msgstr "Version"
797
 
798
  # @ crayon-syntax-highlighter
799
+ #: ../crayon_settings_wp.class.php:1064
800
  msgid "Developer"
801
  msgstr "Développeur"
802
 
803
  # @ crayon-syntax-highlighter
804
+ #: ../crayon_settings_wp.class.php:1065
805
  msgid "Translators"
806
  msgstr "Traducteurs"
807
 
808
  # @ crayon-syntax-highlighter
809
+ #: ../crayon_settings_wp.class.php:1093
810
+ msgid ""
811
+ "The result of innumerable hours of hard work over many months. It's an "
812
+ "ongoing project, keep me motivated!"
813
+ msgstr ""
814
+ "Le résultat de nombreuses heures de dur labeur sur plusieurs mois. C'est un "
815
+ "projet en cours, continuez à me motiver !"
816
+
817
+ # @ crayon-syntax-highlighter
818
+ #: ../crayon_settings_wp.class.php:1103
819
+ msgid "?"
820
+ msgstr ""
821
 
822
  # @ crayon-syntax-highlighter
823
+ #: ../crayon_settings_wp.class.php:1110
824
  msgid "Donate"
825
  msgstr "Faire un don"
826
 
827
  # @ crayon-syntax-highlighter
828
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:64
829
  msgid "Add Crayon Code"
830
+ msgstr "Ajouter un code Crayon"
831
 
832
  # @ crayon-syntax-highlighter
833
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:65
834
  msgid "Edit Crayon Code"
835
  msgstr "Modifier le code Crayon"
836
 
837
  # @ crayon-syntax-highlighter
838
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:66
839
  msgid "Add"
840
  msgstr "Ajouter"
841
 
842
  # @ crayon-syntax-highlighter
843
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:67
844
  msgid "Save"
845
+ msgstr "Enregistrer"
846
 
847
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:173
848
+ msgid "OK"
849
+ msgstr ""
 
850
 
851
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:175
852
+ msgid "Cancel"
853
+ msgstr ""
854
+
855
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:184
856
  msgid "A short description"
857
  msgstr "Une brève description"
858
 
859
  # @ crayon-syntax-highlighter
860
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:186
861
  msgid "Inline"
862
  msgstr "Inline"
863
 
864
  # @ crayon-syntax-highlighter
865
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:188
866
+ #, fuzzy
867
+ msgid "Don't Highlight"
868
+ msgstr "Désactiver la surbrillance"
869
+
870
+ # @ crayon-syntax-highlighter
871
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:193
872
  msgid "Language"
873
+ msgstr "Langage"
874
+
875
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:196
876
+ msgid "Line Range"
877
+ msgstr ""
878
+
879
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:197
880
+ #, fuzzy
881
+ msgid "(e.g. 3-5 or 3)"
882
+ msgstr "(par exemple 1,2,3-5)"
883
 
884
  # @ crayon-syntax-highlighter
885
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:198
886
  msgid "Marked Lines"
887
+ msgstr "Lignes mises en évidence"
888
 
889
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:199
890
  msgid "(e.g. 1,2,3-5)"
891
  msgstr "(par exemple 1,2,3-5)"
892
 
893
  # @ crayon-syntax-highlighter
894
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:206
 
 
 
 
 
895
  msgid "Clear"
896
  msgstr "Effacer"
897
 
898
  # @ crayon-syntax-highlighter
899
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:210
900
  msgid "Paste your code here, or type it in manually."
901
+ msgstr "Collez votre code ici, ou saisissez-le manuellement."
902
 
903
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:214
904
  msgid "URL"
905
  msgstr ""
906
 
907
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:216
908
  msgid "Relative local path or absolute URL"
909
+ msgstr "Chemin d'accès local relatif ou URL absolue"
910
 
911
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:219
912
+ msgid ""
913
+ "If the URL fails to load, the code above will be shown instead. If no code "
914
+ "exists, an error is shown."
915
+ msgstr ""
916
+ "Si l'URL ne parvient pas à charger, le code ci-dessus sera affiché à la "
917
+ "place. Si aucun code n'existe, une erreur s'affichera."
918
 
919
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:221
920
  #, php-format
921
+ msgid ""
922
+ "If a relative local path is given it will be appended to %s - which is "
923
+ "defined in %sCrayon &gt; Settings &gt; Files%s."
924
+ msgstr ""
925
+ "Si un chemin relatif locale est donné, il sera ajouté à %s - qui est défini "
926
+ "dans %sCrayon &gt; Paramètres &gt; Fichiers%s."
927
 
928
  # @ crayon-syntax-highlighter
929
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:246
930
  msgid "Change the following settings to override their global values."
931
+ msgstr ""
932
+ "Modifiez les paramètres suivants pour remplacer leurs valeurs globales."
933
 
934
  # @ crayon-syntax-highlighter
935
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:248
936
  msgid "Only changes (shown yellow) are applied."
937
+ msgstr "Seules les modifications (montrées en jaune) sont appliquées."
938
 
939
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:250
940
  #, php-format
941
+ msgid ""
942
+ "Future changes to the global settings under %sCrayon &gt; Settings%s won't "
943
+ "affect overridden settings."
944
+ msgstr ""
945
+ "Les modifications futures des paramètres globaux sous %sCrayon &gt; "
946
+ "Paramètres%s n'affecteront pas les paramètres écrasés."
947
 
948
  # @ crayon-syntax-highlighter
949
+ #: ../util/theme-editor/theme_editor_content.php:23
950
+ msgid "Theme Editor"
951
+ msgstr "Éditeur de thème"
952
 
953
+ #: ../util/theme-editor/theme_editor_content.php:29
954
+ #, php-format
955
+ msgid "Editing \"%s\" Theme"
956
+ msgstr ""
957
+
958
+ #: ../util/theme-editor/theme_editor_content.php:31
959
+ #, php-format
960
+ msgid "Creating Theme From \"%s\""
961
+ msgstr ""
962
+
963
+ # @ crayon-syntax-highlighter
964
+ #: ../util/theme-editor/theme_editor_content.php:37
965
+ msgid "Back To Settings"
966
+ msgstr "Retour aux paramètres"
trans/crayon-syntax-highlighter-pt_BR.mo ADDED
Binary file
trans/crayon-syntax-highlighter-pt_BR.po ADDED
@@ -0,0 +1,723 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2012-12-02 20:47-0300\n"
5
+ "PO-Revision-Date: 2012-12-02 20:47-0300\n"
6
+ "Last-Translator: Adonai Silveira Canez <adonaicanez@gmail.com>\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.5.4\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;crayon__;crayon_n\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "X-Poedit-SearchPath-0: C:\\Users\\Adonai\\Desktop\\crayon\n"
15
+
16
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:263
17
+ msgid "Toggle Plain Code"
18
+ msgstr "Exibir código simples"
19
+
20
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:264
21
+ msgid "Toggle Line Wrap"
22
+ msgstr "Alternar quebras de linha"
23
+
24
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:266
25
+ #, php-format
26
+ msgid "Press %s to Copy, %s to Paste"
27
+ msgstr "Pressione %s para Copiar, %s para Colar"
28
+
29
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:266
30
+ msgid "Copy Plain Code"
31
+ msgstr "Copiar Código Simples"
32
+
33
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:268
34
+ msgid "Open Code In New Window"
35
+ msgstr "Abrir código em nova janela"
36
+
37
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:270
38
+ msgid "Toggle Line Numbers"
39
+ msgstr "Alternar números de linha"
40
+
41
+ #: C:\Users\Adonai\Desktop\crayon/crayon_formatter.class.php:273
42
+ msgid "Contains Mixed Languages"
43
+ msgstr "Contem Várias Linguagens"
44
+
45
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:143
46
+ msgid "Hourly"
47
+ msgstr "A cada hora"
48
+
49
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:143
50
+ msgid "Daily"
51
+ msgstr "Diário"
52
+
53
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:144
54
+ msgid "Weekly"
55
+ msgstr "Semanal"
56
+
57
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:144
58
+ msgid "Monthly"
59
+ msgstr "Mensal"
60
+
61
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:145
62
+ msgid "Immediately"
63
+ msgstr "Imediatamente"
64
+
65
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:155
66
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:159
67
+ msgid "Max"
68
+ msgstr "Max"
69
+
70
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:155
71
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:159
72
+ msgid "Min"
73
+ msgstr "Min"
74
+
75
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:155
76
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:159
77
+ msgid "Static"
78
+ msgstr "Estático"
79
+
80
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:157
81
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:161
82
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:676
83
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:685
84
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:931
85
+ msgid "Pixels"
86
+ msgstr "Pixels"
87
+
88
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:157
89
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:161
90
+ msgid "Percent"
91
+ msgstr "Porcento"
92
+
93
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:170
94
+ msgid "None"
95
+ msgstr "Nenhum"
96
+
97
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:170
98
+ msgid "Left"
99
+ msgstr "Esqueda"
100
+
101
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:170
102
+ msgid "Center"
103
+ msgstr "Centro"
104
+
105
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:170
106
+ msgid "Right"
107
+ msgstr "Direita"
108
+
109
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:172
110
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:196
111
+ msgid "On MouseOver"
112
+ msgstr "Quando o Mouse estiver sobre"
113
+
114
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:172
115
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:178
116
+ msgid "Always"
117
+ msgstr "Sempre"
118
+
119
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:172
120
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:178
121
+ msgid "Never"
122
+ msgstr "Nunca"
123
+
124
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:178
125
+ msgid "When Found"
126
+ msgstr "Quando encontrar"
127
+
128
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:196
129
+ msgid "On Double Click"
130
+ msgstr "Duplo clique"
131
+
132
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:196
133
+ msgid "On Single Click"
134
+ msgstr "Um clique"
135
+
136
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:196
137
+ msgid "Disable Mouse Events"
138
+ msgstr "Desabilitar eventos de Mouse"
139
+
140
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings.class.php:203
141
+ msgid "An error has occurred. Please try again later."
142
+ msgstr "Ocorreu um erro. Por favor, tente novamente mais tarde."
143
+
144
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:49
145
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1107
146
+ msgid "Settings"
147
+ msgstr "Configurações"
148
+
149
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:130
150
+ msgid "You do not have sufficient permissions to access this page."
151
+ msgstr ""
152
+ "Você não tem permissões de acesso suficientes para acessar esta página."
153
+
154
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:418
155
+ msgid "General"
156
+ msgstr "Geral"
157
+
158
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:419
159
+ msgid "Theme"
160
+ msgstr "Tema"
161
+
162
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:420
163
+ msgid "Font"
164
+ msgstr "Fonte"
165
+
166
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:421
167
+ msgid "Metrics"
168
+ msgstr "Métrica"
169
+
170
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:422
171
+ msgid "Toolbar"
172
+ msgstr "Barra de ferramentas"
173
+
174
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:423
175
+ msgid "Lines"
176
+ msgstr "Linhas"
177
+
178
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:424
179
+ msgid "Code"
180
+ msgstr "Código"
181
+
182
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:425
183
+ msgid "Tags"
184
+ msgstr "Tags"
185
+
186
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:426
187
+ msgid "Languages"
188
+ msgstr "Linguagens"
189
+
190
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:427
191
+ msgid "Files"
192
+ msgstr "Arquivos"
193
+
194
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:428
195
+ msgid "Posts"
196
+ msgstr "Posts"
197
+
198
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:429
199
+ msgid "Tag Editor"
200
+ msgstr "Editor de Tags"
201
+
202
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:430
203
+ msgid "Misc"
204
+ msgstr "Miscelânea"
205
+
206
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:433
207
+ msgid "Debug"
208
+ msgstr "Debug"
209
+
210
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:434
211
+ msgid "Errors"
212
+ msgstr "Erros"
213
+
214
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:435
215
+ msgid "Log"
216
+ msgstr "Log"
217
+
218
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:438
219
+ msgid "About"
220
+ msgstr "Sobre"
221
+
222
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:638
223
+ msgid "Crayon Help"
224
+ msgstr "Crayon Ajuda"
225
+
226
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:653
227
+ msgid "Height"
228
+ msgstr "Altura"
229
+
230
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:659
231
+ msgid "Width"
232
+ msgstr "Largura"
233
+
234
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:665
235
+ msgid "Top Margin"
236
+ msgstr "Margem superior"
237
+
238
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:666
239
+ msgid "Bottom Margin"
240
+ msgstr "Margem inferior"
241
+
242
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:667
243
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:672
244
+ msgid "Left Margin"
245
+ msgstr "Margem Esquerda"
246
+
247
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:668
248
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:672
249
+ msgid "Right Margin"
250
+ msgstr "Margem Direita"
251
+
252
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:678
253
+ msgid "Horizontal Alignment"
254
+ msgstr "Alinhamento horizontal"
255
+
256
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:681
257
+ msgid "Allow floating elements to surround Crayon"
258
+ msgstr "Permitir elementos flutuantes para cercar Crayon"
259
+
260
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:683
261
+ msgid "Inline Margin"
262
+ msgstr "Margem em linha"
263
+
264
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:691
265
+ msgid "Display the Toolbar"
266
+ msgstr "Exibir a barra de ferramentas"
267
+
268
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:694
269
+ msgid "Overlay the toolbar on code rather than push it down when possible"
270
+ msgstr ""
271
+ "Sobrepor a barra de ferramentas sobre o código, em vez de empurrá-lo para "
272
+ "baixo quando possível"
273
+
274
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:695
275
+ msgid "Toggle the toolbar on single click when it is overlayed"
276
+ msgstr "Alterne a barra de ferramentas no único clique quando ele é sobreposto"
277
+
278
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:696
279
+ msgid "Delay hiding the toolbar on MouseOut"
280
+ msgstr "Atraso para ocultar a barra de ferramentas quando o mouse sair de cima"
281
+
282
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:698
283
+ msgid "Display the title when provided"
284
+ msgstr "Exibir o título quando disponível"
285
+
286
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:699
287
+ msgid "Display the language"
288
+ msgstr "Exibir a linguagem"
289
+
290
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:706
291
+ msgid "Display striped code lines"
292
+ msgstr "Exibir linhas de código listradas"
293
+
294
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:707
295
+ msgid "Enable line marking for important lines"
296
+ msgstr "Habilitar marcação de linhas para linhas importantes"
297
+
298
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:708
299
+ msgid "Enable line ranges for showing only parts of code"
300
+ msgstr "Habilitar faixas de linha para mostrar apenas partes do código"
301
+
302
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:709
303
+ msgid "Display line numbers by default"
304
+ msgstr "Exibir o número das linhas por padrão"
305
+
306
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:710
307
+ msgid "Enable line number toggling"
308
+ msgstr "Habilitar alternancia no número de linhas"
309
+
310
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:711
311
+ msgid "Wrap lines by default"
312
+ msgstr "Quebra linhas por padrão"
313
+
314
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:712
315
+ msgid "Enable line wrap toggling"
316
+ msgstr "Ativar alternância de quebra de linha"
317
+
318
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:713
319
+ msgid "Start line numbers from"
320
+ msgstr "Comece a numeração de linha a partir de"
321
+
322
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:724
323
+ msgid "When no language is provided, use the fallback"
324
+ msgstr "Quando nenhuma linguagem é informada, use o padrão"
325
+
326
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:730
327
+ #, php-format
328
+ msgid "%d language has been detected."
329
+ msgstr "Lenguagem %d foi detectada."
330
+
331
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:731
332
+ msgid "Parsing was successful"
333
+ msgstr "A análise foi bem sucedida"
334
+
335
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:731
336
+ msgid "Parsing was unsuccessful"
337
+ msgstr "A análise não foi bem sucedida"
338
+
339
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:737
340
+ #, php-format
341
+ msgid "The selected language with id %s could not be loaded"
342
+ msgstr "O idioma selecionado com o id %s não pôde ser carregado"
343
+
344
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:740
345
+ msgid "Show Languages"
346
+ msgstr "Exibir linguagens"
347
+
348
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:776
349
+ msgid "Show Crayon Posts"
350
+ msgstr "Exibir Crayon Posts"
351
+
352
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:777
353
+ msgid "Refresh"
354
+ msgstr "Atualizar"
355
+
356
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:793
357
+ msgid "ID"
358
+ msgstr "ID"
359
+
360
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:793
361
+ msgid "Title"
362
+ msgstr "Titulo"
363
+
364
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:793
365
+ msgid "Posted"
366
+ msgstr "Posts"
367
+
368
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:793
369
+ msgid "Modifed"
370
+ msgstr "Modificado"
371
+
372
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:793
373
+ msgid "Contains Legacy Tags?"
374
+ msgstr "Contém Tags antigas?"
375
+
376
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:806
377
+ msgid "Yes"
378
+ msgstr "Sim"
379
+
380
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:806
381
+ msgid "No"
382
+ msgstr "Não"
383
+
384
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:890
385
+ msgid "Edit"
386
+ msgstr "Editar"
387
+
388
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:890
389
+ msgid "Duplicate"
390
+ msgstr "Duplicado"
391
+
392
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:890
393
+ msgid "Create"
394
+ msgstr "Criar"
395
+
396
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:890
397
+ msgid "Delete"
398
+ msgstr "Apagar"
399
+
400
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:892
401
+ msgid "Loading..."
402
+ msgstr "Carregando..."
403
+
404
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:907
405
+ #, php-format
406
+ msgid ""
407
+ "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 "
408
+ "are marked."
409
+ msgstr ""
410
+ "Altere a %1$slinguagem padrão%2$s para alterar o código de exemplo. Linhas "
411
+ "5-7 estão marcadas"
412
+
413
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:912
414
+ msgid "Enable Live Preview"
415
+ msgstr "Ativar Visualização Dinâmica"
416
+
417
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:914
418
+ msgid "Enqueue themes in the header (more efficient)."
419
+ msgstr "Colocar temas no cabeçalho (mais eficiente)."
420
+
421
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:917
422
+ #, php-format
423
+ msgid "The selected theme with id %s could not be loaded"
424
+ msgstr "O tema selecionado com o id %s não pode ser carregado"
425
+
426
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:929
427
+ msgid "Custom Font Size"
428
+ msgstr "Tamanho de fonte pesonalizado"
429
+
430
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:934
431
+ #, php-format
432
+ msgid "The selected font with id %s could not be loaded"
433
+ msgstr "A fonte selecionada com o id %s não pode ser carregada"
434
+
435
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:940
436
+ msgid "Enqueue fonts in the header (more efficient)."
437
+ msgstr "Colocar fontes no cabeçalho (mais eficiente)."
438
+
439
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:945
440
+ msgid "Enable plain code view and display"
441
+ msgstr "Habilitar visualização e exibição de código simples"
442
+
443
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:948
444
+ msgid "Enable plain code toggling"
445
+ msgstr "Ativar alternância de código simples"
446
+
447
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:949
448
+ msgid "Show the plain code by default"
449
+ msgstr "Exibir código simples por padrão"
450
+
451
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:950
452
+ msgid "Enable code copy/paste"
453
+ msgstr "Habilitar Copiar/Colar código"
454
+
455
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:952
456
+ msgid "Enable opening code in a window"
457
+ msgstr "Habilitar abrir código em uma janela"
458
+
459
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:953
460
+ msgid "Always display scrollbars"
461
+ msgstr "Sempre exibir barra de rolagem"
462
+
463
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:956
464
+ msgid "Decode HTML entities in code"
465
+ msgstr "Decodificar entidades HTML em código"
466
+
467
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:958
468
+ msgid "Decode HTML entities in attributes"
469
+ msgstr "Decodificar entidades HTML em atributos"
470
+
471
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:960
472
+ msgid "Remove whitespace surrounding the shortcode content"
473
+ msgstr "Remover espaço em branco em torno do código"
474
+
475
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:962
476
+ msgid "Allow Mixed Language Highlighting with delimiters and tags."
477
+ msgstr "Permitir realçar linguagem mista com delimitadores e tags."
478
+
479
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:964
480
+ msgid "Show Mixed Language Icon (+)"
481
+ msgstr "Exibir icone para inúmeras linguagens (+)"
482
+
483
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:966
484
+ msgid "Tab size in spaces"
485
+ msgstr "Tamanho do Tab em espaços"
486
+
487
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:968
488
+ msgid "Blank lines before code:"
489
+ msgstr "Linhas em branco antes do código:"
490
+
491
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:970
492
+ msgid "Blank lines after code:"
493
+ msgstr "Linhas em branco após o código:"
494
+
495
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:975
496
+ msgid "Capture Mini Tags like [php][/php] as Crayons."
497
+ msgstr "Capturar Mini Tags como [php][/php] como Crayons."
498
+
499
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:976
500
+ msgid "Capture Inline Tags like {php}{/php} inside sentences."
501
+ msgstr "Capturar Tag inline como {php} {/php} dentro das sentenças."
502
+
503
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:977
504
+ msgid "Wrap Inline Tags"
505
+ msgstr "Encapsular Tags inline"
506
+
507
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:978
508
+ msgid "Capture `backquotes` as &lt;code&gt;"
509
+ msgstr "Capturar `backquotes` como &lt;code&gt;"
510
+
511
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:979
512
+ msgid "Capture &lt;pre&gt; tags as Crayons"
513
+ msgstr "Capturar &lt;pre&gt; tags como Crayons"
514
+
515
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:980
516
+ msgid "Enable [plain][/plain] tag."
517
+ msgstr "Habilitar [plain][/plain] tag."
518
+
519
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:985
520
+ msgid ""
521
+ "When loading local files and a relative path is given for the URL, use the "
522
+ "absolute path"
523
+ msgstr ""
524
+ "Ao carregar arquivos locais e um caminho relativo é dado para a URL, use o "
525
+ "caminho absoluto"
526
+
527
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:988
528
+ msgid "Followed by your relative URL."
529
+ msgstr "Seguido pela sua URL relativa."
530
+
531
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:995
532
+ msgid "Convert Legacy Tags"
533
+ msgstr "Converter Tags antigas"
534
+
535
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:998
536
+ msgid "No Legacy Tags Found"
537
+ msgstr "Não foram encontradas Tags antigas"
538
+
539
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1003
540
+ #, php-format
541
+ msgid ""
542
+ "Use %s to separate setting names from values in the &lt;pre&gt; class "
543
+ "attribute"
544
+ msgstr ""
545
+ "Use %s para separar nomes de configuração de valores &lt;pre&gt; do atributo "
546
+ "de classe"
547
+
548
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1006
549
+ msgid ""
550
+ "Display the Tag Editor in any TinyMCE instances on the frontend (e.g. "
551
+ "bbPress)"
552
+ msgstr ""
553
+ "Exibir o editor de Tags em todas instâncias TinyMCE da interface. (ex. "
554
+ "bbPress)"
555
+
556
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1007
557
+ msgid "Display Tag Editor settings on the frontend"
558
+ msgstr "Exibir as configurações do Editor de Tags na parte frontal"
559
+
560
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1011
561
+ msgid "Clear the cache used to store remote code requests"
562
+ msgstr "Limpar o cache usado para armazenar solicitações de código remoto"
563
+
564
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1013
565
+ msgid "Clear Now"
566
+ msgstr "Limpar agora"
567
+
568
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1014
569
+ msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
570
+ msgstr "Tentar carregar CSS Crayon e JavaScript apenas quando necessário"
571
+
572
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1015
573
+ msgid "Disable enqueuing for page templates that may contain The Loop."
574
+ msgstr "Desativar enqueuing para modelos de página que pode conter a Loop."
575
+
576
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1016
577
+ msgid "Allow Crayons inside comments"
578
+ msgstr "Permitir comentários sobre os Crayons"
579
+
580
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1017
581
+ msgid "Remove Crayons from excerpts"
582
+ msgstr "Remover Crayons dos trechos"
583
+
584
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1018
585
+ msgid "Load Crayons only from the main Wordpress query"
586
+ msgstr "Carregar Crayons apenas a partir da consulta principal do Wordpress."
587
+
588
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1019
589
+ msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
590
+ msgstr ""
591
+ "Desabilitar movimentos de mouse para dispositivos touchscreen (eg. MouseOver)"
592
+
593
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1020
594
+ msgid "Disable animations"
595
+ msgstr "Desabilitar animações"
596
+
597
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1021
598
+ msgid "Disable runtime stats"
599
+ msgstr "Desabilitar estatisticas em tempo de execução"
600
+
601
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1027
602
+ msgid "Log errors for individual Crayons"
603
+ msgstr "Logar erros Crayons individuais."
604
+
605
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1028
606
+ msgid "Log system-wide errors"
607
+ msgstr "Logar todos os erros do sistema"
608
+
609
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1029
610
+ msgid "Display custom message for errors"
611
+ msgstr "Exibir mensagens customizadas para erros"
612
+
613
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1041
614
+ msgid "Show Log"
615
+ msgstr "Exibir Log"
616
+
617
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1041
618
+ msgid "Hide Log"
619
+ msgstr "Ocultar Log"
620
+
621
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1043
622
+ msgid "Clear Log"
623
+ msgstr "Limpar Log"
624
+
625
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1044
626
+ msgid "Email Admin"
627
+ msgstr "Email para Admin"
628
+
629
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1046
630
+ msgid "Email Developer"
631
+ msgstr "Email para o Desenvolvedor"
632
+
633
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1048
634
+ msgid "The log is currently empty."
635
+ msgstr "O Log está vazio atualmente."
636
+
637
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1062
638
+ msgid "Version"
639
+ msgstr "Versão"
640
+
641
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1064
642
+ msgid "Developer"
643
+ msgstr "Desenvolvedor"
644
+
645
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1065
646
+ msgid "Translators"
647
+ msgstr "Tradutores"
648
+
649
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1091
650
+ msgid ""
651
+ "The result of innumerable hours of hard work over many months. It's an "
652
+ "ongoing project, keep me motivated!"
653
+ msgstr ""
654
+ "O resultado de inúmeras horas de trabalho duro ao longo de muitos meses. "
655
+ "Este é um projeto em andamento, ajude-me a manter-me motivado!"
656
+
657
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1101
658
+ msgid "?"
659
+ msgstr "?"
660
+
661
+ #: C:\Users\Adonai\Desktop\crayon/crayon_settings_wp.class.php:1108
662
+ msgid "Donate"
663
+ msgstr "Doação"
664
+
665
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:64
666
+ msgid "Add Crayon Code"
667
+ msgstr "Adicionar código Crayon"
668
+
669
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:65
670
+ msgid "Edit Crayon Code"
671
+ msgstr "Editar código do Crayon"
672
+
673
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:66
674
+ msgid "Add"
675
+ msgstr "Adicionar"
676
+
677
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:67
678
+ msgid "Save"
679
+ msgstr "Salvar"
680
+
681
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:184
682
+ msgid "A short description"
683
+ msgstr "Descrição curta"
684
+
685
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:197
686
+ msgid "(e.g. 3-5 or 3)"
687
+ msgstr "(ex. 3-5 ou 3)"
688
+
689
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:199
690
+ msgid "(e.g. 1,2,3-5)"
691
+ msgstr "(ex. 1,2,3-5)"
692
+
693
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:216
694
+ msgid "Relative local path or absolute URL"
695
+ msgstr "Caminho local relativo ou uma URL absoluta"
696
+
697
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:221
698
+ #, php-format
699
+ msgid ""
700
+ "If a relative local path is given it will be appended to %s - which is "
701
+ "defined in %sCrayon &gt; Settings &gt; Files%s."
702
+ msgstr ""
703
+ "Se um caminho relativo for informado ele será adicionado a %s - que está "
704
+ "definido na %s &gt; Configurações &gt; do Crayon%s."
705
+
706
+ #: C:\Users\Adonai\Desktop\crayon/util/tag-editor/crayon_tag_editor_wp.class.php:250
707
+ #, php-format
708
+ msgid ""
709
+ "Future changes to the global settings under %sCrayon &gt; Settings%s won't "
710
+ "affect overridden settings."
711
+ msgstr ""
712
+ "Futuras alterações nas configurações globais de %sCrayon &gt; Configurações"
713
+ "%s não afetará configurações substituídas."
714
+
715
+ #: C:\Users\Adonai\Desktop\crayon/util/theme-editor/theme_editor_content.php:29
716
+ #, php-format
717
+ msgid "Editing \"%s\" Theme"
718
+ msgstr "Editando \"%s\" Tema"
719
+
720
+ #: C:\Users\Adonai\Desktop\crayon/util/theme-editor/theme_editor_content.php:31
721
+ #, php-format
722
+ msgid "Creating Theme From \"%s\""
723
+ msgstr "Tema criado por \"%s\""
trans/crayon-syntax-highlighter-tr_TR.mo CHANGED
Binary file
trans/crayon-syntax-highlighter-tr_TR.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: crayon-syntax-highlighter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-10-16 04:19+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: HakanEr <hakanerwptr@gmail.com>\n"
8
  "Language-Team: hakaner <hakanerwptr@gmail.com>\n"
@@ -22,441 +22,478 @@ msgstr ""
22
  "X-Poedit-SearchPath-1: ..\n"
23
 
24
  # @ crayon-syntax-highlighter
25
- #: ../crayon_formatter.class.php:275
26
  msgid "Toggle Plain Code"
27
  msgstr "Düz Koda Geç"
28
 
29
  # @ crayon-syntax-highlighter
30
- #: ../crayon_formatter.class.php:276
31
  msgid "Toggle Line Wrap"
32
  msgstr "Satır Sarımına Geç"
33
 
34
  # @ crayon-syntax-highlighter
35
- #: ../crayon_formatter.class.php:278
 
 
 
 
 
36
  #, php-format
37
  msgid "Press %s to Copy, %s to Paste"
38
  msgstr "%s ile Kopyala, %s ile Yapıştır"
39
 
40
  # @ crayon-syntax-highlighter
41
- #: ../crayon_formatter.class.php:278
42
  msgid "Copy Plain Code"
43
  msgstr "Düz Kodu Kopyala"
44
 
45
  # @ crayon-syntax-highlighter
46
- #: ../crayon_formatter.class.php:280
47
  msgid "Open Code In New Window"
48
  msgstr "Kodu Yeni Pencerede Aç"
49
 
50
  # @ crayon-syntax-highlighter
51
- #: ../crayon_formatter.class.php:282
52
  msgid "Toggle Line Numbers"
53
  msgstr "Satır Numaralarına Geç"
54
 
55
  # @ crayon-syntax-highlighter
56
- #: ../crayon_formatter.class.php:285
57
  msgid "Contains Mixed Languages"
58
  msgstr "Karışık Diller içerir"
59
 
60
  # @ crayon-syntax-highlighter
61
- #: ../crayon_settings.class.php:143
62
  msgid "Hourly"
63
  msgstr "Saatlik"
64
 
65
  # @ crayon-syntax-highlighter
66
- #: ../crayon_settings.class.php:143
67
  msgid "Daily"
68
  msgstr "Günlük"
69
 
70
  # @ crayon-syntax-highlighter
71
- #: ../crayon_settings.class.php:144
72
  msgid "Weekly"
73
  msgstr "Haftalık"
74
 
75
  # @ crayon-syntax-highlighter
76
- #: ../crayon_settings.class.php:144
77
  msgid "Monthly"
78
  msgstr "Aylık"
79
 
80
  # @ crayon-syntax-highlighter
81
- #: ../crayon_settings.class.php:145
82
  msgid "Immediately"
83
  msgstr "Hemen"
84
 
85
  # @ crayon-syntax-highlighter
86
- #: ../crayon_settings.class.php:155 ../crayon_settings.class.php:159
87
  msgid "Max"
88
  msgstr "Max"
89
 
90
  # @ crayon-syntax-highlighter
91
- #: ../crayon_settings.class.php:155 ../crayon_settings.class.php:159
92
  msgid "Min"
93
  msgstr "Min"
94
 
95
  # @ crayon-syntax-highlighter
96
- #: ../crayon_settings.class.php:155 ../crayon_settings.class.php:159
97
  msgid "Static"
98
  msgstr "Sabit"
99
 
100
  # @ crayon-syntax-highlighter
101
- #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
102
- #: ../crayon_settings_wp.class.php:580 ../crayon_settings_wp.class.php:589
103
- #: ../crayon_settings_wp.class.php:698
104
  msgid "Pixels"
105
  msgstr "Piksel"
106
 
107
  # @ crayon-syntax-highlighter
108
- #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
109
  msgid "Percent"
110
  msgstr "Yüzde"
111
 
112
  # @ crayon-syntax-highlighter
113
- #: ../crayon_settings.class.php:170
114
  msgid "None"
115
  msgstr "Yok"
116
 
117
  # @ crayon-syntax-highlighter
118
- #: ../crayon_settings.class.php:170
119
  msgid "Left"
120
  msgstr "Sol"
121
 
122
  # @ crayon-syntax-highlighter
123
- #: ../crayon_settings.class.php:170
124
  msgid "Center"
125
  msgstr "Merkez"
126
 
127
  # @ crayon-syntax-highlighter
128
- #: ../crayon_settings.class.php:170
129
  msgid "Right"
130
  msgstr "Sağ"
131
 
132
  # @ crayon-syntax-highlighter
133
- #: ../crayon_settings.class.php:172 ../crayon_settings.class.php:196
134
  msgid "On MouseOver"
135
  msgstr "Fare Üstündeyken"
136
 
137
  # @ crayon-syntax-highlighter
138
- #: ../crayon_settings.class.php:172 ../crayon_settings.class.php:178
139
  msgid "Always"
140
  msgstr "Herzaman"
141
 
142
  # @ crayon-syntax-highlighter
143
- #: ../crayon_settings.class.php:172 ../crayon_settings.class.php:178
144
  msgid "Never"
145
  msgstr "Asla"
146
 
147
  # @ crayon-syntax-highlighter
148
- #: ../crayon_settings.class.php:178
149
  msgid "When Found"
150
  msgstr "Bulunduğunda"
151
 
152
  # @ crayon-syntax-highlighter
153
- #: ../crayon_settings.class.php:196
154
  msgid "On Double Click"
155
  msgstr "Çift Tık ile aç"
156
 
157
  # @ crayon-syntax-highlighter
158
- #: ../crayon_settings.class.php:196
159
  msgid "On Single Click"
160
  msgstr "Tek Tık ile aç"
161
 
162
  # @ crayon-syntax-highlighter
163
- #: ../crayon_settings.class.php:196
164
  msgid "Disable Mouse Events"
165
  msgstr "Fare Etkinliği Devre Dışı"
166
 
167
  # @ crayon-syntax-highlighter
168
- #: ../crayon_settings.class.php:203
169
  msgid "An error has occurred. Please try again later."
170
  msgstr "Bir hata meydana geldi. Daha sonra tekrar deneyin."
171
 
172
  # @ crayon-syntax-highlighter
173
- #: ../crayon_settings_wp.class.php:44 ../crayon_settings_wp.class.php:132
174
- #: ../crayon_settings_wp.class.php:870
175
- #: ../util/tag-editor/crayon_te_content.php:132
176
  msgid "Settings"
177
  msgstr "Ayarlar"
178
 
179
  # @ crayon-syntax-highlighter
180
- #: ../crayon_settings_wp.class.php:113
181
  msgid "You do not have sufficient permissions to access this page."
182
  msgstr "Bu sayfaya erişmek için yeterli izinlere sahip değilsiniz."
183
 
184
  # @ crayon-syntax-highlighter
185
- #: ../crayon_settings_wp.class.php:144
186
  msgid "Save Changes"
187
  msgstr "Kaydet"
188
 
189
  # @ crayon-syntax-highlighter
190
- #: ../crayon_settings_wp.class.php:150
191
  msgid "Reset Settings"
192
  msgstr "Ayarları Sıfırla"
193
 
194
  # @ crayon-syntax-highlighter
195
- #: ../crayon_settings_wp.class.php:326
196
  msgid "General"
197
  msgstr "Genel"
198
 
199
  # @ crayon-syntax-highlighter
200
- #: ../crayon_settings_wp.class.php:327
201
  msgid "Theme"
202
  msgstr "Tema"
203
 
204
  # @ crayon-syntax-highlighter
205
- #: ../crayon_settings_wp.class.php:328
206
  msgid "Font"
207
  msgstr "Font"
208
 
209
  # @ crayon-syntax-highlighter
210
- #: ../crayon_settings_wp.class.php:329
211
  msgid "Metrics"
212
  msgstr "Ölçüler"
213
 
214
  # @ crayon-syntax-highlighter
215
- #: ../crayon_settings_wp.class.php:330
216
  msgid "Toolbar"
217
  msgstr "Araç Çubuğu"
218
 
219
  # @ crayon-syntax-highlighter
220
- #: ../crayon_settings_wp.class.php:331
221
  msgid "Lines"
222
  msgstr "Satırlar"
223
 
224
  # @ crayon-syntax-highlighter
225
- #: ../crayon_settings_wp.class.php:332
226
- #: ../util/tag-editor/crayon_te_content.php:100
227
  msgid "Code"
228
  msgstr "Kod"
229
 
230
  # @ crayon-syntax-highlighter
231
- #: ../crayon_settings_wp.class.php:333
232
  msgid "Tags"
233
  msgstr "Etiketler"
234
 
235
  # @ crayon-syntax-highlighter
236
- #: ../crayon_settings_wp.class.php:334
237
  msgid "Languages"
238
  msgstr "Diller"
239
 
240
  # @ crayon-syntax-highlighter
241
- #: ../crayon_settings_wp.class.php:335
242
  msgid "Files"
243
  msgstr "Dosyalar"
244
 
245
- #: ../crayon_settings_wp.class.php:336
246
  msgid "Posts"
247
  msgstr "Yazılar"
248
 
249
  # @ crayon-syntax-highlighter
250
- #: ../crayon_settings_wp.class.php:337
251
  msgid "Tag Editor"
252
  msgstr "Etiket Düzenleyici"
253
 
254
  # @ crayon-syntax-highlighter
255
- #: ../crayon_settings_wp.class.php:338
256
  msgid "Misc"
257
  msgstr "Çeşitli"
258
 
259
  # @ crayon-syntax-highlighter
260
- #: ../crayon_settings_wp.class.php:341
261
  msgid "Debug"
262
  msgstr "Hata Ayıklama"
263
 
264
  # @ crayon-syntax-highlighter
265
- #: ../crayon_settings_wp.class.php:342
266
  msgid "Errors"
267
  msgstr "Hatalar"
268
 
269
  # @ crayon-syntax-highlighter
270
- #: ../crayon_settings_wp.class.php:343
271
  msgid "Log"
272
  msgstr "Günlük"
273
 
274
  # @ crayon-syntax-highlighter
275
- #: ../crayon_settings_wp.class.php:346
276
  msgid "About"
277
  msgstr "Hakkında"
278
 
279
  # @ crayon-syntax-highlighter
280
- #: ../crayon_settings_wp.class.php:542
281
  msgid "Crayon Help"
282
  msgstr "Crayon Yardım"
283
 
284
  # @ crayon-syntax-highlighter
285
- #: ../crayon_settings_wp.class.php:557
286
  msgid "Height"
287
  msgstr "Yükseklik"
288
 
289
  # @ crayon-syntax-highlighter
290
- #: ../crayon_settings_wp.class.php:563
291
  msgid "Width"
292
  msgstr "Genişlik"
293
 
294
  # @ crayon-syntax-highlighter
295
- #: ../crayon_settings_wp.class.php:569
296
  msgid "Top Margin"
297
  msgstr "Üst Boşluk"
298
 
299
  # @ crayon-syntax-highlighter
300
- #: ../crayon_settings_wp.class.php:570
301
  msgid "Bottom Margin"
302
  msgstr "Alt Boşluk"
303
 
304
  # @ crayon-syntax-highlighter
305
- #: ../crayon_settings_wp.class.php:571 ../crayon_settings_wp.class.php:576
306
  msgid "Left Margin"
307
  msgstr "Sol Boşluk"
308
 
309
  # @ crayon-syntax-highlighter
310
- #: ../crayon_settings_wp.class.php:572 ../crayon_settings_wp.class.php:576
311
  msgid "Right Margin"
312
  msgstr "Sağ Boşluk"
313
 
314
  # @ crayon-syntax-highlighter
315
- #: ../crayon_settings_wp.class.php:582
316
  msgid "Horizontal Alignment"
317
  msgstr "Yatay Hizalama"
318
 
319
  # @ crayon-syntax-highlighter
320
- #: ../crayon_settings_wp.class.php:585
321
  msgid "Allow floating elements to surround Crayon"
322
  msgstr "Geçişli elementleri Crayon çevrelemeye izin ver"
323
 
324
  # @ crayon-syntax-highlighter
325
- #: ../crayon_settings_wp.class.php:587
326
  msgid "Inline Margin"
327
  msgstr "Satıriçi Boşluk"
328
 
329
  # @ crayon-syntax-highlighter
330
- #: ../crayon_settings_wp.class.php:595
331
  msgid "Display the Toolbar"
332
  msgstr "Araç çubuğunu göster"
333
 
334
  # @ crayon-syntax-highlighter
335
- #: ../crayon_settings_wp.class.php:598
336
  msgid "Overlay the toolbar on code rather than push it down when possible"
337
  msgstr "Araç çubuğunu mümkünse kodları aşağı itmek yerine üstte göster"
338
 
339
  # @ crayon-syntax-highlighter
340
- #: ../crayon_settings_wp.class.php:599
341
  msgid "Toggle the toolbar on single click when it is overlayed"
342
  msgstr "Araç çubuğu üste çıktığında tek tıkla gizle"
343
 
344
  # @ crayon-syntax-highlighter
345
- #: ../crayon_settings_wp.class.php:600
346
  msgid "Delay hiding the toolbar on MouseOut"
347
  msgstr "Fare dışa çıktığında araç çubuğunu gizlemek için bekle"
348
 
349
  # @ crayon-syntax-highlighter
350
- #: ../crayon_settings_wp.class.php:602
351
  msgid "Display the title when provided"
352
  msgstr "Varsa başlığı görüntüle"
353
 
354
  # @ crayon-syntax-highlighter
355
- #: ../crayon_settings_wp.class.php:603
356
  msgid "Display the language"
357
  msgstr "Dilleri göster"
358
 
359
  # @ crayon-syntax-highlighter
360
- #: ../crayon_settings_wp.class.php:610
361
  msgid "Display striped code lines"
362
  msgstr "Şeritli kod satırını göster"
363
 
364
  # @ crayon-syntax-highlighter
365
- #: ../crayon_settings_wp.class.php:611
366
  msgid "Enable line marking for important lines"
367
  msgstr "Önemli satırlar için satır işaretleme etkin"
368
 
369
- #: ../crayon_settings_wp.class.php:612
370
  msgid "Enable line ranges for showing only parts of code"
371
  msgstr "Kodun sadece bir parçasını gösteren satır aralıklarını etkinleştir"
372
 
373
  # @ crayon-syntax-highlighter
374
- #: ../crayon_settings_wp.class.php:613
375
  msgid "Display line numbers by default"
376
  msgstr "Varsayılan olarak satır numaralarını göster"
377
 
378
  # @ crayon-syntax-highlighter
379
- #: ../crayon_settings_wp.class.php:614
380
  msgid "Enable line number toggling"
381
  msgstr "Satır numaraları geçişi etkin"
382
 
383
  # @ crayon-syntax-highlighter
384
- #: ../crayon_settings_wp.class.php:615
385
  msgid "Wrap lines by default"
386
  msgstr "Varsayılan olarak satırları sar"
387
 
388
  # @ crayon-syntax-highlighter
389
- #: ../crayon_settings_wp.class.php:616
390
  msgid "Enable line wrap toggling"
391
  msgstr "Satır sarıma geçişi etkin"
392
 
393
  # @ crayon-syntax-highlighter
394
- #: ../crayon_settings_wp.class.php:617
395
  msgid "Start line numbers from"
396
  msgstr "Satır numarasını buradan başlat"
397
 
398
  # @ crayon-syntax-highlighter
399
- #: ../crayon_settings_wp.class.php:627
400
  msgid "When no language is provided, use the fallback"
401
  msgstr "Belirlenmiş bir dil olmadığında son çareyi kullan"
402
 
403
  # @ crayon-syntax-highlighter
404
- #: ../crayon_settings_wp.class.php:633
405
- #, fuzzy, php-format
406
  msgid "%d language has been detected."
407
  msgstr "%d dil tespit edildi."
408
 
409
  # @ crayon-syntax-highlighter
410
- #: ../crayon_settings_wp.class.php:634
411
  msgid "Parsing was successful"
412
  msgstr "Ayrıştırma başarılı"
413
 
414
  # @ crayon-syntax-highlighter
415
- #: ../crayon_settings_wp.class.php:634
416
  msgid "Parsing was unsuccessful"
417
  msgstr "Ayrıştırma başarılı değil"
418
 
419
  # @ crayon-syntax-highlighter
420
- #: ../crayon_settings_wp.class.php:640
421
  #, php-format
422
  msgid "The selected language with id %s could not be loaded"
423
  msgstr "ID %s ile seçilen dil yüklenemedi"
424
 
425
  # @ crayon-syntax-highlighter
426
- #: ../crayon_settings_wp.class.php:643
427
  msgid "Show Languages"
428
  msgstr "Dilleri Göster"
429
 
430
- #: ../crayon_settings_wp.class.php:652
431
  msgid "Show Crayon Posts"
432
  msgstr "Crayon Yazıları Göster"
433
 
 
 
 
 
 
 
 
 
434
  # @ crayon-syntax-highlighter
435
- #: ../crayon_settings_wp.class.php:652 ../crayon_settings_wp.class.php:681
436
- #: ../crayon_settings_wp.class.php:707 ../crayon_settings_wp.class.php:729
437
- #: ../crayon_settings_wp.class.php:742 ../crayon_settings_wp.class.php:743
438
- #: ../crayon_settings_wp.class.php:744 ../crayon_settings_wp.class.php:745
439
- #: ../crayon_settings_wp.class.php:746 ../crayon_settings_wp.class.php:747
440
- #: ../crayon_settings_wp.class.php:769 ../crayon_settings_wp.class.php:772
441
- #: ../crayon_settings_wp.class.php:781 ../crayon_settings_wp.class.php:782
442
- msgid "?"
443
- msgstr "?"
 
 
 
 
 
 
 
 
 
 
 
444
 
445
  # @ crayon-syntax-highlighter
446
- #: ../crayon_settings_wp.class.php:669 ../crayon_settings_wp.class.php:670
447
- msgid "Loading..."
448
- msgstr "Yükleniyor..."
449
 
450
- #: ../crayon_settings_wp.class.php:669
451
  msgid "Edit"
452
  msgstr "Düzenle"
453
 
454
- #: ../crayon_settings_wp.class.php:670
 
 
 
 
455
  msgid "Create"
456
  msgstr "Oluştur"
457
 
 
 
 
 
458
  # @ crayon-syntax-highlighter
459
- #: ../crayon_settings_wp.class.php:675
 
 
 
 
 
460
  #, php-format
461
  msgid ""
462
  "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 "
@@ -466,137 +503,145 @@ msgstr ""
466
  "işaretli."
467
 
468
  # @ crayon-syntax-highlighter
469
- #: ../crayon_settings_wp.class.php:679
470
  msgid "Enable Live Preview"
471
  msgstr "Ön izleme etkin"
472
 
473
  # @ crayon-syntax-highlighter
474
- #: ../crayon_settings_wp.class.php:681
475
  msgid "Enqueue themes in the header (more efficient)."
476
  msgstr "Temaları header içinde kuyrukla (daha etkin)."
477
 
478
  # @ crayon-syntax-highlighter
479
- #: ../crayon_settings_wp.class.php:684
480
  #, php-format
481
  msgid "The selected theme with id %s could not be loaded"
482
  msgstr "ID %s ile seçilen tema yüklenemedi"
483
 
484
  # @ crayon-syntax-highlighter
485
- #: ../crayon_settings_wp.class.php:696
486
  msgid "Custom Font Size"
487
  msgstr "Kişisel Font Boyutu"
488
 
489
  # @ crayon-syntax-highlighter
490
- #: ../crayon_settings_wp.class.php:701
491
  #, php-format
492
  msgid "The selected font with id %s could not be loaded"
493
  msgstr "ID %s ile seçilen font yüklenemedi"
494
 
495
  # @ crayon-syntax-highlighter
496
- #: ../crayon_settings_wp.class.php:707
497
  msgid "Enqueue fonts in the header (more efficient)."
498
  msgstr "Fontları header içinde kuyrukla (daha etkin)."
499
 
500
  # @ crayon-syntax-highlighter
501
- #: ../crayon_settings_wp.class.php:712
502
  msgid "Enable plain code view and display"
503
  msgstr "Düz kod görünümü ve görüntüleme etkin"
504
 
505
  # @ crayon-syntax-highlighter
506
- #: ../crayon_settings_wp.class.php:715
507
  msgid "Enable plain code toggling"
508
  msgstr "Düz kod geçişi etkin"
509
 
510
  # @ crayon-syntax-highlighter
511
- #: ../crayon_settings_wp.class.php:716
512
  msgid "Show the plain code by default"
513
  msgstr "Düz kodu varsayılan olarak göster"
514
 
515
  # @ crayon-syntax-highlighter
516
- #: ../crayon_settings_wp.class.php:717
517
  msgid "Enable code copy/paste"
518
  msgstr "Kod kopyala/yapıştır etkin"
519
 
520
  # @ crayon-syntax-highlighter
521
- #: ../crayon_settings_wp.class.php:719
522
  msgid "Enable opening code in a window"
523
  msgstr "Kodları bir pencerede açma etkin"
524
 
525
  # @ crayon-syntax-highlighter
526
- #: ../crayon_settings_wp.class.php:720
527
  msgid "Always display scrollbars"
528
  msgstr "Kaydırma çubuğu her zaman göster"
529
 
 
 
 
 
 
 
 
 
530
  # @ crayon-syntax-highlighter
531
- #: ../crayon_settings_wp.class.php:723
532
  msgid "Decode HTML entities in code"
533
  msgstr "HTML varlıkları kod içinde çöz"
534
 
535
  # @ crayon-syntax-highlighter
536
- #: ../crayon_settings_wp.class.php:725
537
  msgid "Decode HTML entities in attributes"
538
  msgstr "HTML varlıkları nitelikler içinde çöz"
539
 
540
  # @ crayon-syntax-highlighter
541
- #: ../crayon_settings_wp.class.php:727
542
  msgid "Remove whitespace surrounding the shortcode content"
543
  msgstr "Kısakod içeriğini çevreleyen beyaz alanları kaldır"
544
 
545
  # @ crayon-syntax-highlighter
546
- #: ../crayon_settings_wp.class.php:729
547
  msgid "Allow Mixed Language Highlighting with delimiters and tags."
548
  msgstr "Sınırlayıcılar ve etiketler ile Karışık Dil Vurgulamaya izin ver."
549
 
550
  # @ crayon-syntax-highlighter
551
- #: ../crayon_settings_wp.class.php:731
552
  msgid "Show Mixed Language Icon (+)"
553
  msgstr "Karışık Dil Simgesini Göster (+)"
554
 
555
  # @ crayon-syntax-highlighter
556
- #: ../crayon_settings_wp.class.php:733
557
  msgid "Tab size in spaces"
558
  msgstr "Boşluk sekme boyutu"
559
 
560
- #: ../crayon_settings_wp.class.php:735
561
  msgid "Blank lines before code:"
562
  msgstr "Kod öncesi boş satırlar:"
563
 
564
- #: ../crayon_settings_wp.class.php:737
565
  msgid "Blank lines after code:"
566
  msgstr "Kod sonrası boş satırlar:"
567
 
568
  # @ crayon-syntax-highlighter
569
- #: ../crayon_settings_wp.class.php:742
570
  msgid "Capture Mini Tags like [php][/php] as Crayons."
571
  msgstr "Crayons olarak [php][/php] gibi küçük etiketleri yakala."
572
 
573
  # @ crayon-syntax-highlighter
574
- #: ../crayon_settings_wp.class.php:743
575
  msgid "Capture Inline Tags like {php}{/php} inside sentences."
576
  msgstr "Cümle içinde {php}{/php} gibi satıriçi etiketleri yakalayın."
577
 
578
  # @ crayon-syntax-highlighter
579
- #: ../crayon_settings_wp.class.php:744
580
  msgid "Wrap Inline Tags"
581
  msgstr "Satıriçi Etiketleri Sar"
582
 
583
  # @ crayon-syntax-highlighter
584
- #: ../crayon_settings_wp.class.php:745
585
  msgid "Capture `backquotes` as &lt;code&gt;"
586
  msgstr "&lt;code&gt; olarak `backquotes` yakalayın"
587
 
588
  # @ crayon-syntax-highlighter
589
- #: ../crayon_settings_wp.class.php:746
590
  msgid "Capture &lt;pre&gt; tags as Crayons"
591
  msgstr "&lt;pre&gt; etiketleri Crayons olarak yakala"
592
 
593
  # @ crayon-syntax-highlighter
594
- #: ../crayon_settings_wp.class.php:747
595
  msgid "Enable [plain][/plain] tag."
596
  msgstr "[plain][/plain] etiketi etkin."
597
 
598
  # @ crayon-syntax-highlighter
599
- #: ../crayon_settings_wp.class.php:752
600
  msgid ""
601
  "When loading local files and a relative path is given for the URL, use the "
602
  "absolute path"
@@ -605,25 +650,20 @@ msgstr ""
605
  "yolu kullan"
606
 
607
  # @ crayon-syntax-highlighter
608
- #: ../crayon_settings_wp.class.php:755
609
  msgid "Followed by your relative URL."
610
  msgstr "Bağlantılı URL tarafından izlendi."
611
 
612
- #: ../crayon_settings_wp.class.php:762
613
  msgid "Convert Legacy Tags"
614
  msgstr "Eski Etiketleri Dönüştür"
615
 
616
- #: ../crayon_settings_wp.class.php:765
617
  msgid "No Legacy Tags Found"
618
  msgstr "Eski Etiketler Bulunamadı"
619
 
620
- #: ../crayon_settings_wp.class.php:769
621
- msgid "Convert existing Crayon tags to Tag Editor format (&lt;pre&gt;)"
622
- msgstr ""
623
- "Mevcut Crayon etiketleri Etiket Düzenleyici biçimine dönüştür (&lt;pre&gt;)"
624
-
625
  # @ crayon-syntax-highlighter
626
- #: ../crayon_settings_wp.class.php:770
627
  #, php-format
628
  msgid ""
629
  "Use %s to separate setting names from values in the &lt;pre&gt; class "
@@ -632,143 +672,147 @@ msgstr ""
632
  "%s kullanarak &lt;pre&gt; sınıf niteliği içinde ayar adlarını değerlerden "
633
  "ayır"
634
 
635
- #: ../crayon_settings_wp.class.php:773
636
- msgid "Display the Tag Editor in any TinyMCE instances on the frontend"
637
- msgstr "Önyüzdeki herhangi bir TinyMCE örneğinde Etiket Düzenleyicisini göster"
 
 
 
 
638
 
639
- #: ../crayon_settings_wp.class.php:774
640
  msgid "Display Tag Editor settings on the frontend"
641
  msgstr "Önyüzde Etiket Düzenleyici ayarlarını göster"
642
 
643
  # @ crayon-syntax-highlighter
644
- #: ../crayon_settings_wp.class.php:778
645
  msgid "Clear the cache used to store remote code requests"
646
  msgstr "Uzak kod isteklerini depolamak için ön belleği temizle"
647
 
648
  # @ crayon-syntax-highlighter
649
- #: ../crayon_settings_wp.class.php:780
650
  msgid "Clear Now"
651
  msgstr "Şimdi Temizle"
652
 
653
  # @ crayon-syntax-highlighter
654
- #: ../crayon_settings_wp.class.php:781
655
  msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
656
  msgstr "Sadece ihtiyaç olduğunda Crayon CSS ve JavaScript yüklemeyi dene"
657
 
658
  # @ crayon-syntax-highlighter
659
- #: ../crayon_settings_wp.class.php:782
660
  msgid "Disable enqueuing for page templates that may contain The Loop."
661
  msgstr "Döngü içeren sayfa şablonları için kuyruklama devre dışı."
662
 
663
  # @ crayon-syntax-highlighter
664
- #: ../crayon_settings_wp.class.php:783
665
  msgid "Allow Crayons inside comments"
666
  msgstr "Yorum içinde Crayons izini verin"
667
 
668
  # @ crayon-syntax-highlighter
669
- #: ../crayon_settings_wp.class.php:784
670
  msgid "Remove Crayons from excerpts"
671
  msgstr "Crayon'ı alıntılardan çıkar"
672
 
673
  # @ crayon-syntax-highlighter
674
- #: ../crayon_settings_wp.class.php:785
675
  msgid "Load Crayons only from the main Wordpress query"
676
  msgstr "Sadece ana Wordpress sorgusundan Crayons yükle"
677
 
678
  # @ crayon-syntax-highlighter
679
- #: ../crayon_settings_wp.class.php:786
680
  msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
681
  msgstr ""
682
  "Dokunmatik cihazlar için fare hareketlerini devre dışı bırak (örn. Fare "
683
  "Üzerinde)"
684
 
685
  # @ crayon-syntax-highlighter
686
- #: ../crayon_settings_wp.class.php:787
687
  msgid "Disable animations"
688
  msgstr "Animasyonlar devre dışı"
689
 
690
  # @ crayon-syntax-highlighter
691
- #: ../crayon_settings_wp.class.php:788
692
  msgid "Disable runtime stats"
693
  msgstr "İşlem istatistikleri devre dışı"
694
 
695
  # @ crayon-syntax-highlighter
696
- #: ../crayon_settings_wp.class.php:794
697
  msgid "Log errors for individual Crayons"
698
  msgstr "Özgün Crayons hataları günlükle"
699
 
700
  # @ crayon-syntax-highlighter
701
- #: ../crayon_settings_wp.class.php:795
702
  msgid "Log system-wide errors"
703
  msgstr "Sistem-geneli hataları günlükle"
704
 
705
  # @ crayon-syntax-highlighter
706
- #: ../crayon_settings_wp.class.php:796
707
  msgid "Display custom message for errors"
708
  msgstr "Hatalar için kişisel mesaj göster"
709
 
710
  # @ crayon-syntax-highlighter
711
- #: ../crayon_settings_wp.class.php:808
712
  msgid "Show Log"
713
  msgstr "Günlüğü Göster"
714
 
715
  # @ crayon-syntax-highlighter
716
- #: ../crayon_settings_wp.class.php:808
717
  msgid "Hide Log"
718
  msgstr "Günlüğü Gizle"
719
 
720
  # @ crayon-syntax-highlighter
721
- #: ../crayon_settings_wp.class.php:810
722
  msgid "Clear Log"
723
  msgstr "Günlüğü Temizle"
724
 
725
  # @ crayon-syntax-highlighter
726
- #: ../crayon_settings_wp.class.php:811
727
  msgid "Email Admin"
728
  msgstr "Yönetici E-Posta"
729
 
730
  # @ crayon-syntax-highlighter
731
- #: ../crayon_settings_wp.class.php:813
732
  msgid "Email Developer"
733
  msgstr "Geliştirici E-Posta"
734
 
735
  # @ crayon-syntax-highlighter
736
- #: ../crayon_settings_wp.class.php:815
737
  msgid "The log is currently empty."
738
  msgstr "Günlük şu anda boş."
739
 
740
  # @ crayon-syntax-highlighter
741
- #: ../crayon_settings_wp.class.php:817
742
  msgid "The log file exists and is writable."
743
  msgstr "Günlük dosyası var ve yazılabilir."
744
 
745
  # @ crayon-syntax-highlighter
746
- #: ../crayon_settings_wp.class.php:817
747
  msgid "The log file exists and is not writable."
748
  msgstr "Günlük dosyası var ve yazılabilir değil."
749
 
750
  # @ crayon-syntax-highlighter
751
- #: ../crayon_settings_wp.class.php:819
752
  msgid "The log file does not exist and is not writable."
753
  msgstr "Günlük dosyası yok ve yazılabilir değil."
754
 
755
  # @ crayon-syntax-highlighter
756
- #: ../crayon_settings_wp.class.php:829
757
  msgid "Version"
758
  msgstr "Sürüm"
759
 
760
  # @ crayon-syntax-highlighter
761
- #: ../crayon_settings_wp.class.php:831
762
  msgid "Developer"
763
  msgstr "Geliştirici"
764
 
765
  # @ crayon-syntax-highlighter
766
- #: ../crayon_settings_wp.class.php:832
767
  msgid "Translators"
768
  msgstr "Çevirmenler"
769
 
770
  # @ crayon-syntax-highlighter
771
- #: ../crayon_settings_wp.class.php:858
772
  msgid ""
773
  "The result of innumerable hours of hard work over many months. It's an "
774
  "ongoing project, keep me motivated!"
@@ -777,103 +821,104 @@ msgstr ""
777
  "projedir, motivasyonumu arttırın!"
778
 
779
  # @ crayon-syntax-highlighter
780
- #: ../crayon_settings_wp.class.php:872
781
- #: ../util/theme-editor/theme_editor_content.php:27
782
- msgid "Theme Editor"
783
- msgstr "Tema Düzenleyici"
784
 
785
  # @ crayon-syntax-highlighter
786
- #: ../crayon_settings_wp.class.php:874
787
  msgid "Donate"
788
  msgstr "Bağış"
789
 
790
  # @ crayon-syntax-highlighter
791
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:67
792
  msgid "Add Crayon Code"
793
  msgstr "Crayon Kod Ekle"
794
 
795
  # @ crayon-syntax-highlighter
796
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:68
797
  msgid "Edit Crayon Code"
798
  msgstr "Crayon Kodu Düzenle"
799
 
800
  # @ crayon-syntax-highlighter
801
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:69
802
  msgid "Add"
803
  msgstr "Ekle"
804
 
805
  # @ crayon-syntax-highlighter
806
- #: ../util/tag-editor/crayon_tag_editor_wp.class.php:70
807
  msgid "Save"
808
  msgstr "Kaydet"
809
 
810
- # @ crayon-syntax-highlighter
811
- #: ../util/tag-editor/crayon_te_content.php:76
812
- msgid "Title"
813
- msgstr "Başlık"
 
 
 
814
 
815
  # @ crayon-syntax-highlighter
816
- #: ../util/tag-editor/crayon_te_content.php:78
817
  msgid "A short description"
818
  msgstr "Kısa açıklama"
819
 
820
  # @ crayon-syntax-highlighter
821
- #: ../util/tag-editor/crayon_te_content.php:81
822
  msgid "Inline"
823
  msgstr "Satıriçi"
824
 
825
  # @ crayon-syntax-highlighter
826
- #: ../util/tag-editor/crayon_te_content.php:85
827
  msgid "Don't Highlight"
828
  msgstr "Vurgulama"
829
 
830
  # @ crayon-syntax-highlighter
831
- #: ../util/tag-editor/crayon_te_content.php:90
832
  msgid "Language"
833
  msgstr "Dil"
834
 
835
- #: ../util/tag-editor/crayon_te_content.php:93
836
  msgid "Line Range"
837
  msgstr "Satır Aralığı"
838
 
839
  # @ crayon-syntax-highlighter
840
- #: ../util/tag-editor/crayon_te_content.php:94
841
- #, fuzzy
842
  msgid "(e.g. 3-5 or 3)"
843
  msgstr "(örn. 1,2,3-5)"
844
 
845
  # @ crayon-syntax-highlighter
846
- #: ../util/tag-editor/crayon_te_content.php:95
847
  msgid "Marked Lines"
848
  msgstr "İşaretli Satırlar"
849
 
850
  # @ crayon-syntax-highlighter
851
- #: ../util/tag-editor/crayon_te_content.php:96
852
  msgid "(e.g. 1,2,3-5)"
853
  msgstr "(örn. 1,2,3-5)"
854
 
855
  # @ crayon-syntax-highlighter
856
- #: ../util/tag-editor/crayon_te_content.php:100
857
  msgid "Clear"
858
  msgstr "Temizle"
859
 
860
  # @ crayon-syntax-highlighter
861
- #: ../util/tag-editor/crayon_te_content.php:101
862
  msgid "Paste your code here, or type it in manually."
863
  msgstr "Kodu buraya yapıştır, ya da onu el ile yaz."
864
 
865
  # @ crayon-syntax-highlighter
866
- #: ../util/tag-editor/crayon_te_content.php:104
867
  msgid "URL"
868
  msgstr "URL"
869
 
870
  # @ crayon-syntax-highlighter
871
- #: ../util/tag-editor/crayon_te_content.php:106
872
  msgid "Relative local path or absolute URL"
873
  msgstr "İlgili yerel yol veya tam URL"
874
 
875
  # @ crayon-syntax-highlighter
876
- #: ../util/tag-editor/crayon_te_content.php:109
877
  msgid ""
878
  "If the URL fails to load, the code above will be shown instead. If no code "
879
  "exists, an error is shown."
@@ -882,7 +927,7 @@ msgstr ""
882
  "herhangi bir kod yoksa, bir hata görünür."
883
 
884
  # @ crayon-syntax-highlighter
885
- #: ../util/tag-editor/crayon_te_content.php:111
886
  #, php-format
887
  msgid ""
888
  "If a relative local path is given it will be appended to %s - which is "
@@ -892,17 +937,17 @@ msgstr ""
892
  "Ayarlar &gt; Dosyalar%s içinde belirtildiği gibi."
893
 
894
  # @ crayon-syntax-highlighter
895
- #: ../util/tag-editor/crayon_te_content.php:135
896
  msgid "Change the following settings to override their global values."
897
  msgstr "Genel değerleri geçersiz kılmak için aşağıdaki ayarları değiştirin."
898
 
899
  # @ crayon-syntax-highlighter
900
- #: ../util/tag-editor/crayon_te_content.php:137
901
  msgid "Only changes (shown yellow) are applied."
902
  msgstr "Sadece değişiklikler (sarı ile gösterilir) uygulanır."
903
 
904
  # @ crayon-syntax-highlighter
905
- #: ../util/tag-editor/crayon_te_content.php:139
906
  #, php-format
907
  msgid ""
908
  "Future changes to the global settings under %sCrayon &gt; Settings%s won't "
@@ -911,17 +956,27 @@ msgstr ""
911
  "%sCrayon &gt; Ayarlar%s altındaki genel ayarların gelecek değişiklikleri, "
912
  "geçersiz ayarları etkilemez."
913
 
914
- #: ../util/theme-editor/theme_editor_content.php:32
 
 
 
 
 
915
  #, php-format
916
  msgid "Editing \"%s\" Theme"
917
  msgstr "\"%s\" Teması Düzenleme"
918
 
919
- #: ../util/theme-editor/theme_editor_content.php:34
920
  #, php-format
921
  msgid "Creating Theme From \"%s\""
922
  msgstr "\"%s\" İçinden Tema Oluştur"
923
 
924
  # @ crayon-syntax-highlighter
925
- #: ../util/theme-editor/theme_editor_content.php:39
926
  msgid "Back To Settings"
927
  msgstr "Ayarlara Geri Dön"
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: crayon-syntax-highlighter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-12-10 08:40+0200\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: HakanEr <hakanerwptr@gmail.com>\n"
8
  "Language-Team: hakaner <hakanerwptr@gmail.com>\n"
22
  "X-Poedit-SearchPath-1: ..\n"
23
 
24
  # @ crayon-syntax-highlighter
25
+ #: ../crayon_formatter.class.php:269
26
  msgid "Toggle Plain Code"
27
  msgstr "Düz Koda Geç"
28
 
29
  # @ crayon-syntax-highlighter
30
+ #: ../crayon_formatter.class.php:270
31
  msgid "Toggle Line Wrap"
32
  msgstr "Satır Sarımına Geç"
33
 
34
  # @ crayon-syntax-highlighter
35
+ #: ../crayon_formatter.class.php:271
36
+ msgid "Expand Code"
37
+ msgstr "Kodu Genişlet"
38
+
39
+ # @ crayon-syntax-highlighter
40
+ #: ../crayon_formatter.class.php:273
41
  #, php-format
42
  msgid "Press %s to Copy, %s to Paste"
43
  msgstr "%s ile Kopyala, %s ile Yapıştır"
44
 
45
  # @ crayon-syntax-highlighter
46
+ #: ../crayon_formatter.class.php:273
47
  msgid "Copy Plain Code"
48
  msgstr "Düz Kodu Kopyala"
49
 
50
  # @ crayon-syntax-highlighter
51
+ #: ../crayon_formatter.class.php:275
52
  msgid "Open Code In New Window"
53
  msgstr "Kodu Yeni Pencerede Aç"
54
 
55
  # @ crayon-syntax-highlighter
56
+ #: ../crayon_formatter.class.php:277
57
  msgid "Toggle Line Numbers"
58
  msgstr "Satır Numaralarına Geç"
59
 
60
  # @ crayon-syntax-highlighter
61
+ #: ../crayon_formatter.class.php:280
62
  msgid "Contains Mixed Languages"
63
  msgstr "Karışık Diller içerir"
64
 
65
  # @ crayon-syntax-highlighter
66
+ #: ../crayon_settings.class.php:145
67
  msgid "Hourly"
68
  msgstr "Saatlik"
69
 
70
  # @ crayon-syntax-highlighter
71
+ #: ../crayon_settings.class.php:145
72
  msgid "Daily"
73
  msgstr "Günlük"
74
 
75
  # @ crayon-syntax-highlighter
76
+ #: ../crayon_settings.class.php:146
77
  msgid "Weekly"
78
  msgstr "Haftalık"
79
 
80
  # @ crayon-syntax-highlighter
81
+ #: ../crayon_settings.class.php:146
82
  msgid "Monthly"
83
  msgstr "Aylık"
84
 
85
  # @ crayon-syntax-highlighter
86
+ #: ../crayon_settings.class.php:147
87
  msgid "Immediately"
88
  msgstr "Hemen"
89
 
90
  # @ crayon-syntax-highlighter
91
+ #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
92
  msgid "Max"
93
  msgstr "Max"
94
 
95
  # @ crayon-syntax-highlighter
96
+ #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
97
  msgid "Min"
98
  msgstr "Min"
99
 
100
  # @ crayon-syntax-highlighter
101
+ #: ../crayon_settings.class.php:157 ../crayon_settings.class.php:161
102
  msgid "Static"
103
  msgstr "Sabit"
104
 
105
  # @ crayon-syntax-highlighter
106
+ #: ../crayon_settings.class.php:159 ../crayon_settings.class.php:163
107
+ #: ../crayon_settings_wp.class.php:676 ../crayon_settings_wp.class.php:685
108
+ #: ../crayon_settings_wp.class.php:947
109
  msgid "Pixels"
110
  msgstr "Piksel"
111
 
112
  # @ crayon-syntax-highlighter
113
+ #: ../crayon_settings.class.php:159 ../crayon_settings.class.php:163
114
  msgid "Percent"
115
  msgstr "Yüzde"
116
 
117
  # @ crayon-syntax-highlighter
118
+ #: ../crayon_settings.class.php:172
119
  msgid "None"
120
  msgstr "Yok"
121
 
122
  # @ crayon-syntax-highlighter
123
+ #: ../crayon_settings.class.php:172
124
  msgid "Left"
125
  msgstr "Sol"
126
 
127
  # @ crayon-syntax-highlighter
128
+ #: ../crayon_settings.class.php:172
129
  msgid "Center"
130
  msgstr "Merkez"
131
 
132
  # @ crayon-syntax-highlighter
133
+ #: ../crayon_settings.class.php:172
134
  msgid "Right"
135
  msgstr "Sağ"
136
 
137
  # @ crayon-syntax-highlighter
138
+ #: ../crayon_settings.class.php:174 ../crayon_settings.class.php:198
139
  msgid "On MouseOver"
140
  msgstr "Fare Üstündeyken"
141
 
142
  # @ crayon-syntax-highlighter
143
+ #: ../crayon_settings.class.php:174 ../crayon_settings.class.php:180
144
  msgid "Always"
145
  msgstr "Herzaman"
146
 
147
  # @ crayon-syntax-highlighter
148
+ #: ../crayon_settings.class.php:174 ../crayon_settings.class.php:180
149
  msgid "Never"
150
  msgstr "Asla"
151
 
152
  # @ crayon-syntax-highlighter
153
+ #: ../crayon_settings.class.php:180
154
  msgid "When Found"
155
  msgstr "Bulunduğunda"
156
 
157
  # @ crayon-syntax-highlighter
158
+ #: ../crayon_settings.class.php:198
159
  msgid "On Double Click"
160
  msgstr "Çift Tık ile aç"
161
 
162
  # @ crayon-syntax-highlighter
163
+ #: ../crayon_settings.class.php:198
164
  msgid "On Single Click"
165
  msgstr "Tek Tık ile aç"
166
 
167
  # @ crayon-syntax-highlighter
168
+ #: ../crayon_settings.class.php:198
169
  msgid "Disable Mouse Events"
170
  msgstr "Fare Etkinliği Devre Dışı"
171
 
172
  # @ crayon-syntax-highlighter
173
+ #: ../crayon_settings.class.php:205
174
  msgid "An error has occurred. Please try again later."
175
  msgstr "Bir hata meydana geldi. Daha sonra tekrar deneyin."
176
 
177
  # @ crayon-syntax-highlighter
178
+ #: ../crayon_settings_wp.class.php:49 ../crayon_settings_wp.class.php:151
179
+ #: ../crayon_settings_wp.class.php:1127
180
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:241
181
  msgid "Settings"
182
  msgstr "Ayarlar"
183
 
184
  # @ crayon-syntax-highlighter
185
+ #: ../crayon_settings_wp.class.php:130
186
  msgid "You do not have sufficient permissions to access this page."
187
  msgstr "Bu sayfaya erişmek için yeterli izinlere sahip değilsiniz."
188
 
189
  # @ crayon-syntax-highlighter
190
+ #: ../crayon_settings_wp.class.php:166
191
  msgid "Save Changes"
192
  msgstr "Kaydet"
193
 
194
  # @ crayon-syntax-highlighter
195
+ #: ../crayon_settings_wp.class.php:173
196
  msgid "Reset Settings"
197
  msgstr "Ayarları Sıfırla"
198
 
199
  # @ crayon-syntax-highlighter
200
+ #: ../crayon_settings_wp.class.php:418
201
  msgid "General"
202
  msgstr "Genel"
203
 
204
  # @ crayon-syntax-highlighter
205
+ #: ../crayon_settings_wp.class.php:419
206
  msgid "Theme"
207
  msgstr "Tema"
208
 
209
  # @ crayon-syntax-highlighter
210
+ #: ../crayon_settings_wp.class.php:420
211
  msgid "Font"
212
  msgstr "Font"
213
 
214
  # @ crayon-syntax-highlighter
215
+ #: ../crayon_settings_wp.class.php:421
216
  msgid "Metrics"
217
  msgstr "Ölçüler"
218
 
219
  # @ crayon-syntax-highlighter
220
+ #: ../crayon_settings_wp.class.php:422
221
  msgid "Toolbar"
222
  msgstr "Araç Çubuğu"
223
 
224
  # @ crayon-syntax-highlighter
225
+ #: ../crayon_settings_wp.class.php:423
226
  msgid "Lines"
227
  msgstr "Satırlar"
228
 
229
  # @ crayon-syntax-highlighter
230
+ #: ../crayon_settings_wp.class.php:424
231
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:204
232
  msgid "Code"
233
  msgstr "Kod"
234
 
235
  # @ crayon-syntax-highlighter
236
+ #: ../crayon_settings_wp.class.php:425
237
  msgid "Tags"
238
  msgstr "Etiketler"
239
 
240
  # @ crayon-syntax-highlighter
241
+ #: ../crayon_settings_wp.class.php:426
242
  msgid "Languages"
243
  msgstr "Diller"
244
 
245
  # @ crayon-syntax-highlighter
246
+ #: ../crayon_settings_wp.class.php:427
247
  msgid "Files"
248
  msgstr "Dosyalar"
249
 
250
+ #: ../crayon_settings_wp.class.php:428
251
  msgid "Posts"
252
  msgstr "Yazılar"
253
 
254
  # @ crayon-syntax-highlighter
255
+ #: ../crayon_settings_wp.class.php:429
256
  msgid "Tag Editor"
257
  msgstr "Etiket Düzenleyici"
258
 
259
  # @ crayon-syntax-highlighter
260
+ #: ../crayon_settings_wp.class.php:430
261
  msgid "Misc"
262
  msgstr "Çeşitli"
263
 
264
  # @ crayon-syntax-highlighter
265
+ #: ../crayon_settings_wp.class.php:433
266
  msgid "Debug"
267
  msgstr "Hata Ayıklama"
268
 
269
  # @ crayon-syntax-highlighter
270
+ #: ../crayon_settings_wp.class.php:434
271
  msgid "Errors"
272
  msgstr "Hatalar"
273
 
274
  # @ crayon-syntax-highlighter
275
+ #: ../crayon_settings_wp.class.php:435
276
  msgid "Log"
277
  msgstr "Günlük"
278
 
279
  # @ crayon-syntax-highlighter
280
+ #: ../crayon_settings_wp.class.php:438
281
  msgid "About"
282
  msgstr "Hakkında"
283
 
284
  # @ crayon-syntax-highlighter
285
+ #: ../crayon_settings_wp.class.php:638
286
  msgid "Crayon Help"
287
  msgstr "Crayon Yardım"
288
 
289
  # @ crayon-syntax-highlighter
290
+ #: ../crayon_settings_wp.class.php:653
291
  msgid "Height"
292
  msgstr "Yükseklik"
293
 
294
  # @ crayon-syntax-highlighter
295
+ #: ../crayon_settings_wp.class.php:659
296
  msgid "Width"
297
  msgstr "Genişlik"
298
 
299
  # @ crayon-syntax-highlighter
300
+ #: ../crayon_settings_wp.class.php:665
301
  msgid "Top Margin"
302
  msgstr "Üst Boşluk"
303
 
304
  # @ crayon-syntax-highlighter
305
+ #: ../crayon_settings_wp.class.php:666
306
  msgid "Bottom Margin"
307
  msgstr "Alt Boşluk"
308
 
309
  # @ crayon-syntax-highlighter
310
+ #: ../crayon_settings_wp.class.php:667 ../crayon_settings_wp.class.php:672
311
  msgid "Left Margin"
312
  msgstr "Sol Boşluk"
313
 
314
  # @ crayon-syntax-highlighter
315
+ #: ../crayon_settings_wp.class.php:668 ../crayon_settings_wp.class.php:672
316
  msgid "Right Margin"
317
  msgstr "Sağ Boşluk"
318
 
319
  # @ crayon-syntax-highlighter
320
+ #: ../crayon_settings_wp.class.php:678
321
  msgid "Horizontal Alignment"
322
  msgstr "Yatay Hizalama"
323
 
324
  # @ crayon-syntax-highlighter
325
+ #: ../crayon_settings_wp.class.php:681
326
  msgid "Allow floating elements to surround Crayon"
327
  msgstr "Geçişli elementleri Crayon çevrelemeye izin ver"
328
 
329
  # @ crayon-syntax-highlighter
330
+ #: ../crayon_settings_wp.class.php:683
331
  msgid "Inline Margin"
332
  msgstr "Satıriçi Boşluk"
333
 
334
  # @ crayon-syntax-highlighter
335
+ #: ../crayon_settings_wp.class.php:691
336
  msgid "Display the Toolbar"
337
  msgstr "Araç çubuğunu göster"
338
 
339
  # @ crayon-syntax-highlighter
340
+ #: ../crayon_settings_wp.class.php:694
341
  msgid "Overlay the toolbar on code rather than push it down when possible"
342
  msgstr "Araç çubuğunu mümkünse kodları aşağı itmek yerine üstte göster"
343
 
344
  # @ crayon-syntax-highlighter
345
+ #: ../crayon_settings_wp.class.php:695
346
  msgid "Toggle the toolbar on single click when it is overlayed"
347
  msgstr "Araç çubuğu üste çıktığında tek tıkla gizle"
348
 
349
  # @ crayon-syntax-highlighter
350
+ #: ../crayon_settings_wp.class.php:696
351
  msgid "Delay hiding the toolbar on MouseOut"
352
  msgstr "Fare dışa çıktığında araç çubuğunu gizlemek için bekle"
353
 
354
  # @ crayon-syntax-highlighter
355
+ #: ../crayon_settings_wp.class.php:698
356
  msgid "Display the title when provided"
357
  msgstr "Varsa başlığı görüntüle"
358
 
359
  # @ crayon-syntax-highlighter
360
+ #: ../crayon_settings_wp.class.php:699
361
  msgid "Display the language"
362
  msgstr "Dilleri göster"
363
 
364
  # @ crayon-syntax-highlighter
365
+ #: ../crayon_settings_wp.class.php:706
366
  msgid "Display striped code lines"
367
  msgstr "Şeritli kod satırını göster"
368
 
369
  # @ crayon-syntax-highlighter
370
+ #: ../crayon_settings_wp.class.php:707
371
  msgid "Enable line marking for important lines"
372
  msgstr "Önemli satırlar için satır işaretleme etkin"
373
 
374
+ #: ../crayon_settings_wp.class.php:708
375
  msgid "Enable line ranges for showing only parts of code"
376
  msgstr "Kodun sadece bir parçasını gösteren satır aralıklarını etkinleştir"
377
 
378
  # @ crayon-syntax-highlighter
379
+ #: ../crayon_settings_wp.class.php:709
380
  msgid "Display line numbers by default"
381
  msgstr "Varsayılan olarak satır numaralarını göster"
382
 
383
  # @ crayon-syntax-highlighter
384
+ #: ../crayon_settings_wp.class.php:710
385
  msgid "Enable line number toggling"
386
  msgstr "Satır numaraları geçişi etkin"
387
 
388
  # @ crayon-syntax-highlighter
389
+ #: ../crayon_settings_wp.class.php:711
390
  msgid "Wrap lines by default"
391
  msgstr "Varsayılan olarak satırları sar"
392
 
393
  # @ crayon-syntax-highlighter
394
+ #: ../crayon_settings_wp.class.php:712
395
  msgid "Enable line wrap toggling"
396
  msgstr "Satır sarıma geçişi etkin"
397
 
398
  # @ crayon-syntax-highlighter
399
+ #: ../crayon_settings_wp.class.php:713
400
  msgid "Start line numbers from"
401
  msgstr "Satır numarasını buradan başlat"
402
 
403
  # @ crayon-syntax-highlighter
404
+ #: ../crayon_settings_wp.class.php:724
405
  msgid "When no language is provided, use the fallback"
406
  msgstr "Belirlenmiş bir dil olmadığında son çareyi kullan"
407
 
408
  # @ crayon-syntax-highlighter
409
+ #: ../crayon_settings_wp.class.php:730
410
+ #, php-format
411
  msgid "%d language has been detected."
412
  msgstr "%d dil tespit edildi."
413
 
414
  # @ crayon-syntax-highlighter
415
+ #: ../crayon_settings_wp.class.php:731
416
  msgid "Parsing was successful"
417
  msgstr "Ayrıştırma başarılı"
418
 
419
  # @ crayon-syntax-highlighter
420
+ #: ../crayon_settings_wp.class.php:731
421
  msgid "Parsing was unsuccessful"
422
  msgstr "Ayrıştırma başarılı değil"
423
 
424
  # @ crayon-syntax-highlighter
425
+ #: ../crayon_settings_wp.class.php:737
426
  #, php-format
427
  msgid "The selected language with id %s could not be loaded"
428
  msgstr "ID %s ile seçilen dil yüklenemedi"
429
 
430
  # @ crayon-syntax-highlighter
431
+ #: ../crayon_settings_wp.class.php:740
432
  msgid "Show Languages"
433
  msgstr "Dilleri Göster"
434
 
435
+ #: ../crayon_settings_wp.class.php:776
436
  msgid "Show Crayon Posts"
437
  msgstr "Crayon Yazıları Göster"
438
 
439
+ #: ../crayon_settings_wp.class.php:777
440
+ msgid "Refresh"
441
+ msgstr "Yenile"
442
+
443
+ #: ../crayon_settings_wp.class.php:802
444
+ msgid "ID"
445
+ msgstr "ID"
446
+
447
  # @ crayon-syntax-highlighter
448
+ #: ../crayon_settings_wp.class.php:802
449
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:182
450
+ msgid "Title"
451
+ msgstr "Başlık"
452
+
453
+ #: ../crayon_settings_wp.class.php:802
454
+ msgid "Posted"
455
+ msgstr "Yayınlandı"
456
+
457
+ #: ../crayon_settings_wp.class.php:802
458
+ msgid "Modifed"
459
+ msgstr "Değiştirildi"
460
+
461
+ #: ../crayon_settings_wp.class.php:802
462
+ msgid "Contains Legacy Tags?"
463
+ msgstr "Eski Etiketleri İçersin?"
464
+
465
+ #: ../crayon_settings_wp.class.php:822
466
+ msgid "Yes"
467
+ msgstr "Evet"
468
 
469
  # @ crayon-syntax-highlighter
470
+ #: ../crayon_settings_wp.class.php:822
471
+ msgid "No"
472
+ msgstr "Hayır"
473
 
474
+ #: ../crayon_settings_wp.class.php:906
475
  msgid "Edit"
476
  msgstr "Düzenle"
477
 
478
+ #: ../crayon_settings_wp.class.php:906
479
+ msgid "Duplicate"
480
+ msgstr "Mükerrer"
481
+
482
+ #: ../crayon_settings_wp.class.php:906
483
  msgid "Create"
484
  msgstr "Oluştur"
485
 
486
+ #: ../crayon_settings_wp.class.php:906
487
+ msgid "Delete"
488
+ msgstr "Sil"
489
+
490
  # @ crayon-syntax-highlighter
491
+ #: ../crayon_settings_wp.class.php:908
492
+ msgid "Loading..."
493
+ msgstr "Yükleniyor..."
494
+
495
+ # @ crayon-syntax-highlighter
496
+ #: ../crayon_settings_wp.class.php:923
497
  #, php-format
498
  msgid ""
499
  "Change the %1$sfallback language%2$s to change the sample code. Lines 5-7 "
503
  "işaretli."
504
 
505
  # @ crayon-syntax-highlighter
506
+ #: ../crayon_settings_wp.class.php:928
507
  msgid "Enable Live Preview"
508
  msgstr "Ön izleme etkin"
509
 
510
  # @ crayon-syntax-highlighter
511
+ #: ../crayon_settings_wp.class.php:930
512
  msgid "Enqueue themes in the header (more efficient)."
513
  msgstr "Temaları header içinde kuyrukla (daha etkin)."
514
 
515
  # @ crayon-syntax-highlighter
516
+ #: ../crayon_settings_wp.class.php:933
517
  #, php-format
518
  msgid "The selected theme with id %s could not be loaded"
519
  msgstr "ID %s ile seçilen tema yüklenemedi"
520
 
521
  # @ crayon-syntax-highlighter
522
+ #: ../crayon_settings_wp.class.php:945
523
  msgid "Custom Font Size"
524
  msgstr "Kişisel Font Boyutu"
525
 
526
  # @ crayon-syntax-highlighter
527
+ #: ../crayon_settings_wp.class.php:950
528
  #, php-format
529
  msgid "The selected font with id %s could not be loaded"
530
  msgstr "ID %s ile seçilen font yüklenemedi"
531
 
532
  # @ crayon-syntax-highlighter
533
+ #: ../crayon_settings_wp.class.php:956
534
  msgid "Enqueue fonts in the header (more efficient)."
535
  msgstr "Fontları header içinde kuyrukla (daha etkin)."
536
 
537
  # @ crayon-syntax-highlighter
538
+ #: ../crayon_settings_wp.class.php:961
539
  msgid "Enable plain code view and display"
540
  msgstr "Düz kod görünümü ve görüntüleme etkin"
541
 
542
  # @ crayon-syntax-highlighter
543
+ #: ../crayon_settings_wp.class.php:964
544
  msgid "Enable plain code toggling"
545
  msgstr "Düz kod geçişi etkin"
546
 
547
  # @ crayon-syntax-highlighter
548
+ #: ../crayon_settings_wp.class.php:965
549
  msgid "Show the plain code by default"
550
  msgstr "Düz kodu varsayılan olarak göster"
551
 
552
  # @ crayon-syntax-highlighter
553
+ #: ../crayon_settings_wp.class.php:966
554
  msgid "Enable code copy/paste"
555
  msgstr "Kod kopyala/yapıştır etkin"
556
 
557
  # @ crayon-syntax-highlighter
558
+ #: ../crayon_settings_wp.class.php:968
559
  msgid "Enable opening code in a window"
560
  msgstr "Kodları bir pencerede açma etkin"
561
 
562
  # @ crayon-syntax-highlighter
563
+ #: ../crayon_settings_wp.class.php:969
564
  msgid "Always display scrollbars"
565
  msgstr "Kaydırma çubuğu her zaman göster"
566
 
567
+ #: ../crayon_settings_wp.class.php:970
568
+ msgid "Expand code beyond page borders on mouseover"
569
+ msgstr "Fare üzerindeyken sayfa sınırları dışında kodu genişlet"
570
+
571
+ #: ../crayon_settings_wp.class.php:971
572
+ msgid "Enable code expanding toggling when possible"
573
+ msgstr "Mümkün olduğunda kod genişletme geçişlerini etkinleştir"
574
+
575
  # @ crayon-syntax-highlighter
576
+ #: ../crayon_settings_wp.class.php:974
577
  msgid "Decode HTML entities in code"
578
  msgstr "HTML varlıkları kod içinde çöz"
579
 
580
  # @ crayon-syntax-highlighter
581
+ #: ../crayon_settings_wp.class.php:976
582
  msgid "Decode HTML entities in attributes"
583
  msgstr "HTML varlıkları nitelikler içinde çöz"
584
 
585
  # @ crayon-syntax-highlighter
586
+ #: ../crayon_settings_wp.class.php:978
587
  msgid "Remove whitespace surrounding the shortcode content"
588
  msgstr "Kısakod içeriğini çevreleyen beyaz alanları kaldır"
589
 
590
  # @ crayon-syntax-highlighter
591
+ #: ../crayon_settings_wp.class.php:980
592
  msgid "Allow Mixed Language Highlighting with delimiters and tags."
593
  msgstr "Sınırlayıcılar ve etiketler ile Karışık Dil Vurgulamaya izin ver."
594
 
595
  # @ crayon-syntax-highlighter
596
+ #: ../crayon_settings_wp.class.php:982
597
  msgid "Show Mixed Language Icon (+)"
598
  msgstr "Karışık Dil Simgesini Göster (+)"
599
 
600
  # @ crayon-syntax-highlighter
601
+ #: ../crayon_settings_wp.class.php:984
602
  msgid "Tab size in spaces"
603
  msgstr "Boşluk sekme boyutu"
604
 
605
+ #: ../crayon_settings_wp.class.php:986
606
  msgid "Blank lines before code:"
607
  msgstr "Kod öncesi boş satırlar:"
608
 
609
+ #: ../crayon_settings_wp.class.php:988
610
  msgid "Blank lines after code:"
611
  msgstr "Kod sonrası boş satırlar:"
612
 
613
  # @ crayon-syntax-highlighter
614
+ #: ../crayon_settings_wp.class.php:993
615
  msgid "Capture Mini Tags like [php][/php] as Crayons."
616
  msgstr "Crayons olarak [php][/php] gibi küçük etiketleri yakala."
617
 
618
  # @ crayon-syntax-highlighter
619
+ #: ../crayon_settings_wp.class.php:994
620
  msgid "Capture Inline Tags like {php}{/php} inside sentences."
621
  msgstr "Cümle içinde {php}{/php} gibi satıriçi etiketleri yakalayın."
622
 
623
  # @ crayon-syntax-highlighter
624
+ #: ../crayon_settings_wp.class.php:995
625
  msgid "Wrap Inline Tags"
626
  msgstr "Satıriçi Etiketleri Sar"
627
 
628
  # @ crayon-syntax-highlighter
629
+ #: ../crayon_settings_wp.class.php:996
630
  msgid "Capture `backquotes` as &lt;code&gt;"
631
  msgstr "&lt;code&gt; olarak `backquotes` yakalayın"
632
 
633
  # @ crayon-syntax-highlighter
634
+ #: ../crayon_settings_wp.class.php:997
635
  msgid "Capture &lt;pre&gt; tags as Crayons"
636
  msgstr "&lt;pre&gt; etiketleri Crayons olarak yakala"
637
 
638
  # @ crayon-syntax-highlighter
639
+ #: ../crayon_settings_wp.class.php:998
640
  msgid "Enable [plain][/plain] tag."
641
  msgstr "[plain][/plain] etiketi etkin."
642
 
643
  # @ crayon-syntax-highlighter
644
+ #: ../crayon_settings_wp.class.php:1003
645
  msgid ""
646
  "When loading local files and a relative path is given for the URL, use the "
647
  "absolute path"
650
  "yolu kullan"
651
 
652
  # @ crayon-syntax-highlighter
653
+ #: ../crayon_settings_wp.class.php:1006
654
  msgid "Followed by your relative URL."
655
  msgstr "Bağlantılı URL tarafından izlendi."
656
 
657
+ #: ../crayon_settings_wp.class.php:1013
658
  msgid "Convert Legacy Tags"
659
  msgstr "Eski Etiketleri Dönüştür"
660
 
661
+ #: ../crayon_settings_wp.class.php:1016
662
  msgid "No Legacy Tags Found"
663
  msgstr "Eski Etiketler Bulunamadı"
664
 
 
 
 
 
 
665
  # @ crayon-syntax-highlighter
666
+ #: ../crayon_settings_wp.class.php:1021
667
  #, php-format
668
  msgid ""
669
  "Use %s to separate setting names from values in the &lt;pre&gt; class "
672
  "%s kullanarak &lt;pre&gt; sınıf niteliği içinde ayar adlarını değerlerden "
673
  "ayır"
674
 
675
+ #: ../crayon_settings_wp.class.php:1024
676
+ msgid ""
677
+ "Display the Tag Editor in any TinyMCE instances on the frontend (e.g. "
678
+ "bbPress)"
679
+ msgstr ""
680
+ "Önyüzdeki herhangi bir TinyMCE örneğinde Etiket Düzenleyicisini göster (örn. "
681
+ "bbPress)"
682
 
683
+ #: ../crayon_settings_wp.class.php:1025
684
  msgid "Display Tag Editor settings on the frontend"
685
  msgstr "Önyüzde Etiket Düzenleyici ayarlarını göster"
686
 
687
  # @ crayon-syntax-highlighter
688
+ #: ../crayon_settings_wp.class.php:1029
689
  msgid "Clear the cache used to store remote code requests"
690
  msgstr "Uzak kod isteklerini depolamak için ön belleği temizle"
691
 
692
  # @ crayon-syntax-highlighter
693
+ #: ../crayon_settings_wp.class.php:1031
694
  msgid "Clear Now"
695
  msgstr "Şimdi Temizle"
696
 
697
  # @ crayon-syntax-highlighter
698
+ #: ../crayon_settings_wp.class.php:1032
699
  msgid "Attempt to load Crayon's CSS and JavaScript only when needed"
700
  msgstr "Sadece ihtiyaç olduğunda Crayon CSS ve JavaScript yüklemeyi dene"
701
 
702
  # @ crayon-syntax-highlighter
703
+ #: ../crayon_settings_wp.class.php:1033
704
  msgid "Disable enqueuing for page templates that may contain The Loop."
705
  msgstr "Döngü içeren sayfa şablonları için kuyruklama devre dışı."
706
 
707
  # @ crayon-syntax-highlighter
708
+ #: ../crayon_settings_wp.class.php:1034
709
  msgid "Allow Crayons inside comments"
710
  msgstr "Yorum içinde Crayons izini verin"
711
 
712
  # @ crayon-syntax-highlighter
713
+ #: ../crayon_settings_wp.class.php:1035
714
  msgid "Remove Crayons from excerpts"
715
  msgstr "Crayon'ı alıntılardan çıkar"
716
 
717
  # @ crayon-syntax-highlighter
718
+ #: ../crayon_settings_wp.class.php:1036
719
  msgid "Load Crayons only from the main Wordpress query"
720
  msgstr "Sadece ana Wordpress sorgusundan Crayons yükle"
721
 
722
  # @ crayon-syntax-highlighter
723
+ #: ../crayon_settings_wp.class.php:1037
724
  msgid "Disable mouse gestures for touchscreen devices (eg. MouseOver)"
725
  msgstr ""
726
  "Dokunmatik cihazlar için fare hareketlerini devre dışı bırak (örn. Fare "
727
  "Üzerinde)"
728
 
729
  # @ crayon-syntax-highlighter
730
+ #: ../crayon_settings_wp.class.php:1038
731
  msgid "Disable animations"
732
  msgstr "Animasyonlar devre dışı"
733
 
734
  # @ crayon-syntax-highlighter
735
+ #: ../crayon_settings_wp.class.php:1039
736
  msgid "Disable runtime stats"
737
  msgstr "İşlem istatistikleri devre dışı"
738
 
739
  # @ crayon-syntax-highlighter
740
+ #: ../crayon_settings_wp.class.php:1045
741
  msgid "Log errors for individual Crayons"
742
  msgstr "Özgün Crayons hataları günlükle"
743
 
744
  # @ crayon-syntax-highlighter
745
+ #: ../crayon_settings_wp.class.php:1046
746
  msgid "Log system-wide errors"
747
  msgstr "Sistem-geneli hataları günlükle"
748
 
749
  # @ crayon-syntax-highlighter
750
+ #: ../crayon_settings_wp.class.php:1047
751
  msgid "Display custom message for errors"
752
  msgstr "Hatalar için kişisel mesaj göster"
753
 
754
  # @ crayon-syntax-highlighter
755
+ #: ../crayon_settings_wp.class.php:1059
756
  msgid "Show Log"
757
  msgstr "Günlüğü Göster"
758
 
759
  # @ crayon-syntax-highlighter
760
+ #: ../crayon_settings_wp.class.php:1059
761
  msgid "Hide Log"
762
  msgstr "Günlüğü Gizle"
763
 
764
  # @ crayon-syntax-highlighter
765
+ #: ../crayon_settings_wp.class.php:1061
766
  msgid "Clear Log"
767
  msgstr "Günlüğü Temizle"
768
 
769
  # @ crayon-syntax-highlighter
770
+ #: ../crayon_settings_wp.class.php:1062
771
  msgid "Email Admin"
772
  msgstr "Yönetici E-Posta"
773
 
774
  # @ crayon-syntax-highlighter
775
+ #: ../crayon_settings_wp.class.php:1064
776
  msgid "Email Developer"
777
  msgstr "Geliştirici E-Posta"
778
 
779
  # @ crayon-syntax-highlighter
780
+ #: ../crayon_settings_wp.class.php:1066
781
  msgid "The log is currently empty."
782
  msgstr "Günlük şu anda boş."
783
 
784
  # @ crayon-syntax-highlighter
785
+ #: ../crayon_settings_wp.class.php:1068
786
  msgid "The log file exists and is writable."
787
  msgstr "Günlük dosyası var ve yazılabilir."
788
 
789
  # @ crayon-syntax-highlighter
790
+ #: ../crayon_settings_wp.class.php:1068
791
  msgid "The log file exists and is not writable."
792
  msgstr "Günlük dosyası var ve yazılabilir değil."
793
 
794
  # @ crayon-syntax-highlighter
795
+ #: ../crayon_settings_wp.class.php:1070
796
  msgid "The log file does not exist and is not writable."
797
  msgstr "Günlük dosyası yok ve yazılabilir değil."
798
 
799
  # @ crayon-syntax-highlighter
800
+ #: ../crayon_settings_wp.class.php:1080
801
  msgid "Version"
802
  msgstr "Sürüm"
803
 
804
  # @ crayon-syntax-highlighter
805
+ #: ../crayon_settings_wp.class.php:1082
806
  msgid "Developer"
807
  msgstr "Geliştirici"
808
 
809
  # @ crayon-syntax-highlighter
810
+ #: ../crayon_settings_wp.class.php:1083
811
  msgid "Translators"
812
  msgstr "Çevirmenler"
813
 
814
  # @ crayon-syntax-highlighter
815
+ #: ../crayon_settings_wp.class.php:1111
816
  msgid ""
817
  "The result of innumerable hours of hard work over many months. It's an "
818
  "ongoing project, keep me motivated!"
821
  "projedir, motivasyonumu arttırın!"
822
 
823
  # @ crayon-syntax-highlighter
824
+ #: ../crayon_settings_wp.class.php:1121
825
+ msgid "?"
826
+ msgstr "?"
 
827
 
828
  # @ crayon-syntax-highlighter
829
+ #: ../crayon_settings_wp.class.php:1128
830
  msgid "Donate"
831
  msgstr "Bağış"
832
 
833
  # @ crayon-syntax-highlighter
834
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:64
835
  msgid "Add Crayon Code"
836
  msgstr "Crayon Kod Ekle"
837
 
838
  # @ crayon-syntax-highlighter
839
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:65
840
  msgid "Edit Crayon Code"
841
  msgstr "Crayon Kodu Düzenle"
842
 
843
  # @ crayon-syntax-highlighter
844
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:66
845
  msgid "Add"
846
  msgstr "Ekle"
847
 
848
  # @ crayon-syntax-highlighter
849
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:67
850
  msgid "Save"
851
  msgstr "Kaydet"
852
 
853
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:173
854
+ msgid "OK"
855
+ msgstr "Tamam"
856
+
857
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:175
858
+ msgid "Cancel"
859
+ msgstr "İptal"
860
 
861
  # @ crayon-syntax-highlighter
862
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:184
863
  msgid "A short description"
864
  msgstr "Kısa açıklama"
865
 
866
  # @ crayon-syntax-highlighter
867
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:186
868
  msgid "Inline"
869
  msgstr "Satıriçi"
870
 
871
  # @ crayon-syntax-highlighter
872
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:188
873
  msgid "Don't Highlight"
874
  msgstr "Vurgulama"
875
 
876
  # @ crayon-syntax-highlighter
877
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:193
878
  msgid "Language"
879
  msgstr "Dil"
880
 
881
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:196
882
  msgid "Line Range"
883
  msgstr "Satır Aralığı"
884
 
885
  # @ crayon-syntax-highlighter
886
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:197
 
887
  msgid "(e.g. 3-5 or 3)"
888
  msgstr "(örn. 1,2,3-5)"
889
 
890
  # @ crayon-syntax-highlighter
891
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:198
892
  msgid "Marked Lines"
893
  msgstr "İşaretli Satırlar"
894
 
895
  # @ crayon-syntax-highlighter
896
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:199
897
  msgid "(e.g. 1,2,3-5)"
898
  msgstr "(örn. 1,2,3-5)"
899
 
900
  # @ crayon-syntax-highlighter
901
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:206
902
  msgid "Clear"
903
  msgstr "Temizle"
904
 
905
  # @ crayon-syntax-highlighter
906
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:210
907
  msgid "Paste your code here, or type it in manually."
908
  msgstr "Kodu buraya yapıştır, ya da onu el ile yaz."
909
 
910
  # @ crayon-syntax-highlighter
911
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:214
912
  msgid "URL"
913
  msgstr "URL"
914
 
915
  # @ crayon-syntax-highlighter
916
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:216
917
  msgid "Relative local path or absolute URL"
918
  msgstr "İlgili yerel yol veya tam URL"
919
 
920
  # @ crayon-syntax-highlighter
921
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:219
922
  msgid ""
923
  "If the URL fails to load, the code above will be shown instead. If no code "
924
  "exists, an error is shown."
927
  "herhangi bir kod yoksa, bir hata görünür."
928
 
929
  # @ crayon-syntax-highlighter
930
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:221
931
  #, php-format
932
  msgid ""
933
  "If a relative local path is given it will be appended to %s - which is "
937
  "Ayarlar &gt; Dosyalar%s içinde belirtildiği gibi."
938
 
939
  # @ crayon-syntax-highlighter
940
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:246
941
  msgid "Change the following settings to override their global values."
942
  msgstr "Genel değerleri geçersiz kılmak için aşağıdaki ayarları değiştirin."
943
 
944
  # @ crayon-syntax-highlighter
945
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:248
946
  msgid "Only changes (shown yellow) are applied."
947
  msgstr "Sadece değişiklikler (sarı ile gösterilir) uygulanır."
948
 
949
  # @ crayon-syntax-highlighter
950
+ #: ../util/tag-editor/crayon_tag_editor_wp.class.php:250
951
  #, php-format
952
  msgid ""
953
  "Future changes to the global settings under %sCrayon &gt; Settings%s won't "
956
  "%sCrayon &gt; Ayarlar%s altındaki genel ayarların gelecek değişiklikleri, "
957
  "geçersiz ayarları etkilemez."
958
 
959
+ # @ crayon-syntax-highlighter
960
+ #: ../util/theme-editor/theme_editor_content.php:23
961
+ msgid "Theme Editor"
962
+ msgstr "Tema Düzenleyici"
963
+
964
+ #: ../util/theme-editor/theme_editor_content.php:29
965
  #, php-format
966
  msgid "Editing \"%s\" Theme"
967
  msgstr "\"%s\" Teması Düzenleme"
968
 
969
+ #: ../util/theme-editor/theme_editor_content.php:31
970
  #, php-format
971
  msgid "Creating Theme From \"%s\""
972
  msgstr "\"%s\" İçinden Tema Oluştur"
973
 
974
  # @ crayon-syntax-highlighter
975
+ #: ../util/theme-editor/theme_editor_content.php:37
976
  msgid "Back To Settings"
977
  msgstr "Ayarlara Geri Dön"
978
+
979
+ #~ msgid "Convert existing Crayon tags to Tag Editor format (&lt;pre&gt;)"
980
+ #~ msgstr ""
981
+ #~ "Mevcut Crayon etiketleri Etiket Düzenleyici biçimine dönüştür (&lt;"
982
+ #~ "pre&gt;)"
util/help.htm DELETED
@@ -1,279 +0,0 @@
1
- <p><strong>Using the Shortcode</strong></p>
2
- <p>Just add your code between <code>[crayon attributes] ... [/crayon]</code> in HTML view when editing posts. You can optionally provide the following <code>attributes</code>:</p>
3
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="crayon-table crayon-table-light">
4
- <tr class="crayon-table-header" >
5
- <td width="20">Attribute</td>
6
- <td width="60%">Description</td>
7
- <td width="30%">Example</td>
8
- </tr>
9
- <tr>
10
- <td width="20">lang</td>
11
- <td width="60%">Specify a Language ID, these are the folders in the <code>langs</code> directory and appears in the list of <a href="#langs">Languages</a>.</td>
12
- <td width="30%"><code>lang="java"</code></td>
13
- </tr>
14
- <tr>
15
- <td width="20">url</td>
16
- <td width="60%">Load a file from the web or a local path. You give a relative local path instead of absolute (see <a href="#files">Files</a>). You can use a closed tag when giving a url: <code>[crayon url="java/code.java" /]</code>. For languages with defined extensions (see <a href="#langs">Languages</a>) you don't even need to provide the <code>lang</code> attribute, as this will be detected if your file ends with it, as in the example.</td>
17
- <td width="30%">
18
- <code>url="http://example.com/code.java&quot;</code><br />
19
- <code>url="java/code.java&quot;</code></td>
20
- </tr>
21
- <tr>
22
- <td width="20">title</td>
23
- <td width="60%">Give a title for your code snippet. Appears in the toolbar.</td>
24
- <td width="30%"><code>title="Sample"</code></td>
25
- </tr>
26
- <tr>
27
- <td width="20">mark</td>
28
- <td width="60%">Mark some lines as important so they appear highlighted. You can specify single numbers, comma separted, a range, or a combination.</td>
29
- <td width="30%"><code>mark="5-10,12"</code></td>
30
- </tr>
31
- </table>
32
- <p>You can also use <code>&lt;pre attributes&gt;...&lt;/pre&gt;</code> so that the code can be reused by other plugins even if you disable Crayon. Make sure to edit all your code in HTML mode, however, not Visual.</p>
33
- <p>You can even use Mini Tags like:</p>
34
- <p align="center"><code>[html]&lt;strong&gt;some code&lt;/strong&gt;[/html]</code><br />
35
- <code>[php]echo "whassup?";[/php]</code></p>
36
- <p>The short name in brackets you use are called IDs and Aliases. For example, <code>xml</code> and <code>hxml</code> are Aliases to the language ID <code>xhtml</code>. The IDs and their Aliases are under:</p>
37
- <pre style="text-align:center;">Settings &gt; Crayon &gt; Languages &gt; Show Languages
38
- </pre>
39
- <p>Perhaps best of all, you can mix code together like on a real HTML page, by having <code>&lt;script&gt;</code>, <code>&lt;style&gt;</code> and <code>&lt;?php...?&gt;</code> tags all in a single Crayon. Find out more <a href="http://bit.ly/ukwts2" target="_blank">here</a>.</p>
40
- <p>You can also display a quick unhighlighted snapshot of code using the <code>[plain]...[/plain]</code> tag. The code will look like it does in the HTML view of the post editor.</p>
41
- <p><strong>Settings</strong></p>
42
- <p>Crayon is versatile so you can override global settings for individual Crayons with attributes.</p>
43
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="crayon-table crayon-table-light">
44
- <tr class="crayon-table-header">
45
- <td width="151"><strong>Setting</strong></td>
46
- <td width="160"><strong>Allowed Value</strong></td>
47
- <td width="65"><strong>Description</strong></td>
48
- </tr>
49
- <tr>
50
- <td> theme</td>
51
- <td>string</td>
52
- <td>ID of the theme to use</td>
53
- </tr>
54
- <tr>
55
- <td> font</td>
56
- <td>string</td>
57
- <td>ID of the font to use</td>
58
- </tr>
59
- <tr>
60
- <td> font-size</td>
61
- <td>number &gt; 0</td>
62
- <td> Custom font size in pixels</td>
63
- </tr>
64
- <tr>
65
- <td> min-height/max-height</td>
66
- <td>number &gt; 0 followed by px/%</td>
67
- <td>Minimum/maximum height in units</td>
68
- </tr>
69
- <tr>
70
- <td>height</td>
71
- <td>number &gt; 0 followed by px/%</td>
72
- <td>Height in units</td>
73
- </tr>
74
- <tr>
75
- <td> min-width/max-width</td>
76
- <td>number &gt; 0 followed by px/%</td>
77
- <td>Minimum/maximum width in units</td>
78
- </tr>
79
- <tr>
80
- <td>width</td>
81
- <td>number &gt; 0 followed by px/%</td>
82
- <td>Width in units</td>
83
- </tr>
84
- <tr>
85
- <td>toolbar</td>
86
- <td>true/false/&quot;always&quot;</td>
87
- <td>Show or hide the toolbar. &quot;always&quot; shows always (without mouseover).</td>
88
- </tr>
89
- <tr>
90
- <td> top-margin</td>
91
- <td>number &gt;= 0</td>
92
- <td>Top margin in pixels</td>
93
- </tr>
94
- <tr>
95
- <td> bottom-margin</td>
96
- <td>number &gt;= 0</td>
97
- <td>Bottom margin in pixels</td>
98
- </tr>
99
- <tr>
100
- <td> left-margin</td>
101
- <td>number &gt;= 0</td>
102
- <td>Left margin in pixels</td>
103
- </tr>
104
- <tr>
105
- <td> right-margin</td>
106
- <td>number &gt;= 0</td>
107
- <td>Right margin in pixels</td>
108
- </tr>
109
- <tr>
110
- <td> h-align</td>
111
- <td>&quot;none/left/right/center&quot;</td>
112
- <td>Horizontal alignment</td>
113
- </tr>
114
- <tr>
115
- <td> float-enable</td>
116
- <td>true/false</td>
117
- <td> Allow floating elements to surround Crayon</td>
118
- </tr>
119
- <tr>
120
- <td>toolbar-overlay</td>
121
- <td>true/false</td>
122
- <td>Overlay the toolbar on code rather than push it down when possible</td>
123
- </tr>
124
- <tr>
125
- <td>toolbar-hide</td>
126
- <td>true/false</td>
127
- <td>Toggle the toolbar on single click when it is overlayed</td>
128
- </tr>
129
- <tr>
130
- <td>toolbar-delay</td>
131
- <td>true/false</td>
132
- <td>Delay hiding the toolbar on MouseOut</td>
133
- </tr>
134
- <tr>
135
- <td>show-title</td>
136
- <td>true/false</td>
137
- <td>Display the title when provided</td>
138
- </tr>
139
- <tr>
140
- <td>show-lang</td>
141
- <td>&quot;found/always/never&quot;</td>
142
- <td>When to display the language.</td>
143
- </tr>
144
- <tr>
145
- <td>striped</td>
146
- <td>true/false</td>
147
- <td>Display striped code lines</td>
148
- </tr>
149
- <tr>
150
- <td>marking</td>
151
- <td>true/false</td>
152
- <td>Enable line marking for important lines</td>
153
- </tr>
154
- <tr>
155
- <td>nums</td>
156
- <td>true/false</td>
157
- <td>Display line numbers by default</td>
158
- </tr>
159
- <tr>
160
- <td>nums-toggle</td>
161
- <td>true/false</td>
162
- <td>Enable line number toggling</td>
163
- </tr>
164
- <tr>
165
- <td>plain</td>
166
- <td>true/false</td>
167
- <td>Enable plain code. Disabling will also disable plain toggling and copy/paste which use the plain code.</td>
168
- </tr>
169
- <tr>
170
- <td>plain-toggle</td>
171
- <td>true/false</td>
172
- <td>Enable plain code toggling</td>
173
- </tr>
174
- <tr>
175
- <td>show-plain-default</td>
176
- <td>true/false</td>
177
- <td>Show the plain code by default instead of the highlighted code</td>
178
- </tr>
179
- <tr>
180
- <td>copy</td>
181
- <td>true/false</td>
182
- <td>Enable code copy/paste</td>
183
- </tr>
184
- <tr>
185
- <td>popup</td>
186
- <td>true/false</td>
187
- <td>Enable opening code in a window</td>
188
- </tr>
189
- <tr>
190
- <td>scroll</td>
191
- <td>true/false</td>
192
- <td>Always show scrollbars</td>
193
- </tr>
194
- <tr>
195
- <td>tab-size</td>
196
- <td>number &gt;= 0</td>
197
- <td>Tab size</td>
198
- </tr>
199
- <tr>
200
- <td>trim-whitespace</td>
201
- <td>true/false</td>
202
- <td>Trim the whitespace around the code</td>
203
- </tr>
204
- <tr>
205
- <td>mixed</td>
206
- <td>true/false</td>
207
- <td>Enable mixed highlighting (multiple languages in code)</td>
208
- </tr>
209
- <tr>
210
- <td>show_mixed</td>
211
- <td>true/false</td>
212
- <td>Show the mixed highlighting plus sign</td>
213
- </tr>
214
- <tr>
215
- <td>start-line</td>
216
- <td>number &gt;= 0</td>
217
- <td>When to start line numbers from</td>
218
- </tr>
219
- <tr>
220
- <td>fallback-lang</td>
221
- <td>string</td>
222
- <td>ID of the language to use when none is detected</td>
223
- </tr>
224
- <tr>
225
- <td>local-path</td>
226
- <td>string</td>
227
- <td>Local path to load file from</td>
228
- </tr>
229
- <tr>
230
- <td> touchscreen</td>
231
- <td>true/false</td>
232
- <td> Disable mouse gestures for touchscreen devices (eg. MouseOver)</td>
233
- </tr>
234
- <tr>
235
- <td> disable-anim</td>
236
- <td>true/false</td>
237
- <td>Disable animations</td>
238
- </tr>
239
- <tr>
240
- <td> runtime</td>
241
- <td>true/false</td>
242
- <td> Disable runtime stats</td>
243
- </tr>
244
- <tr>
245
- <td> error-log</td>
246
- <td>true/false</td>
247
- <td> Log errors for individual Crayons</td>
248
- </tr>
249
- <tr>
250
- <td> error-log-sys</td>
251
- <td>true/false</td>
252
- <td> Log system-wide errors</td>
253
- </tr>
254
- <tr>
255
- <td> error-msg-show</td>
256
- <td>true/false</td>
257
- <td> Display custom message for errors</td>
258
- </tr>
259
- <tr>
260
- <td> error-msg</td>
261
- <td>string</td>
262
- <td> The error message to show for errors</td>
263
- </tr>
264
- <tr>
265
- <td> mixed</td>
266
- <td>true/false</td>
267
- <td> Allow mixed languages using delimiters and tags</td>
268
- </tr>
269
- </table>
270
- <p>Here's a simple example of attributes:</p><p><code>[crayon lang="html" font-size="20" mark="1" width="200px" toolbar=&quot;false&quot;] &lt;strong&gt;This is great!&lt;/strong&gt; [/crayon] </code></p>
271
- <p>If you want to prevent the <code>[crayon]</code> shortcode from turning into a Crayon, use: <code>$[crayon]...[/crayon]</code>. If you want to prevent a <code>[/crayon]</code> from ending a Crayon (say if you wanted to have the Crayon shortcode appear in a Crayon itself), then use <code>$[crayon]...[/crayon]$</code>. The same applies to <code>&lt;pre&gt;</code> and Mini Tags.</p>
272
- <p><strong>Themes</strong></p>
273
- <p>Crayon comes with built-in Themes to style your code. Themes are structured <code>/themes/theme-name/theme-name.css</code>. If you know CSS, take a look at <code>/themes/default/default.css</code> to get an idea of how they work and how you can change/create them.</p>
274
- <p><strong>Languages</strong></p>
275
- <p>You can customize and create new languages and define how to capture each element (keywords, comments, strings, etc.) with regular expressions. Languages are structured <code>/langs/lang-name/lang-name.txt</code>. Take a look at <code>/langs/default/default.txt</code> and check out the neat regex of the default/generic language. I've also spent considerable time putting together a <a href="http://ak.net84.net/projects/crayon-language-file-specification/" target="_blank">quick guide</a> in <code>/langs/readme.txt</code> that will be added to the online docs. If your language is missing, send me an <a href="#info" target="_blank">email</a>. There will be more languages added over time, of course.</p>
276
- <p><strong>Fonts</strong></p>
277
- <p>You can define fonts and font-sizes within Themes, but you can also override the theme's font with those inside <code>/fonts/</code> and also provide @font-face fonts just like in themes - it's just CSS after all.</p>
278
- <p><strong>Disabling Highlight</strong></p>
279
- <p>You can temporarily disable highlighting for a piece of code using the <code>highlight=&quot;false&quot;</code> attribute.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
util/tag-editor/crayon_qt.js CHANGED
@@ -1,33 +1,47 @@
1
  (function($) {
2
 
3
- window.CrayonQuickTags = function() {
4
 
5
  var base = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- base.sel = '*[id*="crayon_quicktag"],*[class*="crayon_quicktag"]';
8
- CrayonTagEditor.init(base.sel);
9
-
10
- QTags.addButton( 'crayon_quicktag', 'crayon', function() {
11
- CrayonTagEditor.showDialog(
12
- function(shortcode) {
13
- QTags.insertContent(shortcode);
14
- },
15
- function(shortcode) {/* Can't edit */}, null, CrayonTagEditor.hide, 'html', null, null, null, 'encode');
16
- jQuery(base.sel).removeClass('qt_crayon_highlight');
17
- });
18
-
19
- var qt_crayon;
20
- var find_qt_crayon = setInterval(function() {
21
- qt_crayon = jQuery(base.sel).first();
22
- if (typeof qt_crayon != 'undefined') {
23
- clearInterval(find_qt_crayon);
24
  }
25
- }, 100);
26
-
27
  };
28
 
29
  $(document).ready(function() {
30
- CrayonQuickTags();
31
  });
32
 
33
  })(jQueryCrayon);
1
  (function($) {
2
 
3
+ window.CrayonQuickTags = new function() {
4
 
5
  var base = this;
6
+
7
+ base.init = function() {
8
+ base.sel = '*[id*="crayon_quicktag"],*[class*="crayon_quicktag"]';
9
+ CrayonTagEditor.bind(base.sel);
10
+ QTags.addButton( 'crayon_quicktag', 'crayon', function() {
11
+ CrayonTagEditor.showDialog({
12
+ insert: function(shortcode) {
13
+ QTags.insertContent(shortcode);
14
+ },
15
+ select: base.getSelectedText,
16
+ editor_str: 'html',
17
+ output: 'encode'
18
+ });
19
+ $(base.sel).removeClass('qt_crayon_highlight');
20
+ });
21
+ var qt_crayon;
22
+ var find_qt_crayon = setInterval(function() {
23
+ qt_crayon = $(base.sel).first();
24
+ if (typeof qt_crayon != 'undefined') {
25
+ clearInterval(find_qt_crayon);
26
+ }
27
+ }, 100);
28
+ }
29
 
30
+ base.getSelectedText = function() {
31
+ if (QTags.instances.length == 0) {
32
+ return null;
33
+ } else {
34
+ var qt = QTags.instances[0];
35
+ var startPos = qt.canvas.selectionStart;
36
+ var endPos = qt.canvas.selectionEnd;
37
+ return qt.canvas.value.substring(startPos, endPos);
 
 
 
 
 
 
 
 
 
38
  }
39
+ };
40
+
41
  };
42
 
43
  $(document).ready(function() {
44
+ CrayonQuickTags.init();
45
  });
46
 
47
  })(jQueryCrayon);
util/tag-editor/crayon_tag_editor_wp.class.php CHANGED
@@ -4,272 +4,272 @@ require_once (CRAYON_ROOT_PATH . 'crayon_settings_wp.class.php');
4
 
5
  class CrayonTagEditorWP {
6
 
7
- public static $settings = null;
8
 
9
- public static function init() {
10
- // Hooks
11
- if (CRAYON_TAG_EDITOR) {
12
- CrayonSettingsWP::load_settings(TRUE);
13
- if (is_admin()) {
14
- // XXX Only runs in wp-admin
15
- add_action('admin_print_scripts-post-new.php', 'CrayonTagEditorWP::enqueue_resources');
16
- add_action('admin_print_scripts-post.php', 'CrayonTagEditorWP::enqueue_resources');
17
- add_filter('tiny_mce_before_init', 'CrayonTagEditorWP::init_tinymce');
18
- // Must come after
19
- add_action("admin_print_scripts-post-new.php", 'CrayonSettingsWP::init_js_settings');
20
- add_action("admin_print_scripts-post.php", 'CrayonSettingsWP::init_js_settings');
21
- self::addbuttons();
22
- } else if ( CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_FRONT) ) {
23
- // XXX This will always need to enqueue, but only runs on front end
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
- }
31
- }
32
 
33
- public static function init_settings() {
34
 
35
- if (!self::$settings) {
36
- // Add settings
37
- self::$settings = array(
38
- 'home_url' => home_url(),
39
- 'css' => 'crayon-te',
40
- 'css_selected' => 'crayon-selected',
41
- 'code_css' => '#crayon-code',
42
- 'url_css' => '#crayon-url',
43
- 'url_info_css' => '#crayon-te-url-info',
44
- 'lang_css' => '#crayon-lang',
45
- 'title_css' => '#crayon-title',
46
- 'mark_css' => '#crayon-mark',
47
- 'range_css' => '#crayon-range',
48
- 'inline_css' => 'crayon-inline',
49
- 'inline_hide_css' => 'crayon-hide-inline',
50
- 'inline_hide_only_css' => 'crayon-hide-inline-only',
51
- 'hl_css' => '#crayon-highlight',
52
- 'switch_html' => '#content-html',
53
- 'switch_tmce' => '#content-tmce',
54
- 'tinymce_button' => 'a.mce_crayon_tinymce',
55
- 'submit_css' => '#crayon-te-ok',
56
- 'cancel_css' => '#crayon-te-cancel',
57
- 'content_css' => '#crayon-te-content',
58
- 'dialog_title_css' => '#crayon-te-title',
59
- 'submit_wrapper_css' => '#crayon-te-submit-wrapper',
60
- 'data_value' => 'data-value',
61
- 'attr_sep' => CrayonGlobalSettings::val_str(CrayonSettings::ATTR_SEP),
62
- 'css_sep' => '_',
63
- 'fallback_lang' => CrayonGlobalSettings::val(CrayonSettings::FALLBACK_LANG),
64
- 'dialog_title_add' => crayon__('Add Crayon Code'),
65
- 'dialog_title_edit' => crayon__('Edit Crayon Code'),
66
- 'submit_add' => crayon__('Add'),
67
- 'submit_edit' => crayon__('Save'),
68
- 'bar' => '#crayon-te-bar',
69
- 'bar_content' => '#crayon-te-bar-content',
70
- 'extensions' => CrayonResources::langs()->extensions_inverted()
71
- );
72
- }
73
- }
74
 
75
- public static function init_tinymce($init) {
76
- $init['extended_valid_elements'] .= ',pre[*],code[*],iframe[*]';
77
- return $init;
78
- }
79
 
80
- public static function addbuttons() {
81
- // Add only in Rich Editor mode
82
- //if ( get_user_option('rich_editing') == 'true') {
83
- add_filter('mce_external_plugins', 'CrayonTagEditorWP::add_plugin');
84
- add_filter('mce_buttons', 'CrayonTagEditorWP::register_buttons');
85
- }
86
 
87
- public static function enqueue_resources() {
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) {
102
- array_push($buttons, 'separator', 'crayon_tinymce');
103
- return $buttons;
104
- }
 
105
 
106
- // Load the TinyMCE plugin : editor_plugin.js (wp2.5)
107
- public static function add_plugin($plugin_array) {
108
- $plugin_array['crayon_tinymce'] = plugins_url(CRAYON_TINYMCE_JS, __FILE__);
109
- return $plugin_array;
110
- }
111
 
112
- // The remaining functions are for priting
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
- public static function select_resource($id, $resources, $current, $set_class = TRUE) {
115
- $id = CrayonSettings::PREFIX . $id;
116
- if (count($resources) > 0) {
117
- $class = $set_class ? 'class="'.CrayonSettings::SETTING.' '.CrayonSettings::SETTING_SPECIAL.'"' : '';
118
- echo '<select id="'.$id.'" name="'.$id.'" '.$class.' '.CrayonSettings::SETTING_ORIG_VALUE.'="'.$current.'">';
119
- foreach ($resources as $resource) {
120
- $asterisk = $current == $resource->id() ? ' *' : '';
121
- echo '<option value="'.$resource->id().'" '.selected($current, $resource->id()).' >'.$resource->name().$asterisk.'</option>';
122
- }
123
- echo '</select>';
124
- } else {
125
- // None found, default to text box
126
- echo '<input type="text" id="'.$id.'" name="'.$id.'" class="'.CrayonSettings::SETTING.' '.CrayonSettings::SETTING_SPECIAL.'" />';
127
- }
128
- }
129
 
130
- public static function checkbox($id) {
131
- $id = CrayonSettings::PREFIX . $id;
132
- echo '<input type="checkbox" id="'.$id.'" name="'.$id.'" class="'.CrayonSettings::SETTING.' '.CrayonSettings::SETTING_SPECIAL.'" />';
133
- }
 
 
 
 
 
134
 
135
- public static function textbox($id, $atts = array(), $set_class = TRUE) {
136
- $id = CrayonSettings::PREFIX . $id;
137
- $atts_str = '';
138
- $class = $set_class ? 'class="'.CrayonSettings::SETTING.' '.CrayonSettings::SETTING_SPECIAL.'"' : '';
139
- foreach ($atts as $k=>$v) {
140
- $atts_str = $k.'="'.$v.'" ';
141
- }
142
- echo '<input type="text" id="'.$id.'" name="'.$id.'" '.$class.' '.$atts_str.' />';
143
- }
144
 
145
- public static function submit() {
146
- ?>
147
- <input type="button"
148
- class="button-primary <?php echo CrayonTagEditorWP::$settings['submit_css']; ?>"
149
- value="<?php echo CrayonTagEditorWP::$settings['submit_add']; ?>"
150
- name="submit" />
151
- <?php
152
- }
153
-
154
- public static function content() {
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);
162
- $fonts = CrayonResources::fonts()->get();
163
- $curr_font = CrayonGlobalSettings::val(CrayonSettings::FONT);
164
- CrayonTagEditorWP::init_settings();
165
 
166
- ?>
167
 
168
- <div id="crayon-te-content" class="crayon-te">
169
- <div id="crayon-te-bar">
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>
179
 
180
- <table id="crayon-te-table" class="describe">
181
- <tr class="crayon-tr-center">
182
- <th><?php crayon_e('Title'); ?>
183
- </th>
184
- <td class="crayon-nowrap"><?php self::textbox('title', array('placeholder'=>crayon__('A short description'))); ?>
185
- <span id="crayon-te-sub-section"> <?php self::checkbox('inline'); ?>
186
- <span class="crayon-te-section"><?php crayon_e('Inline'); ?> </span>
187
  </span> <span id="crayon-te-sub-section"> <?php self::checkbox('highlight'); ?>
188
- <span class="crayon-te-section"><?php crayon_e("Don't Highlight"); ?>
189
  </span>
190
  </span></td>
191
- </tr>
192
- <tr class="crayon-tr-center">
193
- <th><?php crayon_e('Language'); ?>
194
- </th>
195
- <td class="crayon-nowrap"><?php self::select_resource('lang', $langs, $curr_lang); ?>
196
- <span class="crayon-te-section"><?php crayon_e('Line Range'); ?> </span>
197
- <?php self::textbox('range', array('placeholder'=>crayon__('(e.g. 3-5 or 3)'))); ?>
198
- <span class="crayon-te-section"><?php crayon_e('Marked Lines'); ?> </span>
199
- <?php self::textbox('mark', array('placeholder'=>crayon__('(e.g. 1,2,3-5)'))); ?>
200
- </td>
201
- </tr>
202
- <tr class="crayon-tr-center" style="text-align: center;">
203
- <th><div>
204
- <?php crayon_e('Code'); ?>
205
- </div> <input type="button" id="crayon-te-clear"
206
- class="secondary-primary" value="<?php crayon_e('Clear'); ?>"
207
- name="clear" />
208
- </th>
209
- <td><textarea id="crayon-code" name="code"
210
- placeholder="<?php crayon_e('Paste your code here, or type it in manually.'); ?>"></textarea>
211
- </td>
212
- </tr>
213
- <tr class="crayon-tr-center">
214
- <th id="crayon-url-th"><?php crayon_e('URL'); ?>
215
- </th>
216
- <td><?php self::textbox('url', array('placeholder'=>crayon__('Relative local path or absolute URL'))); ?>
217
- <div id="crayon-te-url-info" class="crayon-te-info">
218
- <?php
219
- crayon_e("If the URL fails to load, the code above will be shown instead. If no code exists, an error is shown.");
220
- echo ' ';
221
- printf(crayon__('If a relative local path is given it will be appended to %s - which is defined in %sCrayon &gt; Settings &gt; Files%s.'), '<span class="crayon-te-quote">'. get_home_url() . '/' . CrayonGlobalSettings::val(CrayonSettings::LOCAL_PATH) . '</span>', '<a href="options-general.php?page=crayon_settings" target="_blank">', '</a>');
222
- ?>
223
- </div></td>
224
- </tr>
225
- <tr>
226
- <td id="crayon-te-submit-wrapper" colspan="2"
227
- style="text-align: center;"><?php self::submit(); ?></td>
228
- </tr>
229
- <!-- <tr>-->
230
- <!-- <td colspan="2"><div id="crayon-te-warning" class="updated crayon-te-info"></div></td>-->
231
- <!-- </tr>-->
232
- <tr>
233
- <td colspan="2"><?php
234
- if (!is_admin() && !$_GET['is_admin'] && !CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_SETTINGS)) {
235
- exit;
236
- }
237
- ?>
238
- <hr />
239
- <div>
240
- <h2 class="crayon-te-heading">
241
- <?php crayon_e('Settings'); ?>
242
- </h2>
243
- </div>
244
- <div id="crayon-te-settings-info" class="crayon-te-info">
245
- <?php
246
- crayon_e('Change the following settings to override their global values.');
247
- echo ' <span class="', CrayonSettings::SETTING_CHANGED, '">';
248
- crayon_e('Only changes (shown yellow) are applied.');
249
- echo '</span><br/>';
250
- echo sprintf(crayon__('Future changes to the global settings under %sCrayon &gt; Settings%s won\'t affect overridden settings.'), '<a href="options-general.php?page=crayon_settings" target="_blank">', '</a>');
251
- ?>
252
- </div>
253
- </td>
254
- </tr>
255
- <?php
256
- $sections = array('Theme', 'Font', 'Metrics', 'Toolbar', 'Lines', 'Code');
257
- foreach ($sections as $section) {
258
- echo '<tr><th>', crayon__($section), '</th><td>';
259
- call_user_func('CrayonSettingsWP::'.strtolower($section), TRUE);
260
- echo '</td></tr>';
261
- }
262
- ?>
263
- </table>
264
- </div>
 
 
 
 
265
 
266
- <?php
267
- }
268
 
269
  }
270
 
271
  if (defined('ABSPATH')) {
272
- add_action('init', 'CrayonTagEditorWP::init');
273
  }
274
 
275
  ?>
4
 
5
  class CrayonTagEditorWP {
6
 
7
+ public static $settings = null;
8
 
9
+ public static function init() {
10
+ // Hooks
11
+ if (CRAYON_TAG_EDITOR) {
12
+ CrayonSettingsWP::load_settings(TRUE);
13
+ if (is_admin()) {
14
+ // XXX Only runs in wp-admin
15
+ add_action('admin_print_scripts-post-new.php', 'CrayonTagEditorWP::enqueue_resources');
16
+ add_action('admin_print_scripts-post.php', 'CrayonTagEditorWP::enqueue_resources');
17
+ add_filter('tiny_mce_before_init', 'CrayonTagEditorWP::init_tinymce');
18
+ // Must come after
19
+ add_action("admin_print_scripts-post-new.php", 'CrayonSettingsWP::init_js_settings');
20
+ add_action("admin_print_scripts-post.php", 'CrayonSettingsWP::init_js_settings');
21
+ self::addbuttons();
22
+ } else if (CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_FRONT)) {
23
+ // XXX This will always need to enqueue, but only runs on front end
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
+ }
31
+ }
32
 
33
+ public static function init_settings() {
34
 
35
+ if (!self::$settings) {
36
+ // Add settings
37
+ self::$settings = array(
38
+ 'home_url' => home_url(),
39
+ 'css' => 'crayon-te',
40
+ 'css_selected' => 'crayon-selected',
41
+ 'code_css' => '#crayon-code',
42
+ 'url_css' => '#crayon-url',
43
+ 'url_info_css' => '#crayon-te-url-info',
44
+ 'lang_css' => '#crayon-lang',
45
+ 'title_css' => '#crayon-title',
46
+ 'mark_css' => '#crayon-mark',
47
+ 'range_css' => '#crayon-range',
48
+ 'inline_css' => 'crayon-inline',
49
+ 'inline_hide_css' => 'crayon-hide-inline',
50
+ 'inline_hide_only_css' => 'crayon-hide-inline-only',
51
+ 'hl_css' => '#crayon-highlight',
52
+ 'switch_html' => '#content-html',
53
+ 'switch_tmce' => '#content-tmce',
54
+ 'tinymce_button' => 'a.mce_crayon_tinymce',
55
+ 'submit_css' => '#crayon-te-ok',
56
+ 'cancel_css' => '#crayon-te-cancel',
57
+ 'content_css' => '#crayon-te-content',
58
+ 'dialog_title_css' => '#crayon-te-title',
59
+ 'submit_wrapper_css' => '#crayon-te-submit-wrapper',
60
+ 'data_value' => 'data-value',
61
+ 'attr_sep' => CrayonGlobalSettings::val_str(CrayonSettings::ATTR_SEP),
62
+ 'css_sep' => '_',
63
+ 'fallback_lang' => CrayonGlobalSettings::val(CrayonSettings::FALLBACK_LANG),
64
+ 'dialog_title_add' => crayon__('Add Crayon Code'),
65
+ 'dialog_title_edit' => crayon__('Edit Crayon Code'),
66
+ 'submit_add' => crayon__('Add'),
67
+ 'submit_edit' => crayon__('Save'),
68
+ 'bar' => '#crayon-te-bar',
69
+ 'bar_content' => '#crayon-te-bar-content',
70
+ 'extensions' => CrayonResources::langs()->extensions_inverted()
71
+ );
72
+ }
73
+ }
74
 
75
+ public static function init_tinymce($init) {
76
+ $init['extended_valid_elements'] .= ',pre[*],code[*],iframe[*]';
77
+ return $init;
78
+ }
79
 
80
+ public static function addbuttons() {
81
+ // Add only in Rich Editor mode
82
+ //if ( get_user_option('rich_editing') == 'true') {
83
+ add_filter('mce_external_plugins', 'CrayonTagEditorWP::add_plugin');
84
+ add_filter('mce_buttons', 'CrayonTagEditorWP::register_buttons');
85
+ }
86
 
87
+ public static function enqueue_resources() {
88
+ global $CRAYON_VERSION;
89
+ self::init_settings();
90
+ wp_enqueue_style('crayon_fancybox', plugins_url(CRAYON_CSS_FANCYBOX, dirname(dirname(__FILE__))), array(), $CRAYON_VERSION);
91
+ wp_enqueue_script('crayon_fancybox', plugins_url(CRAYON_JS_FANCYBOX, dirname(dirname(__FILE__))), array('jquery'), $CRAYON_VERSION);
92
+ wp_enqueue_script('crayon_te_js', plugins_url(CRAYON_TE_JS, __FILE__), array('crayon_fancybox', 'crayon_util_js'), $CRAYON_VERSION);
93
+ wp_enqueue_script('crayon_qt_js', plugins_url(CRAYON_QUICKTAGS_JS, __FILE__), array('quicktags', 'crayon_te_js'), $CRAYON_VERSION, TRUE);
94
+ wp_localize_script('crayon_te_js', 'CrayonTagEditorSettings', self::$settings);
95
+ CrayonSettingsWP::other_scripts();
96
+ }
97
 
98
+ public static function register_buttons($buttons) {
99
+ array_push($buttons, 'separator', 'crayon_tinymce');
100
+ return $buttons;
101
+ }
 
 
 
 
 
102
 
103
+ // Load the TinyMCE plugin : editor_plugin.js (wp2.5)
104
+ public static function add_plugin($plugin_array) {
105
+ $plugin_array['crayon_tinymce'] = plugins_url(CRAYON_TINYMCE_JS, __FILE__);
106
+ return $plugin_array;
107
+ }
108
 
109
+ // The remaining functions are for priting
 
 
 
 
110
 
111
+ public static function select_resource($id, $resources, $current, $set_class = TRUE) {
112
+ $id = CrayonSettings::PREFIX . $id;
113
+ if (count($resources) > 0) {
114
+ $class = $set_class ? 'class="' . CrayonSettings::SETTING . ' ' . CrayonSettings::SETTING_SPECIAL . '"' : '';
115
+ echo '<select id="' . $id . '" name="' . $id . '" ' . $class . ' ' . CrayonSettings::SETTING_ORIG_VALUE . '="' . $current . '">';
116
+ foreach ($resources as $resource) {
117
+ $asterisk = $current == $resource->id() ? ' *' : '';
118
+ echo '<option value="' . $resource->id() . '" ' . selected($current, $resource->id()) . ' >' . $resource->name() . $asterisk . '</option>';
119
+ }
120
+ echo '</select>';
121
+ } else {
122
+ // None found, default to text box
123
+ echo '<input type="text" id="' . $id . '" name="' . $id . '" class="' . CrayonSettings::SETTING . ' ' . CrayonSettings::SETTING_SPECIAL . '" />';
124
+ }
125
+ }
126
 
127
+ public static function checkbox($id) {
128
+ $id = CrayonSettings::PREFIX . $id;
129
+ echo '<input type="checkbox" id="' . $id . '" name="' . $id . '" class="' . CrayonSettings::SETTING . ' ' . CrayonSettings::SETTING_SPECIAL . '" />';
130
+ }
 
 
 
 
 
 
 
 
 
 
 
131
 
132
+ public static function textbox($id, $atts = array(), $set_class = TRUE) {
133
+ $id = CrayonSettings::PREFIX . $id;
134
+ $atts_str = '';
135
+ $class = $set_class ? 'class="' . CrayonSettings::SETTING . ' ' . CrayonSettings::SETTING_SPECIAL . '"' : '';
136
+ foreach ($atts as $k => $v) {
137
+ $atts_str = $k . '="' . $v . '" ';
138
+ }
139
+ echo '<input type="text" id="' . $id . '" name="' . $id . '" ' . $class . ' ' . $atts_str . ' />';
140
+ }
141
 
142
+ public static function submit() {
143
+ ?>
144
+ <input type="button"
145
+ class="button-primary <?php echo CrayonTagEditorWP::$settings['submit_css']; ?>"
146
+ value="<?php echo CrayonTagEditorWP::$settings['submit_add']; ?>"
147
+ name="submit"/>
148
+ <?php
149
+ }
 
150
 
151
+ public static function content() {
 
 
 
 
 
 
 
 
 
152
 
153
+ CrayonSettingsWP::load_settings();
154
+ $langs = CrayonLangs::sort_by_name(CrayonParser::parse_all());
155
+ $curr_lang = CrayonGlobalSettings::val(CrayonSettings::FALLBACK_LANG);
156
+ $themes = CrayonResources::themes()->get();
157
+ $curr_theme = CrayonGlobalSettings::val(CrayonSettings::THEME);
158
+ $fonts = CrayonResources::fonts()->get();
159
+ $curr_font = CrayonGlobalSettings::val(CrayonSettings::FONT);
160
+ CrayonTagEditorWP::init_settings();
 
161
 
162
+ ?>
163
 
164
+ <div id="crayon-te-content" class="crayon-te">
165
+ <div id="crayon-te-bar">
166
+ <div id="crayon-te-bar-content">
167
+ <div id="crayon-te-title">Title</div>
168
+ <div id="crayon-te-controls">
169
+ <a id="crayon-te-ok" href="#"><?php crayon_e('OK'); ?></a> <span
170
+ class="crayon-te-seperator">|</span> <a id="crayon-te-cancel"
171
+ href="#"><?php crayon_e('Cancel'); ?></a>
172
+ </div>
173
+ </div>
174
+ </div>
175
 
176
+ <table id="crayon-te-table" class="describe">
177
+ <tr class="crayon-tr-center">
178
+ <th><?php crayon_e('Title'); ?>
179
+ </th>
180
+ <td class="crayon-nowrap"><?php self::textbox('title', array('placeholder' => crayon__('A short description'))); ?>
181
+ <span id="crayon-te-sub-section"> <?php self::checkbox('inline'); ?>
182
+ <span class="crayon-te-section"><?php crayon_e('Inline'); ?> </span>
183
  </span> <span id="crayon-te-sub-section"> <?php self::checkbox('highlight'); ?>
184
+ <span class="crayon-te-section"><?php crayon_e("Don't Highlight"); ?>
185
  </span>
186
  </span></td>
187
+ </tr>
188
+ <tr class="crayon-tr-center">
189
+ <th><?php crayon_e('Language'); ?>
190
+ </th>
191
+ <td class="crayon-nowrap"><?php self::select_resource('lang', $langs, $curr_lang); ?>
192
+ <span class="crayon-te-section"><?php crayon_e('Line Range'); ?> </span>
193
+ <?php self::textbox('range', array('placeholder' => crayon__('(e.g. 3-5 or 3)'))); ?>
194
+ <span class="crayon-te-section"><?php crayon_e('Marked Lines'); ?> </span>
195
+ <?php self::textbox('mark', array('placeholder' => crayon__('(e.g. 1,2,3-5)'))); ?>
196
+ </td>
197
+ </tr>
198
+ <tr class="crayon-tr-center" style="text-align: center;">
199
+ <th>
200
+ <div>
201
+ <?php crayon_e('Code'); ?>
202
+ </div>
203
+ <input type="button" id="crayon-te-clear"
204
+ class="secondary-primary" value="<?php crayon_e('Clear'); ?>"
205
+ name="clear"/>
206
+ </th>
207
+ <td><textarea id="crayon-code" name="code"
208
+ placeholder="<?php crayon_e('Paste your code here, or type it in manually.'); ?>"></textarea>
209
+ </td>
210
+ </tr>
211
+ <tr class="crayon-tr-center">
212
+ <th id="crayon-url-th"><?php crayon_e('URL'); ?>
213
+ </th>
214
+ <td><?php self::textbox('url', array('placeholder' => crayon__('Relative local path or absolute URL'))); ?>
215
+ <div id="crayon-te-url-info" class="crayon-te-info">
216
+ <?php
217
+ crayon_e("If the URL fails to load, the code above will be shown instead. If no code exists, an error is shown.");
218
+ echo ' ';
219
+ printf(crayon__('If a relative local path is given it will be appended to %s - which is defined in %sCrayon &gt; Settings &gt; Files%s.'), '<span class="crayon-te-quote">' . get_home_url() . '/' . CrayonGlobalSettings::val(CrayonSettings::LOCAL_PATH) . '</span>', '<a href="options-general.php?page=crayon_settings" target="_blank">', '</a>');
220
+ ?>
221
+ </div>
222
+ </td>
223
+ </tr>
224
+ <tr>
225
+ <td id="crayon-te-submit-wrapper" colspan="2"
226
+ style="text-align: center;"><?php self::submit(); ?></td>
227
+ </tr>
228
+ <!-- <tr>-->
229
+ <!-- <td colspan="2"><div id="crayon-te-warning" class="updated crayon-te-info"></div></td>-->
230
+ <!-- </tr>-->
231
+ <tr>
232
+ <td colspan="2"><?php
233
+ $admin = isset($_GET['is_admin']) ? intval($_GET['is_admin']) : is_admin();
234
+ if (!$admin && !CrayonGlobalSettings::val(CrayonSettings::TAG_EDITOR_SETTINGS)) {
235
+ exit;
236
+ }
237
+ ?>
238
+ <hr/>
239
+ <div>
240
+ <h2 class="crayon-te-heading">
241
+ <?php crayon_e('Settings'); ?>
242
+ </h2>
243
+ </div>
244
+ <div id="crayon-te-settings-info" class="crayon-te-info">
245
+ <?php
246
+ crayon_e('Change the following settings to override their global values.');
247
+ echo ' <span class="', CrayonSettings::SETTING_CHANGED, '">';
248
+ crayon_e('Only changes (shown yellow) are applied.');
249
+ echo '</span><br/>';
250
+ echo sprintf(crayon__('Future changes to the global settings under %sCrayon &gt; Settings%s won\'t affect overridden settings.'), '<a href="options-general.php?page=crayon_settings" target="_blank">', '</a>');
251
+ ?>
252
+ </div>
253
+ </td>
254
+ </tr>
255
+ <?php
256
+ $sections = array('Theme', 'Font', 'Metrics', 'Toolbar', 'Lines', 'Code');
257
+ foreach ($sections as $section) {
258
+ echo '<tr><th>', crayon__($section), '</th><td>';
259
+ call_user_func('CrayonSettingsWP::' . strtolower($section), TRUE);
260
+ echo '</td></tr>';
261
+ }
262
+ ?>
263
+ </table>
264
+ </div>
265
 
266
+ <?php
267
+ }
268
 
269
  }
270
 
271
  if (defined('ABSPATH')) {
272
+ add_action('init', 'CrayonTagEditorWP::init');
273
  }
274
 
275
  ?>
util/tag-editor/crayon_te.js CHANGED
@@ -3,14 +3,15 @@
3
  window.CrayonTagEditor = new function() {
4
  var base = this;
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,19 +21,30 @@
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],
@@ -52,11 +64,6 @@
52
  },
53
  closeBtn : false
54
  });
55
-
56
- $(s.cancel_css).live('click', function () {
57
- $.crayonFancybox.close();
58
- return false;
59
- });
60
  };
61
 
62
  base.hide = function() {
@@ -74,12 +81,12 @@
74
  }
75
 
76
  // Load the editor content
77
- $.get(gs.ajaxurl, {action : 'crayon-tag-editor'}, function(data) {
78
  dialog = $('<div id="'+s.css+'"></div>');
79
  dialog.appendTo('body').hide();
80
  dialog.html(data);
81
 
82
- me.setOrigValues();
83
 
84
  submit = dialog.find(s.submit_css);
85
 
@@ -139,7 +146,7 @@
139
  orig_value = '';
140
  }
141
  // Depends on type
142
- var value = me.settingValue(setting);
143
  console_log(setting.attr('id') + ' value: ' + value);
144
  var highlight = null;
145
  if (setting.is('input[type=checkbox]')) {
@@ -161,7 +168,7 @@
161
  }
162
  }
163
  // Save standardized value for later
164
- me.settingValue(setting, value);
165
  };
166
  $('.'+gs.setting+'[id]:not(.'+gs.special+')').each(function() {
167
  $(this).change(setting_change);
@@ -171,37 +178,43 @@
171
  };
172
 
173
  // XXX Displays the dialog.
174
- base.showDialog = function(insert, edit, show, hide, editor_str, ed, node, input, output) {
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  // Need to reset all settings back to original, clear yellow highlighting
176
- me.resetSettings();
177
  // Save these for when we add a Crayon
178
- insertCallback = insert;
179
- editCallback = edit;
180
- showCallback = show;
181
- hideCallback = hide;
182
- inputHTML = input;
183
- outputHTML = output;
184
- editor_name = editor_str;
185
- // If we have selected a Crayon, load in the contents
186
- // TODO put this in a separate function
187
- var currNode = null;
188
  is_inline = false;
189
- if (typeof node != 'undefined' && node != null) {
190
- currNode = node;
191
- } else {
192
- // Get it from editor selection, not as precise
193
- currNode = ed != null ? ed.selection.getNode() : null;
194
- }
195
 
196
  // Unbind submit
197
  submit.unbind();
198
  submit.click(function() {
199
- me.submitButton();
200
  return false;
201
  });
202
- me.setSubmitText(s.submit_add);
203
 
204
- if (me.isCrayon(currNode)) {
205
  currCrayon = $(currNode);
206
  if (currCrayon.length != 0) {
207
  // Read back settings for editing
@@ -251,13 +264,13 @@
251
  }
252
 
253
  // Validate the attributes
254
- atts = me.validate(atts);
255
 
256
  // Load in attributes, add prefix
257
  for (var att in atts) {
258
  var setting = $('#' + gs.prefix + att + '.' + gs.setting);
259
  var value = atts[att];
260
- me.settingValue(setting, value);
261
  // Update highlights
262
  setting.change();
263
  // If global setting changes and we access settings, it should declare loaded settings as changed even if they equal the global value, just so they aren't lost on save
@@ -272,7 +285,7 @@
272
  }
273
 
274
  editing = true;
275
- me.setSubmitText(s.submit_edit);
276
 
277
  // Code
278
  var content = currCrayon.html();
@@ -287,9 +300,13 @@
287
  console_log('cannot load currNode of type pre');
288
  }
289
  } else {
 
 
 
 
290
  // We are creating a new Crayon, not editing
291
  editing = false;
292
- me.setSubmitText(s.submit_add);
293
  currCrayon = null;
294
  currClasses = '';
295
  }
@@ -447,7 +464,7 @@
447
  atts['decode'] = 'true';
448
 
449
  // Validate the attributes
450
- atts = me.validate(atts);
451
 
452
  for (var id in atts) {
453
  // Remove prefix, if exists
@@ -482,11 +499,11 @@
482
  }
483
  content = typeof content != 'undefined' ? content : '';
484
  shortcode += '>' + content + '</' + tag + '>' + br_after;
485
-
486
- if (editing) {
487
- // Edit the current selected node, update refere
488
- /*currPre =*/ editCallback(shortcode);
489
- } else {
490
  // Insert the tag and hide dialog
491
  insertCallback(shortcode);
492
  }
@@ -496,8 +513,8 @@
496
 
497
  base.submitButton = function() {
498
  console_log('submit');
499
- if (me.addCrayon() != false) {
500
- me.hideDialog();
501
  }
502
  };
503
 
@@ -513,7 +530,7 @@
513
  base.setOrigValues = function() {
514
  $('.'+gs.setting+'[id]').each(function() {
515
  var setting = $(this);
516
- setting.attr(gs.orig_value, me.settingValue(setting));
517
  });
518
  };
519
 
@@ -521,7 +538,7 @@
521
  console_log('reset');
522
  $('.'+gs.setting).each(function() {
523
  var setting = $(this);
524
- me.settingValue(setting, setting.attr(gs.orig_value));
525
  // Update highlights
526
  setting.change();
527
  });
3
  window.CrayonTagEditor = new function() {
4
  var base = this;
5
 
6
+ var isInit = false;
7
  var loaded = false;
8
  var editing = false;
9
+ var insertCallback, editCallback, showCallback, hideCallback, selectCallback;
10
  // Used for encoding, decoding
11
+ var inputHTML, outputHTML, editor_name, ajax_class_timer;
12
  var ajax_class_timer_count = 0;
13
 
14
+ var code_refresh, url_refresh;
15
 
16
  // Current $ obj of pre node
17
  var currCrayon = null;
21
  var is_inline = false;
22
 
23
  // Generated in WP and contains the settings
24
+ var s, gs, util;
 
 
25
 
26
  // CSS
27
+ var dialog, code, clear, submit;
28
 
29
+ base.init = function() {
30
  s = CrayonTagEditorSettings;
31
  gs = CrayonSyntaxSettings;
32
  util = CrayonUtil;
33
+
34
+ $(s.cancel_css).live('click', function () {
35
+ $.crayonFancybox.close();
36
+ return false;
37
+ });
38
+ };
39
+
40
+ base.bind = function(button) {
41
+ if (!isInit) {
42
+ isInit = true;
43
+ base.init();
44
+ }
45
+
46
  base.loadDialog();
47
+ util.initFancybox();
48
  $(button).crayonFancybox({
49
  href : s.content_css,
50
  margin : [40,10,40,10],
64
  },
65
  closeBtn : false
66
  });
 
 
 
 
 
67
  };
68
 
69
  base.hide = function() {
81
  }
82
 
83
  // Load the editor content
84
+ $.get(gs.ajaxurl, {action : 'crayon-tag-editor', is_admin : gs.is_admin}, function(data) {
85
  dialog = $('<div id="'+s.css+'"></div>');
86
  dialog.appendTo('body').hide();
87
  dialog.html(data);
88
 
89
+ base.setOrigValues();
90
 
91
  submit = dialog.find(s.submit_css);
92
 
146
  orig_value = '';
147
  }
148
  // Depends on type
149
+ var value = base.settingValue(setting);
150
  console_log(setting.attr('id') + ' value: ' + value);
151
  var highlight = null;
152
  if (setting.is('input[type=checkbox]')) {
168
  }
169
  }
170
  // Save standardized value for later
171
+ base.settingValue(setting, value);
172
  };
173
  $('.'+gs.setting+'[id]:not(.'+gs.special+')').each(function() {
174
  $(this).change(setting_change);
178
  };
179
 
180
  // XXX Displays the dialog.
181
+ base.showDialog = function(args) {
182
+ args = $.extend({
183
+ insert: null,
184
+ edit: null,
185
+ show: null,
186
+ hide: base.hide,
187
+ select: null,
188
+ editor_str: null,
189
+ ed: null,
190
+ node: null,
191
+ input: null,
192
+ output: null
193
+ }, args);
194
+
195
  // Need to reset all settings back to original, clear yellow highlighting
196
+ base.resetSettings();
197
  // Save these for when we add a Crayon
198
+ insertCallback = args.insert;
199
+ editCallback = args.edit;
200
+ showCallback = args.show;
201
+ hideCallback = args.hide;
202
+ selectCallback = args.select;
203
+ inputHTML = args.input;
204
+ outputHTML = args.output;
205
+ editor_name = args.editor_str;
206
+ var currNode = args.node;
 
207
  is_inline = false;
 
 
 
 
 
 
208
 
209
  // Unbind submit
210
  submit.unbind();
211
  submit.click(function() {
212
+ base.submitButton();
213
  return false;
214
  });
215
+ base.setSubmitText(s.submit_add);
216
 
217
+ if (base.isCrayon(currNode)) {
218
  currCrayon = $(currNode);
219
  if (currCrayon.length != 0) {
220
  // Read back settings for editing
264
  }
265
 
266
  // Validate the attributes
267
+ atts = base.validate(atts);
268
 
269
  // Load in attributes, add prefix
270
  for (var att in atts) {
271
  var setting = $('#' + gs.prefix + att + '.' + gs.setting);
272
  var value = atts[att];
273
+ base.settingValue(setting, value);
274
  // Update highlights
275
  setting.change();
276
  // If global setting changes and we access settings, it should declare loaded settings as changed even if they equal the global value, just so they aren't lost on save
285
  }
286
 
287
  editing = true;
288
+ base.setSubmitText(s.submit_edit);
289
 
290
  // Code
291
  var content = currCrayon.html();
300
  console_log('cannot load currNode of type pre');
301
  }
302
  } else {
303
+ if (selectCallback) {
304
+ // Add selected content as code
305
+ code.val(selectCallback);
306
+ }
307
  // We are creating a new Crayon, not editing
308
  editing = false;
309
+ base.setSubmitText(s.submit_add);
310
  currCrayon = null;
311
  currClasses = '';
312
  }
464
  atts['decode'] = 'true';
465
 
466
  // Validate the attributes
467
+ atts = base.validate(atts);
468
 
469
  for (var id in atts) {
470
  // Remove prefix, if exists
499
  }
500
  content = typeof content != 'undefined' ? content : '';
501
  shortcode += '>' + content + '</' + tag + '>' + br_after;
502
+
503
+ if (editing && editCallback) {
504
+ // Edit the current selected node
505
+ editCallback(shortcode);
506
+ } else if (insertCallback) {
507
  // Insert the tag and hide dialog
508
  insertCallback(shortcode);
509
  }
513
 
514
  base.submitButton = function() {
515
  console_log('submit');
516
+ if (base.addCrayon() != false) {
517
+ base.hideDialog();
518
  }
519
  };
520
 
530
  base.setOrigValues = function() {
531
  $('.'+gs.setting+'[id]').each(function() {
532
  var setting = $(this);
533
+ setting.attr(gs.orig_value, base.settingValue(setting));
534
  });
535
  };
536
 
538
  console_log('reset');
539
  $('.'+gs.setting).each(function() {
540
  var setting = $(this);
541
+ base.settingValue(setting, setting.attr(gs.orig_value));
542
  // Update highlights
543
  setting.change();
544
  });
util/tag-editor/crayon_tinymce.js CHANGED
@@ -1,180 +1,174 @@
1
- (function($) {
2
-
3
- window.CrayonTinyMCE = new function() {
4
-
5
- // TinyMCE specific
6
- var name = 'crayon_tinymce';
7
- var s, te = null;
8
- var isHighlighted = false;
9
- var currPre = null;
10
- // Switch events
11
- var switch_html_click = switch_tmce_click = null;
12
-
13
- var base = this;
14
- // var wasHighlighted = false;
15
-
16
- base.setHighlight = function(highlight) {
17
- if (highlight) {
18
- $(s.tinymce_button).addClass('mce_crayon_tinymce_highlight');
19
- } else {
20
- $(s.tinymce_button).removeClass('mce_crayon_tinymce_highlight');
21
- }
22
- isHighlighted = highlight;
23
- };
24
-
25
- base.selectPreCSS = function(selected) {
26
- if (currPre) {
27
- if (selected) {
28
- $(currPre).addClass(s.css_selected);
29
- } else {
30
- $(currPre).removeClass(s.css_selected);
31
- }
32
- }
33
- };
34
-
35
- base.isPreSelectedCSS = function() {
36
- if (currPre) {
37
- return $(currPre).hasClass(s.css_selected);
38
- }
39
- return false;
40
- };
41
-
42
- base.init = function(button) {
43
- // TODO
44
- };
45
-
46
- base.loadTinyMCE = function() {
47
- s = CrayonTagEditorSettings;
48
- te = CrayonTagEditor;
49
-
50
- tinymce.PluginManager.requireLangPack(name);
51
-
52
- tinymce.create('tinymce.plugins.Crayon', {
53
- init : function(ed, url) {
54
-
55
- ed.onInit.add(function(ed) {
56
- ed.dom.loadCSS(url + '/crayon_te.css');
57
- });
58
-
59
- // Prevent <p> on enter, turn into \n
60
- ed.onKeyDown.add(function( ed, e ) {
61
- var selection = ed.selection;
62
- if ( e.keyCode == 13) {
63
- var node = selection.getNode();
64
- if (node.nodeName == 'PRE') {
65
- selection.setContent('\n', {format : 'raw'});
66
- return tinymce.dom.Event.cancel(e);
67
- } else if (te.isCrayon(node)) {
68
- // Only triggers for inline <span>, ignore enter in inline
69
- return tinymce.dom.Event.cancel(e);
70
- }
71
- }
72
- });
73
-
74
- ed.onInit.add(function(ed) {
75
- CrayonTagEditor.init(s.tinymce_button);
76
- });
77
-
78
- ed.addCommand('showCrayon', function() {
79
- te.showDialog(
80
- function(shortcode) {
81
- ed.execCommand('mceInsertContent', 0, shortcode);
82
- },
83
- function(shortcode) {
84
- // This will change the currPre object
85
- var newPre = $(shortcode);
86
- $(currPre).replaceWith(newPre);
87
- // XXX DOM element not jQuery
88
- currPre = newPre[0];
89
- }, null, CrayonTagEditor.hide, 'tinymce', ed, currPre, 'decode', 'encode');
90
- });
91
-
92
- // Remove onclick and call ourselves
93
- var switch_html = $(s.switch_html);
94
- // switch_html_click = switch_html.prop('onclick');
95
- switch_html.prop('onclick', null);
96
- switch_html.click(function() {
97
- // Remove selected pre class when switching to HTML editor
98
- base.selectPreCSS(false);
99
- switchEditors.go('content','html');
100
- // switch_html_click();
101
- });
102
-
103
- // // Remove onclick and call ourselves
104
- // var switch_tmce = $(s.switch_tmce);
105
- //// switch_tmce_click = switch_tmce.prop('onclick');
106
- // switch_tmce.prop('onclick', null);
107
- // switch_tmce.click(function() {
108
- // // Add selected pre class when switching to back to TinyMCE
109
- //// if (!base.isPreSelectedCSS()) {
110
- //// base.selectPreCSS(true);
111
- //// }
112
- // switchEditors.go('content','tmce');
113
- //// switch_tmce_click();
114
- // });
115
-
116
- // Highlight selected
117
- ed.onNodeChange.add(function(ed, cm, n, co) {
118
- if (n != currPre) {
119
- // We only care if we select another same object
120
- if (currPre) {
121
- // If we have a previous pre, remove it
122
- base.selectPreCSS(false);
123
- currPre = null;
124
- }
125
- if (te.isCrayon(n)) {
126
- // Add new pre
127
- currPre = n;
128
- base.selectPreCSS(true);
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);
136
- }
137
- });
138
-
139
- ed.onBeforeSetContent.add(function(ed, o) {
140
- // Remove all selected pre tags
141
- var content = $(o.content);
142
- var wrapper = $('<div>');
143
- content.each(function() {
144
- $(this).removeClass(s.css_selected);
145
- wrapper.append($(this).clone());
146
- });
147
- o.content = wrapper.html();
148
- });
149
-
150
- ed.addButton(name, {
151
- // TODO add translation
152
- title: s.dialog_title,
153
- cmd: 'showCrayon'
154
- });
155
- },
156
- createControl : function(n, cm){
157
- return null;
158
- },
159
- getInfo : function(){
160
- return {
161
- longname: 'Crayon Syntax Highlighter',
162
- author: 'Aram Kocharyan',
163
- authorurl: 'http://ak.net84.net/',
164
- infourl: 'http://bit.ly/crayonsyntax/',
165
- version: "1.0"
166
- };
167
- }
168
- });
169
-
170
- tinymce.PluginManager.add(name, tinymce.plugins.Crayon);
171
- };
172
-
173
- };
174
-
175
- $(document).ready(function() {
176
  // Load TinyMCE
177
  CrayonTinyMCE.loadTinyMCE();
178
  });
179
-
180
  })(jQueryCrayon);
1
+ (function ($) {
2
+
3
+ window.CrayonTinyMCE = new function () {
4
+
5
+ // TinyMCE specific
6
+ var name = 'crayon_tinymce';
7
+ var s, te = null;
8
+ var isHighlighted = false;
9
+ var currPre = null;
10
+ // Switch events
11
+ var switch_html_click = switch_tmce_click = null;
12
+
13
+ var base = this;
14
+ // var wasHighlighted = false;
15
+
16
+ base.setHighlight = function (highlight) {
17
+ if (highlight) {
18
+ $(s.tinymce_button).addClass('mce_crayon_tinymce_highlight');
19
+ } else {
20
+ $(s.tinymce_button).removeClass('mce_crayon_tinymce_highlight');
21
+ }
22
+ isHighlighted = highlight;
23
+ };
24
+
25
+ base.selectPreCSS = function (selected) {
26
+ if (currPre) {
27
+ if (selected) {
28
+ $(currPre).addClass(s.css_selected);
29
+ } else {
30
+ $(currPre).removeClass(s.css_selected);
31
+ }
32
+ }
33
+ };
34
+
35
+ base.isPreSelectedCSS = function () {
36
+ if (currPre) {
37
+ return $(currPre).hasClass(s.css_selected);
38
+ }
39
+ return false;
40
+ };
41
+
42
+ base.init = function (button) {
43
+ // TODO
44
+ };
45
+
46
+ base.loadTinyMCE = function () {
47
+ s = CrayonTagEditorSettings;
48
+ te = CrayonTagEditor;
49
+
50
+ tinymce.PluginManager.requireLangPack(name);
51
+
52
+ tinymce.create('tinymce.plugins.Crayon', {
53
+ init: function (ed, url) {
54
+
55
+ ed.onInit.add(function (ed) {
56
+ ed.dom.loadCSS(url + '/crayon_te.css');
57
+ });
58
+
59
+ // Prevent <p> on enter, turn into \n
60
+ ed.onKeyDown.add(function (ed, e) {
61
+ var selection = ed.selection;
62
+ if (e.keyCode == 13) {
63
+ var node = selection.getNode();
64
+ if (node.nodeName == 'PRE') {
65
+ selection.setContent('\n', {format: 'raw'});
66
+ return tinymce.dom.Event.cancel(e);
67
+ } else if (te.isCrayon(node)) {
68
+ // Only triggers for inline <span>, ignore enter in inline
69
+ return tinymce.dom.Event.cancel(e);
70
+ }
71
+ }
72
+ });
73
+
74
+ ed.onInit.add(function (ed) {
75
+ CrayonTagEditor.bind(s.tinymce_button);
76
+ });
77
+
78
+ ed.addCommand('showCrayon', function () {
79
+ te.showDialog({
80
+ insert: function (shortcode) {
81
+ ed.execCommand('mceInsertContent', 0, shortcode);
82
+ },
83
+ edit: function (shortcode) {
84
+ // This will change the currPre object
85
+ var newPre = $(shortcode);
86
+ $(currPre).replaceWith(newPre);
87
+ // XXX DOM element not jQuery
88
+ currPre = newPre[0];
89
+ },
90
+ select: function () {
91
+ return ed.selection.getContent({format: 'text'});
92
+ },
93
+ editor_str: 'tinymce',
94
+ ed: ed,
95
+ node: currPre,
96
+ input: 'decode',
97
+ output: 'encode'
98
+ });
99
+ });
100
+
101
+ // Remove onclick and call ourselves
102
+ var switch_html = $(s.switch_html);
103
+ switch_html.prop('onclick', null);
104
+ switch_html.click(function () {
105
+ // Remove selected pre class when switching to HTML editor
106
+ base.selectPreCSS(false);
107
+ switchEditors.go('content', 'html');
108
+ });
109
+
110
+ // Highlight selected
111
+ ed.onNodeChange.add(function (ed, cm, n, co) {
112
+ if (n != currPre) {
113
+ // We only care if we select another same object
114
+ if (currPre) {
115
+ // If we have a previous pre, remove it
116
+ base.selectPreCSS(false);
117
+ currPre = null;
118
+ }
119
+ if (te.isCrayon(n)) {
120
+ // Add new pre
121
+ currPre = n;
122
+ base.selectPreCSS(true);
123
+ base.setHighlight(true);
124
+ } else {
125
+ // No pre selected
126
+ base.setHighlight(false);
127
+ }
128
+ var tooltip = currPre ? s.dialog_title_edit : s.dialog_title_add;
129
+ $(s.tinymce_button).attr('title', tooltip);
130
+ }
131
+ });
132
+
133
+ ed.onBeforeSetContent.add(function (ed, o) {
134
+ // Remove all selected pre tags
135
+ var content = $(o.content);
136
+ var wrapper = $('<div>');
137
+ content.each(function () {
138
+ $(this).removeClass(s.css_selected);
139
+ wrapper.append($(this).clone());
140
+ });
141
+ o.content = wrapper.html();
142
+ });
143
+
144
+ ed.addButton(name, {
145
+ // TODO add translation
146
+ title: s.dialog_title,
147
+ cmd: 'showCrayon'
148
+ });
149
+ },
150
+ createControl: function (n, cm) {
151
+ return null;
152
+ },
153
+ getInfo: function () {
154
+ return {
155
+ longname: 'Crayon Syntax Highlighter',
156
+ author: 'Aram Kocharyan',
157
+ authorurl: 'http://ak.net84.net/',
158
+ infourl: 'http://bit.ly/crayonsyntax/',
159
+ version: "1.0"
160
+ };
161
+ }
162
+ });
163
+
164
+ tinymce.PluginManager.add(name, tinymce.plugins.Crayon);
165
+ };
166
+
167
+ };
168
+
169
+ $(document).ready(function () {
 
 
 
 
 
 
170
  // Load TinyMCE
171
  CrayonTinyMCE.loadTinyMCE();
172
  });
173
+
174
  })(jQueryCrayon);