Fix problem with javascript when user has other plugins that include a
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Jul 2003 13:10:41 +0000 (13:10 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Jul 2003 13:10:41 +0000 (13:10 +0000)
form before this form (eg Menu Buttons plugin). Using the name of the
compose form solves this.
Plus, use SquirrelMail standard copyright notice.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5366 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/squirrelspell/js/check_me.js
plugins/squirrelspell/js/init.js

index 1abc4e0dcb910ad2d9dc3c2c62e3c2db571cf1c2..ad56b7f25176e5c6cece093f159f215b9f7cbf2a 100644 (file)
@@ -1,14 +1,14 @@
 /**
  * check_me.js
- * ------------
+ *
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
  * This JavaScript app is the driving power of the SquirrelSpell's
  * main spellchecker window. Hope you have as much pain figuring
  * it out as it took to write. ;))
  *
  * $Id$
- * 
- * @author Konstantin Riabitsev <icon@duke.edu> ($Author$)
- * @version $Date$
  */
 
 var CurrentError=0;
@@ -278,8 +278,8 @@ function sqspellCommitChanges(){
     newBody += sqspell_lines[i];
   }
   
-  opener.document.forms[0].subject.value=newSubject;
-  opener.document.forms[0].body.value=newBody;
+  opener.document.compose.subject.value=newSubject;
+  opener.document.compose.body.value=newBody;
   
   /**
    * See if any words were added to the dictionary.
index a7448c31fe9e1d2419ba913a715fafc5abe1c14e..628816d769f76ce7e80ab4d8b699a99bf75288d8 100644 (file)
@@ -1,13 +1,13 @@
 /**
  * init.js
- * -------
+ *
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
  * Grabs the text from the SquirrelMail field and submits it to
  * the squirrelspell.
  *
  * $Id$
- *
- * @author Konstantin Riabitsev <icon@duke.edu> ($Author$)
- * @version $Date$
  */
 
 /**
@@ -19,7 +19,7 @@
  * @return      void 
  */
 function sqspell_init(flag){
-  textToSpell = opener.document.forms[0].subject.value + "\n" + opener.document.forms[0].body.value;
+  textToSpell = opener.document.compose.subject.value + "\n" + opener.document.compose.body.value;
   document.forms[0].sqspell_text.value = textToSpell;
-  if (flag) document.forms[0].submit();
+  if (flag) document.compose.submit();
 }