Grammalecte  Diff

Differences From Artifact [c571bd6bb2]:

To Artifact [fe1ea1f90c]:


11
12
13
14
15
16
17
18
19
20
21




22
23
24
25
26
27
28
11
12
13
14
15
16
17




18
19
20
21
22
23
24
25
26
27
28







-
-
-
-
+
+
+
+








console.log("[Content script] Start");


let nTadId = null;
let nWrapper = 0;

let xConjPanel = null;
let xTFPanel = null;
let xLxgPanel = null;
let xGCPanel = null;
let oConjPanel = null;
let oTFPanel = null;
let oLxgPanel = null;
let oGCPanel = null;


function showError (e) {
    console.error(e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message);
}

function wrapTextareas () {
91
92
93
94
95
96
97
98
99


100
101
102
103


104
105
106
107
108
109
110


111
112
113
114
115




116
117
118
119
120
121
122


123
124
125
126


127
128
129
130
131
132
133


134
135
136

137
138


139
140
141
142
143
144
145
91
92
93
94
95
96
97


98
99
100
101


102
103
104
105
106
107
108


109
110
111
112



113
114
115
116
117
118
119
120
121


122
123
124
125


126
127
128
129
130
131
132


133
134
135
136

137


138
139
140
141
142
143
144
145
146







-
-
+
+


-
-
+
+





-
-
+
+


-
-
-
+
+
+
+





-
-
+
+


-
-
+
+





-
-
+
+


-
+
-
-
+
+







    catch (e) {
        showError(e);
    }
}

function createConjPanel () {
    console.log("Conjugueur");
    if (xConjPanel !== null) {
        xConjPanel.style.display = "block";
    if (oConjPanel !== null) {
        oConjPanel.show();
    } else {
        // create the panel
        xConjPanel = createPanelFrame("grammalecte_conj_panel", "Conjugueur");
        document.body.appendChild(xConjPanel);
        oConjPanel = new GrammalectePanel("grammalecte_conj_panel", "Conjugueur", 600, 600);
        oConjPanel.insertIntoPage();
    }
}

function createTFPanel (xTextArea) {
    console.log("Formateur de texte");
    if (xTFPanel !== null) {
        xTFPanel.style.display = "block";
    if (oTFPanel !== null) {
        oTFPanel.show();
    } else {
        // create the panel
        xTFPanel = createPanelFrame("grammalecte_tf_panel", "Formateur de texte");
        document.body.appendChild(xTFPanel);
        document.getElementById("grammalecte_tf_panel_content").appendChild(createTextFormatter(xTextArea));
        oTFPanel = new GrammalectePanel("grammalecte_tf_panel", "Formateur de texte", 800, 600, false);
        oTFPanel.logInnerHTML();
        oTFPanel.setContent(createTextFormatter(xTextArea));
        oTFPanel.insertIntoPage();
    }
}

function createLxgPanel (xTextArea) {
    console.log("Lexicographe");
    if (xLxgPanel !== null) {
        xLxgPanel.style.display = "block";
    if (oLxgPanel !== null) {
        oLxgPanel.show();
    } else {
        // create the panel
        xLxgPanel = createPanelFrame("grammalecte_lxg_panel", "Lexicographe");
        document.body.appendChild(xLxgPanel);
        oLxgPanel = new GrammalectePanel("grammalecte_lxg_panel", "Lexicographe", 500, 700);
        oLxgPanel.insertIntoPage();
    }
}

function createGCPanel (oErrors) {
    console.log("Correction grammaticale");
    if (xGCPanel !== null) {
        xGCPanel.style.display = "block";
    if (oGCPanel !== null) {
        oGCPanel.show();
    } else {
        // create the panel
        xGCPanel = createPanelFrame("grammalecte_gc_panel", "Correcteur");
        oGCPanel = new GrammalectePanel("grammalecte_gc_panel", "Correcteur", 500, 700);
        document.body.appendChild(xGCPanel);
        document.getElementById("grammalecte_gc_panel_content").appendChild(document.createTextNode(JSON.stringify(oErrors)));
        oGCPanel.setContent(document.createTextNode(JSON.stringify(oErrors)));
        oGCPanel.insertIntoPage();
    }
}


/*
    Simple message
*/