diff --git a/src/js/easymde.js b/src/js/easymde.js index c7d2b47..66d99b1 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -188,7 +188,11 @@ function createImageInput(editor) { imageInput.style.opacity = 0; imageInput.addEventListener('change', function(event) { for(var i=0; i= options.imageMaxSize) { var units = options.imageTexts.sizeUnits.split(','); alert(options.text.errorImageTooBig @@ -1186,9 +1207,9 @@ function uploadImage(file, options) { request.onload = function () { if(this.status === 200) { - console.log('image url: ' + window.location.origin + '/' + this.responseText); + onSuccess(window.location.origin + '/' + this.responseText); } else { - console.log('EasyMDE: Error ' + this.status + ' while importing image: ' + this.statusText.toString()); + onError(this.status, this.statusText.toString()); } }; } @@ -1430,6 +1451,8 @@ var toolbarBuiltInButtons = { var insertTexts = { link: ['[', '](#url#)'], image: ['![](', '#url#)'], + uploadedImage: ['![](#url#)', ''], + // uploadedImage: ['![](#url#)\n', ''], // TODO: New line insertion doesn't work here. table: ['', '\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n'], horizontalRule: ['', '\n\n-----\n\n'], };