Scripts n Styles - Version 3.4.4

Version Description

  • Rename codemirror handle for compatibility
Download this release

Release Info

Developer WraithKenny
Plugin Icon wp plugin Scripts n Styles
Version 3.4.4
Comparing to
See all releases

Code changes from version 3.4.3 to 3.4.4

README.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: WraithKenny, CaptainN
3
  Tags: admin, CSS, javascript, code, custom, Style
4
  Requires at least: 4.7.2
5
- Tested up to: 4.8.1
6
- Stable tag: 3.4.3
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -58,6 +58,9 @@ Sure, if you are an Admin, just go to the plugin editor and wipe out the uninsta
58
 
59
  == Changelog ==
60
 
 
 
 
61
  = 3.4.3 =
62
  * No newline at end of file
63
  * Remove closing php tags
2
  Contributors: WraithKenny, CaptainN
3
  Tags: admin, CSS, javascript, code, custom, Style
4
  Requires at least: 4.7.2
5
+ Tested up to: 4.9
6
+ Stable tag: 3.4.4
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
58
 
59
  == Changelog ==
60
 
61
+ = 3.4.4 =
62
+ * Rename codemirror handle for compatibility
63
+
64
  = 3.4.3 =
65
  * No newline at end of file
66
  * Remove closing php tags
includes/class-sns-admin.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  require_once( 'class-sns-meta-box.php' );
11
- require_once( 'class-sns-code-editor.php' );
12
  require_once( 'class-sns-settings-page.php' );
13
  require_once( 'class-sns-usage-page.php' );
14
  require_once( 'class-sns-global-page.php' );
@@ -33,8 +33,8 @@ class SnS_Admin
33
  */
34
  static function init() {
35
  add_action( 'admin_menu', array( 'SnS_Admin_Meta_Box', 'init' ) );
36
- add_action( 'admin_menu', array( 'SnS_Admin_Code_Editor', 'init' ) );
37
- add_action( 'network_admin_menu', array( 'SnS_Admin_Code_Editor', 'init' ) );
38
 
39
  add_action( 'admin_menu', array( __CLASS__, 'menu' ) );
40
 
@@ -90,10 +90,8 @@ class SnS_Admin
90
  $options = get_option( 'SnS_options' );
91
  $page = $_REQUEST[ 'page' ];
92
  ?>
93
- <?php screen_icon(); ?>
94
  <h2>Scripts n Styles</h2>
95
  <?php if ( ! isset( $options[ 'menu_position' ] ) || 'options-general.php' != $options[ 'menu_position' ] ) settings_errors(); ?>
96
- <?php screen_icon( 'none' ); ?>
97
  <h3 class="nav-tab-wrapper">
98
  <a class="nav-tab<?php echo ( self::MENU_SLUG == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG ); ?>"><?php _e( 'Global', 'scripts-n-styles' ); ?></a>
99
  <a class="nav-tab<?php echo ( self::MENU_SLUG . '_hoops' == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG . '_hoops' ); ?>"><?php _e( 'Hoops', 'scripts-n-styles' ); ?></a>
@@ -201,4 +199,4 @@ class SnS_Admin
201
  return $actions;
202
  }
203
 
204
- }
8
  */
9
 
10
  require_once( 'class-sns-meta-box.php' );
11
+ // require_once( 'class-sns-code-editor.php' );
12
  require_once( 'class-sns-settings-page.php' );
13
  require_once( 'class-sns-usage-page.php' );
14
  require_once( 'class-sns-global-page.php' );
33
  */
34
  static function init() {
35
  add_action( 'admin_menu', array( 'SnS_Admin_Meta_Box', 'init' ) );
36
+ // add_action( 'admin_menu', array( 'SnS_Admin_Code_Editor', 'init' ) );
37
+ // add_action( 'network_admin_menu', array( 'SnS_Admin_Code_Editor', 'init' ) );
38
 
39
  add_action( 'admin_menu', array( __CLASS__, 'menu' ) );
40
 
90
  $options = get_option( 'SnS_options' );
91
  $page = $_REQUEST[ 'page' ];
92
  ?>
 
93
  <h2>Scripts n Styles</h2>
94
  <?php if ( ! isset( $options[ 'menu_position' ] ) || 'options-general.php' != $options[ 'menu_position' ] ) settings_errors(); ?>
 
95
  <h3 class="nav-tab-wrapper">
96
  <a class="nav-tab<?php echo ( self::MENU_SLUG == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG ); ?>"><?php _e( 'Global', 'scripts-n-styles' ); ?></a>
97
  <a class="nav-tab<?php echo ( self::MENU_SLUG . '_hoops' == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG . '_hoops' ); ?>"><?php _e( 'Hoops', 'scripts-n-styles' ); ?></a>
199
  return $actions;
200
  }
