[back]

Have the older popup checker?

If you already have the older version of SpellingCow that pops open a small window to perform spell checking, you can coordinate the new as-you-type version to work with it. Specifically, if the user can take advantage of the as-you-type version, then the spell check button is hidden. In case where they have an older or unsupported browser (fewer of the those by the day!) then they can continue to use the popup checker. You just need to install as follows (and make any needed tweaks as stated on the site install page.

<script type="text/javascript" src="http://buttercup.spellingcow.com/spell/scayt"></script>
<script type="text/javascript">
<!--

// handle browsers that are known to not be compatiable
function handle_sc_ayt_incompatiable(msg)
{
	show_spellcheck_button();
}

// handle case where the user disables the checker
function handle_sc_ayt_disable()
{
	show_spellcheck_button();
}

// hide button - expected to only be called around the time the body onload event fires
function hide_spellcheck_button()
{
	// run the original onload
	if (window.pre_button_hide_onload)
	{
		pre_button_hide_onload() ;
	}

	// hide the button
	var sc_button = document.getElementsByName("spellcheck") ;

	if ((sc_button.length > 0) && (do_hide))
	{
		sc_button[0].style.display = 'none' ;
		// hide the trailing BR
		sc_button[0].nextSibling.style.display = 'none'
	}

	// disable auto_spell_check if set
	var auto_spell_check = document.getElementsByName("auto_spell_check") ;
	if (sc_button.length > 0)
	{
		auto_spell_check[0].value = 0 ;
	}
}

// show button - can be called at any time
function show_spellcheck_button()
{
	var sc_button = document.getElementsByName("spellcheck");

	if (sc_button.length > 0)
	{
		sc_button[0].style.display = '' ;
		do_hide = false ;
	}
}

// remember what the current onload function is b/c we are going to monkey with it
var pre_button_hide_onload = window.onload ;
// this toggle was added b/c things were a bit quirky with things still hidding even though we didn't want them to
var do_hide = true ;
// have our onload handler take precedence
window.onload = hide_spellcheck_button ;


//-->
</script>