Overview
Comment: | [fx] grammar checking ui |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fx | webext2 |
Files: | files | file ages | folders |
SHA3-256: |
11aef9ec2a3ed1556bf11ecd4a5c8f3d |
User & Date: | olr on 2017-08-16 12:25:00 |
Other Links: | branch diff | manifest | tags |
Context
2017-08-16
| ||
13:47 | [fx] wait icon + clean CSS check-in: 85960e8bc6 user: olr tags: fx, webext2 | |
12:25 | [fx] grammar checking ui check-in: 11aef9ec2a user: olr tags: fx, webext2 | |
09:49 | [fx] grammar checking ui check-in: bd4b42b289 user: olr tags: fx, webext2 | |
Changes
Modified gc_lang/fr/webext/background.js from [58f439e338] to [ce09d05446].
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + | let {sActionDone, result, dInfo} = e.data; switch (sActionDone) { case "init": console.log("INIT DONE"); break; case "parse": case "parseAndSpellcheck": case "parseAndSpellcheck1": case "getListOfTokens": console.log("Action done: " + sActionDone); if (typeof(dInfo.iReturnPort) === "number") { let xPort = aConnx[dInfo.iReturnPort]; xPort.postMessage(e.data); } else { console.log("[background] don’t know where to send results"); |
︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | 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 | + + + | function handleMessage (oRequest, xSender, sendResponse) { //console.log(xSender); console.log("[background] received:"); console.log(oRequest); switch (oRequest.sCommand) { case "parse": case "parseAndSpellcheck": case "parseAndSpellcheck1": case "getListOfTokens": case "textToTest": case "getOptions": case "getDefaultOptions": case "setOptions": case "setOption": case "fullTests": xGCEWorker.postMessage(oRequest); break; default: console.log("[background] Unknown command: " + oRequest.sCommand); } //sendResponse({response: "response from background script"}); } browser.runtime.onMessage.addListener(handleMessage); |
︙ | |||
102 103 104 105 106 107 108 109 110 111 112 113 114 115 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | + | console.log(oRequest); switch (oRequest.sCommand) { case "getCurrentTabId": xPort.postMessage({sActionDone: "getCurrentTabId", result: "getCurrentTabId()", dInfo: null, bError: false}); break; case "parse": case "parseAndSpellcheck": case "parseAndSpellcheck1": case "getListOfTokens": oRequest.dInfo.iReturnPort = iPortId; // we pass the id of the return port to receive answer console.log(oRequest); xGCEWorker.postMessage(oRequest); break; default: console.log("[background] Unknown command: " + oRequest.sCommand); |
︙ |
Modified gc_lang/fr/webext/content_scripts/content_modifier.js from [f8304ae53e] to [1969da4c97].
︙ | |||
55 56 57 58 59 60 61 | 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 | + + + - + + + + - + + + | 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() { createLxgPanel(); xPort.postMessage({ sCommand: "getListOfTokens", dParam: {sText: xTextArea.value}, |
︙ | |||
144 145 146 147 148 149 150 | 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 | - + + - + + + + + - + + - + + + + + | sendResponse({response: "response from content script"}); } browser.runtime.onMessage.addListener(handleMessage); /* |
Modified gc_lang/fr/webext/content_scripts/gc_content.css from [809b952985] to [d24d4af48c].
︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + - | /* Action buttons */ .grammalecte_actions { float: right; margin: 0 0 5px 10px; } .grammalecte_actions .button { display: inline-block; background-color: hsl(0, 0%, 50%); text-align: center; |
︙ |
Modified gc_lang/fr/webext/content_scripts/gc_content.js from [6218bb1d3d] to [66b9da98ef].
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 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 | - + - + - - + + - + - + + + + + + + + + | // JavaScript "use strict"; function onGrammalecteGCPanelClick (xEvent) { try { let xElem = xEvent.target; if (xElem.id) { |
︙ | |||
57 58 59 60 61 62 63 | 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 113 114 115 116 117 118 119 120 | - - - - - - - - + - - - + - + + + + + + + + + + + + + + - + - + - + | clear: function () { while (this.xParagraphList.firstChild) { this.xParagraphList.removeChild(this.xParagraphList.firstChild); } this.aIgnoredErrors.clear(); }, |
︙ | |||
121 122 123 124 125 126 127 | 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 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 | - - + + - + - + + - - - - + + + + + - + - - + + + - + + + + - + - + - - - - - - | }); let nErr = 0; // we count errors to give them an identifier let nEndLastErr = 0; for (let oErr of aGrammErr) { let nStart = oErr["nStart"]; let nEnd = oErr["nEnd"]; if (nStart >= nEndLastErr) { |
︙ | |||
322 323 324 325 326 327 328 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | - + | hide () { this.xTooltipArrow.style.display = "none"; this.xTooltip.style.display = "none"; }, _createSuggestion: function (sErrId, iSugg, sSugg) { let xNodeSugg = document.createElement("a"); |
︙ |
Modified gc_lang/fr/webext/gce_worker.js from [faebfd8747] to [cda351c05e].
︙ | |||
93 94 95 96 97 98 99 100 101 102 103 104 105 106 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | + + | break; case "parse": parse(dParam.sText, dParam.sCountry, dParam.bDebug, dParam.bContext, dInfo); break; case "parseAndSpellcheck": parseAndSpellcheck(dParam.sText, dParam.sCountry, dParam.bDebug, dParam.bContext, dInfo); break; case "parseAndSpellcheck1": parseAndSpellcheck1(dParam.sText, dParam.sCountry, dParam.bDebug, dParam.bContext, dInfo); case "getOptions": getOptions(dInfo); break; case "getDefaultOptions": getDefaultOptions(dInfo); break; case "setOptions": |
︙ | |||
191 192 193 194 195 196 197 198 199 200 201 202 203 204 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | + + + + + + | let aGrammErr = gc_engine.parse(sParagraph, sCountry, bDebug, bContext); let aSpellErr = oTokenizer.getSpellingErrors(sParagraph, oDict); n += 1; postMessage(createResponse("parseAndSpellcheck", {sParagraph: sParagraph, sParaNum: n.toString(), aGrammErr: aGrammErr, aSpellErr: aSpellErr}, dInfo, false)); } postMessage(createResponse("parseAndSpellcheck", null, dInfo, true)); } function parseAndSpellcheck1 (sParagraph, sCountry, bDebug, bContext, dInfo={}) { let aGrammErr = gc_engine.parse(sParagraph, sCountry, bDebug, bContext); let aSpellErr = oTokenizer.getSpellingErrors(sParagraph, oDict); postMessage(createResponse("parseAndSpellcheck1", {sParagraph: sParagraph, aGrammErr: aGrammErr, aSpellErr: aSpellErr}, dInfo, true)); } function getOptions (dInfo={}) { postMessage(createResponse("getOptions", gc_engine.getOptions().gl_toString(), dInfo, true)); } function getDefaultOptions (dInfo={}) { postMessage(createResponse("getDefaultOptions", gc_engine.getDefaultOptions().gl_toString(), dInfo, true)); |
︙ |