Grammalecte  Diff

Differences From Artifact [c562cfe40e]:

To Artifact [c1b09949c0]:


1021
1022
1023
1024
1025
1026
1027
1028
1029

1030
1031
1032
1033
1034

1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049




1050
1051



1021
1022
1023
1024
1025
1026
1027


1028





1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048


1049
1050
1051







-
-
+
-
-
-
-
-
+















+
+
+
+
-
-
+
+
+
        }
    }

    write () {
        if (this.xNode !== null) {
            if (this.bResultInEvent) {
                const xEvent = new CustomEvent("GrammalecteResult", { detail: JSON.stringify({ sType: "text", sText: this.getText() }) });
                if (this.xNode) {
                    this.xNode.dispatchEvent(xEvent);
                this.xNode.dispatchEvent(xEvent);
                }
                else if (this.xResultNode) {
                    this.xResultNode.dispatchEvent(xEvent);
                }
                //console.log("Text sent via an event :", xEvent.detail);
                //console.log("Text to xNode:", xEvent.detail);
            }
            else if (this.bTextArea) {
                this.xNode.value = this.getText();
            }
            else if (this.bIframe) {
                //console.log(this.getText());
            }
            else {
                this.eraseNodeContent();
                this.dParagraph.forEach((val, key) => {
                    this.xNode.appendChild(document.createTextNode(val.normalize("NFC")));
                    this.xNode.appendChild(document.createElement("br"));
                });
            }
        }
        else if (this.xResultNode !== null) {
            const xEvent = new CustomEvent("GrammalecteResult", { detail: JSON.stringify({ sType: "text", sText: this.getText() }) });
            this.xResultNode.dispatchEvent(xEvent);
            //console.log("Text to xResultNode:", xEvent.detail);
    }
}
        }
    }
}