Grammalecte  Check-in [e1f9580c26]

Overview
Comment:[fx] gc panel: refresh with blur event (not a so good idea?)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: e1f9580c262c3ff32228a24134af3bec3930acdb820532b20dcb7f3fd89bfebc
User & Date: olr on 2019-05-20 13:22:27
Other Links: manifest | tags
Context
2019-05-20
14:10
[fx] gc panel: autorefresh as option check-in: a7d3941648 user: olr tags: fx, trunk
13:22
[fx] gc panel: refresh with blur event (not a so good idea?) check-in: e1f9580c26 user: olr tags: fx, trunk
12:18
[fx] gc panel: CSS adjustements and auto-refresh adjustements check-in: e4791e17bb user: olr tags: fx, trunk
Changes

Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [a4ec903680] to [0205c3f57a].

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