(editor)
| 247 | } |
| 248 | |
| 249 | function showEditorControls(editor) { |
| 250 | if (editor.dom.parentNode.querySelector(".editor-controls")) return |
| 251 | editor.dom.parentNode.appendChild(elt("div", { |
| 252 | class: "editor-controls" |
| 253 | }, elt("button", { |
| 254 | onmousedown: e => { |
| 255 | runCode(editor) |
| 256 | e.preventDefault() |
| 257 | }, |
| 258 | title: `Run code (${modName}Enter)`, |
| 259 | "aria-label": "Run code" |
| 260 | }, "▸"), elt("button", { |
| 261 | onmousedown: e => { |
| 262 | revertCode(editor) |
| 263 | e.preventDefault() |
| 264 | }, |
| 265 | title: `Revert code (${modName}j)`, |
| 266 | "aria-label": "Revert code" |
| 267 | }, "▫"), elt("button", { |
| 268 | onmousedown: e => { |
| 269 | resetSandbox(editor.state.facet(contextFacet).sandbox) |
| 270 | e.preventDefault() |
| 271 | }, |
| 272 | title: `Reset sandbox (${modName}Escape)`, |
| 273 | "aria-label": "Reset sandbox" |
| 274 | }, "ø"))) |
| 275 | } |
| 276 | |
| 277 | function hideEditorControls(editor) { |
| 278 | let controls = editor.dom.parentNode.querySelector(".editor-controls") |
no test coverage detected