1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
|
}
write () {
if (this.xNode !== null) {
if (this.bResultInEvent) {
const xEvent = new CustomEvent("GrammalecteResult", { detail: JSON.stringify({ sType: "text", sText: this.getText() }) });
this.xNode.dispatchEvent(xEvent);
console.log("[Grammalecte debug] Text sent to xNode via event:", xEvent.detail);
}
else if (this.bTextArea) {
this.xNode.value = this.getText();
console.log("[Grammalecte debug] text written in textarea:", this.getText());
}
else if (this.bIframe) {
//console.log(this.getText());
}
else {
let sText = "";
this.eraseNodeContent();
this.dParagraph.forEach((val, key) => {
this.xNode.appendChild(document.createTextNode(val.normalize("NFC")));
this.xNode.appendChild(document.createElement("br"));
sText += val.normalize("NFC") + "\n";
});
console.log("[Grammalecte debug] text written in editable node:", sText);
}
}
else if (this.xResultNode !== null) {
const xEvent = new CustomEvent("GrammalecteResult", { detail: JSON.stringify({ sType: "text", sText: this.getText() }) });
this.xResultNode.dispatchEvent(xEvent);
console.log("[Grammalecte debug] Text sent to xResultNode via event:", xEvent.detail);
}
}
}
|
|
|
<
<
|
|
|
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
|
}
write () {
if (this.xNode !== null) {
if (this.bResultInEvent) {
const xEvent = new CustomEvent("GrammalecteResult", { detail: JSON.stringify({ sType: "text", sText: this.getText() }) });
this.xNode.dispatchEvent(xEvent);
//console.log("[Grammalecte debug] Text sent to xNode via event:", xEvent.detail);
}
else if (this.bTextArea) {
this.xNode.value = this.getText();
//console.log("[Grammalecte debug] text written in textarea:", 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"));
});
//console.log("[Grammalecte debug] text written in editable node:", this.getText());
}
}
else if (this.xResultNode !== null) {
const xEvent = new CustomEvent("GrammalecteResult", { detail: JSON.stringify({ sType: "text", sText: this.getText() }) });
this.xResultNode.dispatchEvent(xEvent);
//console.log("[Grammalecte debug] Text sent to xResultNode via event:", xEvent.detail);
}
}
}
|