diff --git a/src/editor.js b/src/editor.js index c2e21a3..147ae0a 100644 --- a/src/editor.js +++ b/src/editor.js @@ -234,6 +234,7 @@ Editor.toggleUnOrderedList = toggleUnOrderedList; Editor.toggleOrderedList = toggleOrderedList; Editor.drawLink = drawLink; Editor.drawImage = drawImage; +Editor.drawImageUri = drawImageUri; Editor.undo = undo; Editor.redo = redo; Editor.togglePreview = togglePreview; @@ -263,6 +264,9 @@ Editor.prototype.drawLink = function() { Editor.prototype.drawImage = function() { drawImage(this); }; +Editor.prototype.drawImageUri = function() { + drawImageUri(this); +}; Editor.prototype.undo = function() { undo(this); }; diff --git a/src/intro.js b/src/intro.js index 53efe94..c870b83 100644 --- a/src/intro.js +++ b/src/intro.js @@ -190,6 +190,14 @@ function drawImage(editor) { _replaceSelection(cm, stat.image, '![', '](http://)'); } +/** + * Action for drawing an img with uri. + */ +function drawImageUri(editor,uri) { + var cm = editor.codemirror; + var stat = getState(cm); + _replaceSelection(cm, stat.image, '![', ']('+uri+')'); +} /** * Undo action.