39 lines
1.2 KiB
HTML
39 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Elm Workshop</title>
|
|
|
|
<!-- Favicon -->
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
|
|
|
|
|
<!-- Import Ionicon icons & Google Fonts our Bootstrap theme relies on -->
|
|
<link href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css">
|
|
|
|
<link href="/fonts.css" rel="stylesheet" type="text/css">
|
|
<link rel="stylesheet" href="/main.css">
|
|
|
|
<script src="elm.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
var app = Elm.Main.init({flags: localStorage.session || null});
|
|
|
|
app.ports.storeSession.subscribe(function(session) {
|
|
localStorage.session = session;
|
|
|
|
// Report that the new session was stored succesfully.
|
|
setTimeout(function() { app.ports.onSessionChange.send(session); }, 0);
|
|
});
|
|
|
|
window.addEventListener("storage", function(event) {
|
|
if (event.storageArea === localStorage && event.key === "session") {
|
|
app.ports.onSessionChange.send(event.newValue);
|
|
}
|
|
}, false);
|
|
</script>
|
|
</body>
|
|
</html>
|