52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
for (let xNode of lNode) {
if (xNode.style.display !== "none" && xNode.style.visibility !== "hidden") {
this.lMenu.push(new GrammalecteMenu(this.nMenu, xNode));
this.nMenu += 1;
}
}
},
rescanPage: function () {
if (this.oTFPanel !== null) { this.oTFPanel.hide(); }
if (this.oLxgPanel !== null) { this.oLxgPanel.hide(); }
if (this.oGCPanel !== null) { this.oGCPanel.hide(); }
for (let oMenu of this.lMenu) {
oMenu.deleteNodes();
|
>
>
>
>
>
>
>
>
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
for (let xNode of lNode) {
if (xNode.style.display !== "none" && xNode.style.visibility !== "hidden") {
this.lMenu.push(new GrammalecteMenu(this.nMenu, xNode));
this.nMenu += 1;
}
}
},
createMenus2 () {
let lNode = document.querySelectorAll("[contenteditable]");
for (let xNode of lNode) {
this.lMenu.push(new GrammalecteMenu(this.nMenu, xNode));
this.nMenu += 1;
}
},
rescanPage: function () {
if (this.oTFPanel !== null) { this.oTFPanel.hide(); }
if (this.oLxgPanel !== null) { this.oLxgPanel.hide(); }
if (this.oGCPanel !== null) { this.oGCPanel.hide(); }
for (let oMenu of this.lMenu) {
oMenu.deleteNodes();
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
}
catch (e) {
showError(e);
}
}
}
/*
Connexion to the background
*/
let xGrammalectePort = browser.runtime.connect({name: "content-script port"});
xGrammalectePort.onMessage.addListener(function (oMessage) {
|
>
>
>
>
>
>
>
>
>
>
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
}
catch (e) {
showError(e);
}
}
}
/*
Node where a right click is done
Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1325814
*/
let xRightClickedNode = null;
document.addEventListener('contextmenu', function (xEvent) {
xRightClickedNode = xEvent.target;
}, true);
/*
Connexion to the background
*/
let xGrammalectePort = browser.runtime.connect({name: "content-script port"});
xGrammalectePort.onMessage.addListener(function (oMessage) {
|
159
160
161
162
163
164
165
|
});
/*
Start
*/
oGrammalecte.createMenus();
|
>
|
177
178
179
180
181
182
183
184
|
});
/*
Start
*/
oGrammalecte.createMenus();
oGrammalecte.createMenus2();
|