201
 
202
+ }
includes/class-sns-code-editor.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Admin_Code_Editor
4
- */
5
-
6
- class SnS_Admin_Code_Editor
7
- {
8
- /**
9
- * Initializing method.
10
- */
11
- static function init() {
12
- add_action( 'admin_head-theme-editor.php', array( __CLASS__, 'styles' ) );
13
- add_action( 'admin_head-plugin-editor.php', array( __CLASS__, 'styles' ) );
14
- add_filter( 'editable_extensions', array( __CLASS__, 'extend' ) );
15
- }
16
-
17
- static function extend( $editable_extensions ) {
18
- $editable_extensions[] = 'less';
19
- $editable_extensions[] = 'coffee';
20
- $editable_extensions[] = 'md';
21
- return $editable_extensions;
22
- }
23
-
24
- static function styles() {
25
- $options = get_option( 'SnS_options' );
26
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
27
- wp_enqueue_style( 'sns-code-editor' );
28
- wp_enqueue_script( 'sns-code-editor' );
29
- wp_localize_script( 'sns-code-editor', 'codemirror_options', array( 'theme' => $cm_theme ) );
30
- wp_localize_script( 'sns-code-editor', 'sns_plugin_editor_options', array(
31
- 'action' => 'sns_plugin_editor',
32
- 'nonce' => wp_create_nonce( 'sns_plugin_editor')
33
- ) );
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts-n-styles.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.unfocus.com/projects/scripts-n-styles/
5
  Description: Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
6
  Author: unFocus Projects
7
  Author URI: http://www.unfocus.com/
8
- Version: 3.4.3
9
  License: GPLv3 or later
10
  Text Domain: scripts-n-styles
11
  */
@@ -60,7 +60,7 @@ endif;
60
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
61
  * @author unFocus Projects
62
  * @link http://www.unfocus.com/ Author URI
63
- * @version 3.4.3
64
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
65
  * @copyright Copyright (c) 2010 - 2017, Kenneth Newman
66
  * @copyright Copyright (c) 2012, Kevin Newman
@@ -78,7 +78,7 @@ class Scripts_n_Styles
78
  /**#@+
79
  * @static
80
  */
81
- const VERSION = '3.4.3';
82
  static $file = __FILE__;
83
  static $cm_themes = array( 'default', '3024-day', '3024-night', 'ambiance',
84
  'base16-dark', 'base16-light',
@@ -220,7 +220,7 @@ class Scripts_n_Styles
220
  'user-suggest', 'admin-bar', 'wplink', 'wpdialogs', 'wpdialogs-popup', 'word-count', 'media-upload', 'hoverIntent', 'customize-base',
221
  'customize-loader', 'customize-preview', 'customize-controls', 'accordion', 'shortcode', 'media-models', 'media-views',
222
  'media-editor', 'mce-view', 'less.js', 'coffeescript', 'chosen', 'coffeelint', 'mustache', 'html5shiv', 'html5shiv-printshiv',
223
- 'google-diff-match-patch', 'codemirror'
224
  );
225
  }
226
  static function register() {
@@ -237,21 +237,21 @@ class Scripts_n_Styles
237
  //wp_register_script( 'html5shiv-printshiv', $vendor . 'html5shiv-printshiv.js', array(), '3.6.2' );
238
 
239
  //wp_register_script( 'google-diff-match-patch', $vendor . 'codemirror/diff_match_patch.js', array() );
240
- wp_register_script( 'codemirror', $vendor . 'codemirror/codemirror-compressed.js', array( /*'google-diff-match-patch'*/ ), '3.16' );
241
- wp_register_style( 'codemirror', $vendor . 'codemirror/codemirror-compressed.css', array(), '3.16' );
242
 
243
  $js = $dir . 'js/';
244
- wp_register_script( 'sns-global-page', $js . 'global-page.js', array( 'jquery', 'codemirror', 'less.js', 'coffeescript', 'chosen' ), self::VERSION, true );
245
- wp_register_script( 'sns-theme-page', $js . 'theme-page.js', array( 'jquery', 'codemirror', 'less.js', ), self::VERSION, true );
246
- wp_register_script( 'sns-hoops-page', $js . 'hoops-page.js', array( 'jquery', 'codemirror' ), self::VERSION, true );
247
- wp_register_script( 'sns-settings-page', $js . 'settings-page.js', array( 'jquery', 'codemirror' ), self::VERSION, true );
248
- wp_register_script( 'sns-meta-box', $js . 'meta-box.js', array( 'editor', 'jquery-ui-tabs', 'codemirror', 'chosen' ), self::VERSION, true );
249
- wp_register_script( 'sns-code-editor', $js . 'code-editor.js', array( 'editor', 'jquery-ui-tabs', 'codemirror' ), self::VERSION, true );
250
 
251
  $css = $dir . 'css/';
252
- wp_register_style( 'sns-options', $css . 'options-styles.css', array( 'codemirror' ), self::VERSION );
253
- wp_register_style( 'sns-meta-box', $css . 'meta-box.css', array( 'codemirror' ), self::VERSION );
254
- wp_register_style( 'sns-code-editor', $css . 'code-editor.css', array( 'codemirror' ), self::VERSION );
255
  }
256
 
257
  /**
@@ -478,4 +478,4 @@ class SnS_Widget extends WP_Widget
478
  <p><input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox" <?php checked( isset( $instance[ 'filter' ] ) ? $instance[ 'filter' ] : 0 ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs' ); ?></label></p>
479
  <?php
480
  }
481
- }
5
  Description: Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
6
  Author: unFocus Projects
7
  Author URI: http://www.unfocus.com/
8
+ Version: 3.4.4
9
  License: GPLv3 or later
10
  Text Domain: scripts-n-styles
11
  */
60
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
61
  * @author unFocus Projects
62
  * @link http://www.unfocus.com/ Author URI
63
+ * @version 3.4.4
64
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
65
  * @copyright Copyright (c) 2010 - 2017, Kenneth Newman
66
  * @copyright Copyright (c) 2012, Kevin Newman
78
  /**#@+
79
  * @static
80
  */
81
+ const VERSION = '3.4.4';
82
  static $file = __FILE__;
83
  static $cm_themes = array( 'default', '3024-day', '3024-night', 'ambiance',
84
  'base16-dark', 'base16-light',
220
  'user-suggest', 'admin-bar', 'wplink', 'wpdialogs', 'wpdialogs-popup', 'word-count', 'media-upload', 'hoverIntent', 'customize-base',
221
  'customize-loader', 'customize-preview', 'customize-controls', 'accordion', 'shortcode', 'media-models', 'media-views',
222
  'media-editor', 'mce-view', 'less.js', 'coffeescript', 'chosen', 'coffeelint', 'mustache', 'html5shiv', 'html5shiv-printshiv',
223
+ 'google-diff-match-patch', 'sns-codemirror'
224
  );
225
  }
