Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#1752 closed enhancement (fixed)

Keyboard shortcut for Edit/Preview buttons

Reported by: Shun-ichi Goto <gotoh@…> Owned by: Jonas Borgström
Priority: normal Milestone: 0.9
Component: general Version: none
Severity: normal Keywords: accesskey
Cc: m@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm using modified template file with adding keyboard shortcut via 'accesskey' attribute for 'Edit' button and 'Preview' button they are frequently used.

I assigned 'r' key (ALT-R on windows) for 'Preview', and 'e' key (ALT-E on windows) for 'Edit'.
## Other buttons are not assinged because of avoid submitting by miss operation.

I think this is usefull for daily trac operation.

Index: newticket.cs
===================================================================
--- newticket.cs	(revision 1886)
+++ newticket.cs	(working copy)
@@ -95,7 +95,7 @@
    var:htdocs_location ?>js/wikitoolbar.js"></script>
 
  <div class="buttons">
-  <input type="submit" name="preview" value="Preview" />&nbsp;
+  <input type="submit" name="preview" value="Preview" accesskey="r" />&nbsp;
   <input type="submit" value="Submit ticket" />
  </div>
 </form>
Index: ticket.cs
===================================================================
--- ticket.cs	(revision 1886)
+++ ticket.cs	(working copy)
@@ -287,7 +287,7 @@
    var:htdocs_location ?>js/wikitoolbar.js"></script>
 
  <div class="buttons">
-  <input type="submit" name="preview" value="Preview" />&nbsp;
+  <input type="submit" name="preview" value="Preview" accesskey="r" />&nbsp;
   <input type="submit" value="Submit changes" />
  </div>
 </form>
Index: wiki.cs
===================================================================
--- wiki.cs	(revision 1886)
+++ wiki.cs	(working copy)
@@ -227,7 +227,7 @@
      <?cs /if ?>
     </fieldset>
     <div class="buttons">
-     <input type="submit" name="preview" value="Preview" />&nbsp;
+     <input type="submit" name="preview" value="Preview" accesskey="r" />&nbsp;
      <input type="submit" name="save" value="Submit changes" />&nbsp;
      <input type="submit" name="cancel" value="Cancel" />
     </div>
@@ -257,7 +257,7 @@
     if:trac.acl.WIKI_MODIFY ?>
      <form method="get" action="<?cs var:wiki.current_href ?>"><div>
       <input type="hidden" name="action" value="edit" />
-      <input type="submit" value="<?cs if:wiki.exists ?>Edit<?cs else ?>Create<?cs /if ?> this page" />
+      <input type="submit" value="<?cs if:wiki.exists ?>Edit<?cs else ?>Create<?cs /if ?> this page" accesskey="e" />
      </div></form><?cs
      if:wiki.exists ?>
       <form method="get" action="<?cs var:wiki.attach_href ?>"><div>

Attachments (0)

Change History (6)

comment:1 by Markus Tacker <m@…>, 19 years ago

Bump.

Please also add accesskey="s" to the submit button.s

comment:2 by Markus Tacker <m@…>, 19 years ago

Cc: m@… added

comment:3 by Christopher Lenz, 19 years ago

Component: wikigeneral
Milestone: 0.9
Resolution: fixed
Status: newclosed

Implemented in [2185]. Also adds the access key “f” for jumping to the quick-search text field.

I agree with Shun-ichi Goto that adding access keys for operations such as “Submit” or “Cancel” might be dangerous. You accidentially hit the key (which you aren't aware of due to the bad discoverability of access keys in current user agents), and the current form is submitted or cancelled.

comment:4 by fumanchu@…, 19 years ago

There go my file and edit menus in Firefox on Windows; access keys are extremely annoying for that reason, and are a major usability headache at, say, Wikipedia for the same reason. Alt-F, Alt-C now fails to close the tab; instead, it jumps me to the search box. Alt-E, Alt-F used to allow me to search the text on the current page, now it takes me to "Edit this page", in sharp contrast to every other web page on the 'Net.

I would very much like to see at least the 'e' and 'f' accesskey's backed out of the trunk.

comment:5 by Markus Tacker <m@…>, 19 years ago

I think it would be usefull to move this to a configuration section where you could define the access keys yourself, even for the submit button.

comment:6 by Markus Tacker <m@…>, 19 years ago

Keywords: accesskey added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.