Grammalecte  Check-in [ed3fc18125]

Overview
Comment:[fx] WebExt: some code reformatting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | webext3
Files: files | file ages | folders
SHA3-256: ed3fc18125c4fab0b1639f8e610f7d04fdbeaa45cd7bc611420960937a935196
User & Date: olr on 2017-10-17 20:13:19
Other Links: branch diff | manifest | tags
Context
2017-10-18
07:58
[fx] modify node control for editable node check-in: f31e7e5092 user: olr tags: fx, webext3
2017-10-17
20:13
[fx] WebExt: some code reformatting check-in: ed3fc18125 user: olr tags: fx, webext3
19:04
[fx] WebExt: titles for main ui pages check-in: 2eabbcdb1e user: olr tags: fx, webext3
Changes

Modified gc_lang/fr/webext/background.js from [f6d1815bfa] to [81e58cc301].

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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274


/*
    Context Menu
*/

// Selected text
browser.contextMenus.create({
    id: "rightClickLxgSelectedText",
    title: "Lexicographe (sélection)",
    contexts: ["selection"]
});

browser.contextMenus.create({
    id: "rightClickGCSelectedText",
    title: "Correction grammaticale (sélection)",
    contexts: ["selection"]
});

browser.contextMenus.create({
    id: "separator_selection",
    type: "separator",
    contexts: ["selection"]
});

// Editable content
browser.contextMenus.create({
    id: "rightClickTFEditableNode",
    title: "Formateur de texte (zone de texte)",
    contexts: ["editable"]
});

browser.contextMenus.create({
    id: "rightClickLxgEditableNode",
    title: "Lexicographe (zone de texte)",
    contexts: ["editable"]
});

browser.contextMenus.create({
    id: "rightClickGCEditableNode",
    title: "Correction grammaticale (zone de texte)",
    contexts: ["editable"]
});

browser.contextMenus.create({
    id: "separator_editable",
    type: "separator",
    contexts: ["editable"]
});

// Page
browser.contextMenus.create({
    id: "rightClickLxgPage",
    title: "Lexicographe (page)",
    contexts: ["page"]
});

browser.contextMenus.create({
    id: "rightClickGCPage",
    title: "Correction grammaticale (page)",
    contexts: ["page"]
});

browser.contextMenus.create({
    id: "separator_page",
    type: "separator",
    contexts: ["page"]
});

// Conjugueur
browser.contextMenus.create({
    id: "conjugueur_window",
    title: "Conjugueur [fenêtre]",
    contexts: ["all"]
});

browser.contextMenus.create({
    id: "conjugueur_tab",
    title: "Conjugueur [onglet]",
    contexts: ["all"]
});

// Rescan page
browser.contextMenus.create({
    id: "separator_rescan",
    type: "separator",
    contexts: ["editable"]
});

browser.contextMenus.create({
    id: "rescanPage",
    title: "Rechercher à nouveau les zones de texte",
    contexts: ["editable"]
});


browser.contextMenus.onClicked.addListener(function (xInfo, xTab) {
    // xInfo = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/OnClickData
    // xTab = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/Tab
    // confusing: no way to get the node where we click?!
    switch (xInfo.menuItemId) {







|
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<

|
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<

|
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<

|
<
<
<
<
<
|
<
<
<
<
<

|
<
<
<
<
<
<
<
|
<
<







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
201
202
203
204
205


/*
    Context Menu
*/

// Selected text
browser.contextMenus.create({ id: "rightClickLxgSelectedText",  title: "Lexicographe (sélection)",                  contexts: ["selection"] });





browser.contextMenus.create({ id: "rightClickGCSelectedText",   title: "Correction grammaticale (sélection)",       contexts: ["selection"] });





browser.contextMenus.create({ id: "separator_selection",        type: "separator",                                  contexts: ["selection"] });





// Editable content
browser.contextMenus.create({ id: "rightClickTFEditableNode",   title: "Formateur de texte (zone de texte)",        contexts: ["editable"] });





browser.contextMenus.create({ id: "rightClickLxgEditableNode",  title: "Lexicographe (zone de texte)",              contexts: ["editable"] });





browser.contextMenus.create({ id: "rightClickGCEditableNode",   title: "Correction grammaticale (zone de texte)",   contexts: ["editable"] });





browser.contextMenus.create({ id: "separator_editable",         type: "separator",                                  contexts: ["editable"] });





// Page
browser.contextMenus.create({ id: "rightClickLxgPage",          title: "Lexicographe (page)",                       contexts: ["page"] });





browser.contextMenus.create({ id: "rightClickGCPage",           title: "Correction grammaticale (page)",            contexts: ["page"] });





browser.contextMenus.create({ id: "separator_page",             type: "separator",                                  contexts: ["page"] });





// Conjugueur
browser.contextMenus.create({ id: "conjugueur_window",          title: "Conjugueur [fenêtre]",                      contexts: ["all"] });





browser.contextMenus.create({ id: "conjugueur_tab",             title: "Conjugueur [onglet]",                       contexts: ["all"] });





// Rescan page
browser.contextMenus.create({ id: "separator_rescan",           type: "separator",                                  contexts: ["editable"] });







browser.contextMenus.create({ id: "rescanPage",                 title: "Rechercher à nouveau les zones de texte",   contexts: ["editable"] });




browser.contextMenus.onClicked.addListener(function (xInfo, xTab) {
    // xInfo = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextMenus/OnClickData
    // xTab = https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/Tab
    // confusing: no way to get the node where we click?!
    switch (xInfo.menuItemId) {