Plugin: spellchecker

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

  1. Server with PHP.

  2. Serverside technology

  3. A functioning TinyMCE implementation.

  4. Access to the server to edit configuration and uploading files.

Installation Instructions

  1. Download the latest version of the TinyMCE Spellchecker plugin, you can download this at the following location:
    http://tinymce.moxiecode.com/download.php

  2. Unzip the "spellchecker" directory into the "tiny_mce/plugins" dir, path should be "tiny_mce/plugins/spellchecker".

  3. Open up the config.php file you just unziped in the spellchecker folder.

  4. 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

  5. Enable the spellchecker by changing the $spellCheckerConfig['enabled'] = false; to $spellCheckerConfig['enabled'] = true;

  6. You can also configure default language, but the language will be taken from TinyMCE by default.

  7. 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';

  8. Edit your TinyMCE configuration. Add "spellchecker" to the list of plugins.

  9. 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.