WP Editor - Version 1.2.1

Version Description

  • Added feature to preserve scroll position in post editor on save and toggle between Visual/Text views
  • Added z-index fix for gutter when WordPress menu is collapsed
  • Added ability to edit .less files
  • Added ability to change the editor font size for plugin, theme and page/post editors
  • Fixed window resize issue with codemirror expanding past its boundaries
Download this release

Release Info

Developer benjaminprojas
Plugin Icon 128x128 WP Editor
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2 to 1.2.1

classes/WPEditor.php CHANGED
@@ -95,12 +95,12 @@ class WPEditor {
95
 
96
  // Check if the default allowed extensions for the plugin editor have been set and set if not
97
  if(!WPEditorSetting::getValue('plugin_editor_allowed_extensions')) {
98
- WPEditorSetting::setValue('plugin_editor_allowed_extensions', 'php~js~css~txt~htm~html~jpg~jpeg~png~gif~sql~po');
99
  }
100
 
101
  // Check if the default allowed extensions for the theme editor have been set and set if not
102
  if(!WPEditorSetting::getValue('theme_editor_allowed_extensions')) {
103
- WPEditorSetting::setValue('theme_editor_allowed_extensions', 'php~js~css~txt~htm~html~jpg~jpeg~png~gif~sql~po');
104
  }
105
 
106
  // Check if the upload plugin file option has been set and set if not
95
 
96
  // Check if the default allowed extensions for the plugin editor have been set and set if not
97
  if(!WPEditorSetting::getValue('plugin_editor_allowed_extensions')) {
98
+ WPEditorSetting::setValue('plugin_editor_allowed_extensions', 'php~js~css~txt~htm~html~jpg~jpeg~png~gif~sql~po~less');
99
  }
100
 
101
  // Check if the default allowed extensions for the theme editor have been set and set if not
102
  if(!WPEditorSetting::getValue('theme_editor_allowed_extensions')) {
103
+ WPEditorSetting::setValue('theme_editor_allowed_extensions', 'php~js~css~txt~htm~html~jpg~jpeg~png~gif~sql~po~less');
104
  }
105
 
106
  // Check if the upload plugin file option has been set and set if not
classes/WPEditorAdmin.php CHANGED
@@ -12,6 +12,7 @@ class WPEditorAdmin {
12
  $settings = add_menu_page(__('WP Editor Settings', 'wpeditor'), __('WP Editor', 'wpeditor'), $page_roles['settings'], 'wpeditor_admin', array('WPEditorAdmin', 'addSettingsPage'), $icon);
13
  }
14
  //add_submenu_page('wpeditor_admin', __('Sub Menu', 'wpeditor'), __('Orders', 'wpeditor'), $page_roles['orders'], 'wpeditor_admin', array('WPEditorAdmin', 'subMenuPage'));
 
15
  add_action('admin_print_styles-' . $settings, array('WPEditorAdmin', 'defaultStylesheetAndScript'));
16
  }
17
 
@@ -24,7 +25,9 @@ class WPEditorAdmin {
24
  $menu_slug = 'wpeditor_plugin';
25
  $wpeditor_plugin = add_plugins_page($page_title, $menu_title, $capability, $menu_slug, array('WPEditorPlugins', 'addPluginsPage'));
26
  add_action("load-$wpeditor_plugin", array('WPEditorPlugins', 'pluginsHelpTab'));
27
- add_action('admin_print_styles', array('WPEditorAdmin', 'editorStylesheetAndScripts'));
 
 
28
  }
29
 
30
  public function addThemesPage() {
@@ -37,7 +40,9 @@ class WPEditorAdmin {
37
  $wpeditor_themes = add_theme_page($page_title, $menu_title, $capability, $menu_slug, array('WPEditorThemes', 'addThemesPage'));
38
 
39
  add_action("load-$wpeditor_themes", array('WPEditorThemes', 'themesHelpTab'));
40
- add_action('admin_print_styles', array('WPEditorAdmin', 'editorStylesheetAndScripts'));
 
 
41
  }
42
 
43
  public function addSettingsPage() {
12
  $settings = add_menu_page(__('WP Editor Settings', 'wpeditor'), __('WP Editor', 'wpeditor'), $page_roles['settings'], 'wpeditor_admin', array('WPEditorAdmin', 'addSettingsPage'), $icon);
13
  }
14
  //add_submenu_page('wpeditor_admin', __('Sub Menu', 'wpeditor'), __('Orders', 'wpeditor'), $page_roles['orders'], 'wpeditor_admin', array('WPEditorAdmin', 'subMenuPage'));
15
+
16
  add_action('admin_print_styles-' . $settings, array('WPEditorAdmin', 'defaultStylesheetAndScript'));
17
  }
