WP Add Custom CSS - Version 1.1.2

Version Description

  • Fixed CodeMirror compatibility issues
Download this release

Release Info

Developer danieledesantis
Plugin Icon 128x128 WP Add Custom CSS
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

Files changed (3) hide show
  1. js/scripts.js +2 -6
  2. readme.txt +7 -1
  3. wordpress-add-custom-css.php +7 -7
js/scripts.js CHANGED
@@ -1,4 +1,4 @@
1
- (function ($) {
2
  'use strict';
3
 
4
  $(document).ready(function(){
@@ -16,8 +16,4 @@
16
  var cssCodeMirror = CodeMirror.fromTextArea(document.getElementById(targetId), options);
17
  });
18
 
19
- $(window).on('load', function() {
20
-
21
- });
22
-
23
- })(jQuery);
1
+ (function ($, CodeMirror) {
2
  'use strict';
3
 
4
  $(document).ready(function(){
16
  var cssCodeMirror = CodeMirror.fromTextArea(document.getElementById(targetId), options);
17
  });
18
 
19
+ })(jQuery, CodeMirror);
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: danieledesantis
3
  Tags: css, custom css, style, styles, stylesheet, custom stylesheet, single post css, site css, single page css, custom post type css, product css
4
  Requires at least: 4.0
5
  Tested up to: 4.9.4
6
- Stable tag: 1.1.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -63,6 +63,9 @@ Click on the "Screen option" link from your post/page editing area and be sure t
63
 
64
  == Changelog ==
65
 
 
 
 
66
  = 1.1.1 =
67
  * Fixed uninstall hook
68
 
@@ -102,6 +105,9 @@ Click on the "Screen option" link from your post/page editing area and be sure t
102
 
103
  == Upgrade Notice ==
104
 
 
 
 
105
  = 1.1.1 =
106
  * Fixed uninstall hook
107
 
3
  Tags: css, custom css, style, styles, stylesheet, custom stylesheet, single post css, site css, single page css, custom post type css, product css
4
  Requires at least: 4.0
5
  Tested up to: 4.9.4
6
+ Stable tag: 1.1.2
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
63
 
64
  == Changelog ==
65
 
66
+ = 1.1.2 =
67
+ * Fixed CodeMirror compatibility issues
68
+
69
  = 1.1.1 =
70
  * Fixed uninstall hook
71
 
105
 
106
  == Upgrade Notice ==
107
 
108
+ = 1.1.2 =
109
+ * Fixed CodeMirror compatibility issues
110
+
111
  = 1.1.1 =
112
  * Fixed uninstall hook
113
 
wordpress-add-custom-css.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Add Custom CSS
4
  Plugin URI: http://www.danieledesantis.net
5
  Description: Add custom css to the whole website and to specific posts, pages and custom post types.
6
- Version: 1.1.1
7
  Author: Daniele De Santis
8
  Author URI: http://www.danieledesantis.net
9
  Text Domain: wp-add-custom-css
@@ -74,13 +74,13 @@ if(!class_exists('Wpacc'))
74
  if ( ( in_array( $hook, array('post.php', 'post-new.php') ) && $this->is_enabled_post_type() ) || $hook === 'toplevel_page_wp-add-custom-css_settings' ) {
75
  $this->options = get_option( 'wpacc_settings' );
76
  if ( isset($this->options['enable_advanced_editor']) ) {
77
- wp_enqueue_style( 'wpacc_codemirror', plugin_dir_url( __FILE__ ) . '/lib/codemirror/codemirror.css' );
78
  if ( isset($this->options['advanced_editor_theme']) && $this->options['advanced_editor_theme'] === 'dark' ) {
79
- wp_enqueue_style( 'wpacc_codemirror_dark', plugin_dir_url( __FILE__ ) . '/lib/codemirror/theme/tomorrow-night-bright.css', array('wpacc_codemirror') );
80
  }
81
- wp_enqueue_script( 'wpacc_codemirror', plugin_dir_url( __FILE__ ) . '/lib/codemirror/codemirror.js' );
82
- wp_enqueue_script( 'wpacc_codemirror_css', plugin_dir_url( __FILE__ ) . '/lib/codemirror/mode/css/css.js', array('wpacc_codemirror') );
83
- wp_enqueue_script( 'wpacc_scripts', plugin_dir_url( __FILE__ ) . '/js/scripts.js', array('jquery', 'wpacc_codemirror_css') );
84
  }
85
  }
86
  }
@@ -120,7 +120,7 @@ if(!class_exists('Wpacc'))
120
 
121
  public function add_menu() {
122
  global $wpacc_settings_page;
123
- $wpacc_settings_page = add_menu_page( __('Wordpress Add Custom CSS', 'wp-add-custom-css'), __('Add Custom CSS', 'wp-add-custom-css'), 'manage_options', 'wp-add-custom-css_settings', array($this, 'create_settings_page'), plugin_dir_url( __FILE__ ) . '/images/icon.png');
124
  }
125
 
126
  public function create_settings_page() {
3
  Plugin Name: WP Add Custom CSS
4
  Plugin URI: http://www.danieledesantis.net
5
  Description: Add custom css to the whole website and to specific posts, pages and custom post types.
6
+ Version: 1.1.2
7
  Author: Daniele De Santis
8
  Author URI: http://www.danieledesantis.net
9
  Text Domain: wp-add-custom-css
74
  if ( ( in_array( $hook, array('post.php', 'post-new.php') ) && $this->is_enabled_post_type() ) || $hook === 'toplevel_page_wp-add-custom-css_settings' ) {
75
  $this->options = get_option( 'wpacc_settings' );
76
  if ( isset($this->options['enable_advanced_editor']) ) {
77
+ wp_enqueue_style( 'wpacc_codemirror', plugin_dir_url( __FILE__ ) . 'lib/codemirror/codemirror.css' );
78
  if ( isset($this->options['advanced_editor_theme']) && $this->options['advanced_editor_theme'] === 'dark' ) {
79
+ wp_enqueue_style( 'wpacc_codemirror_dark', plugin_dir_url( __FILE__ ) . 'lib/codemirror/theme/tomorrow-night-bright.css', array('wpacc_codemirror') );
80
  }
81
+ wp_enqueue_script( 'wpacc_codemirror', plugin_dir_url( __FILE__ ) . 'lib/codemirror/codemirror.js' );
82
+ wp_enqueue_script( 'wpacc_codemirror_css', plugin_dir_url( __FILE__ ) . 'lib/codemirror/mode/css/css.js', array('wpacc_codemirror') );
83
+ wp_enqueue_script( 'wpacc_scripts', plugin_dir_url( __FILE__ ) . 'js/scripts.js', array('jquery', 'wpacc_codemirror_css') );
84
  }
85
  }
86
  }
120
 
121
  public function add_menu() {
122
  global $wpacc_settings_page;
123
+ $wpacc_settings_page = add_menu_page( __('Wordpress Add Custom CSS', 'wp-add-custom-css'), __('Add Custom CSS', 'wp-add-custom-css'), 'manage_options', 'wp-add-custom-css_settings', array($this, 'create_settings_page'), plugin_dir_url( __FILE__ ) . 'images/icon.png');
124
  }
125
 
126
  public function create_settings_page() {