Integrating SpellBound into a web page is made possible with the use of
DOM Events which provides a barrier so a web page is unable to acquire
privileges not explicitly granted by a user. Web integration samples can
be viewed on the
Tests page and are available for
download.
Below I have outlined the basic functions for integrating SpellBound
into a web page.
If you develop an integration solution that you believe
others would appreciate and you are willing to share it (e.g. no license
or an appropriate license as in MPL, GPL, LGPL, etc.) please let me know by
using the Contact form.
function sbOnLoad() {
var elems = document.getElementsByTagName("input");
for (var i = 0; i < elems.length; i++) {
if (elems[i].hasAttribute("onclick")) {
var onClick = elems[i].getAttribute("onclick");
if (onClick.indexOf("checkdocspelling") != -1) {
elems[i].setAttribute("onclick", "SpellBound.checkSpellingAll();");
} else if (onClick.indexOf("checknodespelling") != -1) {
var params = onClick.substring(onClick.indexOf("checknodespelling") + 17);
elems[i].setAttribute("onclick", "SpellBound.checkSpellingNode" + params);
}
}
}
}
function sbNotInstalled() {
}
function sbNeedsUpgrade() {
}
function sbStatus() {
var elems = document.getElementsByTagName("input");
for (var i = 0; i < elems.length; i++) {
if (elems[i].hasAttribute("onclick")) {
var onClick = elems[i].getAttribute("onclick");
if (onClick.indexOf("SpellBound.") != -1) {
if (SpellBound.active) {
elems[i].setAttribute("disabled", "true");
} else {
if (elems[i].hasAttribute("disabled"))
elems[i].removeAttribute("disabled");
}
}
}
}
}