This plugin adds spellchecker functionality to TinyMCE by providing a new button that performs a AJAX call to a backend PHP page that uses PSpell/ASpell or Google spellchecker.
Requirements
- Server with PHP.
- Serverside technology
- If you wish to use the PHP integrated PSpell you need to have PSpell/Aspell installed on the server as well as the dictionaries you wish to use and have this compiled with PHP, read more about this on the PHP website or use Google to learn more. Might be a good idea to find a simple script to test so that the PSpell is working correctly before trying the TinyMCE spellchecker as the error msgs aren't optimal.
- If you wish to use the exec version, that is you have PSpell/ASpell installed on the server, but not compiled with PHP, you need to make sure the correct dictionaries are installed and working.
- The Google spellchecker, no special requirements are needed for this method.
- A functioning TinyMCE implementation.
- Access to the server to edit configuration and uploading files.
Installation Instructions
- Download the latest version of the TinyMCE Spellchecker plugin, you can download this at the following location:
http://tinymce.moxiecode.com/download.php - Unzip the "spellchecker" directory into the "tiny_mce/plugins" dir, path should be "tiny_mce/plugins/spellchecker".
- Open up the config.php file you just unziped in the spellchecker folder.
- Uncomment the include you wish to use:
// require_once("classes/TinyPspellShell.class.php"); // Command line pspell
// require_once("classes/TinyGoogleSpell.class.php"); // Google web service
// require_once("classes/TinyPspell.class.php"); // Internal PHP version
- Enable the spellchecker by changing the $spellCheckerConfig['enabled'] = false; to $spellCheckerConfig['enabled'] = true;
- You can also configure default language, but the language will be taken from TinyMCE by default.
- If you use the command line PSpell/ASpell class, you may need to configure the following paths:
$spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell';
$spellCheckerConfig['tinypspellshell.tmp'] = '/tmp'; - Edit your TinyMCE configuration. Add "spellchecker" to the list of plugins.
- Add "spellchecker" as a button somewhere on your toolbar.
Google Spellchecker configuration example
$spellCheckerConfig = array(); // Spellchecker class use // require_once("classes/TinyPspellShell.class.php"); // Command line pspell require_once("classes/TinyGoogleSpell.class.php"); // Google web service // require_once("classes/TinyPspell.class.php"); // Internal PHP version // General settings $spellCheckerConfig['enabled'] = true; // Default settings $spellCheckerConfig['default.language'] = 'en'; $spellCheckerConfig['default.mode'] = PSPELL_FAST; // Normaly not required to configure $spellCheckerConfig['default.spelling'] = ""; $spellCheckerConfig['default.jargon'] = ""; $spellCheckerConfig['default.encoding'] = ""; // Pspell shell specific settings $spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell'; $spellCheckerConfig['tinypspellshell.tmp'] = '/tmp';
Initialization Example
tinyMCE.init({ theme : "advanced", mode : "textareas", plugins : "spellchecker", theme_advanced_buttons3_add : "spellchecker", spellchecker_languages : "+English=en,Swedish=sv" });
Options
[spellchecker_languages] | Enables you to specify what languages your pspell installation can handle. The value of this option should be a comma separated name value list in the following format name1=value1,name2=value,name3=value where name is the string to present in the menu and the value is a ISO language code like sv or en. If you add a + character infront of the name it will be the default value for the spellchecker. The default value for this option is: +English=en. |
[spellchecker_word_separator_chars] | This option enables you to specify the word separator characters. The default value for this option is: \\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c. |
[spellchecker_report_mispellings] | This option enables you to get an alert box with the number of misspelled words, this option is set to false by default. |