I use django and ckeditor to provide wysiwyg taste to TextEdits. I would like to use CKEditor file upload function (in filebrowser / image dialog), but the
You can register for the dialogDefinition event, and completely rewrite the upload tab, thus:
CKEDITOR.on('dialogDefinition', function (ev) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if (dialogName == 'image') {
dialogDefinition.removeContents('Upload');
dialogDefinition.addContents({
title: "Upload",
id: "upload",
label: "Upload",
elements: [{
type: "html",
html: ''
}]
});
}
});
This is an untested simplification of my real-world version, but hopefully it shows the idea.
This does not set the URL field in the image dialog, so clicking OK on the dialog will give you an error message. You will need to set that on a successful upload, thus:
CKEDITOR.dialog.getCurrent().getContentElement('info', 'txtUrl').setValue(theURL);