Mercurial > libervia-web
diff browser_side/base_panels.py @ 356:b95099a1d11b
browser_side: do not use addURLToText to display Microblog XHTML content
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 13 Feb 2014 12:53:07 +0100 (2014-02-13) |
parents | f488692c4903 |
children | df743589bb8c |
line wrap: on
line diff
--- a/browser_side/base_panels.py Thu Feb 13 10:32:26 2014 +0100 +++ b/browser_side/base_panels.py Thu Feb 13 12:53:07 2014 +0100 @@ -418,19 +418,21 @@ class LightTextEditor(BaseTextEditor, HTML, FocusHandler, KeyboardHandler): """Manage a simple text editor whith the HTML 5 "contenteditable" property.""" - def __init__(self, content=None, modifiedCb=None, afterEditCb=None, single_line=False): + def __init__(self, content=None, modifiedCb=None, afterEditCb=None, single_line=False, enhance_display=True): """ @param content @param modifiedCb @param afterEditCb @param single_line: set to True to manage a single line editor. In that case the edition would be terminated when the focus is lost or <enter> key is pressed. + @param enhance_display: if True, the display text will be enhanced with addURLToText """ HTML.__init__(self) if single_line: FocusHandler.__init__(self) KeyboardHandler.__init__(self) self.__single_line = single_line + self.__enhance_display = enhance_display strproc = lambda text: html_sanitize(html_strip(text)) if self.__single_line else html_strip(text) BaseTextEditor.__init__(self, content, strproc, modifiedCb, afterEditCb) @@ -459,7 +461,7 @@ self.removeKeyboardListener(self) def setDisplayContent(self): - self.setHTML(addURLToText(self._original_content['text'])) + self.setHTML(addURLToText(self._original_content['text']) if self.__enhance_display else self._original_content['text']) def setFocus(self, focus): if focus: