Grammalecte  Check-in [beb8701f0c]

Overview
Comment:[tb] fix editor; versions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | tb
Files: files | file ages | folders
SHA3-256: beb8701f0ca557b9e56ffe069d9afe751a52cf0755c625d3e5605063cf151483
User & Date: olr on 2017-04-26 08:38:18
Original Comment: fix editor tb; tb versions
Other Links: manifest | tags
Context
2017-04-26
11:53
setup.py [fr] check-in: 6af5cdea4e user: olr tags: trunk, fr
08:38
[tb] fix editor; versions check-in: beb8701f0c user: olr tags: trunk, tb
2017-04-25
12:44
[doc] how-to build check-in: a3003263a7 user: olr tags: trunk, doc
Changes

Modified gc_lang/fr/tb/content/editor.js from [25c8a38b27] to [982eed5aea].

1
2
3
4
5
6
7
8
9
10








11
12
13
14
15
16
17
// JavaScript

class Editor {

    constructor (sLang) {
        this.xEditor = GetCurrentEditor();
        this.lNode = [];
        this.lParsableNodes = ["P", "LI"];
        this.lRootNodes = ["DIV", "UL", "OL"];
    };









    * _getParsableNodes (xRootNode=this.xEditor.rootElement) {
        // recursive function
        try {
            for (let xNode of xRootNode.childNodes) {
                //echo("tag: " + xNode.tagName);
                if (xNode.className !== "moz-cite-prefix" && xNode.tagName !== "BLOCKQUOTE"










>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// JavaScript

class Editor {

    constructor (sLang) {
        this.xEditor = GetCurrentEditor();
        this.lNode = [];
        this.lParsableNodes = ["P", "LI"];
        this.lRootNodes = ["DIV", "UL", "OL"];
    };

    _getTextFromNode (xNode) {
        if ("innerHTML" in xNode) {
            return xNode.innerHTML;
        } else {
            return xNode.textContent;
        }
    };

    * _getParsableNodes (xRootNode=this.xEditor.rootElement) {
        // recursive function
        try {
            for (let xNode of xRootNode.childNodes) {
                //echo("tag: " + xNode.tagName);
                if (xNode.className !== "moz-cite-prefix" && xNode.tagName !== "BLOCKQUOTE"
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    };

    * getParagraphs () {
        try {
            let i = 0;
            for (let xNode of this._getParsableNodes()) {
                this.lNode.push(xNode);
                yield [i, xNode.innerHTML];
                i += 1;
            }
        } catch (e) {
            Cu.reportError(e);
        }
    };








|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    };

    * getParagraphs () {
        try {
            let i = 0;
            for (let xNode of this._getParsableNodes()) {
                this.lNode.push(xNode);
                yield [i, this._getTextFromNode(xNode)];
                i += 1;
            }
        } catch (e) {
            Cu.reportError(e);
        }
    };

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69


70



71
72
73
74
75
76
77
        } catch (e) {
            Cu.reportError(e);
        }
    };

    getParagraph (iPara) {
        try {
            return this.lNode[iPara].innerHTML;
        } catch (e) {
            Cu.reportError(e);
        }
    };

    writeParagraph (iPara, sText) {
        try {


            this.lNode[iPara].innerHTML = sText;



        } catch (e) {
            Cu.reportError(e);
        }
    };

    changeParagraph (iPara, sModif, iStart, iEnd) {
        let sText = this.getParagraph(iPara);







|







>
>
|
>
>
>







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
        } catch (e) {
            Cu.reportError(e);
        }
    };

    getParagraph (iPara) {
        try {
            return this._getTextFromNode(this.lNode[iPara]);
        } catch (e) {
            Cu.reportError(e);
        }
    };

    writeParagraph (iPara, sText) {
        try {
            let xNode = this.lNode[iPara];
            if ("innerHTML" in xNode) {
                xNode.innerHTML = sText;
            } else {
                xNode.textContent = sText;
            }
        } catch (e) {
            Cu.reportError(e);
        }
    };

    changeParagraph (iPara, sModif, iStart, iEnd) {
        let sText = this.getParagraph(iPara);

Modified gc_lang/fr/tb/install.rdf from [5bcaa105f6] to [95227f9159].

11
12
13
14
15
16
17
18
19
20
21
22
23
    <em:homepageURL>${link}</em:homepageURL>
    <!--<em:optionsURL>chrome://grammarchecker/content/options.xul</em:optionsURL>-->
    <em:unpack>true</em:unpack>

    <em:targetApplication>
      <Description>
        <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->
        <em:minVersion>45.8</em:minVersion>
        <em:maxVersion>49.0</em:maxVersion>
      </Description>
    </em:targetApplication>
  </Description>
</RDF>







|
|




11
12
13
14
15
16
17
18
19
20
21
22
23
    <em:homepageURL>${link}</em:homepageURL>
    <!--<em:optionsURL>chrome://grammarchecker/content/options.xul</em:optionsURL>-->
    <em:unpack>true</em:unpack>

    <em:targetApplication>
      <Description>
        <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->
        <em:minVersion>45.8.0</em:minVersion>
        <em:maxVersion>55.*</em:maxVersion>
      </Description>
    </em:targetApplication>
  </Description>
</RDF>