summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2006-11-21 08:18:29 +0000
committersvncommit <devs@roundcube.net>2006-11-21 08:18:29 +0000
commit31c171846ec7c387fb7fc3e979a63330420002b0 (patch)
treeb59a714ae63247d3711e9a4ded660e73183847b7
parentd17008560036f91fd7327b17ad68cbadc3f7a8ac (diff)
Bypass Trash folder if Shift-Del was pressed.
-rw-r--r--program/js/app.js9
-rw-r--r--program/js/list.js4
-rw-r--r--program/localization/en_US/messages.inc2
-rw-r--r--program/steps/mail/func.inc1
4 files changed, 15 insertions, 1 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 6485a98d7..1f0e3ee1f 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1342,7 +1342,14 @@ function rcube_webmail()
// if there is a trash mailbox defined and we're not currently in it:
if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase()!=String(this.env.trash_mailbox).toLowerCase())
- this.move_messages(this.env.trash_mailbox);
+ // if shift was pressed delete it immediately
+ if (this.message_list.shiftkey)
+ {
+ if (confirm(this.get_label('deletemessagesconfirm')))
+ this.permanently_remove_messages();
+ }
+ else
+ this.move_messages(this.env.trash_mailbox);
// if there is a trash mailbox defined but we *are* in it:
else if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() == String(this.env.trash_mailbox).toLowerCase())
this.permanently_remove_messages();
diff --git a/program/js/list.js b/program/js/list.js
index 88719049a..eac19bb60 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -32,6 +32,8 @@ function rcube_list_widget(list, p)
this.rows = [];
this.selection = [];
+ this.shiftkey = false;
+
this.multiselect = false;
this.draggable = false;
this.keyboard = false;
@@ -504,6 +506,8 @@ key_press: function(e)
if (this.focused != true)
return true;
+ this.shiftkey = e.shiftKey;
+
var keyCode = document.layers ? e.which : document.all ? event.keyCode : document.getElementById ? e.keyCode : 0;
var mod_key = rcube_event.get_modifier(e);
switch (keyCode)
diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc
index 2856db8a9..1a49a8e82 100644
--- a/program/localization/en_US/messages.inc
+++ b/program/localization/en_US/messages.inc
@@ -68,6 +68,8 @@ $messages['errordeleting'] = 'Could not delete the message';
$messages['deletecontactconfirm'] = 'Do you really want to delete the selected contact(s)?';
+$messages['deletemessagesconfirm'] = 'Do you really want to delete the selected message(s)?';
+
$messages['deletefolderconfirm'] = 'Do you really want to delete this folder?';
$messages['purgefolderconfirm'] = 'Do you really want to delete all messages in this folder?';
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index fb7b14c65..76bb9b712 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -79,6 +79,7 @@ function rcmail_mailbox_list($attrib)
// add some labels to client
rcube_add_label('purgefolderconfirm');
+ rcube_add_label('deletemessagesconfirm');
// $mboxlist_start = rcube_timer();