I just upgraded my ckEditor, and it's added a few options I don't want right now.
Of them are to browse images from files rather than just include them as urls. How do I remove those options?
I just upgraded my ckEditor, and it's added a few options I don't want right now.
Of them are to browse images from files rather than just include them as urls. How do I remove those options?
In your source HTML/JS file you'll have some code that replaces a textarea
with the CKEditor. It reads something like:
CKEDITOR.replace( 'editor1',
{
… /* parameters */
filebrowserUploadUrl : '/uploader/upload.php',
… /* other parameters */
});
If you delete the filebrowserUploadUrl
parameter (or empty the string assigned to it), the image upload tab will be gone.
Note that, apart from or instead of filebrowserUploadUrl
, you can also have a parameter called filebrowserImageUploadUrl
. In that case, you have to delete or empty this parameter as well.
See File Browser (Uploader) for more details.
Other solution
You can also customize every dialog:
By listening to the
dialogDefinition
event of CKEditor it's possible to customize the dialogs removing tabs or changing the default values.
So, if you want to remove the upload tab this way, just add the following code:
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;
if ( dialogName == 'image' ) {
// Remove upload tab
dialogDefinition.removeContents('Upload');
}
});
Just add this to your config.js . Good riddance.
CKEDITOR.on( 'dialogDefinition', function( ev ) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if ( dialogName == 'image' ) {
dialogDefinition.removeContents( 'Link' );
dialogDefinition.removeContents( 'advanced' );
dialogDefinition.removeContents( 'Upload' );
}
});