19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
this.center();
}
_createPanel (sTitle) {
try {
let xPanel = createNode("div", {id: this.sId, className: "grammalecte_panel"});
let xBar = createNode("div", {className: "grammalecte_panel_bar"});
xBar.appendChild(this._createButtons());
let xTitle = createNode("div", {className: "grammalecte_panel_title"});
xTitle.appendChild(createLogo());
xTitle.appendChild(createNode("div", {className: "grammalecte_panel_label", textContent: "Grammalecte · " + sTitle}));
xBar.appendChild(xTitle);
xPanel.appendChild(xBar);
//xPanel.appendChild(createNode("div", {className: "grammalecte_empty_space_under_title_bar"}));
xPanel.appendChild(this.xContentNode);
return xPanel;
}
catch (e) {
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"));
}
|
>
|
>
>
>
>
>
>
>
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
this.center();
}
_createPanel (sTitle) {
try {
let xPanel = createNode("div", {id: this.sId, className: "grammalecte_panel"});
let xBar = createNode("div", {className: "grammalecte_panel_bar"});
xBar.appendChild(this._createWaitIcon());
xBar.appendChild(this._createButtons());
let xTitle = createNode("div", {className: "grammalecte_panel_title"});
xTitle.appendChild(createLogo());
xTitle.appendChild(createNode("div", {className: "grammalecte_panel_label", textContent: sTitle}));
xBar.appendChild(xTitle);
xPanel.appendChild(xBar);
//xPanel.appendChild(createNode("div", {className: "grammalecte_empty_space_under_title_bar"}));
xPanel.appendChild(this.xContentNode);
return xPanel;
}
catch (e) {
showError(e);
}
}
_createWaitIcon () {
let xWaitIcon = createNode("div", {id: "grammalecte_wait_icon", className: "grammalecte_spinner"});
xWaitIcon.appendChild(createNode("div", {id: "bounce1"}));
xWaitIcon.appendChild(createNode("div", {id: "bounce2"}));
return xWaitIcon;
}
_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"));
}
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
// todo
}
logInnerHTML () {
// for debugging
console.log(this.xPanelNode.innerHTML);
}
}
/*
Common functions
*/
function createNode (sType, oAttr, oDataset=null) {
|
>
>
>
>
>
>
>
>
|
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
// todo
}
logInnerHTML () {
// for debugging
console.log(this.xPanelNode.innerHTML);
}
startWaitIcon () {
document.getElementById("grammalecte_waiticon").hidden = false;
}
stopWaitIcon () {
document.getElementById("grammalecte_waiticon").hidden = true;
}
}
/*
Common functions
*/
function createNode (sType, oAttr, oDataset=null) {
|