Scripts n Styles - Version 3.1.1

Version Description

  • Add (fix) CodeMirror Themes
Download this release

Release Info

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

Code changes from version 3.1 to 3.1.1

README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Scripts n Styles ===
2
- Contributors: WraithKenny, Touvan
3
  Tags: admin, CSS, javascript, code, custom, Style
4
  Requires at least: 3.3
5
  Tested up to: 3.4-beta3
6
- Stable tag: 3.1
7
  License: GPLv3 or later
8
 
9
  This plugin allows Admin users to individually add custom CSS, Classes and JavaScript directly to Post, Pages or any other custom post types.
@@ -16,7 +16,9 @@ Admin's can also add classes to the TinyMCE "Formats" dropdown which users can u
16
 
17
  Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin's have access to even more sensitive areas by definition, so that should be relatively safe ;)
18
 
19
- A few notes about the implementation:
 
 
20
 
21
  * Admin users, or more specifically, *any user with the `manage_options` and `unfiltered_html` capabilities* (which by default is *only* the admin type user) can use this plugin's functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.
22
  * CSS Styles are embeded, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
@@ -52,6 +54,9 @@ Sure, if you are an Admin, just go to the plugin editor and wipe out the uninsta
52
 
53
  == Changelog ==
54
 
 
 
 
55
  = 3.1 =
56
  * Feature: Dynamic Shortcodes.
57
  * Feature: LESS.js support.
@@ -107,6 +112,9 @@ Sure, if you are an Admin, just go to the plugin editor and wipe out the uninsta
107
 
108
  == Upgrade Notice ==
109
 
 
 
 
110
  = 3.1 =
111
  New Features and Bug fixes
112
 
1
  === Scripts n Styles ===
2
+ Contributors: WraithKenny, CaptainN
3
  Tags: admin, CSS, javascript, code, custom, Style
4
  Requires at least: 3.3
5
  Tested up to: 3.4-beta3
6
+ Stable tag: 3.1.1
7
  License: GPLv3 or later
8
 
9
  This plugin allows Admin users to individually add custom CSS, Classes and JavaScript directly to Post, Pages or any other custom post types.
16
 
17
  Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin's have access to even more sensitive areas by definition, so that should be relatively safe ;)
18
 
19
+ ### Notes
20
+
21
+ About the implementation:
22
 
23
  * Admin users, or more specifically, *any user with the `manage_options` and `unfiltered_html` capabilities* (which by default is *only* the admin type user) can use this plugin's functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.
24
  * CSS Styles are embeded, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
54
 
55
  == Changelog ==
56
 
57
+ = 3.1.1 =
58
+ * Add (fix) CodeMirror Themes
59
+
60
  = 3.1 =
61
  * Feature: Dynamic Shortcodes.
62
  * Feature: LESS.js support.
112
 
113
  == Upgrade Notice ==
114
 
115
+ = 3.1.1 =
116
+ Add (fix) CodeMirror Themes
117
+
118
  = 3.1 =
119
  New Features and Bug fixes
120
 
includes/class.SnS_Admin.php CHANGED
@@ -22,6 +22,7 @@ class SnS_Admin
22
  */
23
  const OPTION_GROUP = 'scripts_n_styles';
24
  const MENU_SLUG = 'sns';
 
25
  static $parent_slug = '';
26
  /**#@-*/
27
 
22
  */
23
  const OPTION_GROUP = 'scripts_n_styles';
24
  const MENU_SLUG = 'sns';
25
+ static $cm_themes = array( 'default', 'ambiance', 'blackboard', 'cobalt', 'eclipse', 'elegant', 'lesser-dark', 'monokai', 'neat', 'night', 'rubyblue', 'xq-dark' );
26
  static $parent_slug = '';
27
  /**#@-*/
28
 
includes/class.SnS_Admin_Meta_Box.php CHANGED
@@ -289,8 +289,8 @@ class SnS_Admin_Meta_Box
289
  $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
290
  $cm_version = '2.4';
291
  wp_enqueue_style( 'codemirror', plugins_url( 'libraries/CodeMirror2/lib/codemirror.css', Scripts_n_Styles::$file), array(), $cm_version );
