Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow full customization of TinyMCE instance #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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