CKEditor for WordPress - Version 1.0.1

Version Description

  • 14.06.2010 =

  • Fixed usage of PHP short tag causing parse error

  • Fixed "Read more" button

  • Fixed issues when working with the qTranslate extension (unable to save edited content)

  • Fixed issues with saving configuration files when using file editor

Download this release

Release Info

Developer wiktor
Plugin Icon 128x128 CKEditor for WordPress
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

ckeditor_class.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  class ckeditor_wordpress {
3
- var $version = '1.0';
4
  var $default_options = array();
5
  var $options = array();
6
  var $ckeditor_path = "";
@@ -460,7 +460,7 @@ class ckeditor_wordpress {
460
  #content table.cke_editor { margin:0; }
461
  #content table.cke_editor tr td { padding:0;border:0; }
462
  </style>
463
- <?
464
  }
465
 
466
  function update_options($new_options, $error){
@@ -492,19 +492,25 @@ class ckeditor_wordpress {
492
 
493
  function file_editor(){
494
  $files=$this->get_writable_files();
 
 
 
 
495
  if(isset($_POST['file'])) {
496
  $file=$_POST['file'];
497
- } else {
 
498
  $keys=array_keys($files);
499
  $file=$keys[0];
500
  unset($keys);
501
  }
502
- $fp=fopen($files[$file], 'r+');
503
  if(isset($_POST['newcontent'])){
 
504
  $content = stripslashes($_POST['newcontent']);
505
  fwrite($fp, stripslashes($_POST['newcontent']));
506
  echo '<div class="updated"><p>' . __('Configuration updated!') . '</p></div>';
507
  } else {
 
508
  $content = fread($fp, filesize($files[$file]));
509
  }
510
  fclose($fp);
1
  <?php
2
  class ckeditor_wordpress {
3
+ var $version = '1.0.1';
4
  var $default_options = array();
5
  var $options = array();
6
  var $ckeditor_path = "";
460
  #content table.cke_editor { margin:0; }
461
  #content table.cke_editor tr td { padding:0;border:0; }
462
  </style>
463
+ <?php
464
  }
465
 
466
  function update_options($new_options, $error){
492
 
493
  function file_editor(){
494
  $files=$this->get_writable_files();
495
+ if(isset($_POST['file']) && !isset($files[$_POST['file']])) {
496
+ echo '<div class="error"><p>' . __('Invalid file!') . '</p></div>';
497
+ return;
498
+ }
499
  if(isset($_POST['file'])) {
500
  $file=$_POST['file'];
501
+ }
502
+ else {
503
  $keys=array_keys($files);
504
  $file=$keys[0];
505
  unset($keys);
506
  }
 
507
  if(isset($_POST['newcontent'])){
508
+ $fp=fopen($files[$file], 'w');
509
  $content = stripslashes($_POST['newcontent']);
510
  fwrite($fp, stripslashes($_POST['newcontent']));
511
  echo '<div class="updated"><p>' . __('Configuration updated!') . '</p></div>';
512
  } else {
513
+ $fp=fopen($files[$file], 'r');
514
  $content = fread($fp, filesize($files[$file]));
515
  }
516
  fclose($fp);
ckeditor_wordpress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CKEditor for WordPress
4
  Plugin URI: http://wordpress.ckeditor.com/
5
  Description: Replaces the default WordPress editor with <a href="http://ckeditor.com/"> CKEditor</a>
6
- Version: 1.0
7
  Author: CKSource, originally created by Dean Lee
8
  Author URI: http://cksource.com/
9
  */
3
  Plugin Name: CKEditor for WordPress
4
  Plugin URI: http://wordpress.ckeditor.com/
5
  Description: Replaces the default WordPress editor with <a href="http://ckeditor.com/"> CKEditor</a>
6
+ Version: 1.0.1
7
  Author: CKSource, originally created by Dean Lee
8
  Author URI: http://cksource.com/
9
  */
includes/ckeditor.utils.js CHANGED
@@ -81,6 +81,9 @@ jQuery(document).ready(function () {
81
  */
82
  if(typeof(qtrans_use) == 'function') {
83
  ckeditorSettings.textarea_id = 'qtrans_textarea_content';
 
 
 
84
  window.tinyMCE = (function () {
85
  var tinyMCE = {
86
  get : function (id) {
@@ -121,12 +124,13 @@ jQuery(document).ready(function () {
121
  ckeditorSettings.textarea_id = val;
122
  if(ckeditorSettings.autostart) {
123
  ckeditorOn();
 
 
124
  }
125
  }
126
  },
127
  triggerSave : function(param) {
128
  CKEDITOR.instances[ckeditorSettings.textarea_id].updateElement();
129
- qtrans_save(CKEDITOR.instances[ckeditorSettings.textarea_id].getData());
130
  }
131
 
132
  }
81
  */
82
  if(typeof(qtrans_use) == 'function') {
83
  ckeditorSettings.textarea_id = 'qtrans_textarea_content';
84
+ ckeditorSettings.configuration['on'].getData = function (evt) {
85
+ qtrans_save(evt.data.dataValue);
86
+ }
87
  window.tinyMCE = (function () {
88
  var tinyMCE = {
89
  get : function (id) {
124
  ckeditorSettings.textarea_id = val;
125
  if(ckeditorSettings.autostart) {
126
  ckeditorOn();
127
+ } else {
128
+ document.getElementById('qtrans_textarea_content').removeAttribute('style');
129
  }
130
  }
131
  },
132
  triggerSave : function(param) {
133
  CKEDITOR.instances[ckeditorSettings.textarea_id].updateElement();
 
134
  }
135
 
136
  }
plugins/wpmore/plugin.js CHANGED
@@ -70,6 +70,10 @@ CKEDITOR.plugins.add( 'wpmore',
70
  // Create the fake element that will be inserted into the document.
71
  // The trick is declaring it as an <hr>, so it will behave like a
72
  // block element (and in effect it behaves much like an <hr>).
 
 
 
 
73
  var fakeElement = editor.createFakeElement( new CKEDITOR.dom.comment( text ), 'cke_wordpress_' + text, 'hr' );
74
 
75
  // This is the trick part. We can't use editor.insertElement()
@@ -117,6 +121,10 @@ CKEDITOR.plugins.add( 'wpmore',
117
  {
118
  comment : function( value )
119
  {
 
 
 
 
120
  if ( value == 'more' )
121
  return editor.createFakeParserElement( new CKEDITOR.htmlParser.comment( value ), 'cke_wordpress_' + value, 'hr' );
122
 
70
  // Create the fake element that will be inserted into the document.
71
  // The trick is declaring it as an <hr>, so it will behave like a
72
  // block element (and in effect it behaves much like an <hr>).
73
+ if ( !CKEDITOR.dom.comment.prototype.getAttribute ) {
74
+ CKEDITOR.dom.comment.prototype.getAttribute = function() { return ''; };
75
+ CKEDITOR.dom.comment.prototype.attributes = { align : '' };
76
+ }
77
  var fakeElement = editor.createFakeElement( new CKEDITOR.dom.comment( text ), 'cke_wordpress_' + text, 'hr' );
78
 
79
  // This is the trick part. We can't use editor.insertElement()
121
  {
122
  comment : function( value )
123
  {
124
+ if ( !CKEDITOR.htmlParser.comment.prototype.getAttribute ) {
125
+ CKEDITOR.htmlParser.comment.prototype.getAttribute = function() { return ''; };
126
+ CKEDITOR.htmlParser.comment.prototype.attributes = { align : '' };
127
+ }
128
  if ( value == 'more' )
129
  return editor.createFakeParserElement( new CKEDITOR.htmlParser.comment( value ), 'cke_wordpress_' + value, 'hr' );
130
 
readme.txt CHANGED
@@ -57,6 +57,13 @@ Features:
57
 
58
  == Changelog ==
59
 
 
 
 
 
 
 
 
60
  = V1.0 - 11.06.2010 =
61
 
62
  * Updated CKEditor to 3.3.1
57
 
58
  == Changelog ==
59
 
60
+ = V1.0.1 - 14.06.2010 =
61
+
62
+ * Fixed usage of PHP short tag causing parse error
63
+ * Fixed "Read more" button
64
+ * Fixed issues when working with the qTranslate extension (unable to save edited content)
65
+ * Fixed issues with saving configuration files when using file editor
66
+
67
  = V1.0 - 11.06.2010 =
68
 
69
  * Updated CKEditor to 3.3.1