Overview
Comment: | [fx] test panel (done) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | fx | webext2 |
Files: | files | file ages | folders |
SHA3-256: |
1debcdc72b63a02c9b9999798cac6221 |
User & Date: | olr on 2017-08-07 13:13:56 |
Other Links: | branch diff | manifest | tags |
Context
2017-08-07
| ||
13:15 | [fx] use strict and useless var check-in: 0289647400 user: olr tags: fx, webext2 | |
13:13 | [fx] test panel (done) check-in: 1debcdc72b user: olr tags: fx, webext2 | |
07:57 | [fx] panel: CSS adjustments check-in: 8a81843b4a user: olr tags: fx, webext2 | |
Changes
Modified gc_lang/fr/webext/background.js from [03c66ef198] to [b24f208146].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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 | + + + + + + + + + + + + + - + - + + - - - - - + + + + + + + + + + + | // Background "use strict"; /* */ let funcSendResultBack = null; /* Worker (separate thread to avoid freezing Firefox) */ let xGCEWorker = new Worker("gce_worker.js"); xGCEWorker.onmessage = function (e) { // https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent switch (e.data[0]) { case "grammar_errors": console.log("GRAMMAR ERRORS"); console.log(e.data[1].aGrammErr); browser.runtime.sendMessage({sCommand: "grammar_errors", aGrammErr: e.data[1].aGrammErr}); break; case "spelling_and_grammar_errors": console.log("SPELLING AND GRAMMAR ERRORS"); console.log(e.data[1].aSpellErr); console.log(e.data[1].aGrammErr); break; case "text_to_test_result": browser.runtime.sendMessage({sCommand: "text_to_test_result", sResult: e.data[1]}); break; |
Modified gc_lang/fr/webext/gce_worker.js from [2ab933f7e3] to [3fc4168020].
︙ | |||
81 82 83 84 85 86 87 88 89 90 91 92 93 94 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + + + | break; case "setOption": setOption(oParam.sOptName, oParam.bValue); break; case "resetOptions": resetOptions(); break; case "textToTest": textToTest(oParam.sText, oParam.sCountry, oParam.bDebug, oParam.bContext); break; case "fullTests": fullTests(); break; case "getListOfTokens": getListOfTokens(oParam.sText); break; default: |
︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | 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 | + + + + + + + + + + + + + - + | console.log(mfsp.getMasForm("pointilleuse", false)); console.log(phonet.getSimil("est")); let aRes = gc_engine.parse("Je suit..."); for (let oErr of aRes) { console.log(text.getReadableError(oErr)); } } function textToTest (sText, sCountry, bDebug, bContext) { if (!gc_engine || !oDict) { postMessage(["error", "# Error: grammar checker or dictionary not loaded."]); return; } let aGrammErr = gc_engine.parse(sText, sCountry, bDebug, bContext); let sMsg = ""; for (let oErr of aGrammErr) { sMsg += text.getReadableError(oErr) + "\n"; } postMessage(["text_to_test_result", sMsg]); } function fullTests (sGCOptions='{"nbsp":true, "esp":true, "unit":true, "num":true}') { if (!gc_engine || !oDict) { postMessage(["error", "# Error: grammar checker or dictionary not loaded."]); return; } let dMemoOptions = gc_engine.getOptions(); if (sGCOptions) { gc_engine.setOptions(helpers.objectToMap(JSON.parse(sGCOptions))); } let sMsg = ""; for (let sRes of oTest.testParse()) { sMsg += sRes + "\n"; console.log(sRes); } gc_engine.setOptions(dMemoOptions); |
︙ |
Modified gc_lang/fr/webext/panel/main.css from [b87893cfe9] to [fb043edbec].
︙ | |||
261 262 263 264 265 266 267 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - + | #test_cmd textarea { width: 100%; border: 2px solid hsl(0, 0%, 89%); border-radius: 3px; resize: vertical; } |
︙ |
Modified gc_lang/fr/webext/panel/main.html from [f1c096d913] to [941cf34c14].
︙ | |||
59 60 61 62 63 64 65 | 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 | - - + + - + - - + | <h1>LEXICOGRAPHE</h1> <div id="tokens_list"></div> </section> <section id="test_page" class="page"> <div id="test_cmd"> <h1>TESTS</h1> |
︙ |
Modified gc_lang/fr/webext/panel/main.js from [f06df035f4] to [49ea22ef41].
|