Hi guys, I am a bit stuck with this so it would be great if you could help. I am using Drupal 7 and Ckeditor 4.3. I am developing a site which has fmath equation editor integrated. I have disabled the image button, as I don't want end users being able to upload their own images. On the other hand, users can use fMath to insert equations. The way fMath handles equation insertion is by inserting a *img* tag. When users double click this image or when they right click over the image, they access the image properties dialog, where they can change source url of the image and few other things. On the url input text, they could change the source of the image so that they could insert their own images on the page, which is something I don't want. The have been working with two different unsuccessful approaches until now trying to solve this problem: 1. Removing elements from the dialog, as the URL input text on the dialog (and the alt text as well). 2. Trying to disable the dialog itself. I'd like to use a custom plugin to accomplish the desired behavior as I have different CKeditor profiles in Drupal. I haven't been successful. Do you know how could I handle this undesirable behavior?
Tue, 11/19/2013 - 20:21
#1

Ok, I ended up with something
Ok, I ended up with something like this: CKEDITOR.plugins.add( 'custom_doubleclick', { init: function( editor ) { // First part, dialogDefinition allow us to remove the // "Link" and "Advanced" tabs on the dialog CKEDITOR.on( 'dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if ( dialogName == 'image' ) { dialogDefinition.removeContents( 'Link' ); dialogDefinition.removeContents( 'advanced' ); } }); // Second part, it disables the textUrl and txtAlt input text boxes editor.on( 'dialogShow', function( ev ) { var dialog = ev.data; var dialogName = dialog.getName(); if ( dialogName == 'image' ) { //var dialog = CKEDITOR.dialog.getCurrent(); // Get a reference to the Link Info tab. console.log(dialog) dialog.getContentElement( 'info','txtUrl' ).disable(); dialog.getContentElement( 'info','txtAlt' ).disable(); } }); } });As you can see, I didn't disable the dialog itself, but the non useful elements. I hope this can help to someone else.