Overview
Comment: | [fx][core] initialization in gce_worker.js |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fx | webext2 |
Files: | files | file ages | folders |
SHA3-256: |
1f4195c966bbafe7f8ee351f98efd6d9 |
User & Date: | olr on 2017-08-04 15:41:45 |
Other Links: | branch diff | manifest | tags |
Context
2017-08-04
| ||
16:09 | [fx] these functions have a new name check-in: b4a1b21d88 user: olr tags: fx, webext2 | |
15:41 | [fx][core] initialization in gce_worker.js check-in: 1f4195c966 user: olr tags: fx, webext2 | |
08:18 | [core][fx] gc engine in a dedicated worker check-in: 51a209f202 user: olr tags: fx, webext2 | |
Changes
Modified gc_core/js/ibdawg.js from [d79dcb6b99] to [10dd14ace9].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + - + | ${string} class IBDAWG { // INDEXABLE BINARY DIRECT ACYCLIC WORD GRAPH |
︙ |
Modified gc_core/js/lang_core/gc_engine.js from [64ba38ab05] to [2f4877bef2].
︙ | |||
308 309 310 311 312 313 314 | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | - + - + | return gc_rules.lSentenceRules; } return gc_rules.lParagraphRules; }, //// Initialization |
︙ |
Modified gc_core/js/tests.js from [c744b064be] to [4a9fbec06f].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + + - + | // JavaScript "use strict"; if (typeof(require) !== 'undefined') { var helpers = require("resource://grammalecte/helpers.js"); } class TestGrammarChecking { |
︙ |
Modified gc_lang/fr/modules-js/conj.js from [5d3a577c36] to [526a57d214].
︙ | |||
475 476 477 478 479 480 481 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | - + - + - + - + | return (this.dConj.get(":PQ").get(":Q4")) ? this.dConj.get(":PQ").get(":Q4") : this.dConj.get(":PQ").get(":Q1"); } } // Initialization if (typeof(browser) !== 'undefined') { |
︙ |
Modified gc_lang/fr/modules-js/mfsp.js from [75f345b054] to [efd19b51da].
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | - + - + | var mfsp = { // list of affix codes _lTagMiscPlur: [], _lTagMasForm: [], // dictionary of words with uncommon plurals (-x, -ux, english, latin and italian plurals) and tags to generate them |
︙ | |||
95 96 97 98 99 100 101 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | - + | if (typeof(browser) !== 'undefined') { // WebExtension mfsp.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/mfsp_data.json"))); } else if (typeof(require) !== 'undefined') { // Add-on SDK and Thunderbird mfsp.init(helpers.loadFile("resource://grammalecte/fr/mfsp_data.json")); } else { |
︙ |
Modified gc_lang/fr/modules-js/phonet.js from [5cab447d24] to [8f4c2c4be2].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - + - + | // Grammalecte - Suggestion phonétique if (typeof(require) !== 'undefined') { var helpers = require("resource://grammalecte/helpers.js"); } var phonet = { |
︙ | |||
84 85 86 87 88 89 90 | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | - + | if (typeof(browser) !== 'undefined') { // WebExtension phonet.init(helpers.loadFile(browser.extension.getURL("grammalecte/fr/phonet_data.json"))); } else if (typeof(require) !== 'undefined') { // Add-on SDK and Thunderbird phonet.init(helpers.loadFile("resource://grammalecte/fr/phonet_data.json")); } else { |
Modified gc_lang/fr/webext/background.js from [67f47c2618] to [7ec98c3680].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + + | // Background "use strict"; let xGCEWorker = new Worker("gce_worker.js"); xGCEWorker.postMessage(["init", browser.extension.getURL(".")]); function handleMessage (oRequest, xSender, sendResponse) { console.log(`[background] received: ${oRequest.content}`); sendResponse({response: "response from background script"}); } browser.runtime.onMessage.addListener(handleMessage); |
Modified gc_lang/fr/webext/gce_worker.js from [ea3f39a7e2] to [0a0381f0d1].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | /* WORKER: https://developer.mozilla.org/en-US/docs/Web/API/Worker https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope |
︙ | |||
38 39 40 41 42 43 44 45 46 47 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | + + + + + + + + + + - + - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | importScripts("grammalecte/fr/conj.js"); importScripts("grammalecte/fr/mfsp.js"); importScripts("grammalecte/fr/phonet.js"); importScripts("grammalecte/fr/cregex.js"); importScripts("grammalecte/fr/gc_options.js"); importScripts("grammalecte/fr/gc_rules.js"); importScripts("grammalecte/fr/gc_engine.js"); importScripts("grammalecte/fr/lexicographe.js"); importScripts("grammalecte/tests.js"); /* Warning. Initialization can’t be completed at startup, for we need the path of the path of the extension to load data stored in JSON files. This path is retrieved in background.js and passed with the following event. */ onmessage = function (e) { if (e.data[0] == "init") { loadGrammarChecker(e.data[1]); |
︙ | |||
114 115 116 117 118 119 120 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - + | if (!gc_engine || !oDict) { return "# Error: grammar checker or dictionary not loaded." } let dMemoOptions = gc_engine.getOptions(); if (sGCOptions) { gc_engine.setOptions(helpers.objectToMap(JSON.parse(sGCOptions))); } |
︙ | |||
141 142 143 144 145 146 147 | 170 171 172 173 174 175 176 | - - - - - - - - - - - - - - - - - - - - - - - - | return JSON.stringify(aElem); } catch (e) { helpers.logerror(e); } return JSON.stringify([]); } |