<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Flask: Jasmine Spec Runner</title>
  <link rel="shortcut icon" type="image/png" href="{{ media_url }}jasmine/jasmine_favicon.png">

  <link rel="stylesheet" type="text/css" href="{{ media_url }}jasmine/jasmine.css">
  <script type="text/javascript" src="{{ media_url }}jasmine/jasmine.js"></script>
  <script type="text/javascript" src="{{ media_url }}jasmine/jasmine-html.js"></script>

  {% for spec in specs %}
    <script type="text/javascript" src="{{ spec }}"></script>
  {% endfor %}

  {% for source in sources %}
    <script type="text/javascript" src="{{ source }}"></script>
  {% endfor %}

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

      var reporter = new jasmine.HtmlReporter();

      jasmineEnv.addReporter(reporter);

      jasmineEnv.specFilter = function(spec) {
        return reporter.specFilter(spec);
      };

      var currentWindowOnload = window.onload;

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

      function execJasmine() {
        jasmineEnv.execute();
      }
    })();
  </script>
</head>
<body>
</body>
</html>
