Grammalecte  Diff

Differences From Artifact [28772a3aac]:

To Artifact [52f71e590a]:


51
52
53
54
55
56
57









58
59
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68







+
+
+
+
+
+
+
+
+


    parseNode: function (xNode) {
        if (xNode instanceof HTMLElement) {
            let xEvent = new CustomEvent("GrammalecteCall", { detail: {sCommand: "parseNode", xNode: xNode} });
            document.dispatchEvent(xEvent);
        } else {
            console.log("[Grammalecte API] Error: parameter is not a HTML node.");
        }
    },

    getSpellSuggestions: function (sWord, sDestination, sErrorId) {
        if (typeof(sWord) === "string") {
            let xEvent = new CustomEvent("GrammalecteCall", { detail: {sCommand: "getSpellSuggestions", sWord: sWord, sDestination: sDestination, sErrorId: sErrorId} });
            document.dispatchEvent(xEvent);
        } else {
            console.log("[Grammalecte API] Error: parameter is not a text.");
        }
    }
}