I have a problem with a hidden preview element in a CKEditor image plugin. I need a very simple image dialog with only an input field for the image source and a form with a button for loading the image. So I removed the unnecessary items using these custom configuration options:
CKEDITOR.on( 'dialogDefinition', function( ev )
{
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if ( dialogName == 'image' ){
dialogDefinition.removeContents( 'advanced' );
dialogDefinition.removeContents( 'Link' );
var infoTab = dialogDefinition.getContents( 'info' );
infoTab.remove( 'ratioLock' );
infoTab.remove( 'txtHeight' );
infoTab.remove( 'txtWidth' );
infoTab.remove( 'txtBorder');
infoTab.remove( 'txtHSpace');
infoTab.remove( 'txtVSpace');
infoTab.remove( 'cmbAlign' );
infoTab.remove( 'txtAlt' );
}
});
Problems begin when I try to hide the htmlPreview element. If I just add infoTab.remove( 'htmlPreview ' );, an error will occur: Uncaught TypeError: Cannot call method 'setStyle' of nulldue to code dependencies for the deleted item. I googled a lot, and it seems that there are two ways to solve this problem - manually edit the source code of the plugin as written there (
, - javascript image/dialogs/image.js, html-, .
, )
. , CSS , , .
, , , .
, . .
P.S. CKEditor - 3.6.4.