Reformateditor layout and add accesskeys
authorBernie Innocenti <bernie@codewiz.org>
Sun, 30 Nov 2008 18:54:43 +0000 (19:54 +0100)
committerBernie Innocenti <bernie@codewiz.org>
Sun, 30 Nov 2008 18:54:43 +0000 (19:54 +0100)
geekigeeki.py

index 794350389c8def020777bfe47efa8733a001a0f4..5a3eb8e58abc8b422d77a1b64bda50789886e3c0 100755 (executable)
@@ -694,19 +694,25 @@ class Page:
             + ' for ' + cgi.escape(remote_user())
             + ' from ' + cgi.escape(get_hostname(remote_host()))
             + '</b></p>')
-        print '<div class="editor"><form method="post" enctype="multipart/form-data" action="%s">' % relative_url(self.page_name)
+        print '<div class="editor"><form name="editform" method="post" enctype="multipart/form-data" action="%s">' % relative_url(self.page_name)
         print '<input type="hidden" name="edit" value="%s">' % (self.page_name)
-        print '<textarea wrap="off" spellcheck="true" id="editor" name="savetext" rows="17" cols="100">%s</textarea>' % (preview or self.get_raw_body())
-        print 'Or upload a file: <input type="file" name="file" value="%s" />' % file
+        print '<input type="input" id="editor" name="changelog" value="Edit page %s" accesskey="c" /><br />' % (self.page_name)
+        print '<textarea wrap="off" spellcheck="true" id="editor" name="savetext" rows="17" cols="100" accesskey="e">%s</textarea>' % (preview or self.get_raw_body())
+        print '<label for="file" accesskey="u">Or Upload a file:</label> <input type="file" name="file" value="%s" />' % file
         print """
             <br />
-            <input type="submit" name="save" value="Save" />
-            <input type="submit" name="preview" value="Preview" />
+            <input type="submit" name="save" value="Save" accesskey="s">
+            <input type="submit" name="preview" value="Preview" accesskey="p" />
             <input type="reset" value="Reset" />
             <input type="submit" name="cancel" value="Cancel" />
-            <br />"""
-       print "Changelog: <input type=\"input\" name=\"changelog\" value=\"Edit page %s\"/>" % self.page_name
-       print"</form></div>"
+            <br />
+            </form></div>
+            <script language="javascript">
+            <!--
+            document.editform.savetext.focus()
+            //-->
+            </script>
+            """
         print "<p>" + Page('EditingTips').link_to() + "</p>"
         if preview:
             print "<div class='preview'>"