| | |
| | | var input_replyto = rcube_find_object('_replyto'); |
| | | var input_subject = rcube_find_object('_subject'); |
| | | var input_message = rcube_find_object('_message'); |
| | | var draftid = rcube_find_object('_draft_saveid'); |
| | | |
| | | // init live search events |
| | | if (input_to) |
| | |
| | | this.init_address_input_events(input_bcc); |
| | | |
| | | // add signature according to selected identity |
| | | if (input_from && input_from.type=='select-one') |
| | | if (input_from && input_from.type=='select-one' && (!draftid || draftid.value=='')) |
| | | this.change_identity(input_from); |
| | | |
| | | if (input_to && input_to.value=='') |
| | |
| | | case 'compose': |
| | | var url = this.env.comm_path+'&_action=compose'; |
| | | |
| | | if (this.task=='mail' && this.env.mailbox==this.env.drafts_mailbox) |
| | | if (this.task=='mail') |
| | | { |
| | | var uid; |
| | | if (uid = this.get_single_uid()) |
| | | url += '&_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox); |
| | | } |
| | | url += '&_mbox='+urlencode(this.env.mailbox); |
| | | |
| | | if (this.env.mailbox==this.env.drafts_mailbox) |
| | | { |
| | | var uid; |
| | | if (uid = this.get_single_uid()) |
| | | url += '&_draft_uid='+uid; |
| | | } |
| | | } |
| | | // modify url if we're in addressbook |
| | | else if (this.task=='addressbook') |
| | | { |
| | | // switch to mail compose step directly |
| | | if (props && props.indexOf('@') > 0) |
| | | { |
| | | { |
| | | url = this.get_task_url('mail', url); |
| | | this.redirect(url + '&_to='+urlencode(props)); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // use contact_id passed as command parameter |
| | | var a_cids = new Array(); |
| | |
| | | rows[uid].forwarded = status; |
| | | else if (flag == 'flagged') |
| | | rows[uid].flagged = status; |
| | | |
| | | this.env.messages[uid] = rows[uid]; |
| | | } |
| | | |
| | | // set message row status, class and icon |
| | |
| | | { |
| | | rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, ''); |
| | | this.set_classname(rows[uid].obj, 'deleted', false); |
| | | } |
| | | |
| | | if (rows[uid].flagged && rows[uid].classname.indexOf('flagged')<0) |
| | | { |
| | | rows[uid].classname += ' flagged'; |
| | | this.set_classname(rows[uid].obj, 'flagged', true); |
| | | } |
| | | else if (!rows[uid].flagged && rows[uid].classname.indexOf('flagged')>=0) |
| | | { |
| | | rows[uid].classname = rows[uid].classname.replace(/\s*flagged/, ''); |
| | | this.set_classname(rows[uid].obj, 'flagged', false); |
| | | } |
| | | |
| | | this.set_message_icon(uid); |
| | |
| | | this.message_list.remove_row(id, (n == selection.length-1)); |
| | | else |
| | | { |
| | | rows[id].deleted = true; |
| | | this.set_message_status(id, 'deleted', true); |
| | | if (this.env.read_when_deleted) |
| | | rows[id].unread = false; |
| | | this.set_message_status(id, 'unread', false); |
| | | this.set_message(id); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // also send search request to get the right messages |
| | | if (this.env.search_request) |
| | | add_url += '&_search='+this.env.search_request; |
| | |
| | | { |
| | | uid = a_uids[i]; |
| | | if (rows[uid]) |
| | | { |
| | | rows[uid].unread = false; |
| | | rows[uid].read = true; |
| | | this.set_message(uid); |
| | | } |
| | | this.set_message(uid, 'unread', false); |
| | | } |
| | | }; |
| | | |
| | |
| | | var input_to = rcube_find_object('_to'); |
| | | var input_cc = rcube_find_object('_cc'); |
| | | var input_bcc = rcube_find_object('_bcc'); |
| | | var input_from = rcube_find_object('_from'); |
| | | var input_subject = rcube_find_object('_subject'); |
| | | var input_message = rcube_find_object('_message'); |
| | | |
| | | // check sender (if have no identities) |
| | | if (input_from.type == 'text' && !rcube_check_email(input_from.value, true)) |
| | | { |
| | | alert(this.get_label('nosenderwarning')); |
| | | input_from.focus(); |
| | | return false; |
| | | } |
| | | |
| | | // check for empty recipient |
| | | var recipients = input_to.value ? input_to.value : (input_cc.value ? input_cc.value : input_bcc.value); |
| | |
| | | this.display_spellcheck_controls = function(vis) |
| | | { |
| | | if (this.env.spellcheck) { |
| | | // stop spellchecking process |
| | | if (!vis && !this.spellcheck_ready) |
| | | { |
| | | exec_event(this.env.spellcheck.check_link, 'click'); |
| | | this.set_spellcheck_state('ready'); |
| | | } |
| | | |
| | | this.env.spellcheck.check_link.style.visibility = vis ? 'visible' : 'hidden'; |
| | | this.env.spellcheck.switch_lan_pic.style.visibility = vis ? 'visible' : 'hidden'; |
| | | } |
| | |
| | | |
| | | var row = document.createElement('TR'); |
| | | row.id = 'rcmrow'+uid; |
| | | row.className = 'message '+(even ? 'even' : 'odd')+(flags.unread ? ' unread' : '')+(flags.deleted ? ' deleted' : ''); |
| | | row.className = 'message' |
| | | + (even ? ' even' : ' odd') |
| | | + (flags.unread ? ' unread' : '') |
| | | + (flags.deleted ? ' deleted' : '') |
| | | + (flags.flagged ? ' flagged' : ''); |
| | | |
| | | if (this.message_list.in_selection(uid)) |
| | | row.className += ' selected'; |
| | |
| | | case 'getunread': |
| | | case 'list': |
| | | if (this.task == 'mail') { |
| | | if (this.message_list) |
| | | if (this.message_list && request_obj.__action == 'list') |
| | | this.msglist_select(this.message_list); |
| | | this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0)); |
| | | this.enable_command('purge', this.purge_mailbox_test()); |
| | | } |
| | | else if (this.task == 'addressbook') |
| | | this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); |
| | | |
| | | break; |
| | | } |
| | | |