The Auto WebSpellChecker system provides automatic spell checking for your website, with easy set up and integration.
Follow the steps in these four sections to add Auto WebSpellChecker support to your website:
- Register and receive a Customer ID
- Download the customized JavaScript file
- Download the SPROXY.CGI script file
- Modify your web pages
| Register and receive a customerID |
To register, please go to the
Sign Up page
and fill out our short form. We will send you an e-mail containing your customerID. Please save this ID,
as it will be required for the rest of the installation.
Top of page
| Download the customized JavaScript file |
To download JavaScript file please login to "My Account" Section of the spellchecker.net site using customerid and password sent to you in the registration email.
Click on the "Download JavaScript file" link. In the page opened click "Download" button to download the spch.js JavaScript file (please select "save to Disk" if prompted).
The JavaScript file contains information that is specific to each customer's web site, so it should not be used on or obtained from another site.
Top of page
| Download the SPROXY.CGI Script File |
The sproxy.cgi script file returns
corrected data from the WebSpellChecker engine to the text-box on
your web page.
1.
Download the file "sproxy.cgi". Please login to "My Account" Section of the spellchecker.net site using customerid and password sent to you in the registration email.
Please open "Download SPROXY.CGI script" page for currently supported versions of the file. Click on the "Download SPROXY script" link.
Each of the archive files SPROXY_*.zip contains the following files:
- sproxy.cgi - main script;
- sproxy.ini - ini-file;
- *.tmpl (check.tmpl, dospell.tmpl, init.tmpl, opts.tmpl, result.tmpl, show.tmpl, unload.tmpl) - the template files.
2. Copy all files from sproxy_*.zip archive to the directory on
your web site that has permissions for script execution (for
example /cgi-bin or /scripts).
Perl script
If you downloaded
Perl version of sproxy.cgi, open the file in edit mode and
change its first line according to your Perl interpreter
location. This file is created to run on UNIX systems
and the first line will be #!/usr/bin/perl. Windows users should
alter this line to reflect the Perl location, for example
#!c:/perl/bin/perl.exe
(note the forward slashes).
3. The sproxy.ini file contains some variable
parameters, which must be customized. Find and change the
following parameters in this file:
a. SPCH_JS_PATH should be replaced with the full
URL where you placed the file spch.js. If you do not have
spch.js file please go to the http://www.spellchecker.net/support/getscript.html
to download it.
c. SPROXY_URL
should be replaced with
the full URL of the sproxy.cgi file. For example, http://my_server.com/cgi-bin/sproxy.cgi.
d. DEF_LANG should be replaced with the default
language to be used by SpellCheck. Change this parameter to
one of the following values:
en -
American English
uk - British English
fr - French
ge
- German
it - Italian
sp - Spanish
dk - Danish
br
- Brazilian Portuguese
nl - Dutch
no - Norwegian
pt
- Portuguese
se - Swedish
e. DEF_ENABLED
should be replaced with 'true' or
'false'. This variable defines the default state of Auto
SpellCheck. Set it to 'true' if you want it to be enabled by
default.
f. DEF_TIMEOUT
should be replaced with the desired
timeout value (in seconds) for background processing.
g. OPT_BG_CL
should be replaced with the desired
color value of the Settings Dialog background. Please use the
standard HTML codes for the colors.
h. AUTO_HIDE
can be [af] flag or nothing.
[af] stands for auto-finish. This flag turns on/off the
ability to automatically dispatch the checked text to the
text-box in your page. For example:
For Perl version
...
$auto_hide = "\"[af]\"";
...
or
...
$auto_hide = "\"\"";
...
For Win32 version
...
auto_hide = [af]
...
or
...
auto_hide =
...
For chat systems several other flags could also be used:
[dc] - don't close SpellCheck window. It saves the time on opening SpellCheck window. SpellCheck window will be a background window.
[sw] - small window. It has the sense because entered text in chat applications is usually short.
[cp] - close prompt. This flag turns on/off two links ("Abort WebSpellChecker" and "Send Without Checking") on the SpellCheck window during its initial loading. Press on "Abort WebSpellChecker" link closes SpellCheck window and returns to text-box. Press "Send Without Checking" link dispatches the text without checking and SpellCheck window is not closed.
For example: [dc][sw][cp][af] or [dc][af] or [af][dc][sw] or leave empty.
i. SPROXY.INI has two additional properties, which
can be used to define the WebSpellChecker server list. You can
define this server list, depending on your server geographic
location and which WebSpellChecker server works faster with your
server.
main_server contains the URL of the main SpellCheck
server. "www.spellchecker.net"
is default server.
second_servers
contains list of additional WebSpellChecker
servers which can be used when the server defined in
main_server properties is not available during DEF_TIMEOUT
seconds. This setting is optional. If it is not defined,
only the main server will be used. Currently, spellchecker.net
uses only one secondary server - www.spellchecker1.net.
EXPTIME should
be replaced with the period of time (in minutes) the last used
secondary server will be used as main if the main_server
is not available. The suggested value is
30-45.
Example:
Perl version of
SPROXY.INI
$main_server = "www.spellchecker.net";
$second_servers = "www.spellchecker1.net;
www.spellchecker2.net";
Win32 version of SPROXY.INI
main_server = www.spellchecker.net
second_servers =
www.spellchecker1.net;
www.spellchecker2.net
The default settings
are:
Perl version of
SPROXY.CGI
$main_server = "www.spellchecker.net";
$second_servers =
"www.spellchecker1.net";
Win32
version of SPROXY.CGI
main_server = www.spellchecker.net
second_servers =
www.spellchecker1.net
Please go
to www.webspellchecker.net
for more information about available WebSpellChecker
servers.
Modify the web
page
Auto WebSpellChecker support can be embedded into a web page
by adding an additional frame. If the page is already a part
of a frameset, a new hidden frame should be added. If the
target page is not a part of the frameset, it should be
wrapped into the frameset.
1. Add a new frame to your frameset by entering the
following html code:
<frame
name=AutoChecker src="SPROXY_URL?cmd=init"
marginHeight=0 marginWidth=0 scrolling=no noresize
height=0 frameborder="no">
SPROXY_URL should be replaced with the actual URL of the
sproxy.cgi file on your server.
2. Change the parameters of the <FRAMESET> tag
to make this a hidden (zero length) frame. For example,
if you add the frame as the first <FRAMESET> tag, change
your code to (note the 0 values within the code):
<frameset cols="0,*" frameborder="0" framespacing="0" border="0">
<frame
name="AutoChecker" src="http://your_server/cgi-bin/sproxy.cgi?cmd=init"
marginheight=0 marginwidth=0 scrolling=no noresize
height=0>
<frame
src="menu.html">
</frameset>
3. Add the following code in the header (between
"<head>" and "</head>" tags) of the page in which
WebSpellChecker will be used:
<script>
<!--
var
frmname = 'FORM_NAME
';
function
SetEnabling_ASC(enbl)
{
document.forms[frmname].enabling.checked
= enbl;
}
function doSubmit_ASC(ctrl)
{
if
(parent.frames['AutoChecker'] &&
parent.frames['AutoChecker'].checkText)
return
parent.frames['AutoChecker'].checkText(ctrl);
else
return
!document.forms[frmname].enabling.checked;
}
function
setOpts_ASC()
{
parent.frames['AutoChecker'].adjustOptions();
}
function
doLoad_ASC()
{
if
(parent.frames['AutoChecker'])
if
(parent.frames['AutoChecker'].isAutoSpellCheckEnabled)
document.forms[frmname].enabling.checked =
parent.frames['AutoChecker'].isAutoSpellCheckEnabled();
}
function
enable_disable_ASC()
{
parent.frames['AutoChecker'].setAutoSpellCheckEnabling(
document.forms[frmname].enabling.checked
);
}
//-->
</script>
FORM_NAME should be replaced with name of the form in which
text control will be checked.
Layout Auto WebSpellChecker
controls
Add to your web page the following code:
<input type="checkbox" name="enabling"
onclick="javascript: enable_disable_ASC();" checked> Auto
Spell Check.
<input type="button"
onclick="javascript: setOpts_ASC();" value= "Options">
Setting up the onLoad
event
1. Find the <BODY> tag in your page.
2. Add the following code within this tag:
onLoad="javascript: return
doLoad_ASC();"
If you already have the onLoad event handler in your page,
add the above code inside the onLoad event.
For
example:
Before changing
<body
onLoad="javascript: doMyLoad()">
After changing
<body onLoad="javascript:
doLoad_ASC(); doMyLoad()">
or
<body onLoad="javascript: doMyLoad();
doLoad_ASC()">
Setting up the onSubmit
event
1. Find the <FORM> tag in your page.
2. Add the following code to this tag:
onSubmit="javascript: return
doSubmit_ASC(this['ELEMENT_NAME']);"
ELEMENT_NAME should be replaced with the name of the
control text to be checked by Auto WebSpellChecker.
3. If the <FORM> tag has already onSubmit event,
find all subsequent references to the onSubmit event
(submit(), SomeFor.Submit(),
document.forms[formname].Submit(), <input type=submit…>
etc.) and replace them with the following code:
doSubmit_ASC(FORM_NAME['ELEMENT_NAME'])
For example:
Before changing:
......
<script>
<!--
......
function
MyHandler()
{
......
if
(SomeFlag)
{
......
document.forms[SomeForm].submit();
}
else
{
......
}
......
document.SomeForm.submit();
}
......
//-->
</script>
......
<form
name=SomeForm onSubmit="javascript: return MyHandler();"
......>
......
<textarea
name=SomeText......>
......
</form>
......
After changing:
......
<script>
<!--
......
function
MyHandler()
{
......
if
(SomeFlag)
{
......
doSubmit_ASC(document.Forms[SomeForm].SomeText);
}
else
{
......
}
......
doSubmit_ASC(document.forms[SomeForm].SomeText);
}
......
//-->
</script>
......
<form
name=SomeForm onSubmit="javascript: return MyHandler();"
......>
......
<textarea
name=SomeText......>
......
</form>
......