Grammalecte  Diff

Differences From Artifact [9caafebd9f]:

To Artifact [321b03c5bf]:


446
447
448
449
450
451
452
453

454
455
456
457
458
459
460
461
462
463
464
465
466
467
468

469
470

471
472

473
474
475
476
446
447
448
449
450
451
452

453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470

471
472

473
474
475
476
477







-
+















+

-
+

-
+




    }

    _loadText () {
        let sText = (this.bTextArea) ? this.xNode.value : this.xNode.innerText;
        let i = 0;
        let iStart = 0;
        let iEnd = 0;
        sText = sText.replace("\r\n", "\n").replace("\r", "\n");
        sText = sText.replace("\r\n", "\n").replace("\r", "\n").normalize("NFC");
        while ((iEnd = sText.indexOf("\n", iStart)) !== -1) {
            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 && (this.bTextArea || this.bWriteEN)) {
            let sText = "";
            this.dParagraph.forEach(function (val, key) {
                sText += val + "\n";
            });
            sText = sText.slice(0,-1).normalize("NFC");
            if (this.bTextArea) {
                this.xNode.value = sText.slice(0,-1);
                this.xNode.value = sText;
            } else {
                this.xNode.textContent = sText.slice(0,-1);
                this.xNode.textContent = sText;
            }
        }
    }
}