1 Jul 2010 4:32 AM #1
Spell Check dialog with server-based CGI
I have a need for a spell-check functionality in my application. The reasoning is as follows:
- Not all users have a browser with a built-in spell-check feature.
- Having my own spell-check allows me to control what's in the dictionary, e.g. add myProduct, and add any custom functionality I desire, e.g. syntax checking.
At this point, it is rather crude, and not a plugin as it probably should be. It was enough work already so I stopped at this
Nevertheless, I would like to release it at this point so you can make use of it and help me improve it.
This code uses server-side Perl CGI script that checks the submitted text with ispell, and returns a JSON with a hash of spelling errors and a list of fix suggestions for each error.
How to use this:
- Include spell_check.js and spell_check.css
- Put spell_check.cgi in your Perl CGI directory.
- If you want to use a button to invoke the spell-checking: call the get_spell_button(target) function, were target is the field from which the text to be checked is taken.
- Invoking without button: call function spell_check()
If anyone can suggest a good place to put this demo, please do.
Attached you'll find a ZIP file with the JS file, CSS file, Perl CGI file, and button icon.
- Layout problem: empty area at bottom of dialog window
- Allow user to add words
- I didn't implement this because it involves issues of permissions: I don't want my external users (customers) to have permissions to add words to the dictionary, but I think it would be nice to allow them to suggest words to be added. Since doing this involves authentication, I will probably do this separately with my own authentication mechanism.
- Allow direct access to any marked word in the checked text by clicking on it.
Last edited by yyogev; 1 Jul 2010 at 4:50 AM. Reason: managed to attach from Google ChromeYaron Yogev
IT Software Developer
By telo.tao.yang in forum Community DiscussionReplies: 9Last Post: 28 Mar 2010, 12:28 AM
By k4anil in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 17 Jun 2009, 6:06 AM
By silcreval in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 15 Jul 2008, 12:17 AM