diff --git a/themes/grav/app/forms/fields/editor/buttons.js b/themes/grav/app/forms/fields/editor/buttons.js index 9c6649ac..bab43800 100644 --- a/themes/grav/app/forms/fields/editor/buttons.js +++ b/themes/grav/app/forms/fields/editor/buttons.js @@ -112,6 +112,76 @@ export default { } } }, + { + headers: { + identifier: 'headers', + title: 'Headers', + label: '', + modes: ['gfm', 'markdown'], + children: [ + { + h1: { + identifier: 'h1', + label: '1', + modes: ['gfm', 'markdown'], + action({ codemirror, button, textarea }) { + replacer({ name: 'h1', replace: '# $1', codemirror, button, mode: 'replaceLine' }); + } + } + }, + { + h2: { + identifier: 'h2', + label: '2', + modes: ['gfm', 'markdown'], + action({ codemirror, button, textarea }) { + replacer({ name: 'h2', replace: '## $1', codemirror, button, mode: 'replaceLine' }); + } + } + }, + { + h3: { + identifier: 'h3', + label: '3', + modes: ['gfm', 'markdown'], + action({ codemirror, button, textarea }) { + replacer({ name: 'h3', replace: '### $1', codemirror, button, mode: 'replaceLine' }); + } + } + }, + { + h4: { + identifier: 'h4', + label: '4', + modes: ['gfm', 'markdown'], + action({ codemirror, button, textarea }) { + replacer({ name: 'h4', replace: '#### $1', codemirror, button, mode: 'replaceLine' }); + } + } + }, + { + h5: { + identifier: 'h5', + label: '5', + modes: ['gfm', 'markdown'], + action({ codemirror, button, textarea }) { + replacer({ name: 'h5', replace: '##### $1', codemirror, button, mode: 'replaceLine' }); + } + } + }, + { + h6: { + identifier: 'h6', + label: '6', + modes: ['gfm', 'markdown'], + action({ codemirror, button, textarea }) { + replacer({ name: 'h6', replace: '###### $1', codemirror, button, mode: 'replaceLine' }); + } + } + } + ] + } + }, { bold: { identifier: 'bold',