18
 
25
  $menu_slug = 'wpeditor_plugin';
26
  $wpeditor_plugin = add_plugins_page($page_title, $menu_title, $capability, $menu_slug, array('WPEditorPlugins', 'addPluginsPage'));
27
  add_action("load-$wpeditor_plugin", array('WPEditorPlugins', 'pluginsHelpTab'));
28
+ if(isset($_GET['page']) && $_GET['page'] == 'wpeditor_plugin') {
29
+ add_action('admin_print_styles', array('WPEditorAdmin', 'editorStylesheetAndScripts'));
30
+ }
31
  }
32
 
33
  public function addThemesPage() {
40
  $wpeditor_themes = add_theme_page($page_title, $menu_title, $capability, $menu_slug, array('WPEditorThemes', 'addThemesPage'));
41
 
42
  add_action("load-$wpeditor_themes", array('WPEditorThemes', 'themesHelpTab'));
43
+ if(isset($_GET['page']) && $_GET['page'] == 'wpeditor_themes') {
44
+ add_action('admin_print_styles', array('WPEditorAdmin', 'editorStylesheetAndScripts'));
45
+ }
46
  }
47
 
48
  public function addSettingsPage() {
classes/WPEditorPosts.php CHANGED
@@ -16,8 +16,11 @@ class WPEditorPosts {
16
  'lookupWord' => __('Enter a word to look up:', 'wpeditor'),
17
  'tabSize' => WPEditorSetting::getValue('enable_post_tab_size') ? WPEditorSetting::getValue('enable_post_tab_size') : 4,
18
  'indentWithTabs' => WPEditorSetting::getValue('enable_post_tab_size') == 'tabs' ? true : false,
19
- 'editorHeight' => WPEditorSetting::getValue('enable_post_editor_height') ? WPEditorSetting::getValue('enable_post_editor_height') : false
 
20
  );
 
 
21
  wp_enqueue_script('wp-editor-posts-jquery');
22
  wp_localize_script('wp-editor-posts-jquery', 'WPEPosts', $post_editor_settings);
23
  }
16
  'lookupWord' => __('Enter a word to look up:', 'wpeditor'),
17
  'tabSize' => WPEditorSetting::getValue('enable_post_tab_size') ? WPEditorSetting::getValue('enable_post_tab_size') : 4,
18
  'indentWithTabs' => WPEditorSetting::getValue('enable_post_tab_size') == 'tabs' ? true : false,
19
+ 'editorHeight' => WPEditorSetting::getValue('enable_post_editor_height') ? WPEditorSetting::getValue('enable_post_editor_height') : false,
20
+ 'fontSize' => WPEditorSetting::getValue("change_post_editor_font_size") ? WPEditorSetting::getValue("change_post_editor_font_size") . "px" : "12px"
21
  );
22
+ $admin = new WPEditorAdmin();
23
+ $admin->editorStylesheetAndScripts();
24
  wp_enqueue_script('wp-editor-posts-jquery');
25
  wp_localize_script('wp-editor-posts-jquery', 'WPEPosts', $post_editor_settings);
26
  }
extensions/codemirror/codemirror.css CHANGED
@@ -55,7 +55,7 @@
55
  }
56
  .CodeMirror-gutter {
57
  position: absolute; left: 0; top: 0;
58
- z-index: 10;
59
  background-color: #f7f7f7;
60
  border-right: 1px solid #eee;
61
  min-width: 2em;
55
  }
