Grammalecte  Check-in [485e91923f]

Overview
Comment:[fx] rename xPort -> xGrammalectePort
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | webext2
Files: files | file ages | folders
SHA3-256: 485e91923f0351bd19dae9e2b692b18877fffda3f814706ef2f043a9ddf32438
User & Date: olr on 2017-08-31 04:20:32
Other Links: branch diff | manifest | tags
Context
2017-08-31
04:31
[fx] console.log adjustments check-in: be93ad702e user: olr tags: fx, webext2
04:20
[fx] rename xPort -> xGrammalectePort check-in: 485e91923f user: olr tags: fx, webext2
2017-08-30
15:55
[fx] rename content scripts -> panel check-in: 6874758304 user: olr tags: fx, webext2
Changes

Modified gc_lang/fr/webext/content_scripts/init.js from [473b1e492b] to [24d04c7299].

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    }
}


/*
    Connexion to the background
*/
let xPort = browser.runtime.connect({name: "content-script port"});

xPort.onMessage.addListener(function (oMessage) {
    let {sActionDone, result, dInfo, bEnd, bError} = oMessage;
    switch (sActionDone) {
        case "parseAndSpellcheck":
            if (!bEnd) {
                oGrammalecte.oGCPanel.addParagraphResult(result);
            } else {
                oGrammalecte.oGCPanel.stopWaitIcon();







|

|







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    }
}


/*
    Connexion to the background
*/
let xGrammalectePort = browser.runtime.connect({name: "content-script port"});

xGrammalectePort.onMessage.addListener(function (oMessage) {
    let {sActionDone, result, dInfo, bEnd, bError} = oMessage;
    switch (sActionDone) {
        case "parseAndSpellcheck":
            if (!bEnd) {
                oGrammalecte.oGCPanel.addParagraphResult(result);
            } else {
                oGrammalecte.oGCPanel.stopWaitIcon();

Modified gc_lang/fr/webext/content_scripts/panel.js from [d6d284c073] to [1ae3863a28].

134
135
136
137
138
139
140
141
142
143
144
145
146
147
    }

    stopWaitIcon () {
        this.xWaitIcon.style.visibility = "hidden";
    }

    openURL (sURL) {
        xPort.postMessage({
            sCommand: "openURL",
            dParam: {"sURL": sURL},
            dInfo: {}
        });
    }
}







|






134
135
136
137
138
139
140
141
142
143
144
145
146
147
    }

    stopWaitIcon () {
        this.xWaitIcon.style.visibility = "hidden";
    }

    openURL (sURL) {
        xGrammalectePort.postMessage({
            sCommand: "openURL",
            dParam: {"sURL": sURL},
            dInfo: {}
        });
    }
}

Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [94e9ffb049] to [9f1f1ad499].

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    }

    recheckParagraph (iParaNum) {
        let sParagraphId = "grammalecte_paragraph" + iParaNum;
        let xParagraph = document.getElementById(sParagraphId);
        this.blockParagraph(xParagraph);
        let sText = this.purgeText(xParagraph.textContent);
        xPort.postMessage({
            sCommand: "parseAndSpellcheck1",
            dParam: {sText: sText, sCountry: "FR", bDebug: false, bContext: false},
            dInfo: {sParagraphId: sParagraphId}
        });
        this.oTAC.setParagraph(iParaNum, sText);
        this.oTAC.write();
    }







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    }

    recheckParagraph (iParaNum) {
        let sParagraphId = "grammalecte_paragraph" + iParaNum;
        let xParagraph = document.getElementById(sParagraphId);
        this.blockParagraph(xParagraph);
        let sText = this.purgeText(xParagraph.textContent);
        xGrammalectePort.postMessage({
            sCommand: "parseAndSpellcheck1",
            dParam: {sText: sText, sCountry: "FR", bDebug: false, bContext: false},
            dInfo: {sParagraphId: sParagraphId}
        });
        this.oTAC.setParagraph(iParaNum, sText);
        this.oTAC.write();
    }

