225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
xParagraph.dataset.caret_position_start = nStart;
xParagraph.dataset.caret_position_end = nEnd;
// write text
this.oTextControl.setParagraph(parseInt(xEvent.target.dataset.para_num), this.purgeText(xEvent.target.textContent));
this.oTextControl.write();
}.bind(this)
, true);
xParagraph.addEventListener("blur", function (xEvent) {
// remove timer for refreshing analysis
window.clearTimeout(parseInt(xParagraph.dataset.timer_id));
// unset caret position
xParagraph.dataset.caret_position_start = "-1";
xParagraph.dataset.caret_position_end = "-1";
// recheck
this.recheckParagraph(oResult.iParaNum);
}.bind(this)
, true);
this._tagParagraph(xParagraph, oResult.sParagraph, oResult.iParaNum, oResult.aGrammErr, oResult.aSpellErr);
// creation
xNodeDiv.appendChild(xActionsBar);
xNodeDiv.appendChild(xParagraph);
this.xParagraphList.appendChild(xNodeDiv);
}
}
|
|
|
|
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
xParagraph.dataset.caret_position_start = nStart;
xParagraph.dataset.caret_position_end = nEnd;
// write text
this.oTextControl.setParagraph(parseInt(xEvent.target.dataset.para_num), this.purgeText(xEvent.target.textContent));
this.oTextControl.write();
}.bind(this)
, true);
/*xParagraph.addEventListener("blur", function (xEvent) {
// remove timer for refreshing analysis
window.clearTimeout(parseInt(xParagraph.dataset.timer_id));
// unset caret position
xParagraph.dataset.caret_position_start = "-1";
xParagraph.dataset.caret_position_end = "-1";
// recheck
this.recheckParagraph(oResult.iParaNum);
}.bind(this)
, true);*/
this._tagParagraph(xParagraph, oResult.sParagraph, oResult.iParaNum, oResult.aGrammErr, oResult.aSpellErr);
// creation
xNodeDiv.appendChild(xActionsBar);
xNodeDiv.appendChild(xParagraph);
this.xParagraphList.appendChild(xNodeDiv);
}
}
|
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
|
showError(e);
}
this.stopWaitIcon();
}
_sendTextToClipboard (sText) {
this.xClipboardButton.textContent = "⇒ presse-papiers";
// Firefox 63+, Chrome 66+
// Working draft: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(sText)
.then(
(res) => { window.setTimeout(() => { this.xClipboardButton.textContent = "📋"; }, 2000); }
)
.catch(
(e) => { console.error(e); this._sendTextToClipboard(sText); }
);
|
>
|
|
<
|
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
|
showError(e);
}
this.stopWaitIcon();
}
_sendTextToClipboard (sText) {
this.xClipboardButton.textContent = "⇒ presse-papiers";
if (navigator.hasOwnProperty("clipboard") && navigator.clipboard.hasOwnProperty("writeText")) {
// Firefox 63+, Chrome 66+
// Working draft: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard
navigator.clipboard.writeText(sText)
.then(
(res) => { window.setTimeout(() => { this.xClipboardButton.textContent = "📋"; }, 2000); }
)
.catch(
(e) => { console.error(e); this._sendTextToClipboard(sText); }
);
|