Mercurial > libervia-web
comparison browser_side/panels.py @ 404:c393e7dc9ae6
browser_side: refactorize SimpleTextEditor init parameters
author | souliane <souliane@mailoo.org> |
---|---|
date | Sat, 15 Mar 2014 00:21:04 +0100 |
parents | d7e78cb78dfc |
children | 6a6551de4414 |
comparison
equal
deleted
inserted
replaced
403:ec6f7581b453 | 404:c393e7dc9ae6 |
---|---|
524 options = ['read_only'] | 524 options = ['read_only'] |
525 else: | 525 else: |
526 options = [] if self.empty else ['update_msg'] | 526 options = [] if self.empty else ['update_msg'] |
527 self.bubble = richtext.RichTextEditor(self._blog_panel.host, content, self.__modifiedCb, self.__afterEditCb, options) | 527 self.bubble = richtext.RichTextEditor(self._blog_panel.host, content, self.__modifiedCb, self.__afterEditCb, options) |
528 else: # assume raw text message have no title | 528 else: # assume raw text message have no title |
529 self.bubble = LightTextEditor(content, self.__modifiedCb, self.__afterEditCb, single_line=True, listen_focus=False) | 529 self.bubble = LightTextEditor(content, self.__modifiedCb, self.__afterEditCb, options={'no_xhtml': True}) |
530 self.bubble.setStyleName("bubble") | 530 self.bubble.setStyleName("bubble") |
531 try: | 531 try: |
532 self.toggle_syntax_button.removeFromParent() | 532 self.toggle_syntax_button.removeFromParent() |
533 except TypeError: | 533 except TypeError: |
534 pass | 534 pass |
949 EMPTY_STATUS = '<click to set a status>' | 949 EMPTY_STATUS = '<click to set a status>' |
950 | 950 |
951 def __init__(self, host, status=''): | 951 def __init__(self, host, status=''): |
952 self.host = host | 952 self.host = host |
953 modifiedCb = lambda content: self.host.bridge.call('setStatus', None, self.host.status_panel.presence, content['text']) or True | 953 modifiedCb = lambda content: self.host.bridge.call('setStatus', None, self.host.status_panel.presence, content['text']) or True |
954 HTMLTextEditor.__init__(self, {'text': status}, modifiedCb, None, single_line=True, listen_click=True) | 954 HTMLTextEditor.__init__(self, {'text': status}, modifiedCb, options={'no_xhtml': True, 'listen_focus': True, 'listen_click': True}) |
955 self.edit(False) | 955 self.edit(False) |
956 self.setStyleName('statusPanel') | 956 self.setStyleName('statusPanel') |
957 | 957 |
958 @property | 958 @property |
959 def status(self): | 959 def status(self): |