From 7904c44036a19fa10cee9a9b43ea1294831a41f6 Mon Sep 17 00:00:00 2001 From: Ryan Graham Date: Thu, 21 Jan 2016 12:13:35 +0000 Subject: [PATCH] Updated README to explain statusCustom support --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 8873c5e..0297368 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ simplemde.value("This text will appear in the editor"); - **spellChecker**: If set to `false`, disable the spell checker. Defaults to `true`. - **status**: If set to `false`, hide the status bar. Defaults to `true`. - Optionally, you can set an array of status bar elements to include, and in what order. +- **statusCustom**: An object of custom elements to add to the statusbar - **tabSize**: If set, customize the tab size. Defaults to `2`. - **toolbar**: If set to `false`, hide the toolbar. Defaults to the [array of icons](#toolbar-icons). - **toolbarTips**: If set to `false`, disable toolbar button tips. Defaults to `true`. @@ -155,6 +156,17 @@ var simplemde = new SimpleMDE({ spellChecker: false, status: false, status: ["autosave", "lines", "words", "cursor"], // Optional usage + statusCustom: { + countKeyStrokes: { // Counts the total number of keystrokes + defaultValue: function(span) { + this.keystrokes = 0; + span.innerHTML = "0 Keystrokes"; + }, + onUpdate: function(span) { + span.innerHTML = ++this.keystrokes + " Keystrokes"; + } + } + }, tabSize: 4, toolbar: false, toolbarTips: false,