diff --git a/src/js/easymde.js b/src/js/easymde.js index ee5ad80..3ff39a0 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -708,9 +708,8 @@ function drawImage(editor) { * @param editor {EasyMDE} The EasyMDE object */ function drawUploadedImage(editor) { - // TODO: Draw the image template with a fake url, ie: '![](importing foo.png...)' - var imageInput = editor.gui.toolbar.getElementsByClassName('imageInput')[0]; - imageInput.dispatchEvent(new MouseEvent('click')); + // TODO: Draw the image template with a fake url? ie: '![](importing foo.png...)' + editor.openBrowseFileWindow(); } /** @@ -1612,20 +1611,17 @@ function EasyMDE(options) { * - drag&drop; * - copy-paste; * - the browse-file window (opened when the user clicks on the *upload-image* icon). - * @param {FileList} files The files to upload the the server. + * @param [onSuccess] {function} see EasyMDE.prototype.uploadImage + * @param [onError] {function} see EasyMDE.prototype.uploadImage */ -EasyMDE.prototype.uploadImages = function(files) { +EasyMDE.prototype.uploadImages = function(files, onSuccess, onError) { var names = []; - var self = this; for(var i=0; i