Overview
Comment: | [fx] call Grammalecte via custom button and send results by event on node |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | fx |
Files: | files | file ages | folders |
SHA3-256: |
360a78ac9fab6875a3f8b97144e5dbe1 |
User & Date: | olr on 2020-03-09 18:54:57 |
Other Links: | manifest | tags |
Context
2020-03-09
| ||
18:56 | [fx] remove console.log() check-in: 442f6eaf7e user: olr tags: trunk, fx | |
18:54 | [fx] call Grammalecte via custom button and send results by event on node check-in: 360a78ac9f user: olr tags: trunk, fx | |
18:53 | [fr] ajustements check-in: 4ba1592ab7 user: olr tags: trunk, fr | |
Changes
Modified gc_lang/fr/webext/content_scripts/init.js from [a857d83fb7] to [646f2e9c29].
︙ | |||
73 74 75 76 77 78 79 | 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 | - + - + - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + | clearRightClickedNode: function () { this.xRightClickedNode = null; }, createButtons: function () { if (bChrome) { |
︙ | |||
156 157 158 159 160 161 162 | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | - + - + | createMessageBox: function () { if (this.oMessageBox === null) { this.oMessageBox = new GrammalecteMessageBox("grammalecte_message_box", "Grammalecte"); this.oMessageBox.insertIntoPage(); } }, |
︙ |
Modified gc_lang/fr/webext/content_scripts/panel_gc.js from [1c3cef7a06] to [327f3b8b3c].
︙ | |||
135 136 137 138 139 140 141 | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - + + | this.xMenu.appendChild(this.xTFButton) this.xMenu.appendChild(this.xEditorButton) this.xMenu.appendChild(this.xLxgButton) this.xMenu.appendChild(this.xConjButton) this.xPanelBar.appendChild(this.xMenu); } |
︙ | |||
950 951 952 953 954 955 956 957 958 959 960 961 962 963 | 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 | + | class GrammalecteTextControl { constructor () { this.xNode = null; this.dParagraph = new Map(); this.bTextArea = null; this.bResultInEvent = false; // if true, the node content is not modified, but an event is dispatched on the node with the modified text } setNode (xNode) { this.clear(); this.xNode = xNode; this.bTextArea = (xNode.tagName == "TEXTAREA" || xNode.tagName == "INPUT"); if (!this.bTextArea) { |
︙ | |||
1015 1016 1017 1018 1019 1020 1021 | 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 | + + + + + + + - + + - + - - - - | while (this.xNode.firstChild) { this.xNode.removeChild(this.xNode.firstChild); } } write () { if (this.xNode !== null) { if (this.bResultInEvent) { const xEvent = new CustomEvent("GrammalecteNodeContentUpdated", { detail: { text: [...this.dParagraph.values()].join("\n").normalize("NFC") } }); this.xNode.dispatchEvent(xEvent); console.log("event", xEvent.detail.text); } |