<commit_before>'use strict';

var calnav = (function() {

  var nav = $('.nav-cals');

  var renderCal = function(cal, level) {
    var input = document.createElement('input');
    input.type = 'checkbox';
    input.checked = 'checked';
    $(input).on('change', function(e) {
      var active = $(this).is(":checked");
      var l = $(this).parent('label');
      l.toggleClass('active', active);

      // Apply to calendar
      $('#calendar').fullCalendar((active ? 'add' : 'remove') + 'EventSource', l.data('url'))
    })

    var label = document.createElement('label');
    var $label = $(label);
    $label.append(input).append(cal.name);
    $label.data('id', cal.id);
    $label.data('slug', cal.slug);
    $label.data('url', cal.url);
    $label.addClass('level--' + level);
    $label.addClass('active');
    nav.append($label);
  };

  var render = function(sources) {
    var levels = {
      1: 1
    };
    var glob = sources[0];
    $.each(sources, function(index, cal) {
      if (!levels[cal.parent_id]) {
        levels[cal.id] = 1;
      } else {
        levels[cal.id] = levels[levels[cal.parent_id]] + 1;
      }
    })

    $.each(sources, function(index, cal) {
      renderCal(cal, levels[cal.parent_id]);
    })

  };

  return {
    render: render
  };
})();<commit_msg>Remove calendar nav generated by js<commit_after>'use strict';

var calnav = (function() {

  var nav = $('.nav-cals');

  var renderCal = function(cal, level) {
    var input = document.createElement('input');
    input.type = 'checkbox';
    input.checked = 'checked';
    $(input).on('change', function(e) {
      var active = $(this).is(":checked");
      var l = $(this).parent('label');
      l.toggleClass('active', active);

      // Apply to calendar
      $('#calendar').fullCalendar((active ? 'add' : 'remove') + 'EventSource', l.data('url'))
    })

    var label = document.createElement('label');
    var $label = $(label);
    $label.append(input).append(cal.name);
    $label.data('id', cal.id);
    $label.data('slug', cal.slug);
    $label.data('url', cal.url);
    $label.addClass('level--' + level);
    $label.addClass('active');
    nav.append($label);
  };

  var render = function(sources) {
  };

  return {
    render: render
  };
})();
{'fraction_non_alphanumeric': 0.20353982300884957, 'fraction_numerical': 0.0022123893805309734, 'mean_word_length': 2.9321739130434783, 'pattern_counts': {'":': 2, '<': 3, '<?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': '3056149', 'n_tokens_mistral': 745, 'n_tokens_neox': 729, 'n_words': 148}