[Svn] r3913 - in trunk/roundcubemail: . program/js

trac at roundcube.net trac at roundcube.net
Sat Aug 28 14:37:56 CEST 2010


Author: alec
Date: 2010-08-28 07:37:56 -0500 (Sat, 28 Aug 2010)
New Revision: 3913

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/js/app.js
Log:
- Fix JS error on IE when trying to send HTML message with enabled spellchecker (#1486940)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-08-27 13:30:54 UTC (rev 3912)
+++ trunk/roundcubemail/CHANGELOG	2010-08-28 12:37:56 UTC (rev 3913)
@@ -12,6 +12,7 @@
 - Fix Tab key doesn't work in HTML editor in Google Chrome (#1486925)
 - Fix TinyMCE uses zh_CN when zh_TW locale is set (#1486929)
 - Fix TinyMCE buttons are hidden in Opera (#1486922)
+- Fix JS error on IE when trying to send HTML message with enabled spellchecker (#1486940)
 
 RELEASE 0.4
 -----------

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2010-08-27 13:30:54 UTC (rev 3912)
+++ trunk/roundcubemail/program/js/app.js	2010-08-28 12:37:56 UTC (rev 3913)
@@ -2752,12 +2752,12 @@
   this.check_compose_input = function()
   {
     // check input fields
-    var input_to = $("[name='_to']");
-    var input_cc = $("[name='_cc']");
-    var input_bcc = $("[name='_bcc']");
-    var input_from = $("[name='_from']");
-    var input_subject = $("[name='_subject']");
-    var input_message = $("[name='_message']");
+    var ed, input_to = $("[name='_to']"),
+      input_cc = $("[name='_cc']"),
+      input_bcc = $("[name='_bcc']"),
+      input_from = $("[name='_from']"),
+      input_subject = $("[name='_subject']"),
+      input_message = $("[name='_message']");
 
     // check sender (if have no identities)
     if (input_from.attr('type') == 'text' && !rcube_check_email(input_from.val(), true)) {
@@ -2795,26 +2795,26 @@
         input_subject.val((subject ? subject : this.get_label('nosubject')));
     }
 
+    // Apply spellcheck changes if spell checker is active
+    this.stop_spellchecking();
+
+    if (window.tinyMCE)
+      ed = tinyMCE.get(this.env.composebody);
+
     // check for empty body
-    if ((!window.tinyMCE || !tinyMCE.get(this.env.composebody))
-        && input_message.val() == '' && !confirm(this.get_label('nobodywarning'))) {
+    if (!ed && input_message.val() == '' && !confirm(this.get_label('nobodywarning'))) {
       input_message.focus();
       return false;
     }
-    else if (window.tinyMCE && tinyMCE.get(this.env.composebody)
-        && !tinyMCE.get(this.env.composebody).getContent()
-        && !confirm(this.get_label('nobodywarning'))) {
-      tinyMCE.get(this.env.composebody).focus();
-      return false;
+    else if (ed) {
+      if (!ed.getContent() && !confirm(this.get_label('nobodywarning'))) {
+        ed.focus();
+        return false;
+      }
+      // move body from html editor to textarea (just to be sure, #1485860)
+      tinyMCE.triggerSave();
     }
 
-    // Apply spellcheck changes if spell checker is active
-    this.stop_spellchecking();
-
-    // move body from html editor to textarea (just to be sure, #1485860)
-    if (window.tinyMCE && tinyMCE.get(this.env.composebody))
-      tinyMCE.triggerSave();
-
     return true;
   };
 
@@ -2845,8 +2845,12 @@
 
   this.stop_spellchecking = function()
   {
-    if (this.env.spellcheck && !this.spellcheck_ready) {
-      $(this.env.spellcheck.spell_span).trigger('click');
+    var ed;
+    if (window.tinyMCE && (ed = tinyMCE.get(this.env.composebody))) {
+      ed.execCommand('mceSpellCheck');
+    }
+    else if ((ed = this.env.spellcheck) && !this.spellcheck_ready) {
+      $(ed.spell_span).trigger('click');
       this.set_spellcheck_state('ready');
     }
   };

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list