From 82bb12ab84242e6c82ef6f467a2cb29b9a337a1c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 7 Oct 2009 15:12:22 -0600 Subject: [PATCH] #message -> #composeMessage --- imp/compose-dimp.php | 2 +- imp/js/compose-dimp.js | 62 +++++++++++++++++++------------------- imp/js/compose.js | 24 +++++++-------- imp/lib/UI/Compose.php | 6 ++-- imp/templates/chunks/compose.php | 4 +-- imp/templates/compose/compose.html | 4 +-- imp/themes/ie6_or_less-dimp.css | 2 +- imp/themes/screen-dimp.css | 6 ++-- 8 files changed, 55 insertions(+), 55 deletions(-) diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index f6847146f..d292bca62 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -328,7 +328,7 @@ Horde::addInlineScript($compose_result['js']); Horde::addInlineScript(array(IMP_Dimp::notify()), 'dom'); /* Javascript to be run on window load. */ -$compose_result['js_onload'][] = 'DimpCompose.fillForm(' . Horde_Serialize::serialize($msg, Horde_Serialize::JSON) . ', ' . Horde_Serialize::serialize($header, Horde_Serialize::JSON) . ', "' . (($type == 'new' || $type == 'forward') ? 'to' : 'message') . '", true)'; +$compose_result['js_onload'][] = 'DimpCompose.fillForm(' . Horde_Serialize::serialize($msg, Horde_Serialize::JSON) . ', ' . Horde_Serialize::serialize($header, Horde_Serialize::JSON) . ', "' . (($type == 'new' || $type == 'forward') ? 'to' : 'composeMessage') . '", true)'; Horde::addInlineScript($compose_result['js_onload'], 'load'); $scripts = array( diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index 2bf99c292..bffd3f1a2 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -73,7 +73,7 @@ var DimpCompose = { var lastSignature, msg, nextSignature, pos, id = $F('identity'), last = this.get_identity($F('last_identity')), - msgval = $('message'), + msgval = $('composeMessage'), next = this.get_identity(id), ssm = $('save_sent_mail'); @@ -85,7 +85,7 @@ var DimpCompose = { // Finally try and replace the signature. if (this.editor_on) { - msg = FCKeditorAPI.GetInstance('message').GetHTML().replace(/\r\n/g, '\n'); + msg = FCKeditorAPI.GetInstance('composeMessage').GetHTML().replace(/\r\n/g, '\n'); lastSignature = '

'; nextSignature = '

' + next.sig.replace(/^ ?
\n/, '').replace(/ +/g, ' ') + '

