diff --git a/resources/assets/javascripts/lib/wysiwyg.js b/resources/assets/javascripts/lib/wysiwyg.js index a1cb6bbc6056733324f13664c5158b34c6d94ad8..7b18313e661aa1de4ea8b0da90e749809ef38153 100644 --- a/resources/assets/javascripts/lib/wysiwyg.js +++ b/resources/assets/javascripts/lib/wysiwyg.js @@ -64,6 +64,43 @@ function replaceTextarea(textarea) { if ($textarea.attr('data-editor')) { const parsed = parseOptions($textarea.attr('data-editor')); + if (parsed.toolbar === 'small') { + options.toolbar = { + removeItems: [ + 'undo', + 'redo', + 'findAndReplace', + 'strikethrough', + 'horizontalLine', + 'insertBlockQuote', + 'splitBlockQuote', + 'removeBlockQuote', + ] + }; + } else if (parsed.toolbar === 'minimal') { + options.toolbar = { + items: [ + 'bold', + 'italic', + 'underline', + 'subscript', + 'superscript', + '|', + 'removeFormat', + '|', + 'bulletedList', + 'numberedList', + '|', + 'fontColor', + 'fontBackgroundColor', + '|', + 'link', + 'math', + 'specialCharacters', + ] + }; + } + if (parsed.removePlugins) { options.removePlugins = parsed.removePlugins.split(",") }