<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Open Media Library</title>
    <link href="../oxjs/min/UI/css/UI.css" rel="stylesheet" type="text/css" />
    <style>
        #loading {
            text-align: center;
            padding-top: 24px;
        }
        #status {
            padding-bottom: 16px;
        }
    </style>
    <script>
        function load() {
            var port = document.location.hash.length
                    ? document.location.hash.slice(1)
                    : '9842',
                base = '//[::1]:' + port,
                ws = new WebSocket('ws:' + base + '/ws');
            ws.onopen = function(event) {
                document.location.href = 'http:' + base;
            };
            ws.onerror = function(event) {
                ws.close();
            };
            ws.onclose = function(event) {
                setTimeout(load, 500);
            };
        };
        load();
        setTimeout(function() {
            document.querySelector('#status').innerHTML = 'Failed to start Open Media Library';
        }, 10000);
    </script>
</head>
<body class="OxThemeOxlight">
    <div id="loading">
        <div id="status">Starting Open Media Library</div>
        <img src="../png/oml.png">
    </div>
</body>
</html>