Crayon Syntax Highlighter - Version 1.4.1

Version Description

  • Fixed Preview in settings, wasn't loading code from different languages
  • Fixed code toggle button updating for copy/paste
  • Added some keywords to c++, changed sample code
Download this release

Release Info

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

Code changes from version 1.4.0 to 1.4.1

crayon_wp.class.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Crayon Syntax Highlighter
4
  Plugin URI: http://ak.net84.net/
5
  Description: Supports multiple languages, themes, highlighting from a URL, local file or post text. <a href="options-general.php?page=crayon_settings">View Settings.</a>
6
- Version: 1.4.0
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  License: GPL2
3
  Plugin Name: Crayon Syntax Highlighter
4
  Plugin URI: http://ak.net84.net/
5
  Description: Supports multiple languages, themes, highlighting from a URL, local file or post text. <a href="options-general.php?page=crayon_settings">View Settings.</a>
6
+ Version: 1.4.1
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  License: GPL2
global.php CHANGED
@@ -114,9 +114,13 @@ function crayon_s($url = '') {
114
  }
115
  }
116
 
117
- // Returns path using forward slashes
118
- function crayon_pf($url) {
119
- return str_replace('\\', '/', crayon_s(trim(strval($url))));
 
 
 
 
120
  }
121
 
122
  // Returns path using back slashes
114
  }
115
  }
116
 
117
+ // Returns path using forward slashes, slash added at the end
118
+ function crayon_pf($url, $slash = TRUE) {
119
+ $url = trim(strval($url));
120
+ if ($slash) {
121
+ $url = crayon_s($url);
122
+ }
123
+ return str_replace('\\', '/', $url);
124
  }
125
 
126
  // Returns path using back slashes
js/crayon.js CHANGED
@@ -245,7 +245,7 @@ function copy_plain(uid, hover) {
245
 
246
  var plain = crayon[uid].plain;
247
 
248
- toggle_plain(uid, true, true);
249
  toolbar_toggle(uid, true);
250
 
251
  key = crayon[uid].mac ? '\u2318' : 'CTRL';
@@ -518,7 +518,7 @@ function update_nums_button(uid) {
518
  }
519
  }
520
 
521
- function update_plain_button(uid) {
522
  if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].plain_visible == 'undefined') {
523
  return;
524
  }
245
 
246
  var plain = crayon[uid].plain;
247
 
248
+ toggle_plain(uid, undefined, true);
249
  toolbar_toggle(uid, true);
250
 
251
  key = crayon[uid].mac ? '\u2318' : 'CTRL';
518
  }
519
  }
520
 
521
+ function update_plain_button(uid) {
522
  if (typeof crayon[uid] == 'undefined' || typeof crayon[uid].plain_visible == 'undefined') {
523
  return;
524
  }
langs/c++/reserved.txt CHANGED
@@ -23,6 +23,8 @@ __assume
23
  delegate
24
  __except
25
  initonly
 
 
26
  noreturn
27
  novtable
28
  safecast
23
  delegate
24
  __except
25
  initonly
26
+ ifstream
27
+ ofstream
28
  noreturn
29
  novtable
30
  safecast
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://ak.net84.net/
4
  Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter
5
  Requires at least: 3.0
6
  Tested up to: 3.3
7
- Stable tag: 1.4.0
8
 
9
  Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
10
 
@@ -33,7 +33,7 @@ It also supports some neat features like:
33
  * Dimensions, margins, alignment and CSS floating
34
  * Extensive error logging
35
 
36
- == Supported Languages ==
37
 
38
  Languages are defined in language files using Regular Expressions to capture elements.
39
  See http://ak.net84.net/projects/crayon-language-file-specification/
@@ -81,6 +81,11 @@ Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
84
  = 1.4.0 =
85
  * Added all other global settings for easy overriding: http://ak.net84.net/projects/crayon-settings/
86
  * Fixed issues with variables and entites in language regex
4
  Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter
5
  Requires at least: 3.0
6
  Tested up to: 3.3
7
+ Stable tag: 1.4.1
8
 
9
  Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
10
 
33
  * Dimensions, margins, alignment and CSS floating
34
  * Extensive error logging
35
 
36
+ **Supported Languages**
37
 
38
  Languages are defined in language files using Regular Expressions to capture elements.
39
  See http://ak.net84.net/projects/crayon-language-file-specification/
81
 
82
  == Changelog ==
83
 
84
+ = 1.4.1 =
85
+ * Fixed Preview in settings, wasn't loading code from different languages
86
+ * Fixed code toggle button updating for copy/paste
87
+ * Added some keywords to c++, changed sample code
88
+
89
  = 1.4.0 =
90
  * Added all other global settings for easy overriding: http://ak.net84.net/projects/crayon-settings/
91
  * Fixed issues with variables and entites in language regex
util/preview.php CHANGED
@@ -24,7 +24,7 @@ $crayon->settings($settings);
24
 
25
  $lang = $crayon->setting_val(CrayonSettings::FALLBACK_LANG);
26
 
27
- $path = crayon_pf( dirname(__FILE__) . '/sample/' . $lang . '.txt' );
28
 
29
  if ($lang && @file_exists($path)) {
30
  $crayon->url($path);
24
 
25
  $lang = $crayon->setting_val(CrayonSettings::FALLBACK_LANG);
26
 
27
+ $path = crayon_pf( dirname(__FILE__) . '/sample/' . $lang . '.txt', FALSE );
28
 
29
  if ($lang && @file_exists($path)) {
30
  $crayon->url($path);
util/sample/c++.txt CHANGED
@@ -1,17 +1,16 @@
1
- /* basic elements */
2
- html {
3
- margin: 0;
4
- padding: 0;
5
- }
6
- body {
7
- font: 75% georgia, sans-serif;
8
- line-height: 1.88889;
9
- color: #555753;
10
- background: #fff url(blossoms.jpg) no-repeat bottom right;
11
- margin: 0;
12
- padding: 0;
13
- }
14
- p {
15
- margin-top: 0;
16
- text-align: justify;
17
  }
1
+ #include <fstream.h>
2
+
3
+ void main () {
4
+ ifstream f1;
5
+ ofstream f2;
6
+ f1.open("scores.96");
7
+ f2.open("final.96");
8
+
9
+ int s1, s2, s3;
10
+ float w1, w2, w3;
11
+
12
+ f1 >> s1 >> w1;
13
+ f1 >> s2 >> w2;
14
+ f1 >> s3 >> w3;
15
+ f2 << (s1*w1+s2*w2+s3*w3);
 
16
  }