changeset 526:d0dba03190b6

cfg.editor_quickhelp to make quickhelp work correctly and configurably for default markup at least imported from: moin--main--1.5--patch-530
author Thomas Waldmann <tw@waldmann-edv.de>
date Fri, 07 Apr 2006 16:44:15 +0000
parents 66c0297e3fd0
children 83be51106619
files ChangeLog MoinMoin/PageEditor.py MoinMoin/multiconfig.py docs/CHANGES
diffstat 4 files changed, 54 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 07 16:33:31 2006 +0000
+++ b/ChangeLog	Fri Apr 07 16:44:15 2006 +0000
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-04-07 17:44:15 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-530
+
+    Summary:
+      cfg.editor_quickhelp to make quickhelp work correctly and configurably for default markup at least
+    Revision:
+      moin--main--1.5--patch-530
+
+    cfg.editor_quickhelp to make quickhelp work correctly and configurably for default markup at least
+    
+
+    modified files:
+     ChangeLog MoinMoin/PageEditor.py MoinMoin/multiconfig.py
+     docs/CHANGES
+
+
 2006-04-07 17:33:31 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-529
 
     Summary:
--- a/MoinMoin/PageEditor.py	Fri Apr 07 16:33:31 2006 +0000
+++ b/MoinMoin/PageEditor.py	Fri Apr 07 16:44:15 2006 +0000
@@ -408,16 +408,12 @@
         self.request.write("</form>")
         
         # QuickHelp originally by Georg Mischler <schorsch@lightingwiki.com>
-        self.request.write(self.request.formatter.div(1, id="editor-help"))
-        self.request.write(_(""" Emphasis:: [[Verbatim('')]]''italics''[[Verbatim('')]]; [[Verbatim(''')]]'''bold'''[[Verbatim(''')]]; [[Verbatim(''''')]]'''''bold italics'''''[[Verbatim(''''')]]; [[Verbatim('')]]''mixed ''[[Verbatim(''')]]'''''bold'''[[Verbatim(''')]] and italics''[[Verbatim('')]]; [[Verbatim(----)]] horizontal rule.
- Headings:: [[Verbatim(=)]] Title 1 [[Verbatim(=)]]; [[Verbatim(==)]] Title 2 [[Verbatim(==)]]; [[Verbatim(===)]] Title 3 [[Verbatim(===)]];   [[Verbatim(====)]] Title 4 [[Verbatim(====)]]; [[Verbatim(=====)]] Title 5 [[Verbatim(=====)]].
- Lists:: space and one of: * bullets; 1., a., A., i., I. numbered items; 1.#n start numbering at n; space alone indents.
- Links:: [[Verbatim(JoinCapitalizedWords)]]; [[Verbatim(["brackets and double quotes"])]]; url; [url]; [url label].
- Tables:: || cell text |||| cell text spanning 2 columns ||;    no trailing white space allowed after tables or titles.
-
-(!) For more help, see HelpOnEditing or SyntaxReference.
-"""))
-        self.request.write(self.request.formatter.div(0))
+        markup = self.pi_format or self.request.cfg.default_markup
+        quickhelp = self.request.cfg.editor_quickhelp.get(markup, "")
+        if quickhelp:
+            self.request.write(self.request.formatter.div(1, id="editor-help"))
+            self.request.write(_(quickhelp))
+            self.request.write(self.request.formatter.div(0))
 
         if preview is not None:
             if staytop:
--- a/MoinMoin/multiconfig.py	Fri Apr 07 16:33:31 2006 +0000
+++ b/MoinMoin/multiconfig.py	Fri Apr 07 16:44:15 2006 +0000
@@ -207,6 +207,36 @@
     editor_default = 'text' # which editor is called when nothing is specified
     editor_ui = 'freechoice' # which editor links are shown on user interface
     editor_force = False
+    editor_quickhelp = { # editor markup hints quickhelp 
+        'wiki': _("""\
+ Emphasis:: [[Verbatim('')]]''italics''[[Verbatim('')]]; [[Verbatim(''')]]'''bold'''[[Verbatim(''')]]; [[Verbatim(''''')]]'''''bold italics'''''[[Verbatim(''''')]]; [[Verbatim('')]]''mixed ''[[Verbatim(''')]]'''''bold'''[[Verbatim(''')]] and italics''[[Verbatim('')]]; [[Verbatim(----)]] horizontal rule.
+ Headings:: [[Verbatim(=)]] Title 1 [[Verbatim(=)]]; [[Verbatim(==)]] Title 2 [[Verbatim(==)]]; [[Verbatim(===)]] Title 3 [[Verbatim(===)]];   [[Verbatim(====)]] Title 4 [[Verbatim(====)]]; [[Verbatim(=====)]] Title 5 [[Verbatim(=====)]].
+ Lists:: space and one of: * bullets; 1., a., A., i., I. numbered items; 1.#n start numbering at n; space alone indents.
+ Links:: [[Verbatim(JoinCapitalizedWords)]]; [[Verbatim(["brackets and double quotes"])]]; url; [url]; [url label].
+ Tables:: || cell text |||| cell text spanning 2 columns ||;    no trailing white space allowed after tables or titles.
+
+(!) For more help, see HelpOnEditing or SyntaxReference.
+"""),
+        'rst': _("""\
+Emphasis: <i>*italic*</i> <b>**bold**</b> ``monospace``<br/>
+<br/><pre>
+Headings: Heading 1  Heading 2  Heading 3
+          =========  ---------  ~~~~~~~~~
+
+Horizontal rule: ---- 
+Links: TrailingUnderscore_ `multi word with backticks`_ external_ 
+
+.. _external: http://external-site.net/foo/
+
+Lists: * bullets; 1., a. numered items.
+</pre>
+<br/>
+(!) For more help, see 
+<a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html">
+reStructuredText Quick Reference
+</a>
+"""),
+    }
     edit_locking = 'warn 10' # None, 'warn <timeout mins>', 'lock <timeout mins>'
     edit_rows = 20
                 
--- a/docs/CHANGES	Fri Apr 07 16:33:31 2006 +0000
+++ b/docs/CHANGES	Fri Apr 07 16:44:15 2006 +0000
@@ -36,6 +36,9 @@
 Version 1.5.3-current:
   New Features:
     * modified SystemInfo macro to give human readable units and disk usage
+    * cfg.editor_quickhelp makes the quick help below the editor configurable
+      (at least as far as the default_markup is concerned). If set to None,
+      it doesn't display any quickhelp.
 
   Bugfixes:
     * fixed double class attribute for nonexistent links