# HG changeset patch # User Goffi # Date 1383238450 -3600 # Node ID d4e73d9140af864ad3a7f8bc3aabea0247b4221d # Parent 146fc67399512c32d44d60e3047d4b5d0c6b5bdc browser side: rich text: update to follow core implementation diff -r 146fc6739951 -r d4e73d9140af browser_side/richtext.py --- a/browser_side/richtext.py Wed Oct 09 15:12:50 2013 +0200 +++ b/browser_side/richtext.py Thu Oct 31 17:54:10 2013 +0100 @@ -46,6 +46,7 @@ # Tupples values must have 3 elements : prefix to the selection or cursor # position, sample text to write if the marker is not applied on a selection, # suffix to the selection or cursor position. +# FIXME: must be moved in backend and not harcoded like this FORMATS = {"markdown": {"bold": ("**", "bold", "**"), "italic": ("*", "italic", "*"), "code": ("`", "code", "`"), @@ -72,7 +73,7 @@ "list": ("\n * ", "item\n", "\n * subitem\n"), "horizontalrule": ("\n----\n", "", "") }, - "html": {"bold": ("", "bold", ""), + "XHTML": {"bold": ("", "bold", ""), "italic": ("", "italic", ""), "underline": ("", "underline", ""), "strikethrough": ("", "strikethrough", ""), @@ -85,8 +86,8 @@ } -FORMAT_PARAM_KEY = "Composition and addressing" -FORMAT_PARAM_NAME = "Format for rich text message composition" +PARAM_KEY = "Composition" +PARAM_NAME = "Syntax" class RichTextEditor(FlexTable): @@ -167,7 +168,7 @@ def setVisible(self, kwargs): """Called each time the widget is displayed, after creation or after having been hidden.""" - self.host.bridge.call('asyncGetParamA', self.setToolBar, FORMAT_PARAM_NAME, FORMAT_PARAM_KEY) or self.setToolBar(None) + self.host.bridge.call('asyncGetParamA', self.setToolBar, PARAM_NAME, PARAM_KEY) or self.setToolBar(None) FlexTable.setVisible(self, kwargs) def __close(self):