here is the delete key patch. It also further abstracts (a little) the key handling code, so it should be easier to add future keys in there. The delete action performs the exact same action as the delete button, so there are no prompts or anything. If the trash folder is present it puts it in there, if not it just deletes it. Again this represents no change from the current delete button functionality.

I did not add a preference for turning off the key shortcuts. To me this seems like a relatively low priority, but I welcome input.

Also, I've been known to break things for Mac browsers in the past so if anyone wants to test on any Mac browsers I would be very grateful.


-Charles

Thomas Bruederli wrote:
Charles McNulty schrieb:
Not to interrupt the how-to-quote discussion, but I'd just like to
comment for a moment on RC.  The above patch will work, I'm sure, but
it's more proper place would be in the javascript files along with all
of the rest of the key handling functionality.  I'd be happy to work on
getting delete in there in the next couple of days.

That would be great. As this discussion showed, my plans to build a
user-customizable shortcut handler was a bit too ambitious...
But I guess we should implement a boolean user pref to enable/disable
keyboard shortcuts.
-Charles


Thanks to all who posted to this thread.

Thomas



Index: app.js
===================================================================
RCS file: /cvsroot/roundcubemail/roundcubemail/program/js/app.js,v
retrieving revision 1.39
diff -r1.39 app.js
239c239
<     document.onkeydown   = function(e){ return 
rcube_webmail_client.use_arrow_keys(e, msg_list_frame); };
---
>     document.onkeydown   = function(e){ return 
> rcube_webmail_client.key_pressed(e, msg_list_frame); };
271,272c271
<   // reset last clicked if user clicks on anything other than the message 
table
<   this.use_arrow_keys = function(e, msg_list_frame) {
---
>   this.key_pressed = function(e, msg_list_frame) {
275d273
<
277a276,289
>     switch (keyCode) {
>       case 40:
>       case 38:
>         return this.use_arrow_key(keyCode, mod_key, msg_list_frame);
>         break;
>       case 46:
>         return this.use_delete_key(keyCode, mod_key, msg_list_frame);
>         break;
>       default:
>         return true;
>     }
>   }
>
>   this.use_arrow_key = function(keyCode, mod_key, msg_list_frame) {
279d290
<
305d315
<
307a318,322
>
>   this.use_delete_key = function(keyCode, mod_key, msg_list_frame){
>     this.command('delete','',this);
>     return false;
>   }

Reply via email to