|
|
|
@ -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.
|
|
|
|
|