mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-18 23:44:29 -06:00
Update CodeMirror; Add three state methods
This commit is contained in:
parent
6215739a60
commit
efc38f43da
10
README.md
10
README.md
@ -211,6 +211,16 @@ simplemde.codemirror.on("change", function(){
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## State methods
|
||||||
|
The following methods will let you check on the state of the editor.
|
||||||
|
|
||||||
|
```
|
||||||
|
var simplemde = new SimpleMDE();
|
||||||
|
simplemde.isPreviewActive();
|
||||||
|
simplemde.isSideBySideActive();
|
||||||
|
simplemde.isFullscreenActive();
|
||||||
|
```
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
SimpleMDE is an improvement of [lepture's Editor project](https://github.com/lepture/editor) and includes a great many number of changes. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fortawesome.github.io/Font-Awesome/).
|
SimpleMDE is an improvement of [lepture's Editor project](https://github.com/lepture/editor) and includes a great many number of changes. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fortawesome.github.io/Font-Awesome/).
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -9909,7 +9909,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
|
|||||||
|
|
||||||
// THE END
|
// THE END
|
||||||
|
|
||||||
CodeMirror.version = "5.7.1";
|
CodeMirror.version = "5.8.1";
|
||||||
|
|
||||||
return CodeMirror;
|
return CodeMirror;
|
||||||
});
|
});
|
||||||
@ -10937,6 +10937,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
|
|||||||
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
||||||
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
||||||
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
|
||||||
|
{name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
|
||||||
{name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
|
{name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
|
||||||
{name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
|
{name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
|
||||||
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
|
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
|
||||||
@ -14038,6 +14039,29 @@ SimpleMDE.prototype.toggleSideBySide = function() {
|
|||||||
SimpleMDE.prototype.toggleFullScreen = function() {
|
SimpleMDE.prototype.toggleFullScreen = function() {
|
||||||
toggleFullScreen(this);
|
toggleFullScreen(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SimpleMDE.prototype.isPreviewActive = function() {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
var wrapper = cm.getWrapperElement();
|
||||||
|
var preview = wrapper.lastChild;
|
||||||
|
|
||||||
|
return /editor-preview-active/.test(preview.className);
|
||||||
|
};
|
||||||
|
|
||||||
|
SimpleMDE.prototype.isSideBySideActive = function() {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
var wrapper = cm.getWrapperElement();
|
||||||
|
var preview = wrapper.nextSibling;
|
||||||
|
|
||||||
|
return /editor-preview-active-side/.test(preview.className);
|
||||||
|
};
|
||||||
|
|
||||||
|
SimpleMDE.prototype.isFullscreenActive = function() {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
|
||||||
|
return cm.getOption("fullScreen");
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = SimpleMDE;
|
module.exports = SimpleMDE;
|
||||||
|
|
||||||
},{"./codemirror/tablist":12,"codemirror":6,"codemirror/addon/display/fullscreen.js":3,"codemirror/addon/edit/continuelist.js":4,"codemirror/addon/mode/overlay.js":5,"codemirror/mode/gfm/gfm.js":7,"codemirror/mode/markdown/markdown.js":8,"codemirror/mode/xml/xml.js":10,"marked":11,"spell-checker":1}]},{},[13])(13)
|
},{"./codemirror/tablist":12,"codemirror":6,"codemirror/addon/display/fullscreen.js":3,"codemirror/addon/edit/continuelist.js":4,"codemirror/addon/mode/overlay.js":5,"codemirror/mode/gfm/gfm.js":7,"codemirror/mode/markdown/markdown.js":8,"codemirror/mode/xml/xml.js":10,"marked":11,"spell-checker":1}]},{},[13])(13)
|
||||||
|
2
dist/simplemde.min.css
vendored
2
dist/simplemde.min.css
vendored
File diff suppressed because one or more lines are too long
16
dist/simplemde.min.js
vendored
16
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1264,4 +1264,27 @@ SimpleMDE.prototype.toggleSideBySide = function() {
|
|||||||
SimpleMDE.prototype.toggleFullScreen = function() {
|
SimpleMDE.prototype.toggleFullScreen = function() {
|
||||||
toggleFullScreen(this);
|
toggleFullScreen(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SimpleMDE.prototype.isPreviewActive = function() {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
var wrapper = cm.getWrapperElement();
|
||||||
|
var preview = wrapper.lastChild;
|
||||||
|
|
||||||
|
return /editor-preview-active/.test(preview.className);
|
||||||
|
};
|
||||||
|
|
||||||
|
SimpleMDE.prototype.isSideBySideActive = function() {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
var wrapper = cm.getWrapperElement();
|
||||||
|
var preview = wrapper.nextSibling;
|
||||||
|
|
||||||
|
return /editor-preview-active-side/.test(preview.className);
|
||||||
|
};
|
||||||
|
|
||||||
|
SimpleMDE.prototype.isFullscreenActive = function() {
|
||||||
|
var cm = this.codemirror;
|
||||||
|
|
||||||
|
return cm.getOption("fullScreen");
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = SimpleMDE;
|
module.exports = SimpleMDE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user