Skip to content

Commit

Permalink
Change replaceTexts to insertTexts
Browse files Browse the repository at this point in the history
  • Loading branch information
Wes Cossick committed Nov 3, 2015
1 parent c1c8de5 commit 73e5e5f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions debug/simplemde.debug.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions debug/simplemde.js
Original file line number Diff line number Diff line change
Expand Up @@ -13065,7 +13065,7 @@ function drawLink(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.link, options.replaceTexts.link);
_replaceSelection(cm, stat.link, options.insertTexts.link);
}

/**
Expand All @@ -13075,7 +13075,7 @@ function drawImage(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.image, options.replaceTexts.image);
_replaceSelection(cm, stat.image, options.insertTexts.image);
}

/**
Expand All @@ -13085,7 +13085,7 @@ function drawHorizontalRule(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.image, options.replaceTexts.horizontalRule);
_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);
}


Expand Down Expand Up @@ -13574,7 +13574,7 @@ var toolbarBuiltInButtons = {
}
};

var replaceTexts = {
var insertTexts = {
link: ["[", "](http://)"],
image: ["![](http://", ")"],
horizontalRule: ["", "\n\n-----\n\n"]
Expand Down Expand Up @@ -13652,8 +13652,8 @@ function SimpleMDE(options) {
options.parsingConfig = options.parsingConfig || {};


// Merging the replaceTexts, with the given options
options.replaceTexts = extend({}, replaceTexts, options.replaceTexts || {});
// Merging the insertTexts, with the given options
options.insertTexts = extend({}, insertTexts, options.insertTexts || {});


// Update this options
Expand Down
12 changes: 6 additions & 6 deletions src/js/simplemde.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function drawLink(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.link, options.replaceTexts.link);
_replaceSelection(cm, stat.link, options.insertTexts.link);
}

/**
Expand All @@ -279,7 +279,7 @@ function drawImage(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.image, options.replaceTexts.image);
_replaceSelection(cm, stat.image, options.insertTexts.image);
}

/**
Expand All @@ -289,7 +289,7 @@ function drawHorizontalRule(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
_replaceSelection(cm, stat.image, options.replaceTexts.horizontalRule);
_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);
}


Expand Down Expand Up @@ -778,7 +778,7 @@ var toolbarBuiltInButtons = {
}
};

var replaceTexts = {
var insertTexts = {
link: ["[", "](http://)"],
image: ["![](http://", ")"],
horizontalRule: ["", "\n\n-----\n\n"]
Expand Down Expand Up @@ -856,8 +856,8 @@ function SimpleMDE(options) {
options.parsingConfig = options.parsingConfig || {};


// Merging the replaceTexts, with the given options
options.replaceTexts = extend({}, replaceTexts, options.replaceTexts || {});
// Merging the insertTexts, with the given options
options.insertTexts = extend({}, insertTexts, options.insertTexts || {});


// Update this options
Expand Down

0 comments on commit 73e5e5f

Please sign in to comment.