[wp-trac] [WordPress Trac] #7643: Gmail-like comment manipulation
keyboard shorcuts
WordPress Trac
wp-trac at lists.automattic.com
Fri Aug 29 16:47:28 GMT 2008
#7643: Gmail-like comment manipulation keyboard shorcuts
-------------------------+--------------------------------------------------
Reporter: nbachiyski | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.7
Component: General | Version:
Severity: normal | Keywords: js shortcuts has-patch
-------------------------+--------------------------------------------------
j - down
k - up
x - mark (check the checkbox)
a - approve current comment (not checked)
u - unapprove
d - delete
s - spam
r - reply
Implemented as a generic jquery plugin and can be easily used on any table
or list. Uses [http://code.google.com/p/js-hotkeys/ jquery-hotkeys]. The
main idea is:
{{{
jQuery.table_hotkeys(jQuery('table.widefat'), ['a', 'u', 's', 'd', 'r']);
...
<tr class="some-css-class-prefix-current">
<a class="some-css-class-prefix-u" href="...">Unapprove</a>
</tr>
}}}
The plugin cycles through rows of the given table and when one of the keys
in the list is pressed, it looks for an element in that row with the
proper class and clicks on it. In the example above, if I press {{{u}}}
the Unapprove link of the current row will be clicked.
Known limitations and bugs:
* Bulk actions can't be triggered via the keyboard. If we want the
interface to be consistent we have two options:
1. Sacrifice either bulk shortcuts or single-comment shortcuts. I have
chosen to drop bulk actions, because they need more attention (ergo,
should be harder). Moreover, comments can be marked via the keyboard and
if one wants to delete all comments the only action with the mouse will be
to select Delete from the menu and click Apply.
2. Choose different shortcuts for single-comment and bulk actions. For
example Shift+u (aka U) can be bulk Unapprove and so on.
* Can't edit the comment because it is a normal link and they can't be
clicked via JS. There is a workaround and we will work around it if
needed.
* Clicking on an action button, which removes the comment from view,
loses the currently selected comment and the user has to press j or k to
bring the cursor back.
* The style for current comment is completely arbitrary (yellow
background). Better ideas will be appreciated.
--
Ticket URL: <http://trac.wordpress.org/ticket/7643>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list