Grammalecte  Check-in [4be617efb4]

Overview
Comment:[fx] small adjustments
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fx | webext2
Files: files | file ages | folders
SHA3-256: 4be617efb4cf78b3c2c96d54c51516e118c60e74f70e438ccaddba8e2244b5ac
User & Date: olr on 2017-08-13 10:52:36
Other Links: branch diff | manifest | tags
Context
2017-08-13
12:07
[fx] code cleaning in CSS [main panel] check-in: b035ad9f2a user: olr tags: fx, webext2
10:52
[fx] small adjustments check-in: 4be617efb4 user: olr tags: fx, webext2
09:57
[fx] object Panel, movable panels check-in: 877eb2d93c user: olr tags: fx, webext2
Changes

Modified gc_lang/fr/webext/content_scripts/content_panels.css from [d5f576988d] to [6a8ccbec0a].

71
72
73
74
75
76
77



78
79
80
81
82
83
84
85
86
87



88
89
90
91
92
93
94
    background-color: hsl(180, 80%, 50%);
    font-size: 22px;
    font-weight: bold;
    color: hsl(210, 0%, 100%);
    text-align: center;
    cursor: pointer;
}



.grammalecte_close_button {
    display: inline-block;
    padding: 2px 10px;
    background-color: hsl(0, 80%, 50%);
    font-size: 22px;
    font-weight: bold;
    color: hsl(210, 0%, 100%);
    text-align: center;
    cursor: pointer;
}




.grammalecte_panel_content {
    height: calc(100% - 45px); /* panel height - title_bar */
    overflow: auto;
}









>
>
>










>
>
>







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    background-color: hsl(180, 80%, 50%);
    font-size: 22px;
    font-weight: bold;
    color: hsl(210, 0%, 100%);
    text-align: center;
    cursor: pointer;
}
.grammalecte_move_button:hover {
    background-color: hsl(180, 100%, 60%);
}
.grammalecte_close_button {
    display: inline-block;
    padding: 2px 10px;
    background-color: hsl(0, 80%, 50%);
    font-size: 22px;
    font-weight: bold;
    color: hsl(210, 0%, 100%);
    text-align: center;
    cursor: pointer;
}
.grammalecte_close_button:hover {
    background-color: hsl(0, 100%, 60%);
}

.grammalecte_panel_content {
    height: calc(100% - 45px); /* panel height - title_bar */
    overflow: auto;
}


Modified gc_lang/fr/webext/content_scripts/panel_creator.js from [bfa5c54a5e] to [a2d8372f65].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
            showError(e);
        }
    }

    _createButtons () {
        let xButtonLine = createNode("div", {className: "grammalecte_panel_commands"});
        if (this.bMovable) {
            xButtonLine.appendChild(this._createMoveButtonTop());
            xButtonLine.appendChild(this._createMoveButtonLeft());
            xButtonLine.appendChild(this._createMoveButtonMiddle());
            xButtonLine.appendChild(this._createMoveButtonRight());
            xButtonLine.appendChild(this._createMoveButtonBottom());
        }
        xButtonLine.appendChild(this._createCloseButton());
        return xButtonLine;
    }

    _createMoveButtonLeft () {
        let xButton = createNode("div", {className: "grammalecte_move_button", textContent: "‹"});
        xButton.onclick = function () { this.stickToLeft(); }.bind(this);
        return xButton;
    }

    _createMoveButtonMiddle () {
        let xButton = createNode("div", {className: "grammalecte_move_button", textContent: "·"});
        xButton.onclick = function () { this.center(); }.bind(this);
        return xButton;
    }

    _createMoveButtonRight () {
        let xButton = createNode("div", {className: "grammalecte_move_button", textContent: "›"});
        xButton.onclick = function () { this.stickToRight(); }.bind(this);
        return xButton;
    }

    _createMoveButtonTop () {
        let xButton = createNode("div", {className: "grammalecte_move_button", textContent: "^"});
        xButton.onclick = function () { this.stickToTop(); }.bind(this);
        return xButton;
    }

    _createMoveButtonBottom () {
        let xButton = createNode("div", {className: "grammalecte_move_button", textContent: "ˇ"});
        xButton.onclick = function () { this.stickToBottom(); }.bind(this);
        return xButton;
    }

    _createCloseButton () {
        let xButton = createNode("div", {className: "grammalecte_close_button", textContent: "×"});
        xButton.onclick = function () { this.hide(); }.bind(this);  // better than writing “let that = this;” before the function?
        return xButton;
    }

    setContent (xNode) {
        this.xContentNode.appendChild(xNode);
    }







|
|
|
|
|





|
|
<
<
<
<
<
<
|



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55






56
57
58
59


















60
61
62
63
64
65
66
67
68
            showError(e);
        }
    }

    _createButtons () {
        let xButtonLine = createNode("div", {className: "grammalecte_panel_commands"});
        if (this.bMovable) {
            xButtonLine.appendChild(this._createMoveButton("stickToTop", "¯", "Coller en haut"));
            xButtonLine.appendChild(this._createMoveButton("stickToLeft", "«", "Coller à gauche"));
            xButtonLine.appendChild(this._createMoveButton("center", "•", "Centrer"));
            xButtonLine.appendChild(this._createMoveButton("stickToRight", "»", "Coller à droite"));
            xButtonLine.appendChild(this._createMoveButton("stickToBottom", "_", "Coller en bas"));
        }
        xButtonLine.appendChild(this._createCloseButton());
        return xButtonLine;
    }

    _createMoveButton (sAction, sLabel, sTitle) {
        let xButton = createNode("div", {className: "grammalecte_move_button", textContent: sLabel, title: sTitle});






        xButton.onclick = function () { this[sAction](); }.bind(this);
        return xButton;
    }



















    _createCloseButton () {
        let xButton = createNode("div", {className: "grammalecte_close_button", textContent: "×", title: "Fermer la fenêtre"});
        xButton.onclick = function () { this.hide(); }.bind(this);  // better than writing “let that = this;” before the function?
        return xButton;
    }

    setContent (xNode) {
        this.xContentNode.appendChild(xNode);
    }