Overview
Comment: | [fx] grammar checking: first attempt (it’s a beginning) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fx | webext2 |
Files: | files | file ages | folders |
SHA3-256: |
cb6718897572c0b18fa15ed7d5357398 |
User & Date: | olr on 2017-08-15 10:27:07 |
Other Links: | branch diff | manifest | tags |
Context
2017-08-15
| ||
11:47 | [fx] CSS update, split CSS in different files check-in: 7eec389765 user: olr tags: fx, webext2 | |
10:27 | [fx] grammar checking: first attempt (it’s a beginning) check-in: cb67188975 user: olr tags: fx, webext2 | |
08:57 | [fx] CSS: thinner borders for the panel + adjustments for the lexicographer check-in: a949a0b41c user: olr tags: fx, webext2 | |
Changes
Modified gc_lang/fr/webext/content_scripts/content_modifier.js from [84cf5b1b92] to [4dca30bd26].
︙ | |||
54 55 56 57 58 59 60 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - + | let xToolbar = createNode("div", {className: "grammalecte_wrapper_toolbar"}); let xConjButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Conjuguer"}); xConjButton.onclick = function() { createConjPanel(); }; let xTFButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Formater"}); xTFButton.onclick = function() { createTFPanel(xTextArea); }; let xLxgButton = createNode("div", {className: "grammalecte_wrapper_button", textContent: "Analyser"}); xLxgButton.onclick = function() { |
︙ | |||
102 103 104 105 106 107 108 | 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 | - + + - - - - | oTFPanel = new GrammalectePanel("grammalecte_tf_panel", "Formateur de texte", 800, 600, false); oTFPanel.logInnerHTML(); oTFPanel.setContentNode(createTextFormatter(xTextArea)); oTFPanel.insertIntoPage(); } } |
︙ | |||
160 161 162 163 164 165 166 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | - + | switch (sActionDone) { case "getCurrentTabId": console.log("[Content script] tab id: " + result); nTadId = result; break; case "parseAndSpellcheck": console.log(result); |
︙ |
Modified gc_lang/fr/webext/content_scripts/gc_content.js from [1881b88610] to [27a797448e].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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 29 30 31 32 33 34 35 36 37 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 | + + - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + - - - + + | // JavaScript "use strict"; const oGCPanelContent = { _xContentNode: createNode("div", {id: "grammalecte_gc_panel_content"}), aIgnoredErrors: new Map(), getNode: function () { return this._xContentNode; }, clear: function () { while (this._xContentNode.firstChild) { this._xContentNode.removeChild(this._xContentNode.firstChild); } }, |
︙ | |||
103 104 105 106 107 108 109 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + | xNodeErr.dataset.gc_url = oErr['URL']; if (xNodeErr.dataset.gc_message.includes(" #")) { xNodeErr.dataset.line_id = oErr['sLineId']; xNodeErr.dataset.rule_id = oErr['sRuleId']; } xNodeErr.dataset.suggestions = oErr["aSuggestions"].join("|"); } |
︙ | |||
129 130 131 132 133 134 135 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | } }, ignoreError: function (sIgnoreButtonId) { // ignore try { //console.log("ignore button: " + sIgnoreButtonId + " // error id: " + document.getElementById(sIgnoreButtonId).dataset.error_id); let xNodeErr = document.getElementById("err"+document.getElementById(sIgnoreButtonId).dataset.error_id); |
︙ |
Modified gc_lang/fr/webext/content_scripts/panel_creator.js from [38b104911b] to [bfbf51c76e].
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + | constructor (sId, sTitle, nWidth, nHeight, bMovable=true) { this.sId = sId; this.sContentId = sId+"_content"; this.nWidth = nWidth; this.nHeight = nHeight; this.bMovable = bMovable; |
︙ |
Modified gc_lang/fr/webext/gce_worker.js from [6354516b05] to [faebfd8747].
︙ | |||
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | + + + + + + + + + - + + - - + + + + + + - - - + + + + + + | let bInitDone = false; let oDict = null; let oTokenizer = null; let oLxg = null; let oTest = null; /* Technical note: This worker don’t work as a PromiseWorker (which returns a promise), so when we send request to this worker, we can’t wait the return of the answer just after the request made. The answer is received by the background in another function (onmessage). That’s why the full text to analyze is send in one block, but analyse is returned paragraph by paragraph. */ function init (sExtensionPath, sGCOptions="", sContext="JavaScript", dInfo={}) { try { if (!bInitDone) { console.log("[Worker] Loading… Extension path: " + sExtensionPath); conj.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/conj_data.json")); phonet.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/phonet_data.json")); mfsp.init(helpers.loadFile(sExtensionPath + "/grammalecte/fr/mfsp_data.json")); console.log("[Worker] Modules have been initialized…"); gc_engine.load(sContext, sExtensionPath+"grammalecte/_dictionaries"); oDict = gc_engine.getDictionary(); oTest = new TestGrammarChecking(gc_engine, sExtensionPath+"/grammalecte/fr/tests_data.json"); oLxg = new Lexicographe(oDict); if (sGCOptions !== "") { gc_engine.setOptions(helpers.objectToMap(JSON.parse(sGCOptions))); } oTokenizer = new Tokenizer("fr"); |
︙ |