Commit abbbc841 authored by Thorsten Wißmann's avatar Thorsten Wißmann 🐧
Browse files

Update custom js to elm 0.19

parent 83a857cc
......@@ -14,6 +14,7 @@
<link rel="stylesheet" type="text/css" href="overlay.css">
</head>
<body>
<div id="elmapp"></div>
<script type="text/javascript">
var getParameters = location.search.substring(1);
/* from http://stackoverflow.com/questions/8648892/convert-url-parameters-to-a-javascript-object */
......@@ -21,7 +22,7 @@
? JSON.parse('{"' + getParameters.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
function(key, value) { return key===""?value:decodeURIComponent(value) })
: {};
console.log(JSON.stringify(getParameters));
/* console.log(JSON.stringify(getParameters)); */
var proto = window.location.protocol;
var mobileBrowser = /* http://stackoverflow.com/a/11381730/4400896 */
navigator.userAgent.match(/Android/i)
......@@ -36,7 +37,10 @@
showRestart: (proto == "file:"),
minimalInterface : (mobileBrowser != null),
};
var app = Elm.Main.fullscreen(appParameters);
var app = Elm.Main.init({
node: document.getElementById("elmapp"),
flags: appParameters,
});
app.ports.scrollIntoView.subscribe(
function(elem_id) {
var element = document.getElementById(elem_id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment