Skip to content

Commit

Permalink
add clear button to clear the sql window
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyblue committed Feb 17, 2019
1 parent 2d83b3a commit 3f66ec6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ sqlfmt was inspired by <a href="https://prettier.io/">prettier</a>. It is based
<br><input type="radio" name="casemode" value="title" onChange="range()" onInput="range()" id="casemode3"><label for="casemode3">Title</label>
<input type="radio" name="casemode" value="spongebob" onChange="range()" onInput="range()" id="casemode4"><label for="casemode4">sPOngEboB</label>
<span class="jsonly"><br><button type="button" onClick="resetVals()" id="reset">reset to defaults</button></span>
<span class="jsonly"><br><button type="button" onClick="clearSQL()" id="clear">clear</button></span>
</div>
</div>
Expand Down Expand Up @@ -596,6 +597,11 @@ function resetVals() {
range();
}
function clearSQL() {
sqlEl.value = '';
range();
}
// https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript
function copyTextToClipboard(text) {
const textArea = document.createElement('textarea');
Expand Down

0 comments on commit 3f66ec6

Please sign in to comment.