From 94f161767ffa5378f67eef777a24b1b8821af60a Mon Sep 17 00:00:00 2001 From: Hakim Zulkufli Date: Thu, 10 Aug 2017 23:25:43 +0800 Subject: [PATCH] Added pagebreak button to SimpleMDE A simple addition to the plugin's toolbar. I feel that the pagebreak function needs to be more noticeable by the users. --- bl-plugins/simplemde/plugin.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bl-plugins/simplemde/plugin.php b/bl-plugins/simplemde/plugin.php index 8b8d29fd..d210ae33 100644 --- a/bl-plugins/simplemde/plugin.php +++ b/bl-plugins/simplemde/plugin.php @@ -127,7 +127,19 @@ class pluginsimpleMDE extends Plugin { uniqueId: "'.$autosaveID.'", delay: 1000, }, - toolbar: ['.Sanitize::htmlDecode($this->getDbField('toolbar')).'] + toolbar: [ { + name: "pageBreak", + action: function addPageBreak(editor){ + var cm = editor.codemirror; + output = "\n\n\n"; + cm.replaceSelection(output); + }, + className: "fa fa-book", + title: "Pagebreak", + }, + "|", + '.Sanitize::htmlDecode($this->getDbField('toolbar')).' + ] });'; $html .= '}); ';