Overview
| Comment: | [fx] WebExt: secure function createNode() |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | fx |
| Files: | files | file ages | folders |
| SHA3-256: |
57f14062ba2245361f09717fc342b105 |
| User & Date: | olr on 2017-09-27 11:45:38 |
| Other Links: | manifest | tags |
Context
|
2017-09-27
| ||
| 12:05 | [fx] WebExt: don’t create menu button if textarea is not visible check-in: 5fc11add34 user: olr tags: trunk, fx | |
| 11:45 | [fx] WebExt: secure function createNode() check-in: 57f14062ba user: olr tags: trunk, fx | |
| 11:26 | [fx] WebExt: adaptation to Chrome: conj initialisation (again) check-in: da4865ce6b user: olr tags: trunk, fx | |
Changes
Modified gc_lang/fr/webext/content_scripts/init.js from [70b0a5f3fd] to [46a029346c].
| ︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - - - - - - - - - - - - - |
let bChrome = false;
if (typeof(browser) !== "object") {
var browser = chrome;
bChrome = true;
}
|
| ︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | + + + + + + + + + + + + + + |
},
createGCPanel: function () {
if (this.oGCPanel === null) {
this.oGCPanel = new GrammalecteGrammarChecker("grammalecte_gc_panel", "Grammalecte", 500, 700);
this.oGCPanel.insertIntoPage();
}
},
createNode: function (sType, oAttr, oDataset=null) {
try {
let xNode = document.createElement(sType);
Object.assign(xNode, oAttr);
if (oDataset) {
Object.assign(xNode.dataset, oDataset);
}
return xNode;
}
catch (e) {
showError(e);
}
}
}
/*
Connexion to the background
*/
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/menu.js from [51ff434365] to [2740b076e9].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 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 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 | - + - + - + - + - + - - + + - + - + - + - + |
// JavaScript
"use strict";
class GrammalecteMenu {
constructor (nMenu, xTextArea) {
this.sMenuId = "grammalecte_menu" + nMenu;
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel.js from [48d95d0550] to [d29d130a09].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 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 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 | - - + + - + - + - + - + - - - + + + - + - + - + |
// JavaScript
// Panel creator
"use strict";
class GrammalectePanel {
constructor (sId, sTitle, nWidth, nHeight, bFlexible=true) {
this.sId = sId;
this.nWidth = nWidth;
this.nHeight = nHeight;
this.bFlexible = bFlexible;
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [0ba0b636f6] to [f13377ba0e].
| ︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - - + + |
grammalecte_error{Id} : [paragraph number]-[error_number]
grammalecte_sugg{Id} : [paragraph number]-[error_number]--[suggestion_number]
*/
constructor (...args) {
super(...args);
this.aIgnoredErrors = new Set();
|
| ︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + - - - + + + - + |
this.xPanel.style.display = "none";
this.oTAC.clear();
}
addParagraphResult (oResult) {
try {
if (oResult && (oResult.sParagraph.trim() !== "" || oResult.aGrammErr.length > 0 || oResult.aSpellErr.length > 0)) {
|
| ︙ | |||
233 234 235 236 237 238 239 | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - + |
}
addSummary () {
// todo
}
addMessage (sMessage) {
|
| ︙ | |||
275 276 277 278 279 280 281 | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | - - + + - - - - - - - + + + + + + + - + |
}
class GrammalecteTooltip {
constructor (xContentNode) {
this.sErrorId = null;
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel_lxg.js from [dcf9b1545d] to [eb959206ea].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 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 60 61 62 63 64 | - + - + - + - - + + - - - + + + - + - + |
// JavaScript
"use strict";
class GrammalecteLexicographer extends GrammalectePanel {
constructor (...args) {
super(...args);
this._nCount = 0;
|
| ︙ |
Modified gc_lang/fr/webext/content_scripts/panel_tf.js from [1a7fb65c7e] to [4e9190557a].
| ︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 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 | - - + + - + |
this.xTextArea = null;
}
_createTextFormatter () {
let xTFNode = document.createElement("div");
try {
// Options
|
| ︙ | |||
66 67 68 69 70 71 72 | 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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | - - + + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + |
xColumn1.appendChild(xDelete);
xColumn2.appendChild(xTypo);
xColumn2.appendChild(xMisc);
xColumn2.appendChild(xStruct);
xOptions.appendChild(xColumn1);
xOptions.appendChild(xColumn2);
// Actions
|
| ︙ |