Changeset 49008

Show
Ignore:
Timestamp:
09/18/06 12:23:06 (2 years ago)
Author:
madarche
Message:

- Added the possibility to have embedded HTML editor window in the text widget.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CPS3/products/CPSSchemas/trunk/CHANGES

    r49003 r49008  
    55~~~~~~~~~~~~~ 
    66- Widgets have a new "readonly_if_expr" property. 
     7- Added the possibility to have embedded HTML editor window in the text widget. 
    78Bug fixes: 
    89~~~~~~~~~~ 
  • CPS3/products/CPSSchemas/trunk/ExtendedWidgets.py

    r47656 r49008  
    7373        {'id': 'file_uploader', 'type': 'boolean', 'mode': 'w', 
    7474         'label': 'Add a file uploader to the widget UI'}, 
     75        {'id': 'html_editor_embedded', 'type': 'boolean', 'mode': 'w', 
     76         'label': 'Embed HTML editor in page, otherwise popup'}, 
    7577        {'id': 'render_format', 'type': 'selection', 'mode': 'w', 
    7678         'select_variable': 'all_render_formats', 
     
    9092    height = 5 
    9193    size_max = 2*1024*1024 
    92     file_uploader = 0 
     94    file_uploader = False 
     95    html_editor_embedded = False 
    9396    render_position = all_render_positions[0] 
    9497    render_format = all_render_formats[0] 
  • CPS3/products/CPSSchemas/trunk/skins/cps_schemas/widget_text_render.pt

    r33803 r49008  
    44  value options/value; 
    55  file_uploader here/file_uploader; 
     6  html_editor_embedded here/html_editor_embedded; 
    67  rposition options/render_position; 
    78  rformat options/render_format; 
     
    1112  format_selector_id string:${value_name}_rformat; 
    1213  button_text_editor_popup_id python:'widget__%s_button' % id; 
     14  utool nocall:here/portal_url; 
     15  absolute here/absolute|python:False; 
     16  base_url python:test(absolute, utool()+'/', utool.getBaseUrl()); 
    1317  "> 
    1418  <tal:block condition="python: mode == 'view'"> 
     
    1923      tal:content="structure value" /> 
    2024  </tal:block> 
    21   <tal:block condition="python: mode == 'edit'"> 
    22       <textarea class="monospaceFont" 
    23         tal:attributes="id value_name; 
    24         name value_name; 
    25         cols here/width; 
    26         rows here/height;" 
    27         tal:content="value" 
    28       /> 
     25  <tal:block condition="python:mode == 'edit'"> 
     26        <textarea class="monospaceFont" 
     27          tal:attributes="id value_name; 
     28          name value_name; 
     29          cols here/width; 
     30          rows here/height;" 
     31          tal:content="value" 
     32          /> 
     33      <tal:block condition="python:rformat == 'html' and html_editor_embedded"> 
     34        <script type="text/javascript" src="" 
     35                tal:attributes="src string:${base_url}fckeditor.js"> 
     36        </script> 
     37        <script type="text/javascript" src="" 
     38                tal:attributes="src string:${base_url}fckeditor_form.js"> 
     39        </script> 
     40        <script type="text/javascript" 
     41                tal:define="parent_path python:context.aq_inner.aq_parent.absolute_url_path()" 
     42                tal:content="structure string: 
     43displayFckEditor('${value_name}', '${parent_path}', '${base_url}'); 
     44"> 
     45        </script> 
     46      </tal:block> 
    2947    <p> 
    3048      <tal:block condition="file_uploader"> 
     
    5977        </select> 
    6078      </tal:block> 
     79      <tal:block condition="not:html_editor_embedded"> 
    6180      <button type="button" 
    6281        i18n:translate="button_text_editor_popup" 
     
    6584        style python:test(rformat == 'html', 
    6685        'visibility: visible;;', 'visibility: hidden;;'); 
    67         class string:standalone; 
    6886        onclick 
    6987        string:javascript:popup_rte('${value_name}', '${here/label_edit}') 
    7088        " 
    7189        >Layout</button> 
     90      </tal:block> 
    7291    </p> 
    7392