yle>
</head>

<body>
    <script src="elm.js"></script>
    <script>
let initValue = null;

try {
    initValue = localStorage.editMe ? JSON.parse(localStorage.editMe) : {}
} catch(e) {
    initValue = {};
}

const elm = Elm.JsonEditorApp.fullscreen(initValue);

elm.ports.select.subscribe(id => {
    setTimeout(() => {
        // console.log('attempt to select', id);
        const x = document.getElementById(id);
        // console.log(x);
        if (x) {
            x.select();
        }
    }, 100);
});
