From 25adda9af0050e6b32b50661449c318ab6ef9a52 Mon Sep 17 00:00:00 2001 From: David Prothero Date: Mon, 14 Nov 2016 13:46:34 -0800 Subject: [PATCH 1/2] Add passthru_init_keys option --- wagtailtinymce/rich_text.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wagtailtinymce/rich_text.py b/wagtailtinymce/rich_text.py index c61003c8..c8c6edc9 100644 --- a/wagtailtinymce/rich_text.py +++ b/wagtailtinymce/rich_text.py @@ -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): From 176bf7b46976a5694a412c191dc0491151e07c88 Mon Sep 17 00:00:00 2001 From: David Prothero Date: Mon, 14 Nov 2016 13:52:38 -0800 Subject: [PATCH 2/2] Document passthru_init_keys option --- README.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.rst b/README.rst index f8731cbb..29b2ee42 100644 --- a/README.rst +++ b/README.rst @@ -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 `_), +set the ``passthru_init_keys`` keyword arg to a dictionary of options. + TinyMCE plugins and tools =========================