Mercurial > libervia-web
diff src/browser/sat_browser/richtext.py @ 648:6d3142b782c3 frontends_multi_profiles
browser_side: classes reorganisation:
- moved widgets in dedicated modules (base, contact, editor, libervia) and a widget module for single classes
- same thing for panels (base, main, contact)
- libervia_widget mix main panels and widget and drag n drop for technical reasons (see comments)
- renamed WebPanel to WebWidget
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 26 Feb 2015 18:10:54 +0100 |
parents | 9092e624bb27 |
children | 9877607c719a |
line wrap: on
line diff
--- a/src/browser/sat_browser/richtext.py Thu Feb 26 13:10:46 2015 +0100 +++ b/src/browser/sat_browser/richtext.py Thu Feb 26 18:10:54 2015 +0100 @@ -34,14 +34,15 @@ from constants import Const as C import dialog -import base_panels +import base_panel +import editor_widget import list_manager import html_tools import blog import chat -class RichTextEditor(base_panels.BaseTextEditor, FlexTable): +class RichTextEditor(editor_widget.BaseTextEditor, FlexTable): """Panel for the rich text editor.""" def __init__(self, host, content=None, modifiedCb=None, afterEditCb=None, options=None, style=None): @@ -64,7 +65,7 @@ if isinstance(style, dict): self.style.update(style) self._prepareUI() - base_panels.BaseTextEditor.__init__(self, content, None, modifiedCb, afterEditCb) + editor_widget.BaseTextEditor.__init__(self, content, None, modifiedCb, afterEditCb) def __readOptions(self, options): """Set the internal flags according to the given options.""" @@ -92,7 +93,7 @@ def addEditListener(self, listener): """Add a method to be called whenever the text is edited. @param listener: method taking two arguments: sender, keycode""" - base_panels.BaseTextEditor.addEditListener(self, listener) + editor_widget.BaseTextEditor.addEditListener(self, listener) if hasattr(self, 'display'): self.display.addEditListener(listener) @@ -109,7 +110,7 @@ if hasattr(self, 'toolbar'): self.toolbar.setVisible(False) if not hasattr(self, 'display'): - self.display = base_panels.HTMLTextEditor(options={'enhance_display': False, 'listen_keyboard': False}) # for display mode + self.display = editor_widget.HTMLTextEditor(options={'enhance_display': False, 'listen_keyboard': False}) # for display mode for listener in self.edit_listeners: self.display.addEditListener(listener) if not self.read_only and not hasattr(self, 'textarea'): @@ -126,7 +127,7 @@ return if not self.no_title and not hasattr(self, 'title_panel'): - self.title_panel = base_panels.TitlePanel() + self.title_panel = base_panel.TitlePanel() self.title_panel.addStyleName(self.style['title']) self.getFlexCellFormatter().setColSpan(self.title_offset, 0, 2) self.setWidget(self.title_offset, 0, self.title_panel) @@ -286,10 +287,10 @@ """ if not (edit and abort): self.refresh(edit) # not when we are asking for a confirmation - base_panels.BaseTextEditor.edit(self, edit, abort, sync) # after the UI has been refreshed + editor_widget.BaseTextEditor.edit(self, edit, abort, sync) # after the UI has been refreshed if (edit and abort): - return # self.abortEdition is called by base_panels.BaseTextEditor.edit - self.setWysiwyg(False, init=True) # after base_panels.BaseTextEditor (it affects self.getContent) + return # self.abortEdition is called by editor_widget.BaseTextEditor.edit + self.setWysiwyg(False, init=True) # after editor_widget.BaseTextEditor (it affects self.getContent) if sync: return # the following must NOT be done at each UI refresh! @@ -319,7 +320,7 @@ self.display.edit(False) def setDisplayContent(self): - """Set the content of the base_panels.HTMLTextEditor which is used for display/wysiwyg""" + """Set the content of the editor_widget.HTMLTextEditor which is used for display/wysiwyg""" content = self._original_content text = content['text'] if 'title' in content and content['title']: