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

trac at roundcube.net trac at roundcube.net
Wed Oct 1 10:29:58 CEST 2008


Author: alec
Date: 2008-10-01 03:29:58 -0500 (Wed, 01 Oct 2008)
New Revision: 1904

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/js/common.js
   trunk/roundcubemail/program/js/editor.js
Log:
- Stop spellchecking when switching to html editor (#1485362)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2008-09-30 13:03:26 UTC (rev 1903)
+++ trunk/roundcubemail/CHANGELOG	2008-10-01 08:29:58 UTC (rev 1904)
@@ -1,6 +1,9 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+2008/10/01 (alec)
+- Stop spellchecking when switching to html editor (#1485362)
+
 2008/09/29 (alec)
 ----------
 - Added 'mime_param_folding' option with possibility to choose 

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2008-09-30 13:03:26 UTC (rev 1903)
+++ trunk/roundcubemail/program/js/app.js	2008-10-01 08:29:58 UTC (rev 1904)
@@ -1971,6 +1971,13 @@
   this.display_spellcheck_controls = function(vis)
   {
     if (this.env.spellcheck) {
+      // stop spellchecking process
+      if (!vis && !this.spellcheck_ready) 
+        {
+	exec_event(this.env.spellcheck.check_link, 'click');
+	this.set_spellcheck_state('ready');
+	}
+			      
       this.env.spellcheck.check_link.style.visibility = vis ? 'visible' : 'hidden';
       this.env.spellcheck.switch_lan_pic.style.visibility = vis ? 'visible' : 'hidden';
     }

Modified: trunk/roundcubemail/program/js/common.js
===================================================================
--- trunk/roundcubemail/program/js/common.js	2008-09-30 13:03:26 UTC (rev 1903)
+++ trunk/roundcubemail/program/js/common.js	2008-10-01 08:29:58 UTC (rev 1904)
@@ -650,3 +650,20 @@
     return o;
     }
   }
+
+
+// Fire event on specified element
+function exec_event(element,event)
+{  
+  if (document.createEventObject) {
+    // dispatch for IE  
+    var evt = document.createEventObject();
+    return element.fireEvent('on'+event,evt)
+  }
+  else {  
+    // dispatch for firefox + others  
+    var evt = document.createEvent("HTMLEvents");
+    evt.initEvent(event, true, true); // event type,bubbling,cancelable
+    return !element.dispatchEvent(evt);
+   }
+}

Modified: trunk/roundcubemail/program/js/editor.js
===================================================================
--- trunk/roundcubemail/program/js/editor.js	2008-09-30 13:03:26 UTC (rev 1903)
+++ trunk/roundcubemail/program/js/editor.js	2008-10-01 08:29:58 UTC (rev 1904)
@@ -58,12 +58,12 @@
   // do the appropriate conversion
   if (selectedEditor == 'html')
     {
+    rcmail.display_spellcheck_controls(false);
     var composeElement = document.getElementById('compose-body');
     var htmlText = "<pre>" + composeElement.value + "</pre>";
     composeElement.value = htmlText;
     tinyMCE.execCommand('mceAddControl', true, 'compose-body');
     htmlFlag.value = "1";
-    rcmail.display_spellcheck_controls(false);
     }
   else
     {

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



More information about the Svn mailing list