Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10921 closed Bug (invalid)

ckeditor api used in 3.6.2 does not work in cke 4.0

Reported by: Rajasimhan Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Oracle Cc: pramod.agrawal@…, bharathi.mani@…, senthil.kumaran@…

Description

We are developing a custom plugin that has to work in both cke 3.6.3 and cke 4.0. But a particular line of code throws a js error in cke 4.0 while it works in cke 3.6.2. The line is shown below.

css : editor.skin.editor.css.concat( config.contentsCss ),

However when i replace the above line with the following line in cke 4.0 it works fine in cke 4.0. But the below line does not work in cke 3.6.2

css: [config.contentsCss, CKEDITOR.getUrl(CKEDITOR.skin.getPath('editor') + 'editor.css')],

Why is the code used in 3.6.3 not working in cke 4.0? I could not find editor.skin property in cke 3.6.2 documentation.

Can you suggest a code that works in both cke 3.6.2 and cke 4.0?

Thanks Rajasimhan

Change History (3)

comment:1 Changed 6 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

Why is the code used in 3.6.3 not working in cke 4.0? I could not find editor.skin property in cke 3.6.2 documentation.

Because these are two different major versions. Durring CKE 4.x design many features were changed, simplified or redesigned to allow things that weren't possible in CKEditor 3.x etc.

Can you suggest a code that works in both cke 3.6.2 and cke 4.0? I'm sorry but we can't. “Skin” is something that got redesigned in CKE 4.x. You can read about it here: http://docs.ckeditor.com/#!/guide/dev_api_changes.

This works in CKE 3.x
css : editor.skin.editor.css.concat( config.contentsCss ),
and these work in CKE 4.x
css: [ CKEDITOR.skin.getPath( 'editor' ) ].concat( config.contentsCss ),
css: [config.contentsCss, CKEDITOR.getUrl(CKEDITOR.skin.getPath('editor') + 'editor.css')],

The only option and IMHO most reasonable one is having two different repositories for custom plugins that you have created for CKE 3.x and 4.x.

comment:2 Changed 6 years ago by Jakub Ś

Custom plugins can use api specific (or even HTML version specific) hacks, tricks. Some may go deep inside version API to get desired behaviour. Please reconsider having two repositories for these plugins.

comment:3 Changed 6 years ago by Rajasimhan

Our app has multiple releases and one of the release uses cke 3.6.2 and another cke 4.0. We need to write common code that fits both the releases and so we cant have two repositories. We have implemented a branching logic that checks CKEDIITOR.Skin if it is undefined we use the 3.6.2 code and if it is available we used the 4.0 code.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy