Are there docs for upgrading FCKEditor 2 integrations to CKEditor 3, specifically dealing with the API?
I'm looking to switch/upgrade to CKEditor 3 in Liferay, and to do that I need to remap a few functions using the CKEditor 3 API. Since Liferay uses FCKEditor 2, I think the switch/upgrade should be totally doable, but the hardest part for me right now is the perceivable lack of FCKEditor 2 API documentation (compared to 3's API docs). is there a good how-to for translating 2's API into 3's API? Maybe it's simple, maybe it's not, but I can't dig up much about it.
For instance, Liferay maps the following FCKEditor 2 API:
function getHTML() { return FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML(); } function getText() { return FCKeditorAPI.GetInstance("FCKeditor1").GetXHTML(); } function setHTML(value) { FCKeditorAPI.GetInstance("FCKeditor1").SetHTML(value); }
Can I confidently assume that this would be the CKEditor 3 API equivalent?
function getHTML() { return CKEDITOR.instances.editor1.getData(); } function getText() { return CKEDITOR.instances.editor1.getData(); } function setHTML(value) { CKEDITOR.instances.editor1.setData(value); }
Are there docs catered to help me along this process? Did I get it right? If I have var editor = CKEDITOR.replace('editor1'); can I write editor.setData(value); for even nicer shorthand? Experimentation is good education and all, but docs would be handy too.
As I move ahead, I'll start getting into more complicated configuration components, so I thought it would be best to ask now. Thanks in advance.
Jonathan
Re: Upgrading from API 2 to 3
Not that I know of.
I wrote a post about the differences if you want to use your own upload script, but I don't think that I have seen in any place a detailed explanation of all the differences between FCKeditor and CKEditor. I guess that it's too much work.
The fact is that the CKEditor docs is quite more extensive as you can see all the objects, properties, methods and now also the events. Instead in FCKeditor you had only whatever was explained in the wiki and the rest was left for you digging the source code. Anyway, don't forget the Developer's guide
Yes, if the instance is named "editor1"
Yes. Read all the docs at the wiki and then look at the samples. There's just one sample to show how to use the basic functions of the API.
Re: Upgrading from API 2 to 3
Thanks for your help. Is there an active IRC channel for this type of discussion? I have more questions.
For instance, does FCKConfig.ToolbarSets["liferay"] = [ stuff ]; become config.toolbar_liferay = [ stuff ];? At first glance, it seems incorrect that I would modify the name of the array like that.
Re: Upgrading from API 2 to 3