Modified gc_lang/fr/webext/content_scripts/wrapper.js from [d4b91e9e99] to [d6f76a7bda].

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
        try {
            let xToolbar = createNode("div", {className: "grammalecte_wrapper_toolbar"});
            let xConjButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Conjuguer"});
            xConjButton.onclick = () => { this.showConjButtons(); };
            let xConjSection = createNode("div", {id: "grammalecte_wrapper_conj_section"+this.nWrapper, className: "grammalecte_wrapper_conj_section"});
            let xConjButtonTab = createNode("div", {className: "grammalecte_wrapper_button2", textContent: ">Onglet"});
            xConjButtonTab.onclick = function () {
                xPort.postMessage({sCommand: "openConjugueurTab", dParam: null, dInfo: null});
                this.hideConjButtons();
            }.bind(this);
            let xConjButtonWin = createNode("div", {className: "grammalecte_wrapper_button2", textContent: ">Fenêtre"});
            xConjButtonWin.onclick = function () {
                xPort.postMessage({sCommand: "openConjugueurWindow", dParam: null, dInfo: null});
                this.hideConjButtons();
            }.bind(this);
            let xTFButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Formater"});
            xTFButton.onclick = function () {
                oGrammalecte.createTFPanel();
                oGrammalecte.oTFPanel.start(xTextArea);
                oGrammalecte.oTFPanel.show();
            };
            let xLxgButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Analyser"});
            xLxgButton.onclick = function () {
                oGrammalecte.createLxgPanel();
                oGrammalecte.oLxgPanel.clear();
                oGrammalecte.oLxgPanel.show();
                oGrammalecte.oLxgPanel.startWaitIcon();
                xPort.postMessage({
                    sCommand: "getListOfTokens",
                    dParam: {sText: xTextArea.value},
                    dInfo: {sTextAreaId: xTextArea.id}
                });
            };
            let xGCButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Corriger"});
            xGCButton.onclick = function () {
                oGrammalecte.createGCPanel();
                oGrammalecte.oGCPanel.clear();
                oGrammalecte.oGCPanel.show();
                oGrammalecte.oGCPanel.start(xTextArea);
                oGrammalecte.oGCPanel.startWaitIcon();
                xPort.postMessage({
                    sCommand: "parseAndSpellcheck",
                    dParam: {sText: xTextArea.value, sCountry: "FR", bDebug: false, bContext: false},
                    dInfo: {sTextAreaId: xTextArea.id}
                });
            };
            // Create
            //xToolbar.appendChild(createNode("img", {scr: browser.extension.getURL("img/logo-16.png")}));







|




|














|












|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
        try {
            let xToolbar = createNode("div", {className: "grammalecte_wrapper_toolbar"});
            let xConjButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Conjuguer"});
            xConjButton.onclick = () => { this.showConjButtons(); };
            let xConjSection = createNode("div", {id: "grammalecte_wrapper_conj_section"+this.nWrapper, className: "grammalecte_wrapper_conj_section"});
            let xConjButtonTab = createNode("div", {className: "grammalecte_wrapper_button2", textContent: ">Onglet"});
            xConjButtonTab.onclick = function () {
                xGrammalectePort.postMessage({sCommand: "openConjugueurTab", dParam: null, dInfo: null});
                this.hideConjButtons();
            }.bind(this);
            let xConjButtonWin = createNode("div", {className: "grammalecte_wrapper_button2", textContent: ">Fenêtre"});
            xConjButtonWin.onclick = function () {
                xGrammalectePort.postMessage({sCommand: "openConjugueurWindow", dParam: null, dInfo: null});
                this.hideConjButtons();
            }.bind(this);
            let xTFButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Formater"});
            xTFButton.onclick = function () {
                oGrammalecte.createTFPanel();
                oGrammalecte.oTFPanel.start(xTextArea);
                oGrammalecte.oTFPanel.show();
            };
            let xLxgButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Analyser"});
            xLxgButton.onclick = function () {
                oGrammalecte.createLxgPanel();
                oGrammalecte.oLxgPanel.clear();
                oGrammalecte.oLxgPanel.show();
                oGrammalecte.oLxgPanel.startWaitIcon();
                xGrammalectePort.postMessage({
                    sCommand: "getListOfTokens",
                    dParam: {sText: xTextArea.value},
                    dInfo: {sTextAreaId: xTextArea.id}
                });
            };
            let xGCButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Corriger"});
            xGCButton.onclick = function () {
                oGrammalecte.createGCPanel();
                oGrammalecte.oGCPanel.clear();
                oGrammalecte.oGCPanel.show();
                oGrammalecte.oGCPanel.start(xTextArea);
                oGrammalecte.oGCPanel.startWaitIcon();
                xGrammalectePort.postMessage({
                    sCommand: "parseAndSpellcheck",
                    dParam: {sText: xTextArea.value, sCountry: "FR", bDebug: false, bContext: false},
                    dInfo: {sTextAreaId: xTextArea.id}
                });
            };
            // Create
            //xToolbar.appendChild(createNode("img", {scr: browser.extension.getURL("img/logo-16.png")}));