-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimplemde.js
28 lines (23 loc) · 1.03 KB
/
simplemde.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2016 Andrea Zanellato
// This file may be used and distributed under the terms of the public license.
// SimpleMDE plugin 0.6.4
var initSimpleMdeFromDOM = function() {
var yellow_editor = document.getElementById("yellow-pane-edit-page");
var simplemde = new SimpleMDE({
element: yellow_editor,
initialValue: yellow.page.rawDataEdit, // set the page text into the editor
forceSync: true, // save text into the original textarea
autofocus: true, // update and show text into the editor?
spellChecker: false // get rid about annoying spellchecker for now
});
// Add some (not yet working) features as reference (see CodeMirror Docs)
simplemde.codemirror.setOption("lineNumbers", true);
simplemde.codemirror.setOption("autoRefresh", true);
simplemde.codemirror.setOption("autofocus", true);
simplemde.codemirror.setOption("styleActiveLine", true);
}
if(window.addEventListener) {
window.addEventListener('load', initSimpleMdeFromDOM, false);
} else {
window.attachEvent('onload', initSimpleMdeFromDOM);
}