owen

I added a feature to PageCat that lets me check the spelling of articles directly from the server via the HTML WYSIWYG editor.  You simply click the Check Spelling button and it underlines each possible mistake with a dotted red line, telling you how many mistakes it detected.  If it finds no mistakes, it tells you so.

You can then highlight an entire misspelled word (by double-clicking), then right-click on it to pop up the context menu.  The context menu will display a short list (5) of suggestions for replacement.  You click on one of the options that appears, and the word is replaced.  Otherwise, you can just highlight the word and type over it.

When you're done editing, the lines can be toggled off by clicking the Check Spelling button again.  If you forget to turn of the spell checking, that's ok, because the editor uses a style sheet to display the underline.  It's likely that your final page doesn't include this extra style, and so your page will render without the lines.  The only detriment is that your final page may have a few extra SPAN tags in it.

Currently, the spell checker is doing a decent job avoiding punctuation in the text, including not checking the text that is inside html tags.  I had to write a handler that would parse the text of the page character by character to avoid the tags.  This was somewhat annoying.  Also, since the editor produces a lot of ampersand (&) codes for spaces and special characters, I had to determine how to avoid them.

There were some other issues in modifying the editor code.  The original code would not allow items to be added dynamically to the context menu.  I fixed that.  Also, the menu wasn't appearing in the correct place.  I think that's working properly now.

In addition, I added a ton of code complexity in order to get the whole thing to work without loading a special pop-up window for the spelling check.  Pop-up windows are annoying.  With the current implementation, you never leave the editor screen.  You push a button and the spelling mistakes are suddenly highlighted.

The spell checker has been a "high demand" feature, and I'm glad it's now implemented.  This implementation is even better than the one I originally did for the ZN-Games bulletin board, since you don't have to switch to a special editing mode in order to get the spelling corrections.  (The old method used drop-down listboxes for suggestion replacements, and didn't let you type over mistakes with custom entries.)

What would I like to do better about this project?  I think that it would be nice to add words to a custom dictionary.  I don't like that it marks PageCat as a misspelled word every time I write it.  There are probably some other checks having to do with numbers in words and checking inside tag attributes (like the img alt"" attribute) that I will put off fixing.  But this should be adequate for now.

Next major task: Adding channel lockouts to specific logins.