'; @@ -113,7 +113,7 @@ var DimpCompose = { msg = msg.replace(/\r\n/g, '\n').replace(/\n/g, '\r\n'); if (this.editor_on) { - FCKeditorAPI.GetInstance('message').SetHTML(msg); + FCKeditorAPI.GetInstance('composeMessage').SetHTML(msg); } else { msgval.setValue(msg); } @@ -198,7 +198,7 @@ var DimpCompose = { } else { // Move HTML text to textarea field for submission. if (this.editor_on) { - FCKeditorAPI.GetInstance('message').UpdateLinkedField(); + FCKeditorAPI.GetInstance('composeMessage').UpdateLinkedField(); } // Use an AJAX submit here so that we can do javascript-y stuff @@ -331,23 +331,23 @@ var DimpCompose = { if (this.editor_on) { this.editor_on = false; - text = FCKeditorAPI.GetInstance('message').GetHTML(); - $('messageParent').childElements().invoke('hide'); - $('message').show(); + text = FCKeditorAPI.GetInstance('composeMessage').GetHTML(); + $('composeMessageParent').childElements().invoke('hide'); + $('composeMessage').show(); DimpCore.doAction('Html2Text', { text: text }, null, this.setMessageText.bind(this), { asynchronous: false }); } else { this.editor_on = true; if (!noupdate) { - DimpCore.doAction('Text2Html', { text: $F('message') }, null, this.setMessageText.bind(this), { asynchronous: false }); + DimpCore.doAction('Text2Html', { text: $F('composeMessage') }, null, this.setMessageText.bind(this), { asynchronous: false }); } oFCKeditor.Height = this.getMsgAreaHeight(); // Try to reuse the old fckeditor instance. try { - FCKeditorAPI.GetInstance('message').SetHTML($F('message')); - $('messageParent').childElements().invoke('show'); - $('message').hide(); + FCKeditorAPI.GetInstance('composeMessage').SetHTML($F('composeMessage')); + $('composeMessageParent').childElements().invoke('show'); + $('composeMessage').hide(); } catch (e) { this.RTELoading('show'); FCKeditor_OnComplete = this.RTELoading.curry('hide'); @@ -362,7 +362,7 @@ var DimpCompose = { { var o, r; if (!$('rteloading')) { - r = new Element('DIV', { id: 'rteloading' }).clonePosition($('messageParent')); + r = new Element('DIV', { id: 'rteloading' }).clonePosition($('composeMessageParent')); $(document.body).insert(r); o = r.viewportOffset(); $(document.body).insert(new Element('SPAN', { id: 'rteloadingtxt' }).setStyle({ top: (o.top + 15) + 'px', left: (o.left + 15) + 'px' }).insert(DIMP.text.loading)); @@ -380,10 +380,10 @@ var DimpCompose = { getMsgAreaHeight: function() { if (!this.mp_padding) { - this.mp_padding = $('messageParent').getHeight() - $('message').getHeight(); + this.mp_padding = $('composeMessageParent').getHeight() - $('composeMessage').getHeight(); } - return document.viewport.getHeight() - $('messageParent').cumulativeOffset()[1] - this.mp_padding; + return document.viewport.getHeight() - $('composeMessageParent').cumulativeOffset()[1] - this.mp_padding; }, initializeSpellChecker: function() @@ -403,9 +403,9 @@ var DimpCompose = { if (!this.editor_on) { return; } - DIMP.SpellCheckerObject.htmlAreaParent = 'messageParent'; - DIMP.SpellCheckerObject.htmlArea = $('message').adjacent('iframe[id*=message]').first(); - $('message').setValue(FCKeditorAPI.GetInstance('message').GetHTML()); + DIMP.SpellCheckerObject.htmlAreaParent = 'composeMessageParent'; + DIMP.SpellCheckerObject.htmlArea = $('composeMessage').adjacent('iframe[id*=message]').first(); + $('composeMessage').setValue(FCKeditorAPI.GetInstance('composeMessage').GetHTML()); this.textarea_ready = false; }.bind(this); DIMP.SpellCheckerObject.onAfterSpellCheck = function() { @@ -413,17 +413,17 @@ var DimpCompose = { return; } DIMP.SpellCheckerObject.htmlArea = DIMP.SpellCheckerObject.htmlAreaParent = null; - var ed = FCKeditorAPI.GetInstance('message'); - ed.SetHTML($F('message')); + var ed = FCKeditorAPI.GetInstance('composeMessage'); + ed.SetHTML($F('composeMessage')); ed.Events.AttachEvent('OnAfterSetHTML', function() { this.textarea_ready = true; }.bind(this)); }.bind(this); }, setMessageText: function(r) { - var ta = $('message'); + var ta = $('composeMessage'); if (!ta) { - $('messageParent').insert(new Element('TEXTAREA', { id: 'message', name: 'message', style: 'width:100%;' }).insert(r.response.text)); + $('composeMessageParent').insert(new Element('TEXTAREA', { id: 'composeMessage', name: 'message', style: 'width:100%;' }).insert(r.response.text)); } else { ta.setValue(r.response.text); } @@ -444,7 +444,7 @@ var DimpCompose = { var bcc_add, fo, identity = this.get_identity($F('last_identity')), - msgval = $('message'); + msgval = $('composeMessage'); if (!this.last_msg.empty() && this.last_msg != $F(msgval).replace(/\r/g, '') && @@ -457,7 +457,7 @@ var DimpCompose = { !this.auto_save_interval) { this.auto_save_interval = new PeriodicalExecuter(function() { var cur_msg = this.editor_on - ? FCKeditorAPI.GetInstance('message').GetHTML() + ? FCKeditorAPI.GetInstance('composeMessage').GetHTML() : $F(msgval); cur_msg = cur_msg.replace(/\r/g, ''); if (!cur_msg.empty() && this.last_msg != cur_msg) { @@ -468,7 +468,7 @@ var DimpCompose = { } if (this.editor_on) { - fo = FCKeditorAPI.GetInstance('message'); + fo = FCKeditorAPI.GetInstance('composeMessage'); fo.SetHTML(msg); this.last_msg = fo.GetHTML().replace(/\r/g, ''); } else { @@ -509,7 +509,7 @@ var DimpCompose = { if (!this.editor_on) { this.toggleHtmlEditor(noupdate || false); } - if (focus == 'message') { + if (focus == 'composeMessage') { this.focusEditor(); } } @@ -518,7 +518,7 @@ var DimpCompose = { focusEditor: function() { try { - FCKeditorAPI.GetInstance('message').Focus(); + FCKeditorAPI.GetInstance('composeMessage').Focus(); } catch (e) { this.focusEditor.bind(this).defer(); } @@ -555,7 +555,7 @@ var DimpCompose = { { var m, rows, de = document.documentElement, - msg = $('message'); + msg = $('composeMessage'); if (!document.loaded) { this.resizeMsgArea.bind(this).defer(); @@ -563,7 +563,7 @@ var DimpCompose = { } if (this.editor_on) { - m = $('messageParent').select('iframe').last(); + m = $('composeMessageParent').select('iframe').last(); if (m) { m.setStyle({ height: this.getMsgAreaHeight() + 'px' }); } else { @@ -623,15 +623,15 @@ var DimpCompose = { switch (DIMP.conf_compose.compose_cursor) { case 'top': pos = 0; - $('message').setValue('\n' + $F('message')); + $('composeMessage').setValue('\n' + $F('message')); break; case 'bottom': - pos = $F('message').length; + pos = $F('composeMessage').length; break; case 'sig': - pos = $F('message').replace(/\r\n/g, '\n').lastIndexOf(this.get_identity($F('last_identity')).sig) - 1; + pos = $F('composeMessage').replace(/\r\n/g, '\n').lastIndexOf(this.get_identity($F('last_identity')).sig) - 1; break; default: diff --git a/imp/js/compose.js b/imp/js/compose.js index 23b58fe2e..2908b917a 100644 --- a/imp/js/compose.js +++ b/imp/js/compose.js @@ -64,7 +64,7 @@ var ImpCompose = { // If the rich text editor is on, we'll use a regexp to find the // signature comment and replace its contents. if (this.rtemode) { - ed = FCKeditorAPI.GetInstance('message'); + ed = FCKeditorAPI.GetInstance('composeMessage'); msg = ed.GetHTML.replace(/\r\n/g, '\n'); @@ -75,7 +75,7 @@ var ImpCompose = { // http://simonwillison.net/2004/Sep/20/newlines/ msg = msg.replace(/

