diff browser_side/richtext.py @ 234:d4e73d9140af

browser side: rich text: update to follow core implementation
author Goffi <goffi@goffi.org>
date Thu, 31 Oct 2013 17:54:10 +0100
parents 146fc6739951
children 28d3315a8003
line wrap: on
line diff
--- 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": ("<b>", "bold", "</b>"),
+           "XHTML": {"bold": ("<b>", "bold", "</b>"),
                         "italic": ("<i>", "italic", "</i>"),
                         "underline": ("<u>", "underline", "</u>"),
                         "strikethrough": ("<s>", "strikethrough", "</s>"),
@@ -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):