292
- if ( in_array( $cm_theme, array( 'cobalt', 'eclipse', 'elegant', 'monokai', 'neat', 'night', 'rubyblue' ) ) )
293
- wp_enqueue_style( "codemirror-$cm_theme", plugins_url( "libraries/CodeMirror2/theme/$cm_theme.css", Scripts_n_Styles::$file), array( 'codemirror' ), $cm_version );
294
  wp_enqueue_style( 'sns-meta-box-styles', plugins_url( 'css/meta-box-styles.css', Scripts_n_Styles::$file), array( 'codemirror' ), Scripts_n_Styles::VERSION );
295
  }
296
 
289
  $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
290
  $cm_version = '2.4';
291
  wp_enqueue_style( 'codemirror', plugins_url( 'libraries/CodeMirror2/lib/codemirror.css', Scripts_n_Styles::$file), array(), $cm_version );
292
+ if ( in_array( $cm_theme, SnS_Admin::$cm_themes ) && 'default' !== $cm_theme )
293
+ wp_enqueue_style( "codemirror_$cm_theme", plugins_url( "libraries/CodeMirror2/theme/$cm_theme.css", Scripts_n_Styles::$file), array( 'codemirror' ), $cm_version );
294
  wp_enqueue_style( 'sns-meta-box-styles', plugins_url( 'css/meta-box-styles.css', Scripts_n_Styles::$file), array( 'codemirror' ), Scripts_n_Styles::VERSION );
295
  }
296
 
includes/class.SnS_Global_Page.php CHANGED
@@ -33,7 +33,7 @@ class SnS_Global_Page
33
 
34
  wp_enqueue_style( 'sns-options-styles', plugins_url('css/options-styles.css', Scripts_n_Styles::$file), array( 'codemirror' ), Scripts_n_Styles::VERSION );
35
  wp_enqueue_style( 'codemirror', plugins_url( 'libraries/CodeMirror2/lib/codemirror.css', Scripts_n_Styles::$file), array(), $cm_version );
36
- if ( in_array( $cm_theme, array( 'cobalt', 'eclipse', 'elegant', 'lesser-dark', 'monokai', 'neat', 'night', 'rubyblue', 'xq-dark' ) ) )
37
  wp_enqueue_style( "codemirror-$cm_theme", plugins_url( "libraries/CodeMirror2/theme/$cm_theme.css", Scripts_n_Styles::$file), array( 'codemirror' ), $cm_version );
38
 
39
  wp_enqueue_script( 'sns-global-page-scripts', plugins_url('js/global-page.js', Scripts_n_Styles::$file), array( 'jquery', 'codemirror-less', 'codemirror-css', 'codemirror-javascript', 'less.js' ), Scripts_n_Styles::VERSION, true );
33
 
34
  wp_enqueue_style( 'sns-options-styles', plugins_url('css/options-styles.css', Scripts_n_Styles::$file), array( 'codemirror' ), Scripts_n_Styles::VERSION );
35
  wp_enqueue_style( 'codemirror', plugins_url( 'libraries/CodeMirror2/lib/codemirror.css', Scripts_n_Styles::$file), array(), $cm_version );
36
+ if ( in_array( $cm_theme, SnS_Admin::$cm_themes ) && 'default' !== $cm_theme )
37
  wp_enqueue_style( "codemirror-$cm_theme", plugins_url( "libraries/CodeMirror2/theme/$cm_theme.css", Scripts_n_Styles::$file), array( 'codemirror' ), $cm_version );
38
 
39
  wp_enqueue_script( 'sns-global-page-scripts', plugins_url('js/global-page.js', Scripts_n_Styles::$file), array( 'jquery', 'codemirror-less', 'codemirror-css', 'codemirror-javascript', 'less.js' ), Scripts_n_Styles::VERSION, true );
includes/class.SnS_Settings_Page.php CHANGED
@@ -40,8 +40,8 @@ class SnS_Settings_Page
40
  wp_enqueue_style( 'sns-options-styles', plugins_url('css/options-styles.css', Scripts_n_Styles::$file), array( 'codemirror' ), Scripts_n_Styles::VERSION );
