<!DOCTYPE html>
<html>
<head>
    <script src="/lib/jquery-1.12.4.js"></script>
    <script src="/lib/handlebars.js"></script>
    <script src="/lib/underscore.js"></script>
    <script src="/lib/backbone.js"></script>
    <script src="/app.js"></script>
    <link rel="stylesheet" type="text/css" href="app.css">
    {% for src in scripts %}
        <script src="{{ src }}"></script>
    {% endfor %}
    {% for src in cssfiles %}
        <link rel="stylesheet" type="text/css" href="app.css">
    {% endfor %}
    <script>
        {{ presetup }}
        APP2.setup();
        {% if appname == "" %}
        APP2.connect("ws://localhost:8881/websocket");
        {% else %}
        APP2.connect("ws://localhost:8881/{{appname}}/websocket");
        {% endif %}
        $(function () {
            // let w = new Widget2("topwidget", {}, APP2);
            // w.setElement($("body"));
        });
    </script>
    <style>
        {{ css }}
    </style>
</head>
<body id="topwidget">

</body>
</html>