Hi there, i'm looking to modify onchange method for txtUrl in the infoTab of image.js. my code is something like this.
CKEDITOR.on('dialogDefinition', function(ev) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
if (dialogName == 'image') {
var infoTab = dialogDefinition.getContents('info');
var txtURLObj = locateObject(infoTab.elements, "txtUrl");
if (txtURLObj != null) {
txtURLObj.onChange = function() {
<code here>
}
}
}
}
In the onChange function, I got the original code from image.js and pasted in the <code here> section. However, the original code access some of the variables and method in image.js. I've failed to seek a way to access those variables and method when pasted in <code here>, for example. In the original code, the below bold methods or variable I failed to have access to.
var loader = CKEDITOR.document.getById(imagePreviewLoaderId);
original.on( 'load', onImgLoadEvent, dialog );
original.on( 'error', onImgLoadErrorEvent, dialog );
original.on( 'abort', onImgLoadErrorEvent, dialog );
Can anyone here shine me some light how I can access those variables so I can modify the method and add custom logic to them without breaking the original behavior?
Thank you so much!