| | |
| | | |
| | | case 'open': |
| | | if (uid = this.get_single_uid()) { |
| | | obj.href = this.url('show', {_mbox: this.env.mailbox, _uid: uid}); |
| | | obj.href = this.url('show', {_mbox: this.get_message_mailbox(uid), _uid: uid}); |
| | | return true; |
| | | } |
| | | break; |
| | |
| | | break; |
| | | |
| | | case 'list': |
| | | // TODO: don't reset search but re-send for the new folder |
| | | if (props && props != '') |
| | | this.reset_qsearch(); |
| | | if (this.env.action == 'compose' && this.env.extwin) |
| | |
| | | this.load_contact(cid, 'edit'); |
| | | else if (this.task == 'settings' && props) |
| | | this.load_identity(props, 'edit-identity'); |
| | | else if (this.task == 'mail' && (cid = this.get_single_uid())) { |
| | | url = { _mbox: this.env.mailbox }; |
| | | url[this.env.mailbox == this.env.drafts_mailbox && props != 'new' ? '_draft_uid' : '_uid'] = cid; |
| | | else if (this.task == 'mail' && (uid = this.get_single_uid())) { |
| | | url = { _mbox: this.get_message_mailbox(uid) }; |
| | | url[this.env.mailbox == this.env.drafts_mailbox && props != 'new' ? '_draft_uid' : '_uid'] = uid; |
| | | this.open_compose_step(url); |
| | | } |
| | | break; |
| | |
| | | case 'reply-list': |
| | | case 'reply': |
| | | if (uid = this.get_single_uid()) { |
| | | url = {_reply_uid: uid, _mbox: this.env.mailbox}; |
| | | url = {_reply_uid: uid, _mbox: this.get_message_mailbox(uid)}; |
| | | if (command == 'reply-all') |
| | | // do reply-list, when list is detected and popup menu wasn't used |
| | | url._all = (!props && this.env.reply_all_mode == 1 && this.commands['reply-list'] ? 'list' : 'all'); |
| | |
| | | this.gui_objects.messagepartframe.contentWindow.print(); |
| | | } |
| | | else if (uid = this.get_single_uid()) { |
| | | ref.printwin = this.open_window(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''), true, true); |
| | | ref.printwin = this.open_window(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.get_message_mailbox(uid))+(this.env.safemode ? '&_safe=1' : ''), true, true); |
| | | if (this.printwin) { |
| | | if (this.env.action != 'show') |
| | | this.mark_message('read', uid); |
| | |
| | | if (this.env.action == 'get') { |
| | | location.href = location.href.replace(/_frame=/, '_download='); |
| | | } |
| | | else if (uid = this.get_single_uid()) |
| | | this.goto_url('viewsource', { _uid: uid, _mbox: this.env.mailbox, _save: 1 }); |
| | | else if (uid = this.get_single_uid()) { |
| | | this.goto_url('viewsource', { _uid: uid, _mbox: this.get_message_mailbox(uid), _save: 1 }); |
| | | } |
| | | break; |
| | | |
| | | // quicksearch |
| | |
| | | |
| | | var uid = list.get_single_selection(); |
| | | |
| | | if (uid && this.env.mailbox == this.env.drafts_mailbox) |
| | | if (uid && (this.env.messages[uid].mbox || this.env.mailbox) == this.env.drafts_mailbox) |
| | | this.open_compose_step({ _draft_uid: uid, _mbox: this.env.mailbox }); |
| | | else if (uid) |
| | | this.show_message(uid, false, false); |
| | |
| | | selected: this.select_all_mode || this.message_list.in_selection(uid), |
| | | ml: flags.ml?1:0, |
| | | ctype: flags.ctype, |
| | | mbox: flags.mbox, |
| | | // flags from plugins |
| | | flags: flags.extra_flags |
| | | }); |
| | |
| | | |
| | | var win, target = window, |
| | | action = preview ? 'preview': 'show', |
| | | url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox); |
| | | url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.get_message_mailbox(id)); |
| | | |
| | | if (preview && (win = this.get_frame_window(this.env.contentframe))) { |
| | | target = win; |
| | |
| | | if ((n = $.inArray('status', this.env.coltypes)) >= 0) |
| | | this.env.status_col = n; |
| | | |
| | | if (list) |
| | | if (list) { |
| | | list.hide_column('folder', !(this.env.search_request || this.env.search_id)); |
| | | list.init_header(); |
| | | } |
| | | }; |
| | | |
| | | // replace content of row count display |
| | |
| | | return this.env.cid ? this.env.cid : (this.contact_list ? this.contact_list.get_single_selection() : null); |
| | | }; |
| | | |
| | | // get the IMP mailbox of the message with the given UID |
| | | this.get_message_mailbox = function(uid) |
| | | { |
| | | var msg = this.env.messages ? this.env.messages[uid] : {}; |
| | | return msg.mbox || this.env.mailbox; |
| | | } |
| | | |
| | | // gets cursor position |
| | | this.get_caret_pos = function(obj) |
| | | { |