mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge 5b8a45b75c43b281ed171d98a2e0f3bbb6049bed into 6abda7ab68cc20f4aca870eb243747951b90ab04
This commit is contained in:
commit
990984f98b
@ -630,18 +630,17 @@ function drawLink(editor) {
|
|||||||
/**
|
/**
|
||||||
* Action for drawing an img.
|
* Action for drawing an img.
|
||||||
*/
|
*/
|
||||||
function drawImage(editor) {
|
function drawImage(editor, url) {
|
||||||
var cm = editor.codemirror;
|
var cm = editor.codemirror;
|
||||||
var stat = getState(cm);
|
var stat = getState(cm);
|
||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
var url = "http://";
|
|
||||||
if(options.promptURLs) {
|
if(options.promptURLs) {
|
||||||
url = prompt(options.promptTexts.image);
|
url = prompt(options.promptTexts.image);
|
||||||
if(!url) {
|
if(!url) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_replaceSelection(cm, stat.image, options.insertTexts.image, url);
|
_replaceSelection(cm, stat.image, options.insertTexts.image, url || "http://");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1947,8 +1946,8 @@ SimpleMDE.prototype.cleanBlock = function() {
|
|||||||
SimpleMDE.prototype.drawLink = function() {
|
SimpleMDE.prototype.drawLink = function() {
|
||||||
drawLink(this);
|
drawLink(this);
|
||||||
};
|
};
|
||||||
SimpleMDE.prototype.drawImage = function() {
|
SimpleMDE.prototype.drawImage = function(url) {
|
||||||
drawImage(this);
|
drawImage(this, url);
|
||||||
};
|
};
|
||||||
SimpleMDE.prototype.drawTable = function() {
|
SimpleMDE.prototype.drawTable = function() {
|
||||||
drawTable(this);
|
drawTable(this);
|
||||||
@ -2025,4 +2024,4 @@ SimpleMDE.prototype.toTextArea = function() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SimpleMDE;
|
module.exports = SimpleMDE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user