I\'ve been looking at the API and I can not figure out how to open the image dialog with a default url. I use the execCommand
function, as follows:
To set default value, you got to use the dialogDefinition
event to modify dialog fields (see this answer: How do I programatically set default table properties for CKEditor?).
To change the value dynamically:
CKEDITOR.replace( 'editor1', {
extraPlugins: 'devtools', // useful for dialog development
on: {
dialogShow: function ( evt ) {
var dialog = evt.data;
if ( dialog.getName() == 'image' )
dialog.setValueOf( 'info', 'txtUrl', 'http://foo.com' );
}
}
});