if (!far.length) {
if (fire_add) {
+ this.editor.syncValue();
editor.owner.fireEvent('editorevent', editor.owner, false);
editor.owner.fireEvent('imageadd', editor.owner, false);
}
var reader = new FileReader();
reader.addEventListener('load', (function() {
if (bl) {
+ var oldSrc = bl.image_src;
bl.image_src = reader.result;
//bl.caption = f.name;
bl.updateElement(sn);
+ this.editor.syncValue();
editor.owner.fireEvent('editorevent', editor.owner, false);
- editor.owner.fireEvent('imageupdate', editor.owner, sn);
+ editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc);
// we only do the first file!! and replace.
return;
}
}
// just a standard img..
if (sn && sn.tagName.toUpperCase() == 'IMG') {
+ var oldSrc = sn.src;
sn.src = reader.result;
+ this.editor.syncValue();
editor.owner.fireEvent('editorevent', editor.owner, false);
- editor.owner.fireEvent('imageupdate', editor.owner, sn);
+ editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc);
return;
}
editor.insertAtCursor('<img src="' + reader.result +'">');
}
if (url != '') {
this.selectedNode.setAttribute('href', newurl);
+ this.editor.syncValue();
return;
}
if(newurl && newurl .match(/http(s):\/\/.+/)) {
this.editorcore.relayCmd('createlink', newurl);
}
this.editorcore.focus();
- }
+ },
+ cls : this.editorcore.linkDialogCls
});
},
/**
selection.addRange(range);
this.updateToolbar(null, null, null);
if (sn.tagName.toUpperCase() == 'FIGURE') {
+ this.editor.syncValue();
this.editor.fireEvent('imagedelete', this.editor, sn);
}
selection.removeAllRanges();
selection.addRange(range);
if (sn.tagName.toUpperCase() == 'IMG"') {
+ this.editor.syncValue();
this.editor.fireEvent('imagedelete', this.editor, sn);
}