diff MoinMoin/PageGraphicalEditor.py @ 3035:b545446562a0

fix for MoinMoinBugs/TrivialChangeEasyAccess (thanks to Ninnu) (ported from 1.6)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 03 Feb 2008 20:57:26 +0100
parents 7b0aadb97d01
children c0d62e7f4fbc
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Sun Feb 03 20:37:01 2008 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Sun Feb 03 20:57:26 2008 +0100
@@ -287,6 +287,23 @@
 <input class="button" type="submit" name="button_cancel" value="%s">
 <input type="hidden" name="editor" value="gui">
 ''' % (button_spellcheck, cancel_button_text, ))
+        if self.cfg.mail_enabled:
+            request.write('''
+<script type="text/javascript">
+    function toggle_trivial(CheckedBox)
+    {
+        TrivialBoxes = document.getElementsByName("trivial");
+        for (var i = 0; i < TrivialBoxes.length; i++)
+            TrivialBoxes[i].checked = CheckedBox.checked;
+    }
+</script>
+&nbsp;
+<input type="checkbox" name="trivial" id="chktrivial" value="1" %(checked)s onclick="toggle_trivial(this)">
+<label for="chktrivial">%(label)s</label>
+''' % {
+          'checked': ('', 'checked')[form.get('trivial', ['0'])[0] == '1'],
+          'label': _("Trivial change", formatted=False),
+       })
 
         from MoinMoin.security.textcha import TextCha
         request.write(TextCha(request).render())
@@ -361,7 +378,7 @@
         if self.cfg.mail_enabled:
             request.write('''
 &nbsp;
-<input type="checkbox" name="trivial" id="chktrivial" value="1" %(checked)s>
+<input type="checkbox" name="trivial" id="chktrivial" value="1" %(checked)s onclick="toggle_trivial(this)">
 <label for="chktrivial">%(label)s</label> ''' % {
                 'checked': ('', 'checked')[form.get('trivial', ['0'])[0] == '1'],
                 'label': _("Trivial change"),