From: Michael M Slusarz Date: Wed, 3 Mar 2010 05:37:55 +0000 (-0700) Subject: Bug #8895: Fix quickreply X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0d6782f3504c15183e19be8114bedd645a3f2839;p=horde.git Bug #8895: Fix quickreply --- diff --git a/imp/js/compose-base.js b/imp/js/compose-base.js index 48177df40..e8f837c68 100644 --- a/imp/js/compose-base.js +++ b/imp/js/compose-base.js @@ -10,11 +10,11 @@ var IMP_Compose_Base = { // Vars defaulting to null: editor_on, identities - getIdentity: function(id) + getIdentity: function(id, editor_on) { return { id: this.identities[id], - sig: this.identities[id][(this.editor_on ? 'sig_html' : 'sig')].replace(/^\n/, '') + sig: this.identities[id][((editor_on || this.editor_on) ? 'sig_html' : 'sig')].replace(/^\n/, '') }; }, diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index ea71ed64b..7a3d2da66 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -18,7 +18,8 @@ var DimpCompose = { if (window.confirm(DIMP.text_compose.cancel)) { if ((this.is_popup || DIMP.conf_compose.popup) && DIMP.baseWindow && - DIMP.baseWindow.DimpBase) { + DIMP.baseWindow.DimpBase && + !DIMP.conf_compose.qreply) { DIMP.baseWindow.focus(); } DimpCore.doAction(DIMP.conf_compose.auto_save_interval_val ? 'DeleteDraft' : 'CancelCompose', { imp_compose: $F('composeCache') }, { ajaxopts: { asynchronous: DIMP.conf_compose.qreply } }); @@ -390,6 +391,7 @@ var DimpCompose = { setMessageText: function(r) { var ta = $('composeMessage'); + if (!ta) { $('composeMessageParent').insert(new Element('TEXTAREA', { id: 'composeMessage', name: 'message', style: 'width:100%' }).insert(r.response.text)); } else { @@ -401,7 +403,7 @@ var DimpCompose = { } }, - // opts = auto, focus, fwd_list, noupdate + // opts = auto, focus, fwd_list, noupdate, show_editor fillForm: function(msg, header, opts) { // On IE, this can get loaded before DOM:loaded. @@ -428,8 +430,6 @@ var DimpCompose = { this.auto_save_interval.execute(); } - this.setBodyText(msg, true); - $('to').setValue(header.to); if (header.cc) { $('cc').setValue(header.cc); @@ -476,7 +476,10 @@ var DimpCompose = { break; } - if (DIMP.conf_compose.show_editor) { + this.setBodyText(msg); + this.resizeMsgArea(); + + if (DIMP.conf_compose.show_editor || opts.show_editor) { if (!IMP_Compose_Base.editor_on) { this.toggleHtmlEditor(opts.noupdate); } @@ -603,9 +606,11 @@ var DimpCompose = { * size by the available height, round down to the lowest integer * row, and resize the textarea. */ rows = parseInt(mah / (msg.clientHeight / msg.getAttribute('rows')), 10); - msg.writeAttribute({ rows: rows, disabled: false }); - if (de.scrollHeight - de.clientHeight) { - msg.writeAttribute('rows', rows - 1); + if (!isNaN(rows)) { + msg.writeAttribute({ rows: rows, disabled: false }); + if (de.scrollHeight - de.clientHeight) { + msg.writeAttribute('rows', rows - 1); + } } } }, diff --git a/imp/js/fullmessage-dimp.js b/imp/js/fullmessage-dimp.js index a230f6a08..7125faa88 100644 --- a/imp/js/fullmessage-dimp.js +++ b/imp/js/fullmessage-dimp.js @@ -45,19 +45,19 @@ var DimpFullmessage = { return; } - var r = result.response, - editor_on = ((r.format == 'html') && !DimpCompose.editor_on), - id = (r.identity === null) ? $F('identity') : r.identity, - i = DimpCompose.getIdentity(id, editor_on); + var i, + r = result.response, + id = (r.identity === null) ? $F('identity') : r.identity; + + r.opts.noupdate = true; + r.opts.show_editor = (r.format == 'html'); + + i = IMP_Compose_Base.getIdentity(id, r.opts.show_editor); $('identity', 'last_identity').invoke('setValue', id); DimpCompose.fillForm((i.id[2]) ? ("\n" + i.sig + r.body) : (r.body + "\n" + i.sig), r.header, r.opts); - if (editor_on) { - DimpCompose.toggleHtmlEditor(true); - } - if (r.imp_compose) { $('composeCache').setValue(r.imp_compose); }