56
  .CodeMirror-gutter {
57
  position: absolute; left: 0; top: 0;
58
+ z-index: 1;
59
  background-color: #f7f7f7;
60
  border-right: 1px solid #eee;
61
  min-width: 2em;
extensions/codemirror/js/codemirror.js CHANGED
@@ -2055,7 +2055,7 @@ window.CodeMirror = (function() {
2055
  tabSize: 4,
2056
  keyMap: "default",
2057
  extraKeys: null,
2058
- electricChars: true,
2059
  autoClearEmptyLines: false,
2060
  onKeyEvent: null,
2061
  onDragEvent: null,
2055
  tabSize: 4,
2056
  keyMap: "default",
2057
  extraKeys: null,
2058
+ electricChars: false,
2059
  autoClearEmptyLines: false,
2060
  onKeyEvent: null,
2061
  onDragEvent: null,
images/less.png ADDED
Binary file
js/posts-jquery.js CHANGED
@@ -1,6 +1,9 @@
1
  editor_status = '';
2
  tags = {};
3
  (function($){
 
 
 
4
  $(window).load(function() {
5
  if(!isTinyMCE()) {
6
  setTimeout(setupPostEditor, 50);
@@ -165,6 +168,9 @@ tags = {};
165
  $('#content-html').attr('onclick','').unbind('click');
166
  $('#content-tmce').click(function() {
167
  if(editor_status !== 'tmce') {
 
 
 
168
  editor.toTextArea();
169
  switchEditors.switchto(this);
170
  editor_status = 'tmce';
@@ -174,24 +180,48 @@ tags = {};
174
  if(editor_status !== 'html') {
175
  switchEditors.switchto(this);
176
  postCodeMirror('content');
 
177
  editor_status = 'html';
178
  return false;
179
  }
180
  else {
 
181
  editor.toTextArea();
182
  postCodeMirror('content');
 
 
 
183
  return false;
184
  }
185
  })
186
- $('#publish').click(function() {
 
 
 
187
  editor.save();
188
  })
189
  })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  function setupPostEditor() {
191
  if(!isTinyMCE()) {
192
  if($('#content').is(':visible')) {
193
  if(!$('#content_parent').is(':visible')) {
194
  postCodeMirror('content');
 
195
  editor_status = 'html';
196
  }
197
  }
@@ -291,6 +321,7 @@ tags = {};
291
  'Esc': toggleFullscreenEditing
292
  }
293
  });
 
294
  if(activeLine) {
295
  var hlLine = editor.setLineClass(0, activeLine);
296
  }
@@ -303,7 +334,7 @@ tags = {};
303
  }
304
  }
305
  if(!$('.CodeMirror .quicktags-toolbar').length) {
306
- $('.CodeMirror').prepend('<div class="quicktags-toolbar">' +
307
  '<input type="button" id="wpe_qt_content_strong" class="wpe_ed_button" title="" value="b">' +
308
  '<input type="button" id="wpe_qt_content_em" class="wpe_ed_button" title="" value="i">' +
309
  '<input type="button" id="wpe_qt_content_link" class="wpe_ed_button" title="" value="link">' +
@@ -321,6 +352,7 @@ tags = {};
321
  '<input type="button" id="wpe_qt_content_fullscreen" class="ed_button" title="" value="fullscreen">' +
322
  '</div>'
323
  ).height($('.CodeMirror').height() + 33);
 
324
  editor.focus();
325
  }
326
  }
1
  editor_status = '';
2
  tags = {};
3
  (function($){
4
+ $(window).resize(function() {
5
+ $('.CodeMirror-scroll').height($('.CodeMirror-wrap').height() - $('#wp-editor-quicktags').height() - 3);
6
+ });
7
  $(window).load(function() {
8
  if(!isTinyMCE()) {
9
  setTimeout(setupPostEditor, 50);
168
  $('#content-html').attr('onclick','').unbind('click');
169
  $('#content-tmce').click(function() {
170
  if(editor_status !== 'tmce') {
171
+ var scrollPosition = editor.getScrollInfo();
172
+ document.cookie="scrollPositionX=" + scrollPosition.x;
173
+ document.cookie="scrollPositionY=" + scrollPosition.y;
174
  editor.toTextArea();
175
  switchEditors.switchto(this);
176
  editor_status = 'tmce';
180
  if(editor_status !== 'html') {
181
  switchEditors.switchto(this);
182
  postCodeMirror('content');
183
+ editor.scrollTo(getPositionCookie('scrollPositionX'), getPositionCookie('scrollPositionY'));
184
  editor_status = 'html';
185
  return false;
186
  }
187
  else {
188
+ var scrollPosition = editor.getScrollInfo();
189
  editor.toTextArea();
190
  postCodeMirror('content');
191
+ editor.scrollTo(scrollPosition.x, scrollPosition.y);
192
+ document.cookie="scrollPositionX=" + scrollPosition.x;
193
+ document.cookie="scrollPositionY=" + scrollPosition.y;
194
  return false;
195
  }
196
  })
197
+ $('#publish').click(function(e) {
198
+ var scrollPosition = editor.getScrollInfo();
199
+ document.cookie="scrollPositionX=" + scrollPosition.x;
200
+ document.cookie="scrollPositionY=" + scrollPosition.y;
201
  editor.save();
202
  })
203
  })
204
+ function getPositionCookie(key) {
205
+ currentcookie = document.cookie;
206
+ if(currentcookie.length > 0) {
207
+ firstidx = currentcookie.indexOf(key + "=");
208
+ if(firstidx != -1) {
209
+ firstidx = firstidx + key.length + 1;
210
+ lastidx = currentcookie.indexOf(";",firstidx);
211
+ if(lastidx == -1) {
212
+ lastidx = currentcookie.length;
213
+ }
214
+ return unescape(currentcookie.substring(firstidx, lastidx));
215
+ }
216
+ }
217
+ return "";
218
+ }
219
  function setupPostEditor() {
220
  if(!isTinyMCE()) {
221
  if($('#content').is(':visible')) {
222
  if(!$('#content_parent').is(':visible')) {
223
  postCodeMirror('content');
224
+ editor.scrollTo(getPositionCookie('scrollPositionX'), getPositionCookie('scrollPositionY'));
225
  editor_status = 'html';
226
  }
227
  }
321
  'Esc': toggleFullscreenEditing
322
  }
323
  });
324
+ $('.CodeMirror').css('font-size', WPEPosts.fontSize);
325
  if(activeLine) {
326
  var hlLine = editor.setLineClass(0, activeLine);
327
  }
334
  }
335
  }
336
  if(!$('.CodeMirror .quicktags-toolbar').length) {
337
+ $('.CodeMirror').prepend('<div id="wp-editor-quicktags" class="quicktags-toolbar">' +
338
  '<input type="button" id="wpe_qt_content_strong" class="wpe_ed_button" title="" value="b">' +
339
  '<input type="button" id="wpe_qt_content_em" class="wpe_ed_button" title="" value="i">' +
340
  '<input type="button" id="wpe_qt_content_link" class="wpe_ed_button" title="" value="link">' +
352
  '<input type="button" id="wpe_qt_content_fullscreen" class="ed_button" title="" value="fullscreen">' +
353
  '</div>'
354
  ).height($('.CodeMirror').height() + 33);
355
+ $('.CodeMirror-scroll').height($('.CodeMirror-wrap').height() - $('#wp-editor-quicktags').height() - 3);
356
  editor.focus();
357
  }
358
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpeditor.net/
4
  Tags: code editor, plugin editor, theme editor, page editor, post editor, pages, posts, html, codemirror, plugins, themes, editor, fancybox, post.php, post-new.php, ajax, syntax highlighting, html syntax highlighting
5
  Requires at least: 3.0
6
  Tested up to: 3.5
7
- Stable tag: 1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -69,6 +69,13 @@ Yes! While we don't have a need for further developers at this time, any financi
69
 
70
  == Changelog ==
71
 
 
 
 
 
 
 
 
72
  = 1.2 =
73
  * Added Save, Undo, Redo, Search, Find Next, Find Prev, Replace, Replace All and Fullscreen buttons to plugin/theme editors
74
  * Added ability to hide WP Editor menu icon from menu sidebar and move it to settings submenu
@@ -125,6 +132,13 @@ Yes! While we don't have a need for further developers at this time, any financi
125
 
126
  == Upgrade Notice ==
127
 
 
 
 
 
 
 
 
128
  = 1.2 =
129
  Compatibility with WordPress 3.5
130
  Added Save, Undo, Redo, Search, Find Next, Find Prev, Replace, Replace All and Fullscreen buttons to plugin/theme editors
4
  Tags: code editor, plugin editor, theme editor, page editor, post editor, pages, posts, html, codemirror, plugins, themes, editor, fancybox, post.php, post-new.php, ajax, syntax highlighting, html syntax highlighting
5
  Requires at least: 3.0
6
  Tested up to: 3.5
7
+ Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
69
 
70
  == Changelog ==
71
 
72
+ = 1.2.1 =
73
+ * Added feature to preserve scroll position in post editor on save and toggle between Visual/Text views
74
+ * Added z-index fix for gutter when WordPress menu is collapsed
75
+ * Added ability to edit .less files
76
+ * Added ability to change the editor font size for plugin, theme and page/post editors
77
+ * Fixed window resize issue with codemirror expanding past its boundaries
78
+
79
  = 1.2 =
80
  * Added Save, Undo, Redo, Search, Find Next, Find Prev, Replace, Replace All and Fullscreen buttons to plugin/theme editors
81
  * Added ability to hide WP Editor menu icon from menu sidebar and move it to settings submenu
132
 
133
  == Upgrade Notice ==
134
 
135
+ = 1.2.1 =
136
+ Added feature to preserve scroll position in post editor on save and toggle between Visual/Text views
137
+ Added z-index fix for gutter when WordPress menu is collapsed
138
+ Added ability to edit .less files
139
+ Added ability to change the editor font size for plugin, theme and page/post editors
140
+ Fixed window resize issue with codemirror expanding past its boundaries
141
+
142
  = 1.2 =
143
  Compatibility with WordPress 3.5
144
  Added Save, Undo, Redo, Search, Find Next, Find Prev, Replace, Replace All and Fullscreen buttons to plugin/theme editors
views/plugin-editor.php CHANGED
@@ -247,6 +247,7 @@
247
  'Esc': toggleFullscreenEditing
248
  } // set fullscreen options here
249
  });
 
250
  if(activeLine) {
251
  var hlLine = editor.setLineClass(0, activeLine);
252
  }
247
  'Esc': toggleFullscreenEditing
248
  } // set fullscreen options here
