Hi,
I want to use colorbox inline image, which can be done using http://website-design.operationenterprise.com/articles/website-development/colorbox-ckeditor-drupal-7, but I want to automate the the process for it to be user friendly.
The code I used
CKEDITOR.on( 'dialogDefinition', function( ev ) { // Take the dialog name and its definition from the event data. var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; // Check if the definition is from the dialog window you are interested in (the "Image" dialog window). if ( dialogName == 'image' ) { var linkTab = dialogDefinition.getContents( 'info' ); var link = linkTab.get( 'txtUrl' ); link['onChange'] = function(evt){ var dialog = CKEDITOR.dialog.getCurrent(); dialog.getContentElement('Link', 'txtUrl').setValue(dialog.getContentElement('info', 'txtUrl').getValue()); } if ( dialogName == 'link' ) { // Get a reference to the "Link Info" tab. var infoTab = dialogDefinition.getContents( 'advanced' ); // Set the default value for the URL field. var cssField = infoTab.get( 'advCSSClasses' ); cssField['default'] = 'colorbox-load'; } } });
From Drupal forums.
Copying url in image-link tab tab worked fine but setting default css in Link dialog didnot.
I am no Java developer, so What am i doing wrong
Thanks