Grammalecte  Check-in [ce039a8de4]

Overview
Comment:[fx] small code cleaning
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: ce039a8de4cf807a611556d8f3740ea8b8620fa7b35c532944dde5c325fc2af0
User & Date: olr on 2019-05-04 14:17:14
Other Links: manifest | tags
Context
2019-05-04
16:31
[fx] fix text formatter and adjustments, +code cleaning check-in: 0a02475e6f user: olr tags: fx, trunk
14:17
[fx] small code cleaning check-in: ce039a8de4 user: olr tags: fx, trunk
13:17
[fx] update ui check-in: c834b85865 user: olr tags: fx, trunk
Changes

Modified gc_lang/fr/webext/content_scripts/init.js from [d5cb24d97c] to [b64a4037b3].

    60     60       sExtensionUrl: null,
    61     61   
    62     62       oOptions: null,
    63     63   
    64     64       listenRightClick: function () {
    65     65           // Node where a right click is done
    66     66           // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1325814
    67         -        document.addEventListener('contextmenu', function (xEvent) {
           67  +        document.addEventListener('contextmenu', (xEvent) => {
    68     68               this.xRightClickedNode = xEvent.target;
    69         -        }.bind(this), true);
           69  +        }, true);
    70     70       },
    71     71   
    72     72       clearRightClickedNode: function () {
    73     73           this.xRightClickedNode = null;
    74     74       },
    75     75   
    76     76       createMenus: function () {

Modified gc_lang/fr/webext/content_scripts/panel.js from [004624125f] to [be9bbebdca].

    69     69           xButtonLine.appendChild(this._createMoveButton("stickToBottom", "⏷", "Coller en bas"));
    70     70           xButtonLine.appendChild(this._createCloseButton());
    71     71           return xButtonLine;
    72     72       }
    73     73   
    74     74       _createWaitIcon () {
    75     75           let xWaitIcon = oGrammalecte.createNode("div", {className: "grammalecte_spinner"});
    76         -        //xWaitIcon.appendChild(oGrammalecte.createNode("div", {className: "bounce1"}));
    77         -        //xWaitIcon.appendChild(oGrammalecte.createNode("div", {className: "bounce2"}));
    78     76           return xWaitIcon;
    79     77       }
    80     78   
    81     79       _createCopyButton () {
    82     80           let xButton = oGrammalecte.createNode("div", {id: "grammalecte_clipboard_button", className: "grammalecte_panel_button grammalecte_copy_button", textContent: "∑", title: "Copier dans le presse-papiers"});
    83         -        xButton.onclick = function () { this.copyTextToClipboard(); }.bind(this);
           81  +        xButton.onclick = () => { this.copyTextToClipboard(); };
    84     82           return xButton;
    85     83       }
    86     84   
    87     85       _createMoveButton (sAction, sLabel, sTitle) {
    88     86           let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_move_button", textContent: sLabel, title: sTitle});
    89         -        xButton.onclick = function () { this[sAction](); }.bind(this);
           87  +        xButton.onclick = () => { this[sAction](); };
    90     88           return xButton;
    91     89       }
    92     90   
    93     91       _createCloseButton () {
    94     92           let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_close_button", textContent: "×", title: "Fermer la fenêtre"});
    95         -        xButton.onclick = function () { this.hide(); }.bind(this);  // better than writing “let that = this;” before the function?
           93  +        xButton.onclick = () => { this.hide(); };
    96     94           return xButton;
    97     95       }
    98     96   
    99     97       insertIntoPage () {
   100     98           if (this.bShadow) {
   101     99               oGrammalecte.createStyle("content_scripts/panel.css", null, this.xShadow);
   102    100               oGrammalecte.createStyle("content_scripts/panel_gc.css", null, this.xShadow);