249
  });
250
+ $jq('.CodeMirror').css('font-size', '<?php echo WPEditorSetting::getValue("change_plugin_editor_font_size") ? WPEditorSetting::getValue("change_plugin_editor_font_size") . "px" : "12px"; ?>');
251
  if(activeLine) {
252
  var hlLine = editor.setLineClass(0, activeLine);
253
  }
views/settings.php CHANGED
@@ -216,6 +216,8 @@
216
  <label class="checkbox_label"><?php _e('.po', 'wpeditor'); ?></label>
217
  <input type="checkbox" name="theme_editor_allowed_extensions[]" value="pot" <?php echo in_array('pot', $allowed_extensions) ? 'checked="checked"' : '' ?>>
218
  <label class="checkbox_label"><?php _e('.pot', 'wpeditor'); ?></label>
 
 
219
  </li>
220
  <li class="indent description">
221
  <p><?php _e('Select which extensions you would like the theme editor browser to be able to access.', 'wpeditor'); ?></p>
@@ -223,6 +225,24 @@
223
  </ul>
224
  </div>
225
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  <div id="enable-theme-line-numbers" class="section">
227
  <div class="section-header">
228
  <h3><?php _e('Line Numbers', 'wpeditor'); ?></h3>
@@ -442,6 +462,8 @@
442
  <label class="checkbox_label"><?php _e('.po', 'wpeditor'); ?></label>
