From d06e57fdf21879a4e93d6c00b939ca42094d3e86 Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Wed, 21 Sep 2011 16:43:47 -0400 Subject: [PATCH] Skip confirmation dialog when deleting a contact from a source that supports undelete operations --- program/js/app.js | 39 ++++++++++++++++++++++++--------------- 1 files changed, 24 insertions(+), 15 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index f9233eb..52b3f60 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3620,19 +3620,15 @@ return; if (q.length && q.length < min) { - if (!this.env.acinfo) { - this.env.acinfo = this.display_message( + if (!this.ksearch_info) { + this.ksearch_info = this.display_message( this.get_label('autocompletechars').replace('$min', min)); } return; } - else if (this.env.acinfo) { - this.hide_message(this.env.acinfo); - } var old_value = this.ksearch_value; this.ksearch_value = q; - this.ksearch_destroy(); // ...string is empty @@ -3730,16 +3726,20 @@ this.env.contacts = this.env.contacts.concat(results); // run next parallel search - if (maxlen > 0 && this.ksearch_data.id == reqid && this.ksearch_data.sources.length) { - var lock, xhr, props = this.ksearch_data, source = props.sources.shift(); - if (source) { - lock = this.display_message(this.get_label('searching'), 'loading'); - xhr = this.http_post(props.action, '_search='+urlencode(s_val)+'&_id='+reqid - +'&_source='+urlencode(source), lock); + if (this.ksearch_data.id == reqid) { + if (maxlen > 0 && this.ksearch_data.sources.length) { + var lock, xhr, props = this.ksearch_data, source = props.sources.shift(); + if (source) { + lock = this.display_message(this.get_label('searching'), 'loading'); + xhr = this.http_post(props.action, '_search='+urlencode(s_val)+'&_id='+reqid + +'&_source='+urlencode(source), lock); - this.ksearch_data.locks.push(lock); - this.ksearch_data.requests.push(xhr); + this.ksearch_data.locks.push(lock); + this.ksearch_data.requests.push(xhr); + } } + else if (!maxlen && !this.ksearch_msg) + this.ksearch_msg = this.display_message(this.get_label('autocompletemore')); } }; @@ -3783,7 +3783,15 @@ for (i=0, len=ac.locks.length; i<len; i++) this.abort_request({request: ac.requests[i], lock: ac.locks[i]}); + if (this.ksearch_info) + this.hide_message(this.ksearch_info); + + if (this.ksearch_msg) + this.hide_message(this.ksearch_msg); + this.ksearch_data = null; + this.ksearch_info = null; + this.ksearch_msg = null; } /*********************************************************/ @@ -3986,7 +3994,8 @@ { // exit if no mailbox specified or if selection is empty var selection = this.contact_list.get_selection(); - if (!(selection.length || this.env.cid) || !confirm(this.get_label('deletecontactconfirm'))) + var undelete = this.env.address_sources[this.env.source].undelete; + if (!(selection.length || this.env.cid) || (!undelete && !confirm(this.get_label('deletecontactconfirm')))) return; var id, n, a_cids = [], qs = ''; -- Gitblit v1.9.1