Grammalecte  Diff

Differences From Artifact [ae034ec96f]:

To Artifact [d0cd9c03ec]:


177
178
179
180
181
182
183
184

185
186
187
188
189
190
191

192
193
194
195
196
197
198
177
178
179
180
181
182
183

184
185
186
187
188
189
190

191
192
193
194
195
196
197
198







-
+






-
+







    createMessageBox: function () {
        if (this.oMessageBox === null) {
            this.oMessageBox = new GrammalecteMessageBox("grammalecte_message_box", "Grammalecte");
            this.oMessageBox.insertIntoPage();
        }
    },

    startGCPanel: function (what, bCheckText=true) {
    startGCPanel: function (what, xResultNode=null) {
        this.createGCPanel();
        this.oGCPanel.clear();
        this.oGCPanel.show();
        this.oGCPanel.showEditor();
        this.oGCPanel.start(what);
        this.oGCPanel.startWaitIcon();
        if (what && bCheckText) {
        if (what) {
            let sText = this.oGCPanel.oTextControl.getText();
            oGrammalecteBackgroundPort.parseAndSpellcheck(sText, "__GrammalectePanel__");
        }
    },

    showMessage: function (sMessage) {
        this.createMessageBox();
462
463
464
465
466
467
468
469

470
471
472
473
474
475
476
477
462
463
464
465
466
467
468

469

470
471
472
473
474
475
476







-
+
-







                        oGrammalecte.showMessage("Erreur. Le node sur lequel vous avez cliqué n’a pas pu être identifié. Sélectionnez le texte à corriger et relancez le correcteur via le menu contextuel.");
                    }
                    break;
                case "grammar_checker_page":
                    oGrammalecte.startGCPanel(oGrammalecte.getPageText());
                    break;
                case "grammar_checker_selection":
                    oGrammalecte.startGCPanel(result, false); // result is the selected text
                    oGrammalecte.startGCPanel(result); // result is the selected text
                    // selected text is sent to the GC worker in the background script.
                    break;
                case "grammar_checker_iframe":
                    console.log("[Grammalecte] selected iframe: ", result);
                    if (document.activeElement.tagName == "IFRAME") {
                        //console.log(document.activeElement.id); frameId given by result is different than frame.id
                        oGrammalecte.startGCPanel(document.activeElement);
                    } else {