Overview
| Comment: | [tb][fx] adjustement for Mail Extension: no event for input -> no autorefresh |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | tb | fx | mailext |
| Files: | files | file ages | folders |
| SHA3-256: |
081fa7f8ca8323505c38f85c5fe39520 |
| User & Date: | olr on 2020-07-08 17:26:07 |
| Other Links: | branch diff | manifest | tags |
Context
|
2020-07-09
| ||
| 13:07 | [tb][fx] adapt conjugueur to MailExtension -> no input allowed in compose scripts check-in: 53f7b50983 user: olr tags: tb, fx, mailext | |
|
2020-07-08
| ||
| 17:26 | [tb][fx] adjustement for Mail Extension: no event for input -> no autorefresh check-in: 081fa7f8ca user: olr tags: tb, fx, mailext | |
| 11:07 | [tb][fx] fix recursive function check-in: e4ff01c69e user: olr tags: tb, fx, mailext | |
Changes
Modified gc_lang/fr/webext/content_scripts/editor.js from [c240d85760] to [4bcac7be9b].
| ︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + |
constructor (xDocument, bCheckSignature=false) {
this.xDocument = xDocument;
this.xRootNode = xDocument.body;
//console.log(xDocument.body);
//console.log(xDocument.body.innerHTML);
this.lNode = [];
this.bCheckSignature = bCheckSignature;
|
| ︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + |
catch (e) {
showError(e);
}
}
setParagraph (iPara, sText) {
try {
|
| ︙ | |||
187 188 189 190 191 192 193 | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | - + |
}
getText () {
return [...this.dParagraph.values()].join("\n").normalize("NFC");
}
setParagraph (iParagraph, sText) {
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/init.js from [b5e2ece3a6] to [1238d56b74].
| ︙ | |||
66 67 68 69 70 71 72 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - + |
xObserver: null,
sExtensionUrl: null,
oOptions: null,
|
| ︙ | |||
141 142 143 144 145 146 147 148 149 150 151 152 153 154 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + + + + |
let sPageText = document.body.innerText;
let nPos = sPageText.indexOf("__grammalecte_panel__");
if (nPos >= 0) {
sPageText = sPageText.slice(0, nPos).normalize("NFC");
}
return sPageText;
},
purgeText: function (sText) {
return sText.replace(/ /g, " ").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
},
createNode: function (sType, oAttr, oDataset=null) {
try {
let xNode = document.createElement(sType);
Object.assign(xNode, oAttr);
if (oDataset) {
Object.assign(xNode.dataset, oDataset);
|
| ︙ | |||
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | + + + |
return { top: Math.round(top), left: Math.round(left), bottom: Math.round(bottom), right: Math.round(right) };
}
};
function autoRefreshOption (oSavedOptions=null) {
// auto recallable function
if (bThunderbird) {
return;
}
if (oSavedOptions === null) {
if (bChrome) {
browser.storage.local.get("autorefresh_option", autoRefreshOption);
return;
}
browser.storage.local.get("autorefresh_option").then(autoRefreshOption, showError);
}
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [0389257f9b] to [b47d4ce959].
| ︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | + + + + |
};
this.xEditorButton.onclick = () => {
if (!this.bWorking) {
this.showEditor();
}
};
this.xAutoRefresh.onclick = () => {
if (bThunderbird) {
oGrammalecte.showMessage("À cause d’une limitation de Thunberbird, l’auto-rafraîchissement est indisponible. Si vous modifiez le texte dans ce panneau, cliquez sur le bouton ↻ pour relancer l’analyse grammaticale du paragraphe.")
return;
}
this.bAutoRefresh = !this.bAutoRefresh;
oGrammalecte.bAutoRefresh = this.bAutoRefresh;
browser.storage.local.set({"autorefresh_option": this.bAutoRefresh});
this.setAutoRefreshButton();
}
this.xLxgButton.onclick = () => {
if (!this.bWorking) {
|
| ︙ | |||
236 237 238 239 240 241 242 | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - + |
if (this.bAutoRefresh) {
// timer for refreshing analysis
window.clearTimeout(parseInt(xParagraph.dataset.timer_id, 10));
xParagraph.dataset.timer_id = window.setTimeout(this.recheckParagraph.bind(this), 3000, oResult.iParaNum);
this.iLastEditedParagraph = oResult.iParaNum;
}
// write text
|
| ︙ | |||
274 275 276 277 278 279 280 | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | + + - + + |
recheckParagraph (iParaNum) {
if (!this.bOpened) {
return;
}
let sParagraphId = "grammalecte_paragraph" + iParaNum;
let xParagraph = this.xParent.getElementById(sParagraphId);
this._blockParagraph(xParagraph);
if (bThunderbird) {
// WORKAROUND: input event isn’t triggered by key input, so as textContent isn’t up to date, we do it now
|
| ︙ | |||
405 406 407 408 409 410 411 | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | - + |
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);
|
| ︙ | |||
429 430 431 432 433 434 435 | 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | - - - - |
this.oTooltip.hide();
}
catch (e) {
showError(e);
}
}
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel_tf.js from [e01fea3896] to [dd32e278d0].
| ︙ | |||
73 74 75 76 77 78 79 | 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 | - - - + + + + - + + |
xTypo.appendChild(this._createLigaturesSelection());
let xMisc = this._createFieldset("group_misc", true, "Divers");
xMisc.appendChild(this._createOrdinalOptions());
xMisc.appendChild(this._createBlockOption("o_etc", true, "Et cætera, etc."));
xMisc.appendChild(this._createBlockOption("o_missing_hyphens", true, "Traits d’union manquants"));
xMisc.appendChild(this._createBlockOption("o_ma_word", true, "Apostrophes manquantes"));
xMisc.appendChild(this._createSingleLetterOptions());
|
| ︙ |