Grammalecte  Diff

Differences From Artifact [8c82f9ecd9]:

To Artifact [9028379210]:


467
468
469
470
471
472
473






474
475
476
477
478
479
480
481
482
483






484
485
486
487

488
489
490
491
            this.dParagraph.set(i, sText.slice(iStart, iEnd));
            i++;
            iStart = iEnd+1;
        }
        this.dParagraph.set(i, sText.slice(iStart));
        //console.log("Paragraphs number: " + (i+1));
    }







    write () {
        if (this.xNode !== null) {
            let sText = "";
            if (this.bTextArea) {
                this.dParagraph.forEach(function (val, key) {
                    sText += val + "\n";
                });
                this.xNode.value = sText.slice(0,-1).normalize("NFC");
            } else {






                this.dParagraph.forEach(function (val, key) {
                    sText += val + "<br/>";
                });
                this.xNode.innerHTML = sText.normalize("NFC");

            }
        }
    }
}







>
>
>
>
>
>










>
>
>
>
>
>




>




467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
            this.dParagraph.set(i, sText.slice(iStart, iEnd));
            i++;
            iStart = iEnd+1;
        }
        this.dParagraph.set(i, sText.slice(iStart));
        //console.log("Paragraphs number: " + (i+1));
    }

    eraseContent () {
        while (this.xNode.firstChild) {
            this.xNode.removeChild(this.xNode.firstChild);
        }
    }

    write () {
        if (this.xNode !== null) {
            let sText = "";
            if (this.bTextArea) {
                this.dParagraph.forEach(function (val, key) {
                    sText += val + "\n";
                });
                this.xNode.value = sText.slice(0,-1).normalize("NFC");
            } else {
                this.eraseContent();
                this.dParagraph.forEach((val, key) => {
                    this.xNode.appendChild(document.createTextNode(val.normalize("NFC")));
                    this.xNode.appendChild(document.createElement("br"));
                });
                /*
                this.dParagraph.forEach(function (val, key) {
                    sText += val + "<br/>";
                });
                this.xNode.innerHTML = sText.normalize("NFC");
                */
            }
        }
    }
}