<commit_before>{% extends "base.html" %}

{% block html_imports %}
  <link rel="import" href="/static/elements/chromedash-featurelist.html">
  <link rel="import" href="/static/elements/chromedash-metadata.html">
{% endblock %}

{% block css %}
<link rel="stylesheet" type="text/css" href="/static/css/features/features.css?2012-06-29">
{% endblock %}

{% block subheader %}
<div id="subheader">
  <div>
    <h2>Builds</h2>
  </div>
  <div>
    <h2>Features</h2>
  </div>
  <div class="search">
    <input type="search" placeholder="Search" disabled>
  </div>
  <div>
    {% if user.is_whitelisted %}
      <a href="/admin/features/new">Add a new feature</a>
    {% endif %}
  </div>
</div>

{% endblock %}

{% block content %}
<section id="panels">
<nav>
  <chromedash-metadata></chromedash-metadata>
</nav>
<chromedash-featurelist {% if user.is_whitelisted %}whitelisted{% endif %}></chromedash-featurelist>
</section>

<!--
{% load verbatim %}
{% verbatim %}
{% endverbatim %} -->

{% endblock %}

{% block js %}
<script>
(function() {

var chromedashApp = document.querySelector('chromedash-featurelist');
document.addEventListener('WebComponentsReady', function(e) {

  // Fill data from server by including it directly in template.
  chromedashApp.features = {{features|safe}};

  // Fill data via AJAX instead.
  // var xhr = new XMLHttpRequest();
  // xhr.open('GET', '/features.json');
  // xhr.onloadend = function(e) {
  //   chromedashApp.features = JSON.parse(e.target.response);
  // };
  // xhr.send();

  var search = document.querySelector('.search [type="search"]');
  search.disabled = false;

  search.addEventListener('keyup', function(e) {<commit_msg>Fill via ajax instead of including in template<commit_after>{% extends "base.html" %}

{% block html_imports %}
  <link rel="import" href="/static/elements/chromedash-featurelist.html">
  <link rel="import" href="/static/elements/chromedash-metadata.html">
{% endblock %}

{% block css %}
<link rel="stylesheet" type="text/css" href="/static/css/features/features.css?2012-06-29">
{% endblock %}

{% block subheader %}
<div id="subheader">
  <div>
    <h2>Builds</h2>
  </div>
  <div>
    <h2>Features</h2>
  </div>
  <div class="search">
    <input type="search" placeholder="Search" disabled>
  </div>
  <div>
    {% if user.is_whitelisted %}
      <a href="/admin/features/new">Add a new feature</a>
    {% endif %}
  </div>
</div>

{% endblock %}

{% block content %}
<section id="panels">
<nav>
  <chromedash-metadata></chromedash-metadata>
</nav>
<chromedash-featurelist {% if user.is_whitelisted %}whitelisted{% endif %}></chromedash-featurelist>
</section>

<!--
{% load verbatim %}
{% verbatim %}
{% endverbatim %} -->

{% endblock %}

{% block js %}
<script>
(function() {

var chromedashApp = document.querySelector('chromedash-featurelist');
document.addEventListener('WebComponentsReady', function(e) {
  {% comment %}
  // Fill data from server by including it directly in template.
  //chromedashApp.features = {{features|safe}};
  {% endcomment %}

  // Fill data via AJAX.
  var xhr = new XMLHttpRequest();
  xhr.open('GET', '/features.json');
  xhr.onloadend = function(e) {
    chromedashApp.features = JSON.parse(e.target.response);
  };
  xhr.send();

  var search = document.querySelector('.search [type="search"]');
  search.disabled = false;

  search.addEventListener('keyup', function(e) {
{'fraction_non_alphanumeric': 0.18954827280779452, 'fraction_numerical': 0.0070859167404783, 'mean_word_length': 4.148936170212766, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7624588', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1131, 'n_words': 232}