Grammalecte  Diff

Differences From Artifact [0ba0b636f6]:

To Artifact [7e48ad2a90]:


51
52
53
54
55
56
57
58

59
60
61
62


63
64
65
66
67
68
69
51
52
53
54
55
56
57

58
59
60


61
62
63
64
65
66
67
68
69







-
+


-
-
+
+







        this.xContentNode.appendChild(this.xParagraphList);
        this.xPanelContent.addEventListener("click", onGrammalecteGCPanelClick, false);
        this.oTooltip = new GrammalecteTooltip(this.xContentNode);
        this.xPanelContent.appendChild(this.xContentNode);
        this.oTAC = new GrammalecteTextAreaControl();
    }

    start (xTextArea=null) {
    start (xNode=null) {
        this.oTooltip.hide();
        this.clear();
        if (xTextArea) {
            this.oTAC.setTextArea(xTextArea);
        if (xNode && xNode.tagName == "TEXTAREA") {
            this.oTAC.setTextArea(xNode);
        }
    }

    clear () {
        while (this.xParagraphList.firstChild) {
            this.xParagraphList.removeChild(this.xParagraphList.firstChild);
        }
446
447
448
449
450
451
452
453

454
455
456
457
458
459
460
461
462
463
464
465
446
447
448
449
450
451
452

453
454
455
456
457
458
459
460
461
462
463
464
465







-
+












        sText = sText.replace("\r\n", "\n").replace("\r", "\n");
        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));
        //console.log("Paragraphs number: " + (i+1));
    }

    write () {
        if (this._xTextArea !== null) {
            let sText = "";
            this._dParagraph.forEach(function (val, key) {
                sText += val + "\n";
            });
            this._xTextArea.value = sText.slice(0,-1);
        }
    }
}