How to configure ckeditor 4.2 inline plugin as links?

If I want to add a tab to the link plugin, which approach works best? I do not want to change the release code, just overriding it with the version with my settings. Therefore, it is easy to update with new releases. Does CKEDITOR 4.2 have instructions for this? I use the new built-in toolbars.

If I get the source code, can I restore the release version without the link plugin? and then make an external plugin using my customized version of the link plugin?

+4
source share
1 answer

To do this, you must observe dialogDefinition :

CKEDITOR.on( 'dialogDefinition', function( evt ) { var dialog = evt.data; if ( dialog.name == 'link' ) { // Get dialog definition. var def = evt.data.definition; // Add some stuff to definition. def.addContents( { id: 'custom', label: 'My custom tab', elements: [ { id: 'myField1', type: 'text', label: 'My Text Field' }, { id: 'myField2', type: 'text', label: 'Another Text Field' } ] }); } } ); CKEDITOR.replace( 'editor1' ); 

You can also delete existing fields:

 var someTab = def.getContents( 'someTab' ); someTab.remove( 'someField' ); 

Or change them:

 var input = someTab.get( 'input' ); input[ 'default' ] = 'www.example.com'; 

Or event to delete the whole tab:

 def.removeContents( 'anotherTab' ); 
+9
source

Source: https://habr.com/ru/post/1496019/


All Articles