mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-18 23:44:29 -06:00
Rename class to SimpleMDE
This commit is contained in:
parent
2090a8f252
commit
d3c2661e7f
4
simplemde.min.js
vendored
4
simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
@ -418,16 +418,16 @@ var toolbar = [{
|
|||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface of Markdownify.
|
* Interface of SimpleMDE.
|
||||||
*/
|
*/
|
||||||
function Markdownify(options) {
|
function SimpleMDE(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
if (options.element) {
|
if (options.element) {
|
||||||
this.element = options.element;
|
this.element = options.element;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.toolbar = options.toolbar || Markdownify.toolbar;
|
options.toolbar = options.toolbar || SimpleMDE.toolbar;
|
||||||
// you can customize toolbar with object
|
// you can customize toolbar with object
|
||||||
// [{name: 'bold', shortcut: 'Ctrl-B', className: 'icon-bold'}]
|
// [{name: 'bold', shortcut: 'Ctrl-B', className: 'icon-bold'}]
|
||||||
|
|
||||||
@ -446,12 +446,12 @@ function Markdownify(options) {
|
|||||||
/**
|
/**
|
||||||
* Default toolbar elements.
|
* Default toolbar elements.
|
||||||
*/
|
*/
|
||||||
Markdownify.toolbar = toolbar;
|
SimpleMDE.toolbar = toolbar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default markdown render.
|
* Default markdown render.
|
||||||
*/
|
*/
|
||||||
Markdownify.markdown = function(text) {
|
SimpleMDE.markdown = function(text) {
|
||||||
if (window.marked) {
|
if (window.marked) {
|
||||||
// use marked as markdown parser
|
// use marked as markdown parser
|
||||||
return marked(text);
|
return marked(text);
|
||||||
@ -461,7 +461,7 @@ Markdownify.markdown = function(text) {
|
|||||||
/**
|
/**
|
||||||
* Render editor to the given element.
|
* Render editor to the given element.
|
||||||
*/
|
*/
|
||||||
Markdownify.prototype.render = function(el) {
|
SimpleMDE.prototype.render = function(el) {
|
||||||
if (!el) {
|
if (!el) {
|
||||||
el = this.element || document.getElementsByTagName('textarea')[0];
|
el = this.element || document.getElementsByTagName('textarea')[0];
|
||||||
}
|
}
|
||||||
@ -510,7 +510,7 @@ Markdownify.prototype.render = function(el) {
|
|||||||
this._rendered = this.element;
|
this._rendered = this.element;
|
||||||
};
|
};
|
||||||
|
|
||||||
Markdownify.prototype.createToolbar = function(items) {
|
SimpleMDE.prototype.createToolbar = function(items) {
|
||||||
items = items || this.options.toolbar;
|
items = items || this.options.toolbar;
|
||||||
|
|
||||||
if (!items || items.length === 0) {
|
if (!items || items.length === 0) {
|
||||||
@ -573,7 +573,7 @@ Markdownify.prototype.createToolbar = function(items) {
|
|||||||
return bar;
|
return bar;
|
||||||
};
|
};
|
||||||
|
|
||||||
Markdownify.prototype.createStatusbar = function(status) {
|
SimpleMDE.prototype.createStatusbar = function(status) {
|
||||||
status = status || this.options.status;
|
status = status || this.options.status;
|
||||||
|
|
||||||
if (!status || status.length === 0) return;
|
if (!status || status.length === 0) return;
|
||||||
@ -614,7 +614,7 @@ Markdownify.prototype.createStatusbar = function(status) {
|
|||||||
/**
|
/**
|
||||||
* Get or set the text content.
|
* Get or set the text content.
|
||||||
*/
|
*/
|
||||||
Markdownify.prototype.value = function(val) {
|
SimpleMDE.prototype.value = function(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.codemirror.getDoc().setValue(val);
|
this.codemirror.getDoc().setValue(val);
|
||||||
return this;
|
return this;
|
||||||
@ -627,51 +627,51 @@ Markdownify.prototype.value = function(val) {
|
|||||||
/**
|
/**
|
||||||
* Bind static methods for exports.
|
* Bind static methods for exports.
|
||||||
*/
|
*/
|
||||||
Markdownify.toggleBold = toggleBold;
|
SimpleMDE.toggleBold = toggleBold;
|
||||||
Markdownify.toggleItalic = toggleItalic;
|
SimpleMDE.toggleItalic = toggleItalic;
|
||||||
Markdownify.toggleBlockquote = toggleBlockquote;
|
SimpleMDE.toggleBlockquote = toggleBlockquote;
|
||||||
Markdownify.toggleUnOrderedList = toggleUnOrderedList;
|
SimpleMDE.toggleUnOrderedList = toggleUnOrderedList;
|
||||||
Markdownify.toggleOrderedList = toggleOrderedList;
|
SimpleMDE.toggleOrderedList = toggleOrderedList;
|
||||||
Markdownify.drawLink = drawLink;
|
SimpleMDE.drawLink = drawLink;
|
||||||
Markdownify.drawImage = drawImage;
|
SimpleMDE.drawImage = drawImage;
|
||||||
Markdownify.undo = undo;
|
SimpleMDE.undo = undo;
|
||||||
Markdownify.redo = redo;
|
SimpleMDE.redo = redo;
|
||||||
Markdownify.togglePreview = togglePreview;
|
SimpleMDE.togglePreview = togglePreview;
|
||||||
Markdownify.toggleFullScreen = toggleFullScreen;
|
SimpleMDE.toggleFullScreen = toggleFullScreen;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bind instance methods for exports.
|
* Bind instance methods for exports.
|
||||||
*/
|
*/
|
||||||
Markdownify.prototype.toggleBold = function() {
|
SimpleMDE.prototype.toggleBold = function() {
|
||||||
toggleBold(this);
|
toggleBold(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.toggleItalic = function() {
|
SimpleMDE.prototype.toggleItalic = function() {
|
||||||
toggleItalic(this);
|
toggleItalic(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.toggleBlockquote = function() {
|
SimpleMDE.prototype.toggleBlockquote = function() {
|
||||||
toggleBlockquote(this);
|
toggleBlockquote(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.toggleUnOrderedList = function() {
|
SimpleMDE.prototype.toggleUnOrderedList = function() {
|
||||||
toggleUnOrderedList(this);
|
toggleUnOrderedList(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.toggleOrderedList = function() {
|
SimpleMDE.prototype.toggleOrderedList = function() {
|
||||||
toggleOrderedList(this);
|
toggleOrderedList(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.drawLink = function() {
|
SimpleMDE.prototype.drawLink = function() {
|
||||||
drawLink(this);
|
drawLink(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.drawImage = function() {
|
SimpleMDE.prototype.drawImage = function() {
|
||||||
drawImage(this);
|
drawImage(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.undo = function() {
|
SimpleMDE.prototype.undo = function() {
|
||||||
undo(this);
|
undo(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.redo = function() {
|
SimpleMDE.prototype.redo = function() {
|
||||||
redo(this);
|
redo(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.togglePreview = function() {
|
SimpleMDE.prototype.togglePreview = function() {
|
||||||
togglePreview(this);
|
togglePreview(this);
|
||||||
};
|
};
|
||||||
Markdownify.prototype.toggleFullScreen = function() {
|
SimpleMDE.prototype.toggleFullScreen = function() {
|
||||||
toggleFullScreen(this);
|
toggleFullScreen(this);
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user