Changeset 1904


Ignore:
Timestamp:
07/24/07 15:02:06 (12 years ago)
Author:
gabor
Message:

fixed #1446 spent 17h

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FieldsWidgets.py

    r1902 r1904  
    5454    # material types use versions of chapter_widgets and are not affected by this 
    5555 
     56    def process_form(self, instance, field, form, empty_marker=None, emptyReturnsMarker=False): 
     57        """Basic impl for form processing in a widget""" 
     58        value = form.get(field.getName(), empty_marker) 
     59        if value is empty_marker: 
     60            return empty_marker 
     61        if emptyReturnsMarker and value == '': 
     62            return empty_marker 
     63 
     64        if form.get('replaceNewLines') != None and field.getName() == 'bodyText': 
     65            lt = getToolByName(instance, 'lemill_tool') 
     66            value = lt.addBreaksToText(value) 
     67 
     68        return value, {} 
     69 
    5670registerWidget(LeVisualWidget, 
    5771    title='Visual Widget', 
     
    243257            text= form.get('%s_%s' % (fieldname, i)) 
    244258            text = remove_invalid_html_tags(text) 
     259            if form.get('replaceNewLines') != None and field.getName() == 'bodyText': 
     260                lt = getToolByName(instance, 'lemill_tool') 
     261                text = lt.addBreaksToText(text) 
    245262            value.append(text) 
    246263 
  • trunk/skins/lemill/cookText.py

    r1898 r1904  
    1313lt=context.lemill_tool 
    1414if bodytext: 
    15     return lt.shortenSymbolicLines(lt.shorten_link_names(lt.addBreaksToText(lt.htmlify(bodytext)))) 
     15    return lt.shortenSymbolicLines(lt.shorten_link_names((lt.htmlify(bodytext)))) 
    1616else: 
    1717    return None 
  • trunk/skins/lemill/kupu_wysiwyg_support.html

    r1773 r1904  
    3535                Allowed tags: <h2>, <p>, <br />, <pre>, <ul>, <ol>, <li>, <a>, <i>, <b> 
    3636            </div> 
     37            <label><input type="checkbox" checked="checked" name="replaceNewLines" i18n:translate="label_replace_line_breaks" />Replace line breaks with &lt;br /&gt; tags.</label> 
    3738        </div> 
    3839        <div tal:condition="usekupu"> 
Note: See TracChangeset for help on using the changeset viewer.