Grammalecte  Diff

Differences From Artifact [184dcb850a]:

To Artifact [4233cac483]:


30
31
32
33
34
35
36



37
38
39
40
41
42
43
            let sNodeId = "";
            if (vNode instanceof HTMLElement && vNode.id) {
                sNodeId = vNode.id;
            }
            else if (typeof(vNode) === "string" && document.getElementById(vNode)) {
                sNodeId = vNode;
            }



            let xEvent = new CustomEvent("GrammalecteCall", { detail: JSON.stringify({sCommand: "openPanelForText", sText: sText, sNodeId: sNodeId}) });
            document.dispatchEvent(xEvent);
        } else {
            console.log("[Grammalecte API] Error: parameter is not a text.");
        }
    },








>
>
>







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
            let sNodeId = "";
            if (vNode instanceof HTMLElement && vNode.id) {
                sNodeId = vNode.id;
            }
            else if (typeof(vNode) === "string" && document.getElementById(vNode)) {
                sNodeId = vNode;
            }
            else {
                console.log("[Grammalecte API] No node identifier. No event, no result will be sent.")
            }
            let xEvent = new CustomEvent("GrammalecteCall", { detail: JSON.stringify({sCommand: "openPanelForText", sText: sText, sNodeId: sNodeId}) });
            document.dispatchEvent(xEvent);
        } else {
            console.log("[Grammalecte API] Error: parameter is not a text.");
        }
    },