src/pyams_content/zmi/tinymce.py
changeset 0 7c0001cacf8e
equal deleted inserted replaced
-1:000000000000 0:7c0001cacf8e
       
     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_form.interfaces.form import IForm
       
    20 from pyams_skin.interfaces.tinymce import ITinyMCEConfiguration
       
    21 from pyams_skin.layer import IPyAMSLayer
       
    22 
       
    23 # import packages
       
    24 from pyams_utils.adapter import adapter_config, ContextRequestAdapter
       
    25 
       
    26 
       
    27 @adapter_config(context=(IForm, IPyAMSLayer), provides=ITinyMCEConfiguration)
       
    28 class TinyMCEEditorConfiguration(ContextRequestAdapter):
       
    29     """TinyMCE editor configuration"""
       
    30 
       
    31     @property
       
    32     def configuration(self):
       
    33         return {'ams-plugins': 'pyams_content',
       
    34                 'ams-plugin-pyams_content-src': '/--static--/pyams_content/js/pyams_content{MyAMS.devext}.js',
       
    35                 'ams-plugin-pyams_content-async': 'false',
       
    36                 'ams-tinymce-init-callback': 'PyAMS_content.TinyMCE.initEditor'}