443
  <input type="checkbox" name="plugin_editor_allowed_extensions[]" value="pot" <?php echo in_array('pot', $allowed_extensions) ? 'checked="checked"' : '' ?>>
444
  <label class="checkbox_label"><?php _e('.pot', 'wpeditor'); ?></label>
 
 
445
  </li>
446
  <li class="indent description">
447
  <p><?php _e('Select which extensions you would like the plugin editor browser to be able to access.', 'wpeditor'); ?></p>
@@ -449,6 +471,24 @@
449
  </ul>
450
  </div>
451
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
  <div id="enable-plugin-line-numbers" class="section">
453
  <div class="section-header">
454
  <h3><?php _e('Line Numbers', 'wpeditor'); ?></h3>
@@ -642,6 +682,24 @@
642
  </ul>
643
  </div>
644
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645
  <div id="enable-post-line-numbers" class="section">
646
  <div class="section-header">
647
  <h3><?php _e('Line Numbers', 'wpeditor'); ?></h3>
216
  <label class="checkbox_label"><?php _e('.po', 'wpeditor'); ?></label>
217
  <input type="checkbox" name="theme_editor_allowed_extensions[]" value="pot" <?php echo in_array('pot', $allowed_extensions) ? 'checked="checked"' : '' ?>>
218
  <label class="checkbox_label"><?php _e('.pot', 'wpeditor'); ?></label>
