-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a demo test page for the main readme-example.
The demo isn't perfect, since it's compiled before being served, but it's a start.
- Loading branch information
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ barelyServe({ | |
outDir: "./.temp/dev", | ||
esbuildOptions: { | ||
target: "es5", | ||
splitting: false, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<script src="./main.js" href="./main.ts" type="module"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as clipboard from "../../clipboard-polyfill/entries/es6/clipboard-polyfill.es6"; | ||
|
||
function handler() { | ||
clipboard.writeText("This text is plain.").then( | ||
() => { | ||
console.log("success!"); | ||
}, | ||
() => { | ||
console.log("error!"); | ||
}, | ||
); | ||
} | ||
|
||
window.addEventListener("DOMContentLoaded", function () { | ||
var button = document.body.appendChild(document.createElement("button")); | ||
button.textContent = "Copy"; | ||
button.addEventListener("click", handler); | ||
}); |