#message -> #composeMessage
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 7 Oct 2009 21:12:22 +0000 (15:12 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 8 Oct 2009 18:02:49 +0000 (12:02 -0600)
imp/compose-dimp.php
imp/js/compose-dimp.js
imp/js/compose.js
imp/lib/UI/Compose.php
imp/templates/chunks/compose.php
imp/templates/compose/compose.html
imp/themes/ie6_or_less-dimp.css
imp/themes/screen-dimp.css

index f684714..d292bca 100644 (file)
@@ -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(
index 2bf99c2..bffd3f1 100644 (file)
@@ -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 = '<p><!--begin_signature--><!--end_signature--></p>';
             nextSignature = '<p><!--begin_signature-->' + next.sig.replace(/^ ?<br \/>\n/, '').replace(/ +/g, ' ') + '<!--end_signature--></p>';
 
@@ -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:
index 23b58fe..2908b91 100644 (file)
@@ -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(/<p class="imp-signature">\s*<!--begin_signature-->[\s\S]*?<!--end_signature-->\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();
                 }
             }
         }
index e5bdf3a..2c21d01 100644 (file)
@@ -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');
index 2e07f15..e7356ab 100644 (file)
@@ -128,8 +128,8 @@ function _createDAcompose($text, $image, $id)
   </table>
  </div>
 
- <div id="messageParent">
-  <textarea name="message" rows="20" id="message" class="fixed"></textarea>
+ <div id="composeMessageParent">
+  <textarea name="message" rows="20" id="composeMessage" class="fixed"></textarea>
  </div>
 </div>
 </form>
index 996c64f..7717e55 100644 (file)
 
  <tr>
   <td class="light rightAlign" valign="top"><strong><tag:message_label />&nbsp;</strong></td>
-  <td class="item" colspan="2" id="messageParent">
-   <textarea class="fixed composebody" tabindex="<tag:message_tabindex />" name="message" id="message" rows="20" cols="80"><tag:message /></textarea>
+  <td class="item" colspan="2" id="composeMessageParent">
+   <textarea class="fixed composebody" tabindex="<tag:message_tabindex />" name="message" id="composeMessage" rows="20" cols="80"><tag:message /></textarea>
   </td>
  </tr>
 
index 58bd921..1ccd60a 100644 (file)
@@ -42,7 +42,7 @@ form#compose {
 #to, #cc, #bcc {
     overflow: auto;
 }
-#messageParent {
+#composeMessageParent {
     width: 96% !important;
 }
 
index 235db75..66aab83 100644 (file)
@@ -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;