<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>{% block title %}Jasmine Test Runner{% endblock %}</title>

  {% load js %}

  {% block js_init %}
    {% if use_django_js %}
    {% django_js %}
    {% endif %}

    {% css "test/js/libs/jasmine.css" %}
    {% js "test/js/libs/jasmine.js" %}
    {% js "test/js/libs/jasmine-html.js" %}
    {% js "test/js/libs/jasmine-djangojs.js" %}
    {% js "test/js/libs/jasmine-jquery.js" %}
  {% endblock js_init %}

  {% for file in js_test_files %}
  {% js file %}
  {% endfor %}

  {% block js_content %}{% endblock %}

  <script type="text/javascript">
    (function() {
        var jasmineEnv = jasmine.getEnv();

        jasmineEnv.updateInterval = 1000;

        if (navigator.userAgent.indexOf('PhantomJS') != -1) {
            jasmineEnv.addReporter(new jasmine.TapReporter());
        } else {
            var htmlReporter = new jasmine.HtmlReporter();
            jasmineEnv.addReporter(htmlReporter);
            jasmineEnv.specFilter = function(spec) {
                return htmlReporter.specFilter(spec);
            };
        }

        var currentWindowOnload = window.onload;

        window.onload = function() {
            if (currentWindowOnload) {
                currentWindowOnload();
            }
            execJasmine();
        };

        function execJasmine() {
            jasmineEnv.execute();
        }

    })();
  </script>

</head>

<body>
  {% block body_content %}{% endblock %}
</body>
</html>
