Merge dc3c9b51c3bf95bbb1824f82573c6a70a4e2aebc into 6abda7ab68cc20f4aca870eb243747951b90ab04

This commit is contained in:
ucev 2017-04-01 12:42:13 +00:00 committed by GitHub
commit 8516757807
4 changed files with 18880 additions and 17677 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

18
dist/simplemde.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -618,6 +618,9 @@ function drawLink(editor) {
var stat = getState(cm);
var options = editor.options;
var url = "http://";
if(options.drawLink) {
options.drawLink(__drawLink(editor));
} else {
if(options.promptURLs) {
url = prompt(options.promptTexts.link);
if(!url) {
@ -626,6 +629,19 @@ function drawLink(editor) {
}
_replaceSelection(cm, stat.link, options.insertTexts.link, url);
}
}
/**
* Custom Action for drawing a link
* by ucev
*/
function __drawLink(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
return function(url) {
_replaceSelection(cm, stat.link, options.insertTexts.link, url);
};
}
/**
* Action for drawing an img.
@ -634,6 +650,9 @@ function drawImage(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
if(options.drawImage) {
options.drawImage(__drawImage(editor));
} else {
var url = "http://";
if(options.promptURLs) {
url = prompt(options.promptTexts.image);
@ -643,6 +662,19 @@ function drawImage(editor) {
}
_replaceSelection(cm, stat.image, options.insertTexts.image, url);
}
}
/**
* Custom Action for drawing am img.
* by ucev
*/
function __drawImage(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
return function(url) {
_replaceSelection(cm, stat.image, options.insertTexts.image, url);
};
}
/**
* Action for drawing a table.
@ -1242,7 +1274,7 @@ var toolbarBuiltInButtons = {
var insertTexts = {
link: ["[", "](#url#)"],
image: ["![](", "#url#)"],
image: ["![", "](#url#)"],
table: ["", "\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],
horizontalRule: ["", "\n\n-----\n\n"]
};