comparison browser_side/richtext.py @ 400:487dd238ab88

browser_side: bug fixes for microblog raw/rich edition toggle
author souliane <souliane@mailoo.org>
date Tue, 11 Mar 2014 13:53:19 +0100
parents 98cd5387d291
children ea03f898067f
comparison
equal deleted inserted replaced
399:6e38d317bc16 400:487dd238ab88
310 syntaxConvertCb() 310 syntaxConvertCb()
311 self.host.bridge.call('asyncGetParamA', getParamCb, composition.PARAM_NAME_SYNTAX, composition.PARAM_KEY_COMPOSITION) 311 self.host.bridge.call('asyncGetParamA', getParamCb, composition.PARAM_NAME_SYNTAX, composition.PARAM_KEY_COMPOSITION)
312 else: 312 else:
313 if not self.initialized: 313 if not self.initialized:
314 # set the display text in XHTML only during init because a new MicroblogEntry instance is created after each modification 314 # set the display text in XHTML only during init because a new MicroblogEntry instance is created after each modification
315 text = content['text'] 315 self.setDisplayContent()
316 if 'title' in content and content['title']:
317 text = '<h1>%s</h1>%s' % (html_sanitize(content['title']), content['text'])
318 self.display.setContent({'text': text})
319 self.display.edit(False) 316 self.display.edit(False)
317
318 def setDisplayContent(self):
319 """Set the content of the LightTextEditor which is used for display/wysiwyg"""
320 content = self._original_content
321 text = content['text']
322 if 'title' in content and content['title']:
323 text = '<h1>%s</h1>%s' % (html_sanitize(content['title']), content['text'])
324 self.display.setContent({'text': text})
320 325
321 def setFocus(self, focus): 326 def setFocus(self, focus):
322 self.textarea.setFocus(focus) 327 self.textarea.setFocus(focus)
323 328
324 def abortEdition(self, content): 329 def abortEdition(self, content):