219
+ <input type="checkbox" name="theme_editor_allowed_extensions[]" value="less" <?php echo in_array('less', $allowed_extensions) ? 'checked="checked"' : '' ?>>
220
+ <label class="checkbox_label"><?php _e('.less', 'wpeditor'); ?></label>
221
  </li>
222
  <li class="indent description">
223
  <p><?php _e('Select which extensions you would like the theme editor browser to be able to access.', 'wpeditor'); ?></p>
225
  </ul>
226
  </div>
227
  </div>
228
+ <div id="change-theme-editor-font-size" class="section">
229
+ <div class="section-header">
230
+ <h3><?php _e('Font Size', 'wpeditor'); ?></h3>
231
+ </div>
232
+ <div class="section-body">
233
+ <ul>
234
+ <li>
235
+ <label for="change_theme_editor_font_size"><?php _e('Change Font Size:', 'wpeditor'); ?></label>
236
+ </li>
237
+ <li class="indent">
238
+ <input class="small-text" name="change_theme_editor_font_size" value="<?php echo WPEditorSetting::getValue('change_theme_editor_font_size') ? WPEditorSetting::getValue('change_theme_editor_font_size') : 12; ?>" />
239
+ </li>
240
+ <li class="indent description">
241
+ <p><?php _e("This will set the font size in pixels for the theme editor.<br />Default: 12", 'wpeditor'); ?></p>
242
+ </li>
243
+ </ul>
244
+ </div>
245
+ </div>
246
  <div id="enable-theme-line-numbers" class="section">
247
  <div class="section-header">
248
  <h3><?php _e('Line Numbers', 'wpeditor'); ?></h3>
462
  <label class="checkbox_label"><?php _e('.po', 'wpeditor'); ?></label>
463
  <input type="checkbox" name="plugin_editor_allowed_extensions[]" value="pot" <?php echo in_array('pot', $allowed_extensions) ? 'checked="checked"' : '' ?>>
464
  <label class="checkbox_label"><?php _e('.pot', 'wpeditor'); ?></label>
465
+ <input type="checkbox" name="plugin_editor_allowed_extensions[]" value="less" <?php echo in_array('less', $allowed_extensions) ? 'checked="checked"' : '' ?>>
466
+ <label class="checkbox_label"><?php _e('.less', 'wpeditor'); ?></label>
467
  </li>
468
  <li class="indent description">
469
  <p><?php _e('Select which extensions you would like the plugin editor browser to be able to access.', 'wpeditor'); ?></p>
471
  </ul>
472
  </div>
473
  </div>
474
+ <div id="change-plugin-editor-font-size" class="section">
475
+ <div class="section-header">
476
+ <h3><?php _e('Font Size', 'wpeditor'); ?></h3>
477
+ </div>
478
+ <div class="section-body">
479
+ <ul>
480
+ <li>
481
+ <label for="change_plugin_editor_font_size"><?php _e('Change Font Size:', 'wpeditor'); ?></label>
482
+ </li>
483
+ <li class="indent">
484
+ <input class="small-text" name="change_plugin_editor_font_size" value="<?php echo WPEditorSetting::getValue('change_plugin_editor_font_size') ? WPEditorSetting::getValue('change_plugin_editor_font_size') : 12; ?>" />
485
+ </li>
486
+ <li class="indent description">
487
+ <p><?php _e("This will set the font size in pixels for the plugin editor.<br />Default: 12", 'wpeditor'); ?></p>
488
+ </li>
489
+ </ul>
490
+ </div>
491
+ </div>
492
  <div id="enable-plugin-line-numbers" class="section">
