Skip to content

Commit 7904c44

Browse files
Updated README to explain statusCustom support
1 parent 7bc2cb3 commit 7904c44

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ simplemde.value("This text will appear in the editor");
100100
- **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`.
101101
- **status**: If set to `false`, hide the status bar. Defaults to `true`.
102102
- Optionally, you can set an array of status bar elements to include, and in what order.
103+
- **statusCustom**: An object of custom elements to add to the statusbar
103104
- **tabSize**: If set, customize the tab size. Defaults to `2`.
104105
- **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons).
105106
- **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`.
@@ -155,6 +156,17 @@ var simplemde = new SimpleMDE({
155156
spellChecker: false,
156157
status: false,
157158
status: ["autosave", "lines", "words", "cursor"], // Optional usage
159+
statusCustom: {
160+
countKeyStrokes: { // Counts the total number of keystrokes
161+
defaultValue: function(span) {
162+
this.keystrokes = 0;
163+
span.innerHTML = "0 Keystrokes";
164+
},
165+
onUpdate: function(span) {
166+
span.innerHTML = ++this.keystrokes + " Keystrokes";
167+
}
168+
}
169+
},
158170
tabSize: 4,
159171
toolbar: false,
160172
toolbarTips: false,

0 commit comments

Comments
 (0)