From c50d8872ced7c09dd9fcf5b3bf460c31e5b0c0ce Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 3 Nov 2010 14:19:48 +0000 Subject: - Add missing confirmation/error messages on contact/group/message actions (#1486845) - Add 'loading' message on message move/copy/delete/mark actions --- program/js/app.js | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'program/js') diff --git a/program/js/app.js b/program/js/app.js index 870459dc4..bbc455021 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -2362,6 +2362,7 @@ function rcube_webmail() return; var a_uids = [], + lock = this.display_message(this.get_label('copyingmessage'), 'loading'), add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : ''); if (this.env.uid) @@ -2374,7 +2375,7 @@ function rcube_webmail() } // send request to server - this.http_post('copy', '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, false); + this.http_post('copy', '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock); }; // move selected messages to the specified mailbox @@ -2425,7 +2426,7 @@ function rcube_webmail() return false; } // if there isn't a defined trash mailbox or we are in it - else if (!this.env.trash_mailbox || this.env.mailbox == this.env.trash_mailbox) + else if (!this.env.trash_mailbox || this.env.mailbox == this.env.trash_mailbox) this.permanently_remove_messages(); // if there is a trash mailbox defined and we're not currently in it else { @@ -2456,7 +2457,7 @@ function rcube_webmail() // @private this._with_selected_messages = function(action, lock, add_url) { - var a_uids = [], count = 0; + var a_uids = [], count = 0, msg; if (this.env.uid) a_uids[0] = this.env.uid; @@ -2486,7 +2487,7 @@ function rcube_webmail() } } - // also send search request to get the right messages + // also send search request to get the right messages if (this.env.search_request) add_url += '&_search='+this.env.search_request; @@ -2501,6 +2502,11 @@ function rcube_webmail() add_url += '&_uid='+this.uids_to_list(a_uids); + if (!lock) { + msg = action == 'moveto' ? 'movingmessage' : 'deletingmessage'; + lock = this.display_message(this.get_label(msg), 'loading'); + } + // send request to server this.http_post(action, '_mbox='+urlencode(this.env.mailbox)+add_url, lock); }; @@ -2564,13 +2570,14 @@ function rcube_webmail() for (var i=0; i