http://wordpress.org/extend/plugins/cke ... wordpress/
CKEDITOR.replace(ckeditorSettings.textarea_id, ckeditorSettings.configuration);
return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_REPLACE );
CKEDITOR.on( 'loaded', function()
{
// Run the full initialization for pending editors.
var pending = CKEDITOR.editor._pending;
if ( pending )
{
delete CKEDITOR.editor._pending;
for ( var i = 0 ; i < pending.length ; i++ )
pending[ i ]._init();
}
});
Re: CKEditor For WordPress not working for comments
plugins seems to be fine, it's a string with a bunch of plugins names separated by ','
Just before the call I use alert() to see what's inside plugins, but then nothing else happens.
As I can understand, this function should be called so that loadTheme() is called inside it. loadTheme() would call editorTheme.build(), that's defined in theme.js, and would build editor's HTML, store it in the variable "container", and then insert it to DOM.
So, why aren't plugins finishing to be loaded?
Re: CKEditor For WordPress not working for comments
I suspected the problem was not in the editor itself because it's tested in many platforms, while plugin files are still beta and less used, but I couldn't find it.
editor.config.extraPlugins has a bunch of plugins that aren't working. They don't seem to be added directly by the plugin, I couldn't find where they are coming from, but I found where they are being added.
In \ckeditor\_source\core\config.js, CKEDITOR.config.plugins defines these default plugins:
but editor.config.extraPlugins had these:
Wherever they are coming from, they are added in \ckeditor-for-wordpress\includes\ckeditor.utils.js, so we just need to comment the line that adds them to the editor:
//evt.editor.config.extraPlugins += (evt.editor.config.extraPlugins ? ','+externals.join(',') : externals.join(','));Commenting this line they stop being added. But there's still another plugin bugging, "find", so we also must remove it.
Still inside the "configLoaded" event listener, we add the folloing code:
ckeditorSettings.configuration['on'] = { configLoaded : function ( evt ) { // (...) var remove = "find"; evt.editor.config.removePlugins += (evt.editor.config.removePlugins ? ','+remove : remove); } }Using "removePlugins" property, all plugins listed there will be removed when plugins are loaded, and finally doing that the editor will load!
But there are still 2 other bugs. The plugin offers 3 toolbars: WordpressBasic, WordpressFull and Full, but Full is not working. I set it to use WordpressFull and worked fine.
Also, when reply is used and comment form is moved, the editor brokes. comment-reply.js must be hacked to remove the editor before the move, then brought back after it. There's a TinyMCE plugin that implements it, and CKEditor plugin has functions to "easily" load and unload the editor, so it must be easy to adapt.
Re: CKEditor For WordPress not working for comments
Are you experiencing this bug in fresh install of WordPress?
those "extra plugins":
eachSlice,all,any,collect,detect,findAll,grep,include,inGroupsOf,inject,invoke,max,min,partition,pluck,reject,sortBy,toArray,zip,size,inspect,find,select,member,entries,_reverse,_each,clear,first,last,compact,flatten,without,uniq,intersect,clone,toJSON
are taken from prototype.js that is included in the "redirection" plugin for example... try disabling other plugins to see where is it coming from.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: CKEditor For WordPress not working for comments
Re: CKEditor For WordPress not working for comments
Perhaps it's "redirection" if you're using it, if not, let's check the other plugins.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: CKEditor For WordPress not working for comments
http://wordpress.org/extend/plugins/tinymcecomments/
Re: CKEditor For WordPress not working for comments
I'll publish the code here for now and do some more tests, if anything new shows up I update it.
original \wp-includes\js\comment-reply.dev.js :
addComment = { moveForm : function(commId, parentId, respondId, postId) { var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID'); if ( ! comm || ! respond || ! cancel || ! parent ) return; t.respondId = respondId; postId = postId || false; if ( ! t.I('wp-temp-form-div') ) { div = document.createElement('div'); div.id = 'wp-temp-form-div'; div.style.display = 'none'; respond.parentNode.insertBefore(div, respond); } comm.parentNode.insertBefore(respond, comm.nextSibling); if ( post && postId ) post.value = postId; parent.value = parentId; cancel.style.display = ''; cancel.onclick = function() { var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId); if ( ! temp || ! respond ) return; t.I('comment_parent').value = '0'; temp.parentNode.insertBefore(respond, temp); temp.parentNode.removeChild(temp); this.style.display = 'none'; this.onclick = null; return false; } try { t.I('comment').focus(); } catch(e) {} return false; }, I : function(e) { return document.getElementById(e); } }updated to support CKEditor:
addComment = { moveForm : function(commId, parentId, respondId, postId) { var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID'); if ( ! comm || ! respond || ! cancel || ! parent ) return; ckeditorOff(); t.respondId = respondId; postId = postId || false; if ( ! t.I('wp-temp-form-div') ) { div = document.createElement('div'); div.id = 'wp-temp-form-div'; div.style.display = 'none'; respond.parentNode.insertBefore(div, respond); } comm.parentNode.insertBefore(respond, comm.nextSibling); if ( post && postId ) t.I('comment_post_ID').value = postId; t.I('comment_parent').value = parentId; cancel.style.display = ''; cancel.onclick = function() { var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId); if ( ! temp || ! respond ) return; ckeditorOff(); t.I('comment_parent').value = '0'; temp.parentNode.insertBefore(respond, temp); temp.parentNode.removeChild(temp); this.style.display = 'none'; this.onclick = null; ckeditorOn(); return false; } ckeditorOn() try { t.I('comment').focus(); } catch(e) {} return false; }, I : function(e) { return document.getElementById(e); } }Use this code in a file in ur plugin root folder named comment-reply.js, then add the following code inside ckeditor_wordpress.add_comment_js():
wp_deregister_script('comment-reply'); wp_register_script( 'comment-reply', plugin_dir_url(__FILE__). "comment-reply.js", array('ckeditor.utils'), '20090102');In a few tests it worked great, I can move comment form around and CKEditor continues working.
Re: CKEditor For WordPress not working for comments
http://Hikari.ws
Re: CKEditor For WordPress not working for comments