| | |
| | | // 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 { |