mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Serve runtime from assetserver if requested. Add gin guide, fix asset server merge, add gin example adding http.CloseNotifier and http.Flusher interface to assetserver.contentTypeSniffer, for Gin (and other framework) compatibility.
29 lines
1.1 KiB
HTML
29 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<style>body{ text-align: center; color: white; background-color: #191919; user-select: none; -ms-user-select: none; -webkit-user-select: none; }</style>
|
|
</head>
|
|
<body>
|
|
<h1>Events Demo</h1>
|
|
<br/>
|
|
The main program emits an event every 10s which will be displayed in the section below.
|
|
To send an event from this window, click here: <button onclick="wails.Events.Emit('myevent', 'hello!')">Send Event</button>
|
|
<div id="results"></div>
|
|
</body>
|
|
|
|
<script type="module">
|
|
import * as wails from "/wails/runtime.js";
|
|
|
|
wails.Events.On("myevent", function(data) {
|
|
let currentHTML = document.getElementById("results").innerHTML;
|
|
document.getElementById("results").innerHTML = currentHTML + "<br/>" + JSON.stringify(data);
|
|
})
|
|
wails.Events.On("windowevent", function(data) {
|
|
let currentHTML = document.getElementById("results").innerHTML;
|
|
document.getElementById("results").innerHTML = currentHTML + "<br/>" + JSON.stringify(data);
|
|
})
|
|
</script>
|
|
|
|
</html>
|