Skip to content

Commit

Permalink
feat: clear code button
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszkubacki committed Apr 1, 2024
1 parent e4d27df commit a49c76d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ <h2>Dot And Box editor</h2>
<div class="links">
<a href="https://github.com/dot-and-box/dot-and-box">Dot and Box repository</a>
<a href="https://dot-and-box.github.io/dot-and-box/">Documentation</a>
<div>
<button id="save" title="save">💾 </button>
<button id="clear" title="clear">clear</button>
</div>
<button id="save" title="save">💾 </button>
<button id="clear" title="delete">delete</button>

</div>
<hr>
Expand Down
3 changes: 3 additions & 0 deletions src/dotAndBoxEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class DotAndBoxEditor extends HTMLElement {
<div><input type="checkbox" id="show-experimental" title="show controls">experimental</div>
<div><input type="checkbox" id="toggle-editor" checked title="show/hide editor">editor</div>
<div><button id="reformat" title="reformat">reformat</div>
<div><button id="clear" title="clear">✖</div>
<div class="right-menu"><button id="copy-clipboard" title="copy to clipboard">📋</button></div>
</div>
<div class="content-wrapper">
Expand All @@ -241,6 +242,8 @@ class DotAndBoxEditor extends HTMLElement {

const reformatButton: HTMLElement = this.getControl('#reformat')
reformatButton.onclick = (_: any) => this.reformat()
const clearButton: HTMLElement = this.getControl('#clear')
clearButton.onclick = (_: any) => this.updateEditorCode('title: new ')

const runCodeButton: HTMLElement = this.getControl('#run-code')
runCodeButton.onclick = (_: any) => this.runCode()
Expand Down

0 comments on commit a49c76d

Please sign in to comment.