mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-02 05:52:43 +02:00
Merge 2877d9563d
into e32fe3f91c
This commit is contained in:
commit
f9285b3b21
|
@ -632,17 +632,22 @@ function drawLink(editor) {
|
|||
/**
|
||||
* Action for drawing an img.
|
||||
*/
|
||||
function drawImage(editor) {
|
||||
function drawImage(editor,imageUrl) {
|
||||
var cm = editor.codemirror;
|
||||
var stat = getState(cm);
|
||||
var options = editor.options;
|
||||
var url = "http://";
|
||||
if(options.promptURLs) {
|
||||
if(options.onDrawImage && !imageUrl) {
|
||||
options.onDrawImage();
|
||||
return;
|
||||
}
|
||||
if(options.promptURLs) {
|
||||
url = prompt(options.promptTexts.image);
|
||||
if(!url) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
url = imageUrl || url;
|
||||
_replaceSelection(cm, stat.image, options.insertTexts.image, url);
|
||||
}
|
||||
|
||||
|
@ -2004,8 +2009,8 @@ SimpleMDE.prototype.cleanBlock = function() {
|
|||
SimpleMDE.prototype.drawLink = function() {
|
||||
drawLink(this);
|
||||
};
|
||||
SimpleMDE.prototype.drawImage = function() {
|
||||
drawImage(this);
|
||||
SimpleMDE.prototype.drawImage = function(url) {
|
||||
drawImage(this,url);
|
||||
};
|
||||
SimpleMDE.prototype.drawTable = function() {
|
||||
drawTable(this);
|
||||
|
|
Loading…
Reference in a new issue