302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
let nLimit = nPanelWidth - 330; // paragraph width - tooltip width
xNodeTooltipArrow.style.top = (xNodeErr.offsetTop + 16) + "px"
xNodeTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor((xNodeErr.offsetWidth / 2))-4) + "px" // 4 is half the width of the arrow.
xNodeTooltip.style.top = (xNodeErr.offsetTop + 20) + "px";
xNodeTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px";
if (xNodeErr.dataset.error_type === "grammar") {
// grammar error
document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
if (xNodeErr.dataset.gc_url != "") {
document.getElementById("gc_url").style.display = "inline";
document.getElementById("gc_url").setAttribute("href", xNodeErr.dataset.gc_url);
} else {
document.getElementById("gc_url").style.display = "none";
}
document.getElementById("gc_ignore").dataset.error_id = xNodeErr.dataset.error_id;
|
>
>
>
>
>
>
|
>
|
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
let nLimit = nPanelWidth - 330; // paragraph width - tooltip width
xNodeTooltipArrow.style.top = (xNodeErr.offsetTop + 16) + "px"
xNodeTooltipArrow.style.left = (xNodeErr.offsetLeft + Math.floor((xNodeErr.offsetWidth / 2))-4) + "px" // 4 is half the width of the arrow.
xNodeTooltip.style.top = (xNodeErr.offsetTop + 20) + "px";
xNodeTooltip.style.left = (xNodeErr.offsetLeft > nLimit) ? nLimit + "px" : xNodeErr.offsetLeft + "px";
if (xNodeErr.dataset.error_type === "grammar") {
// grammar error
if (xNodeErr.dataset.gc_message.includes(" ##")) {
let n = xNodeErr.dataset.gc_message.indexOf(" ##");
document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message.slice(0, n);
document.getElementById("gc_rule_id").textContent = "Règle : " + xNodeErr.dataset.gc_message.slice(n+2);
document.getElementById("gc_rule_id").style.display = "block";
} else {
document.getElementById("gc_message").textContent = xNodeErr.dataset.gc_message;
}
if (xNodeErr.dataset.gc_url != "") {
document.getElementById("gc_url").style.display = "inline";
document.getElementById("gc_url").setAttribute("href", xNodeErr.dataset.gc_url);
} else {
document.getElementById("gc_url").style.display = "none";
}
document.getElementById("gc_ignore").dataset.error_id = xNodeErr.dataset.error_id;
|
366
367
368
369
370
371
372
373
374
375
376
377
378
379
|
let sIdParagr = sCheckButtonId.slice(5);
self.port.emit("modifyAndCheck", sIdParagr, getPurgedTextOfParagraph("paragr"+sIdParagr));
stopWaitIcon();
}
function hideAllTooltips () {
document.getElementById("gc_tooltip").style.display = "none";
document.getElementById("sc_tooltip").style.display = "none";
document.getElementById("gc_tooltip_arrow").style.display = "none";
document.getElementById("sc_tooltip_arrow").style.display = "none";
}
function setSpellSuggestionsFor (sWord, sSuggestions, sErrId) {
// spell checking suggestions
|
>
|
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
let sIdParagr = sCheckButtonId.slice(5);
self.port.emit("modifyAndCheck", sIdParagr, getPurgedTextOfParagraph("paragr"+sIdParagr));
stopWaitIcon();
}
function hideAllTooltips () {
document.getElementById("gc_tooltip").style.display = "none";
document.getElementById("gc_rule_id").style.display = "none";
document.getElementById("sc_tooltip").style.display = "none";
document.getElementById("gc_tooltip_arrow").style.display = "none";
document.getElementById("sc_tooltip_arrow").style.display = "none";
}
function setSpellSuggestionsFor (sWord, sSuggestions, sErrId) {
// spell checking suggestions
|