diff -r f37b5995a48c -r 50c73e42883a src/pyams_content/skin/zmi/tinymce.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/skin/zmi/tinymce.py Fri Jan 26 16:44:29 2018 +0100 @@ -0,0 +1,36 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_form.interfaces.form import IForm +from pyams_skin.interfaces.tinymce import ITinyMCEConfiguration +from pyams_skin.layer import IPyAMSLayer + +# import packages +from pyams_utils.adapter import adapter_config, ContextRequestAdapter + + +@adapter_config(context=(IForm, IPyAMSLayer), provides=ITinyMCEConfiguration) +class TinyMCEEditorConfiguration(ContextRequestAdapter): + """TinyMCE editor configuration""" + + @property + def configuration(self): + return {'ams-plugins': 'pyams_content', + 'ams-plugin-pyams_content-src': '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js', + 'ams-plugin-pyams_content-async': 'false', + 'ams-tinymce-init-callback': 'PyAMS_content.TinyMCE.initEditor'}