| | |
| | | parent.rcmail.env.frame_lock = null; |
| | | } |
| | | |
| | | // Makes that reference to document.activeElement do not throw |
| | | // "unspecified error" in IE9 (#1489008) |
| | | if (this.env.framed && bw.ie) |
| | | document.documentElement.focus(); |
| | | |
| | | // enable general commands |
| | | this.enable_command('close', 'logout', 'mail', 'addressbook', 'settings', 'save-pref', 'compose', 'undo', 'about', 'switch-task', true); |
| | | |
| | |
| | | |
| | | // open attachment in frame if it's of a supported mimetype |
| | | if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, this.env.mimetypes) >= 0) { |
| | | var attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'+this.env.uid+props.part); |
| | | var attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', this.html_identifier('rcubemailattachment'+this.env.uid+props.part)); |
| | | if (attachment_win) { |
| | | setTimeout(function(){ attachment_win.focus(); }, 10); |
| | | break; |
| | |
| | | // Reset the auto-save timer |
| | | clearTimeout(this.save_timer); |
| | | |
| | | // compose form did not change |
| | | if (this.cmp_hash == this.compose_field_hash()) { |
| | | // compose form did not change (and draft wasn't saved already) |
| | | if (this.env.draft_id && this.cmp_hash == this.compose_field_hash()) { |
| | | this.auto_save_start(); |
| | | break; |
| | | } |
| | |
| | | |
| | | this.set_draft_id = function(id) |
| | | { |
| | | var rc; |
| | | |
| | | if (!this.env.draft_id && id && (rc = this.opener())) { |
| | | // refresh the drafts folder in opener window |
| | | if (rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == this.env.drafts_mailbox) |
| | | rc.command('checkmail'); |
| | | } |
| | | |
| | | this.env.draft_id = id; |
| | | $("input[name='_draft_saveid']").val(id); |
| | | }; |
| | | |
| | |
| | | sig = this.env.signatures[sig].text; |
| | | sig = sig.replace(/\r\n/g, '\n'); |
| | | |
| | | p = this.env.sig_above ? message.indexOf(sig) : message.lastIndexOf(sig); |
| | | p = this.env.top_posting ? message.indexOf(sig) : message.lastIndexOf(sig); |
| | | if (p >= 0) |
| | | message = message.substring(0, p) + message.substring(p+sig.length, message.length); |
| | | } |
| | |
| | | sig = this.env.signatures[id].text; |
| | | sig = sig.replace(/\r\n/g, '\n'); |
| | | |
| | | if (this.env.sig_above) { |
| | | if (this.env.top_posting) { |
| | | if (p >= 0) { // in place of removed signature |
| | | message = message.substring(0, p) + sig + message.substring(p, message.length); |
| | | cursor_pos = p - 1; |
| | |
| | | sigElem = doc.createElement('div'); |
| | | sigElem.setAttribute('id', '_rc_sig'); |
| | | |
| | | if (this.env.sig_above) { |
| | | if (this.env.top_posting) { |
| | | // if no existing sig and top posting then insert at caret pos |
| | | editor.getWin().focus(); // correct focus in IE & Chrome |
| | | |
| | |
| | | this.env.search_id = null; |
| | | }; |
| | | |
| | | this.sent_successfully = function(type, msg) |
| | | this.sent_successfully = function(type, msg, target) |
| | | { |
| | | this.display_message(msg, type); |
| | | |
| | | if (this.env.extwin) { |
| | | var opener_rc = this.opener(); |
| | | var rc = this.opener(); |
| | | this.lock_form(this.gui_objects.messageform); |
| | | if (opener_rc) |
| | | opener_rc.display_message(msg, type); |
| | | if (rc) { |
| | | rc.display_message(msg, type); |
| | | // refresh the folder where sent message was saved |
| | | if (target && rc.env.task == 'mail' && rc.env.action == '' && rc.env.mailbox == target) |
| | | rc.command('checkmail'); |
| | | } |
| | | setTimeout(function(){ window.close() }, 1000); |
| | | } |
| | | else { |