Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ This is a dict. By default, TinyMCE is loaded with the following options set:
- ``language`` (taken from Django settings)
- ``language_load``

TinyMCE Init Passthru
---------------------

To pass any additional keys to the ``init()`` function of TinyMCE (`see the TinyMCE docs <https://www.tinymce.com/docs/configure/>`_),
set the ``passthru_init_keys`` keyword arg to a dictionary of options.

TinyMCE plugins and tools
=========================

Expand Down
3 changes: 3 additions & 0 deletions wagtailtinymce/rich_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def render_js_init(self, id_, name, value):
else:
kwargs['menubar'] = ' '.join(self.kwargs['menus'])

if 'passthru_init_keys' in self.kwargs:
kwargs.update(self.kwargs['passthru_init_keys'])

return "makeTinyMCEEditable({0}, {1});".format(json.dumps(id_), json.dumps(kwargs))

def value_from_datadict(self, data, files, name):
Expand Down