-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
31 lines (27 loc) · 1.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Travis Branch radiator</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css' />
<link href="radiator.css" rel="stylesheet" type='text/css' />
<script type="text/javascript" src="dist/radiator.js"></script>
</head>
<body>
<div id="app"></div>
</body>
<script type="text/javascript">
;(function() {
var localStorageKey = 'radiatorConfig'
var savedConfiguration = localStorage.getItem(localStorageKey)
var config = savedConfiguration ? JSON.parse(savedConfiguration) : null
var appElem = document.getElementById('app');
var app = Elm.RadiatorApp.init({
node: appElem,
flags: { localStorageCfg: config }
})
app.ports.saveConfiguration.subscribe(function(newConfig) {
localStorage.setItem(localStorageKey, JSON.stringify(newConfig))
})
})()
</script>
</html>