1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-14 07:30:21 +00:00
Interlisp.maiko/src/lde.html
Nick Briggs 29fdf4c40b Adapt to window geometry, set up a fake environment variable MEDLEYDIR
Passes the window width/height as the requested geometry to lde at startup.

Since we control the directory structure of the file-system, we can pass the
known fixed location of the Medley directories in the MEDLEYDIR environment variable.

Sets up the NetHub host as localhost - not currenty functional, but a WebSocket
server could be added to communicate with the NetHub gateway to enable local
networking from the browser version of Medley.
2024-01-01 16:58:23 -08:00

25 lines
975 B
HTML

<!doctype html>
<!-- Based on https://github.com/timhutton/sdl-canvas-wasm/blob/main/index.html -->
<!-- html to set up WebAssembly module for Medley running in a browser -->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="text-align: center;">
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<script type="text/javascript">
var width = 32*Math.trunc(Math.min(Math.max(window.innerWidth, 512), 1664)/32);
var height = Math.min(Math.max(window.innerHeight, 512), 1260);
var Module = {
preRun: [ function() {ENV.MEDLEYDIR = "{DSK}<medley>";} ],
arguments: ["medley/loadups/full.sysout","-sc", width+"x"+height, "-nh-host", "127.0.0.1"],
canvas: (function() { return document.getElementById('canvas'); })()
};
</script>
<script src="ldesdl.js"></script>
</body>
</html>