Grammalecte  Check-in [db3f9c82ad]

Overview
Comment:[fx] gc panel: update ui, better signs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | fx
Files: files | file ages | folders
SHA3-256: db3f9c82ad89ae343b56ac92bf5e61ca57d2ba6bd97d4a3b853054fb421e3ca9
User & Date: olr on 2019-05-07 16:01:56
Other Links: manifest | tags
Context
2019-05-07
20:04
[fx] gc panel: ajustements check-in: 8058c7ee7c user: olr tags: trunk, fx
16:01
[fx] gc panel: update ui, better signs check-in: db3f9c82ad user: olr tags: trunk, fx
15:43
[fx] gc panel: add bundled conjugation tool check-in: ee9dfb8d91 user: olr tags: trunk, fx
Changes

Modified gc_lang/fr/webext/content_scripts/panel.js from [d484609e88] to [833707eaf0].

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

    _createWaitIcon () {
        let xWaitIcon = oGrammalecte.createNode("div", {className: "grammalecte_spinner"});
        return xWaitIcon;
    }

    _createCopyButton () {
        let xButton = oGrammalecte.createNode("div", {id: "grammalecte_clipboard_button", className: "grammalecte_panel_button grammalecte_copy_button", textContent: "", title: "Copier dans le presse-papiers"});
        xButton.onclick = () => { this.copyTextToClipboard(); };
        return xButton;
    }

    _createMoveButton (sAction, sLabel, sTitle) {
        let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_move_button", textContent: sLabel, title: sTitle});
        xButton.onclick = () => { this[sAction](); };







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

    _createWaitIcon () {
        let xWaitIcon = oGrammalecte.createNode("div", {className: "grammalecte_spinner"});
        return xWaitIcon;
    }

    _createCopyButton () {
        let xButton = oGrammalecte.createNode("div", {id: "grammalecte_clipboard_button", className: "grammalecte_panel_button grammalecte_copy_button", textContent: "📋", title: "Copier dans le presse-papiers"});
        xButton.onclick = () => { this.copyTextToClipboard(); };
        return xButton;
    }

    _createMoveButton (sAction, sLabel, sTitle) {
        let xButton = oGrammalecte.createNode("div", {className: "grammalecte_panel_button grammalecte_move_button", textContent: sLabel, title: sTitle});
        xButton.onclick = () => { this[sAction](); };

Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [2868380740] to [349ae0830b].

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    }

    createMenu () {
        this.xMenu = oGrammalecte.createNode("div", {className: "grammalecte_panel_menu"});
        this.xTFButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Formateur de texte"});
        this.xEditorButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur"});
        this.xLxgButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Lexicographe"});
        this.xConjButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Conjugueur "});
        this.xLEButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur lexical "});
        this.xTFButton.onclick = () => {
            if (this.xNode  && (this.xNode.tagName == "TEXTAREA" || this.xNode.tagName == "INPUT" || this.xNode.isContentEditable)) {
                oGrammalecte.createTFPanel();
                oGrammalecte.oTFPanel.start(this);
                oGrammalecte.oTFPanel.show();
            } else {
                oGrammalecte.showMessage("Aucune zone de texte éditable sur laquelle appliquer le formatage de texte.")







|
|







73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    }

    createMenu () {
        this.xMenu = oGrammalecte.createNode("div", {className: "grammalecte_panel_menu"});
        this.xTFButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Formateur de texte"});
        this.xEditorButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur"});
        this.xLxgButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Lexicographe"});
        this.xConjButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Conjugueur"});
        this.xLEButton = oGrammalecte.createNode("div", {className: "grammalecte_menu_button", textContent: "Éditeur lexical "});
        this.xTFButton.onclick = () => {
            if (this.xNode  && (this.xNode.tagName == "TEXTAREA" || this.xNode.tagName == "INPUT" || this.xNode.isContentEditable)) {
                oGrammalecte.createTFPanel();
                oGrammalecte.oTFPanel.start(this);
                oGrammalecte.oTFPanel.show();
            } else {
                oGrammalecte.showMessage("Aucune zone de texte éditable sur laquelle appliquer le formatage de texte.")
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
            let sText = "";
            // Quand c'est dans un shadow "this.xParent.getElementsByClassName" n'existe pas.
            let xElem = this.xParent.getElementById("grammalecte_gc_panel");
            for (let xNode of xElem.getElementsByClassName("grammalecte_paragraph")) {
                sText += xNode.textContent + "\n";
            }
            this._copyToClipboard(sText);
            xClipboardButton.textContent = "OK";
            window.setTimeout(function() { xClipboardButton.textContent = ""; } , 2000);
        }
        catch (e) {
            showError(e);
        }
        this.stopWaitIcon();
    }








|
|







397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
            let sText = "";
            // Quand c'est dans un shadow "this.xParent.getElementsByClassName" n'existe pas.
            let xElem = this.xParent.getElementById("grammalecte_gc_panel");
            for (let xNode of xElem.getElementsByClassName("grammalecte_paragraph")) {
                sText += xNode.textContent + "\n";
            }
            this._copyToClipboard(sText);
            xClipboardButton.textContent = "⇒ presse-papiers";
            window.setTimeout(function() { xClipboardButton.textContent = "📋"; } , 2000);
        }
        catch (e) {
            showError(e);
        }
        this.stopWaitIcon();
    }