For Runtime control and integration with non PHP Languages
The JavaScript API allows developers the choice to use all of PHPSpellCheck's functionality using JavaScript as the integration language. This also allows PHPSpellCheck to be implemented within non-php applications.
e.g.
<script src="/phpspellcheck/include.js' type='text/javascript'></script>
<script type='text/javascript'>
var mySpell = new LiveSpellInstance();
mySpell.Fields = "ALL"
mySpell.DrawSpellImageButton()
mySpell.ActivateAsYouType()
</script>
You can access your existing PHPSpellCheck AsYouType and SpellButton objects in JavaScript using their ID attribute as their JavaScript object name. Both the AsYouType and SpellButton PHP objects create an instance of the JavaScript LiveSpellObject class documented below.
<?php
require "/phpspellcheck/include.php";
$mySpell = new SpellCheckButton();
$mySpell->InstallationPath = "/phpspellcheck/";
echo $mySpell->SpellImageButton();
?>
<script type='text/javascript'>
var mySpellObject = <?php echo ($mySpell->ID)?>;
mySpellObject.onDialogOpen = function(){
alert("onDialogOpen event fired")
}
</script>
CaseSensitive
CheckGrammar
CSSTheme
Fields
FormToSubmit
IgnoreAllCaps
IgnoreNumeric
Language
SettingsFile
UserInterfaceLanguage
CustomOpener
CustomOpenerClose
ServerModel
Delay
WindowMode
Sets the behavior of the spellchecker dialog to either:
Strict
ShowSummaryScreen
ShowMeanings
MeaningProvider
UndoLimit
HiddenButtons
checkInWindow()
checkInSitu()
activateAsYouType()
pauseAsYouType()
url()
DrawSpellButton ([inPlace] [,text] [,Class] [,style] )
DrawSpellImageButton ([inPlace] [,image] [,rollover] [,text] [,Class] [,style])
DrawSpellLink ([inPlace] [,text] [,Class] [,style])
SpellButton ([inPlace][,text][,Class][,style])
SpellLink ([inPlace][,text][,Class][,style])
SpellImageButton ([inPlace][,image,][,rolloverImage][,Class][,style])
onDialogOpen()
onDialogComplete()
onDialogCancel()
onDialogClose()
onChangeLanguage(Language)
onIgnore (Word)
onIgnoreAll (Word)
onChangeWord (From, To)
onChangeAll (From, To)
onLearnWord (Word)
onLearnAutoCorrect(From,To)
onUpdateFields(arrayOfFieldIds)
AjaxSpellCheck(word, makeSuggestions)
AjaxSpellCheckArray(arrayOfWords, makeSuggestions)
AjaxDidYouMean(inputString)
onSpellCheck (word, spelling, reason, suggestions)
onDidYouMean(suggestion, original)