Overview
| Comment: | [fx] don’t rewrite text when rechecking paragraphs -> prevent bug of overlapping events |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | fx |
| Files: | files | file ages | folders |
| SHA3-256: |
9d2f92044a03d2aff0901757bd86f3de |
| User & Date: | olr on 2020-04-08 08:50:16 |
| Other Links: | manifest | tags |
Context
|
2020-04-08
| ||
| 10:11 | [build] build chrome extension check-in: 359d58c56b user: olr tags: trunk, build | |
| 08:50 | [fx] don’t rewrite text when rechecking paragraphs -> prevent bug of overlapping events check-in: 9d2f92044a user: olr tags: trunk, fx | |
| 07:31 | [fr] ajustements check-in: 651318a215 user: olr tags: trunk, fr | |
Changes
Modified gc_lang/fr/webext/content_scripts/api.js from [2457ed4f51] to [0dfb85fb05].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + |
// JavaScript
"use strict";
const oGrammalecteAPI = {
// functions callable from within pages
// to be sent to the content-cript via an event “GrammalecteCall”
sVersion: "1.0",
generateNodeId: function (xNode) {
xNode.id = "grammalecte_generated_id_" + Date.now().toString(36) + "_" + (Math.floor(Math.random() * (1000000))).toString(36);
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [ec198a43f7] to [a5deafa9f3].
| ︙ | |||
277 278 279 280 281 282 283 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | - + + - - |
recheckParagraph (iParaNum) {
if (!this.bOpened) {
return;
}
let sParagraphId = "grammalecte_paragraph" + iParaNum;
let xParagraph = this.xParent.getElementById(sParagraphId);
this._blockParagraph(xParagraph);
|
| ︙ | |||
407 408 409 410 411 412 413 414 | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | + + + - + |
try {
let sErrorId = this.xParent.getElementById(sNodeSuggId).dataset.error_id;
//let sParaNum = sErrorId.slice(0, sErrorId.indexOf("-"));
let xNodeErr = this.xParent.getElementById("grammalecte_err" + sErrorId);
xNodeErr.textContent = this.xParent.getElementById(sNodeSuggId).textContent;
xNodeErr.className = "grammalecte_error_corrected";
xNodeErr.removeAttribute("style");
let iParaNum = parseInt(sErrorId.slice(0, sErrorId.indexOf("-")), 10);
this.oTextControl.setParagraph(iParaNum, this.purgeText(this.xParent.getElementById("grammalecte_paragraph" + iParaNum).textContent));
this.oTextControl.write();
this.oTooltip.hide();
|
| ︙ | |||
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 | + + + + |
getText () {
return [...this.dParagraph.values()].join("\n").normalize("NFC");
}
setParagraph (iParagraph, sText) {
this.dParagraph.set(iParagraph, sText);
}
getParagraph (iParaNum) {
return this.dParagraph.get(iParaNum);
}
eraseNodeContent () {
while (this.xNode.firstChild) {
this.xNode.removeChild(this.xNode.firstChild);
}
}
|
| ︙ |