70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
-
+
|
dInfo: {sTextAreaId: xTextArea.id}
});
};
let xGCButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Corriger"});
xGCButton.onclick = function() {
createGCPanel();
oGCPanel.startWaitIcon();
oGCPanelContent.start(xTextArea);
oGCPanel.start(xTextArea);
xPort.postMessage({
sCommand: "parseAndSpellcheck",
dParam: {sText: xTextArea.value, sCountry: "FR", bDebug: false, bContext: false},
dInfo: {sTextAreaId: xTextArea.id}
});
};
// Create
|
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
147
148
149
150
151
152
|
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
147
148
149
150
151
|
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
|
oConjPanel.insertIntoPage();
}
}
function createTFPanel (xTextArea) {
console.log("Formateur de texte");
if (oTFPanel !== null) {
oTFPanel.setTextArea(xTextArea);
oTFPanel.show();
} else {
// create the panel
oTFPanel = new GrammalectePanel("grammalecte_tf_panel", "Formateur de texte", 800, 600, false);
oTFPanel = new GrammalecteTextFormatter("grammalecte_tf_panel", "Formateur de texte", 800, 600, false);
oTFPanel.logInnerHTML();
oTFPanel.setContentNode(createTextFormatter(xTextArea));
oTFPanel.setTextArea(xTextArea);
oTFPanel.insertIntoPage();
}
}
function createLxgPanel () {
console.log("Lexicographe");
if (oLxgPanel !== null) {
oLxgPanelContent.clear();
oLxgPanel.clear();
oLxgPanel.show();
} else {
// create the panel
oLxgPanel = new GrammalectePanel("grammalecte_lxg_panel", "Lexicographe", 500, 700);
oLxgPanel = new GrammalecteLexicographer("grammalecte_lxg_panel", "Lexicographe", 500, 700);
oLxgPanel.setContentNode(oLxgPanelContent.init());
oLxgPanel.insertIntoPage();
}
}
function createGCPanel () {
console.log("Correction grammaticale");
if (oGCPanel !== null) {
oGCPanelContent.clear();
oGCPanel.clear();
oGCPanel.show();
} else {
// create the panel
oGCPanel = new GrammalectePanel("grammalecte_gc_panel", "Grammalecte", 500, 700);
oGCPanel = new GrammalecteGrammarChecker("grammalecte_gc_panel", "Grammalecte", 500, 700);
oGCPanel.setContentNode(oGCPanelContent.init());
oGCPanel.insertIntoPage();
}
}
/*
Simple message
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
-
+
-
+
-
+
|
case "getCurrentTabId":
console.log("[Content script] tab id: " + result);
nTadId = result;
break;
case "parseAndSpellcheck":
console.log("[content script] received: parseAndSpellcheck");
if (!bEnd) {
oGCPanelContent.addParagraphResult(result);
oGCPanel.addParagraphResult(result);
} else {
oGCPanel.stopWaitIcon();
}
break;
case "parseAndSpellcheck1":
console.log("[content script] received: parseAndSpellcheck1");
oGCPanelContent.refreshParagraph(dInfo.sParagraphId, result);
oGCPanel.refreshParagraph(dInfo.sParagraphId, result);
break;
case "getListOfTokens":
console.log("[content script] received: getListOfTokens");
if (!bEnd) {
oLxgPanelContent.addListOfTokens(result);
oLxgPanel.addListOfTokens(result);
} else {
oLxgPanel.stopWaitIcon();
}
break;
default:
console.log("[Content script] Unknown command: " + sActionDone);
}
|