Grammalecte  Check-in [0cdaf7b284]

Overview
Comment:[fx] editable node: don’t use innerHTML -> createTextNode
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: 0cdaf7b28428d71e280200794002361b55a40a4342274fe190886cfb61476b71
User & Date: olr on 2018-04-16 19:30:48
Other Links: manifest | tags
Context
2018-04-16
21:12
[fx] CSS: menu spinner update check-in: f7cf79677c user: olr tags: trunk, fx
19:30
[fx] editable node: don’t use innerHTML -> createTextNode check-in: 0cdaf7b284 user: olr tags: trunk, fx
18:19
[fx] update warning text for editable nodes check-in: afa96e5e95 user: olr tags: trunk, fx
Changes

Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [8c82f9ecd9] to [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
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");
                */
            }
        }
    }
}