From: Dan Brown Date: Fri, 24 Mar 2023 10:59:25 +0000 (+0000) Subject: Added hack: example of custom WYSWIYG editor buttons X-Git-Url: http://source.bookstackapp.com/hacks/commitdiff_plain/a54c56cea56c669d616c54f9b8c83f677387bedf Added hack: example of custom WYSWIYG editor buttons --- diff --git a/content/wysiwyg-custom-buttons/head.html b/content/wysiwyg-custom-buttons/head.html new file mode 100644 index 0000000..b5f4a97 --- /dev/null +++ b/content/wysiwyg-custom-buttons/head.html @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/content/wysiwyg-custom-buttons/index.md b/content/wysiwyg-custom-buttons/index.md new file mode 100644 index 0000000..262bf17 --- /dev/null +++ b/content/wysiwyg-custom-buttons/index.md @@ -0,0 +1,25 @@ ++++ +title = "Custom WYSIWYG Editor Buttons" +author = "@ssddanbrown" +date = 2023-02-24T00:00:00Z +updated = 2023-02-24T00:00:00Z +tested = "v23.02" ++++ + +This hack provides an example of adding custom actions to the WYSIWYG page editor (TinyMCE). +By default, this adds an additional "..." overflow menu to the end of the WYSWIYG toolbar, which contains a single new +"Insert Cat" button that has a custom icon. When clicked, this adds a placeholder kitten image into the page. + +This is only meant to be an example, to be tweaked and modified to your use-case. +The code is heavily commented for this reason. + +For significant alterations, you'll likely want to review the [TinyMCE documentation](https://www.tiny.cloud/docs/tinymce/6/custom-toolbarbuttons/) +to understand the full set of available capabilities and actions within the TinyMCE editor API. + +#### Considerations + +- This heavily relies on internal methods of TinyMCE, which may change upon any BookStack release as we update the editor libraries. + +#### Code + +{{}}