Add event hooks for core editor setup actions #1412

Closed
opened 2026-02-05 00:49:59 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @ssddanbrown on GitHub (Oct 16, 2019).

Add the ability to set event listeners to customize core editor configs and instances.

  • Will need to document the listeners.
    • Provide examples.
  • Will be unstable (Potential editor change in future). Ensure this is clear in documentation.

Will allow customization to TinyMCE editor and markdown codemirror/md-it instances without having to re-compile JS or edit base BookStack code. Will be able to use event listeners via custom head content.

Will leave this open until the docs are updated.

Originally created by @ssddanbrown on GitHub (Oct 16, 2019). Add the ability to set event listeners to customize core editor configs and instances. * Will need to document the listeners. * Provide examples. * Will be unstable (Potential editor change in future). Ensure this is clear in documentation. Will allow customization to TinyMCE editor and markdown codemirror/md-it instances without having to re-compile JS or edit base BookStack code. Will be able to use event listeners via custom head content. Will leave this open until the docs are updated.
OVERLORD added the 🛠️ Enhancement📖 Docs Update💻 Front-End labels 2026-02-05 00:49:59 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Oct 16, 2019):

Sample code to log out all events added:

<script>
	window.addEventListener('editor-tinymce::pre-init', event => console.log('TINYMCE-PRE_INIT', event.detail));
	window.addEventListener('editor-tinymce::setup', event => console.log('TINYMCE-SETUP', event.detail));
	window.addEventListener('editor-markdown-cm::pre-init', event => console.log('MARKDOWN-CODEMIRROR-PRE_INIT', event.detail));
	window.addEventListener('editor-markdown::setup', event => console.log('MARKDOWN-EDITOR-SETUP', event.detail));
</script>
@ssddanbrown commented on GitHub (Oct 16, 2019): Sample code to log out all events added: ```html <script> window.addEventListener('editor-tinymce::pre-init', event => console.log('TINYMCE-PRE_INIT', event.detail)); window.addEventListener('editor-tinymce::setup', event => console.log('TINYMCE-SETUP', event.detail)); window.addEventListener('editor-markdown-cm::pre-init', event => console.log('MARKDOWN-CODEMIRROR-PRE_INIT', event.detail)); window.addEventListener('editor-markdown::setup', event => console.log('MARKDOWN-EDITOR-SETUP', event.detail)); </script> ```
Author
Owner

@ssddanbrown commented on GitHub (Oct 19, 2019):

Will close this off for now until it comes to documentation stage.

@ssddanbrown commented on GitHub (Oct 19, 2019): Will close this off for now until it comes to documentation stage.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1412