Changeset 1944

Show
Ignore:
Timestamp:
10/07/06 07:36:01 (2 years ago)
Author:
alberto
Message:

Adding a 'new_options' parameter to TinyMCE to update the default mce_options. Bumping it's version number to 1.0.6

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • widgets/TurboTinyMCE/tinymce/release.py

    r1940 r1944  
    11# Release information about tinyMCE 
    22 
    3 version = "1.0.4
     3version = "1.0.6
    44 
    55description = "TinyMCE widget for TurboGears" 
  • widgets/TurboTinyMCE/tinymce/widgets.py

    r1940 r1944  
    3535    """ 
    3636    langs = utils.get_available_languages() 
    37     params = ["mce_options"] 
     37    params = ["mce_options", "new_options"] 
     38    params_doc = { 
     39            'mce_options' : _("Options to initialize TinyMCE's javascript. This" 
     40                              " dict will override the defaults"), 
     41            'new_options' : _("Options to initialize TinyMCE's javascript. This" 
     42                              " dict will update the defaults"), 
     43            } 
    3844    rows = 25 
    3945    mce_options = dict( 
     
    5157        paste_strip_class_attributes = "all", 
    5258    ) 
     59    new_options = {} 
    5360    validator = utils.HTMLCleaner() 
    5461    javascript = [JSLink("tinymce", "tiny_mce_src.js")] 
     
    7481    def update_params(self, d): 
    7582        super(TinyMCE, self).update_params(d) 
     83        d['mce_options'].update(d['new_options']) 
    7684        locale = self._get_locale() 
    7785        if locale: 
    7886            d['mce_options'].setdefault('language', locale) 
    79         d['mce_options']['elements'] = d['field_id'] 
     87        if d['mce_options'].get('mode', 'textareas') == 'exact': 
     88            d['mce_options']['elements'] = d['field_id'] 
    8089        d['TinyMCEInit'] = "tinyMCE.init(%s);" % encode(d['mce_options']) 
    8190