<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<!-- Vendor Styles -->
<!--
    <link href="{{ url_for('static', filename='vendor/bokehjs/css/bokeh.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='vendor/bokehjs/css/continuum.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='vendor/bokehjs/vendor/bootstrap/css/bootstrap.css') }}" rel="stylesheet">    
-->
{% if include_js %}
    {% for jsfile in jsfiles %}
    <script type="text/javascript" src="{{jsfile}}"></script>
    {% endfor %}
    {% for jsfile in hemfiles %}
    <script type="text/javascript" src="{{jsfile}}"></script>
    {% endfor %}
{% endif %}
  
</head>
<body>
  <p>content</p>

  <script type="text/javascript">
    (function () {
        window.injectF = function() {
            var scr = document.createElement("script");
    
            var sa = function(name,val){
                console.log(name,val);
                scr.setAttribute(name, val);};
            sa('src',"http://localhost:5006/bokeh/embed.js");
    
            sa('bokeh_plottype',"serverconn");
            sa('bokeh_docid',"{{docid}}");
            sa('bokeh_ws_conn_string',"ws://localhost:5006/bokeh/sub" );
            sa('bokeh_docapikey',"{{docapikey}}");
            sa('bokeh_root_url',"http://localhost:5006" );
            sa('bokeh_modelid', "{{modelid}}");
            sa('bokeh_modeltype',"Plot" );
    
            document.body.appendChild(scr);};
        console.log("end of script tag injection");
    }())
        
</script>
{% if delay %}
  <script type="text/javascript">
      setTimeout(injectF, 5000);
  </script>
{% endif %}
{% if onload %}
  <script type="text/javascript">
        var addOnload = function(func){
            if (window.attachEvent){
                window.attachEvent('onload', func);}
            else {
                window.addEventListener('load', func, false);}};
        console.log(document.readyState);
        addOnload(injectF);
  </script>
{% endif %}
{% if direct %}
  <script type="text/javascript">
    injectF();
  </script>
{% endif %}
{% if plot_scr %}
  {{plot_scr|safe}}
{% endif %}


</body>
</html>