493
  <div class="section-header">
494
  <h3><?php _e('Line Numbers', 'wpeditor'); ?></h3>
682
  </ul>
683
  </div>
684
  </div>
685
+ <div id="change-post-editor-font-size" class="section">
686
+ <div class="section-header">
687
+ <h3><?php _e('Font Size', 'wpeditor'); ?></h3>
688
+ </div>
689
+ <div class="section-body">
690
+ <ul>
691
+ <li>
692
+ <label for="change_post_editor_font_size"><?php _e('Change Font Size:', 'wpeditor'); ?></label>
693
+ </li>
694
+ <li class="indent">
695
+ <input class="small-text" name="change_post_editor_font_size" value="<?php echo WPEditorSetting::getValue('change_post_editor_font_size') ? WPEditorSetting::getValue('change_post_editor_font_size') : 12; ?>" />
696
+ </li>
697
+ <li class="indent description">
698
+ <p><?php _e("This will set the font size in pixels for the post editor.<br />Default: 12", 'wpeditor'); ?></p>
699
+ </li>
700
+ </ul>
701
+ </div>
702
+ </div>
703
  <div id="enable-post-line-numbers" class="section">
704
  <div class="section-header">
705
  <h3><?php _e('Line Numbers', 'wpeditor'); ?></h3>
views/theme-editor.php CHANGED
@@ -254,6 +254,7 @@
254
  'Esc': toggleFullscreenEditing
255
  } // set fullscreen options here
256
  });
 
257
  if(activeLine) {
258
  var hlLine = editor.setLineClass(0, activeLine);
259
  }
254
  'Esc': toggleFullscreenEditing
255
  } // set fullscreen options here
256
  });
257
+ $jq('.CodeMirror').css('font-size', '<?php echo WPEditorSetting::getValue("change_theme_editor_font_size") ? WPEditorSetting::getValue("change_theme_editor_font_size") . "px" : "12px"; ?>');
258
  if(activeLine) {
259
  var hlLine = editor.setLineClass(0, activeLine);
260
  }
wpeditor.css CHANGED
@@ -210,6 +210,9 @@ li.indent {
210
  #plugin-editor-files .plugin-folders ul li.pot, #theme-editor-files .theme-folders ul li.pot {
211
  background:url('images/pot.png') 0px 0px no-repeat;
212
  }
 
 
 
213
  #plugin-editor-files .plugin-folders ul li.png, #theme-editor-files .theme-folders ul li.png {
214
  background:url('images/png.png') 0px 0px no-repeat;
215
  }
210
  #plugin-editor-files .plugin-folders ul li.pot, #theme-editor-files .theme-folders ul li.pot {
211
  background:url('images/pot.png') 0px 0px no-repeat;
212
  }
213
+ #plugin-editor-files .plugin-folders ul li.less, #theme-editor-files .theme-folders ul li.less {
214
+ background:url('images/less.png') 0px 0px no-repeat;
215
+ }
216
  #plugin-editor-files .plugin-folders ul li.png, #theme-editor-files .theme-folders ul li.png {
217
  background:url('images/png.png') 0px 0px no-repeat;
218
  }
wpeditor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Editor
4
  Plugin URI: http://wpeditor.net
5
  Description: This plugin modifies the default behavior of the WordPress plugin and theme editors.
6
- Version: 1.2
7
  Author: Benjamin Rojas
8
  Author URI: http://benjaminrojas.net
9
  Text Domain: wpeditor
3
  Plugin Name: WP Editor
4
  Plugin URI: http://wpeditor.net
5
  Description: This plugin modifies the default behavior of the WordPress plugin and theme editors.
6
+ Version: 1.2.1
7
  Author: Benjamin Rojas
8
  Author URI: http://benjaminrojas.net
9
  Text Domain: wpeditor