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.
This commit is contained in:
Hakim Zulkufli 2017-08-10 23:25:43 +08:00
parent 3ae41bd710
commit 94f161767f
1 changed files with 13 additions and 1 deletions

View File

@ -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<!-- pagebreak -->\n\n";
cm.replaceSelection(output);
},
className: "fa fa-book",
title: "Pagebreak",
},
"|",
'.Sanitize::htmlDecode($this->getDbField('toolbar')).'
]
});';
$html .= '}); </script>';