\s*[\s\S]*?\s*<\/p>/, lastSignature); } else { - msg = $F('message').replace(/\r\n/g, '\n'); + msg = $F('composeMessage').replace(/\r\n/g, '\n'); lastSignature = last[0].replace(/^\n/, ''); nextSignature = next[0].replace(/^\n/, ''); @@ -102,7 +102,7 @@ var ImpCompose = { if (this.rtemode) { ed.SetHTML(msg); } else { - $('message').setValue(msg); + $('composeMessage').setValue(msg); } @@ -276,17 +276,17 @@ var ImpCompose = { _beforeSpellCheck: function() { - IMP.SpellCheckerObject.htmlAreaParent = 'messageParent'; - IMP.SpellCheckerObject.htmlArea = $('message').adjacent('iframe[id*=message]').first(); - $('message').setValue(FCKeditorAPI.GetInstance('message').GetHTML()); + IMP.SpellCheckerObject.htmlAreaParent = 'composeMessageParent'; + IMP.SpellCheckerObject.htmlArea = $('composeMessage').adjacent('iframe[id*=message]').first(); + $('composeMessage').setValue(FCKeditorAPI.GetInstance('composeMessage').GetHTML()); this.textarea_ready = false; }, _afterSpellCheck: function() { IMP.SpellCheckerObject.htmlArea = IMP.SpellCheckerObject.htmlAreaParent = null; - var ed = FCKeditorAPI.GetInstance('message'); - ed.SetHTML($('message').value); + var ed = FCKeditorAPI.GetInstance('composeMessage'); + ed.SetHTML($('composeMessage').value); ed.Events.AttachEvent('OnAfterSetHTML', this._afterSetHTML.bind(this)); }, @@ -366,8 +366,8 @@ var ImpCompose = { } }); - if (this.cursor_pos !== null && $('message')) { - this.setCursorPosition($('message'), this.cursor_pos); + if (this.cursor_pos !== null && $('composeMessage')) { + this.setCursorPosition($('composeMessage'), this.cursor_pos); } if (this.redirect) { @@ -377,7 +377,7 @@ var ImpCompose = { $('subject').observe('keydown', function(e) { if (e.keyCode == Event.KEY_TAB && !e.shiftKey) { e.stop(); - $('message').focus(); + $('composeMessage').focus(); } }); } @@ -392,7 +392,7 @@ var ImpCompose = { if (this.rtemode) { $('subject').focus(); } else { - $('message').focus(); + $('composeMessage').focus(); } } } diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index e5bdf3aab..2c21d014e 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -112,7 +112,7 @@ class IMP_UI_Compose $spell_img = Horde::img('spellcheck.png'); $args = array( 'id' => ($mode == 'dimp' ? 'DIMP.' : 'IMP.') . 'SpellCheckerObject', - 'targetId' => 'message', + 'targetId' => 'composeMessage', 'triggerId' => 'spellcheck', 'states' => array( 'CheckSpelling' => $spell_img . ($show_text ? $br . _("Check Spelling") : ''), @@ -172,7 +172,7 @@ class IMP_UI_Compose */ public function initRTE($mode = 'imp', $editoronly = false) { - $editor = Horde_Editor::singleton('Fckeditor', array('id' => 'message', 'no_notify' => true)); + $editor = Horde_Editor::singleton('Fckeditor', array('id' => 'composeMessage', 'no_notify' => true)); if ($editoronly) { return $editor; } @@ -186,7 +186,7 @@ class IMP_UI_Compose 'oFCKeditor.ToolbarSet = "ImpToolbar"' ); if ($mode == 'imp') { - $js_onload[] = 'oFCKeditor.Height = $(\'message\').getHeight()'; + $js_onload[] = 'oFCKeditor.Height = $(\'composeMessage\').getHeight()'; $js_onload[] = 'oFCKeditor.ReplaceTextarea()'; } Horde::addInlineScript($js_onload, 'load'); diff --git a/imp/templates/chunks/compose.php b/imp/templates/chunks/compose.php index 2e07f1502..e7356ab4c 100644 --- a/imp/templates/chunks/compose.php +++ b/imp/templates/chunks/compose.php @@ -128,8 +128,8 @@ function _createDAcompose($text, $image, $id) -

- +
+
diff --git a/imp/templates/compose/compose.html b/imp/templates/compose/compose.html index 996c64f51..7717e5573 100644 --- a/imp/templates/compose/compose.html +++ b/imp/templates/compose/compose.html @@ -195,8 +195,8 @@   - - + + diff --git a/imp/themes/ie6_or_less-dimp.css b/imp/themes/ie6_or_less-dimp.css index 58bd921a3..1ccd60a71 100644 --- a/imp/themes/ie6_or_less-dimp.css +++ b/imp/themes/ie6_or_less-dimp.css @@ -42,7 +42,7 @@ form#compose { #to, #cc, #bcc { overflow: auto; } -#messageParent { +#composeMessageParent { width: 96% !important; } diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 235db75b7..66aab8356 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -662,18 +662,18 @@ div.dimpActionsCompose, div.dimpActionsMsg { display: block; } -#messageParent { +#composeMessageParent { background: #fff url("graphics/backhead_shadow.png") top repeat-x; border-left: 1px silver solid; border-right: 1px silver solid; border-bottom: 1px silver solid; padding: 1%; } -#messageParent .htmlarea { +#composeMessageParent .htmlarea { width: 98% !important; border: none; } -#message { +#composeMessage { border: none; margin: 0; padding: 0; -- 2.11.0