add fs and notifications to stdlib
This commit is contained in:
parent
f858daff59
commit
20f413508f
7 changed files with 163 additions and 35 deletions
|
@ -4,7 +4,8 @@
|
|||
<button onclick="greet()">Greet</button>
|
||||
<button onclick="file()">Read File</button>
|
||||
<button onclick="directory()">List Directory</button>
|
||||
|
||||
<button onclick="notify()">Notify</button>
|
||||
|
||||
<script>
|
||||
function greet() {
|
||||
tiramisu.invoke("hello", "world")
|
||||
|
@ -27,6 +28,14 @@
|
|||
.then(files => alert("Files: " + files.join(", ")))
|
||||
.catch(error => alert("Error listing directory: " + error.message));
|
||||
}
|
||||
|
||||
function notify() {
|
||||
const message = prompt("Enter the notification message:");
|
||||
if (!message) return;
|
||||
tiramisu.notifications.notify(message)
|
||||
.then(() => alert("Notification sent!"))
|
||||
.catch(error => alert("Error sending notification: " + error.message));
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue