Overview
Comment: | [fx] cancel code cosmetics |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fx | comunicate |
Files: | files | file ages | folders |
SHA3-256: |
686c43591b2598808441a71749618407 |
User & Date: | olr on 2020-03-10 08:33:48 |
Other Links: | branch diff | manifest | tags |
Context
2020-03-10
| ||
08:41 | [fx] cancel code cosmetics check-in: 4cb15368e7 user: olr tags: fx, comunicate | |
08:33 | [fx] cancel code cosmetics check-in: 686c43591b user: olr tags: fx, comunicate | |
2018-11-12
| ||
12:22 | [fx] minor coding style adjustments check-in: 74f2ec49cc user: olr tags: fx, comunicate | |
Changes
Modified gc_lang/fr/webext/content_scripts/init.js from [4d30429eeb] to [6855746abd].
︙ | ︙ | |||
10 11 12 13 14 15 16 | https://bugzilla.mozilla.org/show_bug.cgi?id=1267027 No SharedWorker, no images allowed for now… */ "use strict"; function showError (e) { | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | https://bugzilla.mozilla.org/show_bug.cgi?id=1267027 No SharedWorker, no images allowed for now… */ "use strict"; function showError (e) { // console can’t display error objects from content scripts console.error(e.fileName + "\n" + e.name + "\nline: " + e.lineNumber + "\n" + e.message); } // Chrome don’t follow the W3C specification: // https://browserext.github.io/browserext/ let bChrome = false; if (typeof browser !== "object") { |
︙ | ︙ | |||
58 59 60 61 62 63 64 | xObserver: null, sExtensionUrl: null, listenRightClick: function () { // Node where a right click is done // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1325814 | | < < | | < < | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | xObserver: null, sExtensionUrl: null, listenRightClick: function () { // Node where a right click is done // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1325814 document.addEventListener("contextmenu", function (xEvent) { this.xRightClickedNode = xEvent.target; }.bind(this), true); }, clearRightClickedNode: function () { this.xRightClickedNode = null; }, createMenus: function () { |
︙ | ︙ | |||
161 162 163 164 165 166 167 | this.xObserver.observe(document.body, { childList: true, subtree: true }); }, rescanPage: function () { | | < < | < < | < < | < | < < | < | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | this.xObserver.observe(document.body, { childList: true, subtree: true }); }, rescanPage: function () { if (this.oTFPanel !== null) { this.oTFPanel.hide(); } if (this.oLxgPanel !== null) { this.oLxgPanel.hide(); } if (this.oGCPanel !== null) { this.oGCPanel.hide(); } for (let oMenu of this.lMenu) { oMenu.deleteNodes(); } this.lMenu.length = 0; // to clear an array this.listenRightClick(); this.createMenus(); }, createTFPanel: function () { if (this.oTFPanel === null) { this.oTFPanel = new GrammalecteTextFormatter("grammalecte_tf_panel", "Formateur de texte", 760, 615, false); //this.oTFPanel.logInnerHTML(); this.oTFPanel.insertIntoPage(); window.setTimeout(function(self) { self.oTFPanel.adjustHeight(); }, 50, this); } }, createLxgPanel: function () { if (this.oLxgPanel === null) { this.oLxgPanel = new GrammalecteLexicographer("grammalecte_lxg_panel", "Lexicographe", 500, 700); this.oLxgPanel.insertIntoPage(); |
︙ | ︙ | |||
229 230 231 232 233 234 235 | startLxgPanel: function () { this.createLxgPanel(); this.oLxgPanel.clear(); this.oLxgPanel.show(); this.oLxgPanel.startWaitIcon(); }, | | | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | startLxgPanel: function () { this.createLxgPanel(); this.oLxgPanel.clear(); this.oLxgPanel.show(); this.oLxgPanel.startWaitIcon(); }, startFTPanel: function (xNode=null) { this.createTFPanel(); this.oTFPanel.start(xNode); this.oTFPanel.show(); }, showMessage: function (sMessage) { this.createMessageBox(); |
︙ | ︙ | |||
258 259 260 261 262 263 264 | try { let xNode = document.createElement(sType); Object.assign(xNode, oAttr); if (oDataset) { Object.assign(xNode.dataset, oDataset); } return xNode; | > | > | | 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 275 276 277 278 279 280 281 | try { let xNode = document.createElement(sType); Object.assign(xNode, oAttr); if (oDataset) { Object.assign(xNode.dataset, oDataset); } return xNode; } catch (e) { showError(e); } }, createStyle: function (sLinkCss, sLinkId=null, xNodeToAppendTo=null) { try { let xNode = document.createElement("link"); Object.assign(xNode, { rel: "stylesheet", type: "text/css", media: "all", href: this.sExtensionUrl + sLinkCss }); if (sLinkId) { Object.assign(xNode, { id: sLinkId }); } if (xNodeToAppendTo) { xNodeToAppendTo.appendChild(xNode); } return xNode; } catch (e) { showError(e); } } }; /* Connexion to the background |
︙ | ︙ | |||
336 337 338 339 340 341 342 | sText = oGrammalecte.xRightClickedNode.tagName == "TEXTAREA" ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; xGrammalectePort.postMessage({ sCommand: "parseAndSpellcheck", dParam: { sText: sText, sCountry: "FR", bDebug: false, bContext: false }, dInfo: { sTextAreaId: oGrammalecte.xRightClickedNode.id } }); } else { | < | < | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | sText = oGrammalecte.xRightClickedNode.tagName == "TEXTAREA" ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; xGrammalectePort.postMessage({ sCommand: "parseAndSpellcheck", dParam: { sText: sText, sCountry: "FR", bDebug: false, bContext: false }, dInfo: { sTextAreaId: oGrammalecte.xRightClickedNode.id } }); } else { 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 "rightClickGCPage": oGrammalecte.startGCPanel(); xGrammalectePort.postMessage({ sCommand: "parseAndSpellcheck", dParam: { sText: oGrammalecte.getPageText(), sCountry: "FR", bDebug: false, bContext: false }, |
︙ | ︙ | |||
364 365 366 367 368 369 370 | sText = oGrammalecte.xRightClickedNode.tagName == "TEXTAREA" ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; xGrammalectePort.postMessage({ sCommand: "getListOfTokens", dParam: { sText: sText }, dInfo: { sTextAreaId: oGrammalecte.xRightClickedNode.id } }); } else { | < | < < | < | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | sText = oGrammalecte.xRightClickedNode.tagName == "TEXTAREA" ? oGrammalecte.xRightClickedNode.value : oGrammalecte.xRightClickedNode.innerText; xGrammalectePort.postMessage({ sCommand: "getListOfTokens", dParam: { sText: sText }, dInfo: { sTextAreaId: oGrammalecte.xRightClickedNode.id } }); } else { oGrammalecte.showMessage("Erreur. Le node sur lequel vous avez cliqué n’a pas pu être identifié. Sélectionnez le texte à analyser et relancez le lexicographe via le menu contextuel."); } break; case "rightClickLxgPage": oGrammalecte.startLxgPanel(); xGrammalectePort.postMessage({ sCommand: "getListOfTokens", dParam: { sText: oGrammalecte.getPageText() }, dInfo: {} }); break; case "rightClickLxgSelectedText": oGrammalecte.startLxgPanel(); // selected text is sent to the GC worker in the background script. break; // Text formatter command case "rightClickTFEditableNode": if (oGrammalecte.xRightClickedNode !== null) { if (oGrammalecte.xRightClickedNode.tagName == "TEXTAREA") { oGrammalecte.startFTPanel(oGrammalecte.xRightClickedNode); } else { oGrammalecte.showMessage("Cette zone de texte n’est pas réellement un champ de formulaire, mais un node HTML éditable. Le formateur de texte n’est pas disponible pour ce type de champ de saisie."); } } else { oGrammalecte.showMessage("Erreur. Le node sur lequel vous avez cliqué n’a pas pu être identifié."); } break; // rescan page command case "rescanPage": |
︙ | ︙ |