3 function speller_enable (&$CFG) {
4 echo "function spellClickHandler(editor, buttonId) {\n";
5 echo "\teditor._textArea.value = editor.getHTML();\n";
6 echo "\tvar speller = new spellChecker( editor._textArea );\n";
7 echo "\tspeller.popUpUrl = \"" . $CFG->httpswwwroot
."/lib/speller/spellchecker.html\";\n";
8 echo "\tspeller.spellCheckScript = \"". $CFG->httpswwwroot
."/lib/speller/server-scripts/spellchecker.php?id=$courseid\";\n";
9 echo "\tspeller._moogle_edit=1;\n";
10 echo "\tspeller._editor=editor;\n";
11 echo "\tspeller.openChecker();\n";
13 echo "config.registerButton(\"spell-check\", \"spell-check\", \"". $CFG->wwwroot
."/lib/speller/spell.gif\", false, spellClickHandler);\n";
14 echo "config.toolbar.push([\"spell-check\"]);\n";