Updating copyrights. Happy New Year.
[squirrelmail.git] / plugins / squirrelspell / js / init.js
CommitLineData
849bdf42 1/**
a8380e75 2 * init.js
145dc7aa 3 *
a8380e75 4 * Grabs the text from the SquirrelMail field and submits it to
5 * the squirrelspell.
6 *
c0d96801 7 * @copyright 2001-2012 The SquirrelMail Project Team
4b4abf93 8 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * @version $Id$
a8380e75 10 */
11
12/**
13 * This is the work function.
14 *
15 * @param flag tells the function whether to automatically submit the
16 * form, or wait for user input. True submits the form, while
17 * false doesn't.
18 * @return void
19 */
849bdf42 20function sqspell_init(flag){
145dc7aa 21 textToSpell = opener.document.compose.subject.value + "\n" + opener.document.compose.body.value;
849bdf42 22 document.forms[0].sqspell_text.value = textToSpell;
c464f51a 23 if (flag) document.forms[0].submit();
4b4abf93 24}