41
  wp_enqueue_style( 'codemirror', plugins_url( 'libraries/CodeMirror2/lib/codemirror.css', Scripts_n_Styles::$file), array(), $cm_version );
42
 
43
- foreach ( array( 'cobalt', 'eclipse', 'elegant', 'lesser-dark', 'monokai', 'neat', 'night', 'rubyblue', 'xq-dark' ) as $theme )
44
- wp_enqueue_style( "codemirror-$theme", plugins_url( "libraries/CodeMirror2/theme/$theme.css", Scripts_n_Styles::$file), array( 'codemirror' ), $cm_version );
45
 
46
  wp_enqueue_script( 'sns-settings-page-scripts', plugins_url('js/settings-page.js', Scripts_n_Styles::$file), array( 'jquery', 'codemirror-less', 'codemirror-css', 'codemirror-javascript' ), Scripts_n_Styles::VERSION, true );
47
  wp_localize_script( 'sns-settings-page-scripts', 'codemirror_options', array( 'theme' => $cm_theme ) );
@@ -125,7 +125,7 @@ class SnS_Settings_Page
125
  array(
126
  'label_for' => 'cm_theme',
127
  'setting' => 'SnS_options',
128
- 'choices' => array( 'cobalt', 'eclipse', 'elegant', 'lesser-dark', 'monokai', 'neat', 'night', 'rubyblue', 'xq-dark' ),
129
  'default' => 'default',
130
  'legend' => __( 'Theme', 'scripts-n-styles' ),
131
  'layout' => 'horizontal',
40
  wp_enqueue_style( 'sns-options-styles', plugins_url('css/options-styles.css', Scripts_n_Styles::$file), array( 'codemirror' ), Scripts_n_Styles::VERSION );
41
  wp_enqueue_style( 'codemirror', plugins_url( 'libraries/CodeMirror2/lib/codemirror.css', Scripts_n_Styles::$file), array(), $cm_version );
42
 
43
+ foreach ( SnS_Admin::$cm_themes as $theme )
44
+ if ( 'default' !== $theme ) wp_enqueue_style( "codemirror-$theme", plugins_url( "libraries/CodeMirror2/theme/$theme.css", Scripts_n_Styles::$file), array( 'codemirror' ), $cm_version );
45
 
46
  wp_enqueue_script( 'sns-settings-page-scripts', plugins_url('js/settings-page.js', Scripts_n_Styles::$file), array( 'jquery', 'codemirror-less', 'codemirror-css', 'codemirror-javascript' ), Scripts_n_Styles::VERSION, true );
47
  wp_localize_script( 'sns-settings-page-scripts', 'codemirror_options', array( 'theme' => $cm_theme ) );
125
  array(
126
  'label_for' => 'cm_theme',
127
  'setting' => 'SnS_options',
128
+ 'choices' => SnS_Admin::$cm_themes,
129
  'default' => 'default',
130
  'legend' => __( 'Theme', 'scripts-n-styles' ),
131
  'layout' => 'horizontal',
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.1
9
  License: GPLv3 or later
10
  Text Domain: scripts-n-styles
11
  Network: true
@@ -49,7 +49,7 @@ Network: true
49
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
50
  * @author unFocus Projects
51
  * @link http://www.unfocus.com/ Author URI
52
- * @version 3.1
53
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
54
  * @copyright Copyright (c) 2010 - 2012, Kenneth Newman
55
  *
@@ -74,7 +74,7 @@ class Scripts_n_Styles
74
  /**#@+
75
  * @static
76
  */
77
- const VERSION = '3.1';
78
  static $file = __FILE__;
79
  /**#@-*/
80
 
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.1.1
9
  License: GPLv3 or later
10
  Text Domain: scripts-n-styles
11
  Network: true
49
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
50
  * @author unFocus Projects
51
  * @link http://www.unfocus.com/ Author URI
52
+ * @version 3.1.1
53
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
54
  * @copyright Copyright (c) 2010 - 2012, Kenneth Newman
55
  *
74
  /**#@+
75
  * @static
76
  */
77
+ const VERSION = '3.1.1';
78
  static $file = __FILE__;
79
  /**#@-*/
80