Skip to content

Commit

Permalink
copy button
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Mar 10, 2024
1 parent d660c4c commit a289f8d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sources/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,25 @@ const App = () => {
<p></p>
</div>
<div class="row">
<div class="col">
<button
class="btn btn-primary"
onclick=${() => {
navigator.clipboard.writeText(r.ast);
if (window.getSelection) {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(
document.getElementById("output_scala"),
);
selection.removeAllRanges();
selection.addRange(range);
}
}}
>
copy
</button>
</div>
<div class="col">
<button
class="btn btn-primary"
Expand Down

0 comments on commit a289f8d

Please sign in to comment.