1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from pyams_content.skin import pyams_content |
|
20 from pyams_form.interfaces.form import IForm |
|
21 from pyams_skin.interfaces.tinymce import ITinyMCEConfiguration |
|
22 from pyams_skin.layer import IPyAMSLayer |
|
23 |
|
24 # import packages |
|
25 from pyams_utils.adapter import adapter_config, ContextRequestAdapter |
|
26 from pyams_utils.fanstatic import get_resource_path |
|
27 |
|
28 |
|
29 @adapter_config(context=(IForm, IPyAMSLayer), provides=ITinyMCEConfiguration) |
|
30 class TinyMCEEditorConfiguration(ContextRequestAdapter): |
|
31 """TinyMCE editor configuration""" |
|
32 |
|
33 @property |
|
34 def configuration(self): |
|
35 return { |
|
36 'ams-plugins': 'pyams_content', |
|
37 'ams-plugin-pyams_content-src': get_resource_path(pyams_content), |
|
38 'ams-plugin-pyams_content-async': 'false', |
|
39 'ams-tinymce-init-callback': 'PyAMS_content.TinyMCE.initEditor' |
|
40 } |
|