Version Description
Download this release
Release Info
Developer | arniebradfo |
Plugin | HTML Editor Syntax Highlighter |
Version | 2.2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.3
- dist/hesh.css +1 -1
- dist/hesh.js +2 -2
- html-editor-syntax-highlighter.php +18 -8
- readme.txt +2 -2
dist/hesh.css
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Author URI: http://arniebradfo.com/
|
5 |
* Author: Peter Mukhortov
|
6 |
* Author URI: http://mukhortov.com/
|
7 |
-
* Version: 2.2.
|
8 |
**//* BASICS */.CodeMirror {
|
9 |
/* Set height, width, borders, and global font properties here */
|
10 |
font-family: monospace;
|
4 |
* Author URI: http://arniebradfo.com/
|
5 |
* Author: Peter Mukhortov
|
6 |
* Author URI: http://mukhortov.com/
|
7 |
+
* Version: 2.2.3
|
8 |
**//* BASICS */.CodeMirror {
|
9 |
/* Set height, width, borders, and global font properties here */
|
10 |
font-family: monospace;
|
dist/hesh.js
CHANGED
@@ -21782,7 +21782,7 @@ CodeMirror.registerHelper("fold", "indent", function(cm, start) {
|
|
21782 |
* @link http://arniebradfo.com/
|
21783 |
* @author Petr Mukhortov
|
21784 |
* @link http://mukhortov.com/
|
21785 |
-
* @since 2.2.
|
21786 |
*/
|
21787 |
|
21788 |
// console.log(window.heshOptions); // from wordpress php
|
@@ -22514,4 +22514,4 @@ CodeMirror.registerHelper("fold", "indent", function(cm, start) {
|
|
22514 |
window.CodeMirror,
|
22515 |
window.jQuery,
|
22516 |
window.heshOptions
|
22517 |
-
|
21782 |
* @link http://arniebradfo.com/
|
21783 |
* @author Petr Mukhortov
|
21784 |
* @link http://mukhortov.com/
|
21785 |
+
* @since 2.2.2
|
21786 |
*/
|
21787 |
|
21788 |
// console.log(window.heshOptions); // from wordpress php
|
22514 |
window.CodeMirror,
|
22515 |
window.jQuery,
|
22516 |
window.heshOptions
|
22517 |
+
);
|
html-editor-syntax-highlighter.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
|
4 |
/**
|
5 |
-
* @since 2.2.
|
6 |
* @package HESH_plugin
|
7 |
*
|
8 |
* Plugin Name: HTML Editor Syntax Highlighter
|
@@ -15,10 +15,12 @@
|
|
15 |
* Author URI: http://bradford.digital/
|
16 |
* License: GPL-2.0+
|
17 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
18 |
-
*
|
|
|
|
|
19 |
* Requires at least: 4.0.15
|
20 |
-
* Tested up to: 4.
|
21 |
-
* Stable tag: 2.2.
|
22 |
**/
|
23 |
|
24 |
// Check for required PHP version
|
@@ -30,7 +32,6 @@ if ( preg_match( '#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'] ) ) {
|
|
30 |
die('You are not allowed to call this page directly.');
|
31 |
}
|
32 |
|
33 |
-
|
34 |
define( 'HESH_LIBS', plugins_url( '/dist/', __FILE__ ) );
|
35 |
|
36 |
class wp_html_editor_syntax {
|
@@ -41,21 +42,32 @@ class wp_html_editor_syntax {
|
|
41 |
add_action( 'wp_ajax_'.$this->formProcessName, array(&$this, 'hesh_options_form_process'));
|
42 |
add_action( 'admin_footer', array(&$this, 'hesh_output_form') );
|
43 |
}
|
44 |
-
|
45 |
// Enqueues scripts and styles for hesh.js
|
46 |
public function hesh_admin_enqueue_scripts () {
|
47 |
|
|
|
48 |
if (
|
49 |
!strstr($_SERVER['SCRIPT_NAME'], 'post.php') &&
|
50 |
!strstr($_SERVER['SCRIPT_NAME'], 'post-new.php') &&
|
51 |
!strstr($_SERVER['SCRIPT_NAME'], 'editor.php')
|
52 |
) return;
|
53 |
|
|
|
54 |
$plugData = get_plugin_data( __FILE__ ); // need this temporary var to support versions of php < 5.4
|
55 |
$ver = $plugData['Version'];
|
56 |
|
|
|
57 |
$min = strpos(home_url(), 'localhost') ? '' : '.min' ;
|
58 |
wp_enqueue_script( 'jquery');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
wp_enqueue_script( 'heshjs', HESH_LIBS.'hesh'.$min.'.js', array('jquery', 'editor'), $ver, true );
|
60 |
wp_enqueue_style( 'heshcss', HESH_LIBS.'hesh'.$min.'.css', false, $ver );
|
61 |
|
@@ -204,7 +216,6 @@ class wp_html_editor_syntax {
|
|
204 |
// error_log( $id . ': ' . $value['current'] . ': ' . isset($value['current']) ); // for debug
|
205 |
}
|
206 |
}
|
207 |
-
|
208 |
|
209 |
public function hesh_options_form_process() {
|
210 |
if (empty($_POST) || !wp_verify_nonce($_POST[$this->nonceSecretCode], $this->formProcessName)) {
|
@@ -343,7 +354,6 @@ class wp_html_editor_syntax {
|
|
343 |
endforeach;
|
344 |
$this->hesh_output_fieldset();
|
345 |
}
|
346 |
-
|
347 |
|
348 |
public function hesh_output_form() {
|
349 |
?>
|
2 |
|
3 |
|
4 |
/**
|
5 |
+
* @since 2.2.3
|
6 |
* @package HESH_plugin
|
7 |
*
|
8 |
* Plugin Name: HTML Editor Syntax Highlighter
|
15 |
* Author URI: http://bradford.digital/
|
16 |
* License: GPL-2.0+
|
17 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
18 |
+
* GitHub Branch: master
|
19 |
+
* GitHub Plugin URI: https://github.com/mukhortov/HESH-WordPress-Plugin
|
20 |
+
* Version: 2.2.3
|
21 |
* Requires at least: 4.0.15
|
22 |
+
* Tested up to: 4.9.1
|
23 |
+
* Stable tag: 2.2.3
|
24 |
**/
|
25 |
|
26 |
// Check for required PHP version
|
32 |
die('You are not allowed to call this page directly.');
|
33 |
}
|
34 |
|
|
|
35 |
define( 'HESH_LIBS', plugins_url( '/dist/', __FILE__ ) );
|
36 |
|
37 |
class wp_html_editor_syntax {
|
42 |
add_action( 'wp_ajax_'.$this->formProcessName, array(&$this, 'hesh_options_form_process'));
|
43 |
add_action( 'admin_footer', array(&$this, 'hesh_output_form') );
|
44 |
}
|
45 |
+
|
46 |
// Enqueues scripts and styles for hesh.js
|
47 |
public function hesh_admin_enqueue_scripts () {
|
48 |
|
49 |
+
// Load only on certin pages
|
50 |
if (
|
51 |
!strstr($_SERVER['SCRIPT_NAME'], 'post.php') &&
|
52 |
!strstr($_SERVER['SCRIPT_NAME'], 'post-new.php') &&
|
53 |
!strstr($_SERVER['SCRIPT_NAME'], 'editor.php')
|
54 |
) return;
|
55 |
|
56 |
+
// get the plugin version number for cache busting purposes
|
57 |
$plugData = get_plugin_data( __FILE__ ); // need this temporary var to support versions of php < 5.4
|
58 |
$ver = $plugData['Version'];
|
59 |
|
60 |
+
// load minified version if not a localhost dev account
|
61 |
$min = strpos(home_url(), 'localhost') ? '' : '.min' ;
|
62 |
wp_enqueue_script( 'jquery');
|
63 |
+
|
64 |
+
// dequeue the native WP code-editor and codemirror
|
65 |
+
if (wp_script_is( 'code-editor', 'enqueued' )) wp_dequeue_script( 'code-editor' );
|
66 |
+
if (wp_style_is( 'code-editor', 'enqueued' )) wp_dequeue_style( 'code-editor' );
|
67 |
+
if (wp_script_is( 'codemirror', 'enqueued' )) wp_dequeue_script( 'codemirror' );
|
68 |
+
if (wp_style_is( 'codemirror', 'enqueued' )) wp_dequeue_style( 'codemirror' );
|
69 |
+
|
70 |
+
// enqueue hesh scripts
|
71 |
wp_enqueue_script( 'heshjs', HESH_LIBS.'hesh'.$min.'.js', array('jquery', 'editor'), $ver, true );
|
72 |
wp_enqueue_style( 'heshcss', HESH_LIBS.'hesh'.$min.'.css', false, $ver );
|
73 |
|
216 |
// error_log( $id . ': ' . $value['current'] . ': ' . isset($value['current']) ); // for debug
|
217 |
}
|
218 |
}
|
|
|
219 |
|
220 |
public function hesh_options_form_process() {
|
221 |
if (empty($_POST) || !wp_verify_nonce($_POST[$this->nonceSecretCode], $this->formProcessName)) {
|
354 |
endforeach;
|
355 |
$this->hesh_output_fieldset();
|
356 |
}
|
|
|
357 |
|
358 |
public function hesh_output_form() {
|
359 |
?>
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: nixdns, arniebradfo, rraub, collinprice
|
|
3 |
Donate link: https://www.paypal.me/mukhortov/5
|
4 |
Tags: syntax highlighter, codemirror, text editor, code highlighter, code coloring, editor, html editor, theme editor, plugin editor, syntax, highlighting, highlighter, syntax highlighting, codemirror.js, code,
|
5 |
Requires at least: 4.0.15
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPL-2.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
3 |
Donate link: https://www.paypal.me/mukhortov/5
|
4 |
Tags: syntax highlighter, codemirror, text editor, code highlighter, code coloring, editor, html editor, theme editor, plugin editor, syntax, highlighting, highlighter, syntax highlighting, codemirror.js, code,
|
5 |
Requires at least: 4.0.15
|
6 |
+
Tested up to: 4.9.1
|
7 |
+
Stable tag: 2.2.3
|
8 |
License: GPL-2.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|