Emil’s Chronicle - The journal of Emil A Eklund

SpellingCow followup

Just got the following message from Craig Nuttall, the creator of SpellingCow, as a comment to my LiteSpellChecker post:

Hello All. Right now I am spell checking this message as I type. I am the creator of SpellingCow ( http://www.spellingcow.com ). I would like to thank Emil for his hard work as he inspired my creation. SpellingCow operates completely different in many ways from Emil’s checker, but has the same idea of making the textarea transparent and showing a markup div in the background.

Emil was gracious enough to share his code with the world, benefiting me and who knows how many others. I wish I could open source all of my code, but I just cannot unobfuscate it - though I’d gladly give Emil a peek =] I have open sourced the communication method I’ve developed which allows SpellingCow to be installed with a single line of code on any website or run as a favelet. It’s called COWS Ajax ( http://cows-ajax.sourceforge.net ).

I would like to give some pointers for you guys beyond this though, just to contribute a little more. First of all, Emil’s demo works well b/c the textarea he is using is so large that it masks a lot of problems. The PRE whitespace style type is not recognized by IE and that creates a lot of problems. Also in firefox, this cause long lines to not wrap and completely blows out the display. The fix for this is to drop the PRE whitespace style type entirely. For special cases where you need to render something like consecutive spaces, then wrap just the spaces with the PRE whitespace type. That solves the problem for FF. But IE has a further problem in that in strips leading whitespace on spans. But if you use createTextNode to insert it into the DOM tree directly, that will get you the desired effect.

So… I wish I could make the unobfuscated and commented source available but I can’t. However, the above paragraphs represents MANY hours of tinkering and I think will be quite valuable to someone wanting to OSS what Emil started. Between that and COWS Ajax, I hope you all feel that I am “giving back” at least something ;-)

Thanks again Emil… you rock!

Now that it has been settled that it’s not a cheap ripoff but rather a service inspired (and partly based on) my work it feels a lot better.

His other claims are true too, quite a few of the bugs and limitations found in my implementation has been resolved, and his description of the conceptual changes required for that could prove quite valuable.

Thanks and sorry about my accusations.

One Response to 'SpellingCow followup'

  1. Hakan Bilgin Says:

    Hi Emil,
    Regarding transparent textarea + DIV; I have never liked that idea. A while back, I experimented with adding the contentEditable to Firefox with XBL but was to lazy to finish it. You can see a (buggy) demo of how much it is done, here:

    Anywho; I have a couple of questions about namespaces and I hope you can help me out.

    1. In IE, there is a property named scopeName, which returns the namespace of the element/node. Do you know the equalling property to this in Firefox?
    Properties such as localName, nodeName, etc returns the namespace with the nodeName united by the colon…but in uppercase. Which I don’t fancy at all…and I am not satisfied with my solution below…


    Node.prototype.__defineGetter__(’scopeName’, function() {
    var ln = this.localName.toString();
    return (ln.indexOf(’:') > -1)? ln.split(’:')[0] : ‘HTML’ ;


    2. Do you know if it is possible to add namespaces to a document programmatically?

    Thanks is advance…

Leave a Reply

(required, will not be published)