226
  static function register() {
237
  //wp_register_script( 'html5shiv-printshiv', $vendor . 'html5shiv-printshiv.js', array(), '3.6.2' );
238
 
239
  //wp_register_script( 'google-diff-match-patch', $vendor . 'codemirror/diff_match_patch.js', array() );
240
+ wp_register_script( 'sns-codemirror', $vendor . 'codemirror/codemirror-compressed.js', array( /*'google-diff-match-patch'*/ ), '3.16' );
241
+ wp_register_style( 'sns-codemirror', $vendor . 'codemirror/codemirror-compressed.css', array(), '3.16' );
242
 
243
  $js = $dir . 'js/';
244
+ wp_register_script( 'sns-global-page', $js . 'global-page.js', array( 'jquery', 'sns-codemirror', 'less.js', 'coffeescript', 'chosen' ), self::VERSION, true );
245
+ wp_register_script( 'sns-theme-page', $js . 'theme-page.js', array( 'jquery', 'sns-codemirror', 'less.js', ), self::VERSION, true );
246
+ wp_register_script( 'sns-hoops-page', $js . 'hoops-page.js', array( 'jquery', 'sns-codemirror' ), self::VERSION, true );
247
+ wp_register_script( 'sns-settings-page', $js . 'settings-page.js', array( 'jquery', 'sns-codemirror' ), self::VERSION, true );
248
+ wp_register_script( 'sns-meta-box', $js . 'meta-box.js', array( 'editor', 'jquery-ui-tabs', 'sns-codemirror', 'chosen' ), self::VERSION, true );
249
+ wp_register_script( 'sns-code-editor', $js . 'code-editor.js', array( 'editor', 'jquery-ui-tabs', 'sns-codemirror' ), self::VERSION, true );
250
 
251
  $css = $dir . 'css/';
252
+ wp_register_style( 'sns-options', $css . 'options-styles.css', array( 'sns-codemirror' ), self::VERSION );
253
+ wp_register_style( 'sns-meta-box', $css . 'meta-box.css', array( 'sns-codemirror' ), self::VERSION );
254
+ wp_register_style( 'sns-code-editor', $css . 'code-editor.css', array( 'sns-codemirror' ), self::VERSION );
255
  }
256
 
257
  /**
478
  <p><input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox" <?php checked( isset( $instance[ 'filter' ] ) ? $instance[ 'filter' ] : 0 ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs' ); ?></label></p>
479
  <?php
480
  }
481
+ }