<commit_before>"use strict";
var credits = (function() {
  var names = [],
      len   = roles.length,
      vid   = document.querySelector("video"),
      main  = document.querySelector("main");

  function init() {
    var choices = document.querySelector("#choices"),
        i       = 0;

    for (; i < len; i++) {
      names.push(chance.name());
    }

    choices.addEventListener("change", function(e) {
      var choice = this.value,
          source0, source1;

      if (choice === "blank" || choice === "star-wars") {
        vid.style.display = "none";
      } else {
        vid.style.display = "block";
        vid.setAttribute("id", this.value);
        source0 = vid.querySelectorAll("source")[0];
        source1 = vid.querySelectorAll("source")[1];
        source0.setAttribute("src", "media/" + this.value + ".mp4");
        source0.setAttribute("type", "video/mp4");
        source1.setAttribute("src", "media/" + this.value + ".ogg");
        source1.setAttribute("type", 'video/ogg; codecs="theora, vorbis"');
        vid.load();
      }

      restartCredits(choice);
    });

    buildCredits();
  }

  function restartCredits(choice) {
    main.classList.remove("animate", "star-wars");

    setTimeout(function() {
      main.classList.add("animate", choice);
    });
  }

  function buildCredits() {
    var dl, dt, dd, i = 0;

    dl = document.createElement("dl");

    for (; i < len; i++) {
      dt = document.createElement("dt");
      dt.appendChild(document.createTextNode(roles[i]));
      dd = document.createElement("dd");
      dd.appendChild(document.createTextNode(names[i]));
      dl.appendChild(dt);
      dl.appendChild(dd);
    }

    main.appendChild(dl);
    main.classList.add("animate");
  }

  return { init : init };
})();<commit_msg>Revert "Clean up credits JS"<commit_after>"use strict";
var credits = (function() {
  var names = [],
      len   = roles.length,
      vid   = document.querySelector("video"),
      main  = document.querySelector("main");

  function init() {
    var choices = document.querySelector("#choices");

    for (var i = 0; i < len; i++) {
      names.push(chance.name());
    }

    choices.addEventListener("change", function(e) {
      var choice = this.value,
          source0, source1;

      if (choice === "blank" || choice === "star-wars") {
        vid.style.display = "none";
      } else {
        vid.style.display = "block";
        vid.setAttribute("id", this.value);
        source0 = vid.querySelectorAll("source")[0];
        source1 = vid.querySelectorAll("source")[1];
        source0.setAttribute("src", "media/" + this.value + ".mp4");
        source0.setAttribute("type", "video/mp4");
        source1.setAttribute("src", "media/" + this.value + ".ogg");
        source1.setAttribute("type", 'video/ogg; codecs="theora, vorbis"');
        vid.load();
      }

      restartCredits(choice);
    });

    buildCredits();
  }

  function restartCredits(choice) {
    main.classList.remove("animate", "star-wars");

    setTimeout(function() {
      main.classList.add("animate", choice);
    }, 300);
  }

  function buildCredits() {
    var dl, dt, dd, i;

    dl = document.createElement("dl");

    for (i = 0; i < len; i++) {
      dt = document.createElement("dt");
      dt.appendChild(document.createTextNode(roles[i]));
      dd = document.createElement("dd");
      dd.appendChild(document.createTextNode(names[i]));
      dl.appendChild(dt);
      dl.appendChild(dd);
    }

    main.appendChild(dl);
    main.classList.add("animate");
  }

  return { init : init };
})();
{'fraction_non_alphanumeric': 0.1774058577405858, 'fraction_numerical': 0.008647140864714086, 'mean_word_length': 2.6893004115226335, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '5285591', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1104, 'n_words': 205}