3 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
6 * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
13 * @param $config Configuration name/value array.
15 function SpellChecker(&$config) {
16 $this->_config = $config;
20 * Simple loopback function everything that gets in will be send back.
22 * @param $args.. Arguments.
23 * @return {Array} Array of all input arguments.
25 function &loopback(/* args.. */) {
26 return func_get_args();
30 * Spellchecks an array of words.
32 * @param {String} $lang Language code like sv or en.
33 * @param {Array} $words Array of words to spellcheck.
34 * @return {Array} Array of misspelled words.
36 function &checkWords($lang, $words) {
41 * Returns suggestions of for a specific word.
43 * @param {String} $lang Language code like sv or en.
44 * @param {String} $word Specific word to get suggestions for.
45 * @return {Array} Array of suggestions for the specified word.
47 function &getSuggestions($lang, $word) {
52 * Throws an error message back to the user. This will stop all execution.
54 * @param {String} $str Message to send back to user.
56 function throwError($str) {
57 die('{"result":null,"id":null,"error":{"errstr":"' . addslashes($str) . '","errfile":"","errline":null,"errcontext":"","level":"FATAL"}}');