<commit_before>
<script language="javascript" type="text/javascript"><!--

(function($) {
  // http://stackoverflow.com/questions/4911577/jquery-click-toggle-between-two-functions
  // $(..).toggle() no longer exists in JQuery
  $.fn.clickToggle = function(func1, func2) {
    var funcs = [func1, func2];
    this.data('toggleclicked', 0);
    this.click(function() {
      var data = $(this).data();
      var tc = data.toggleclicked;
      $.proxy(funcs[tc], this)();
      data.toggleclicked = (tc + 1) % 2;
    });
    return this;
  };
}(jQuery));

$(document).ready(function() {

  cd.buildDiffFilenameHandlers(<%= @diffs.to_json.html_safe %>);
  
  var display = function(node, name, value) {
    if ($(node).attr('disabled') !== 'disabled') {
      $(name).css('display', value);
    }
  };
  var allLineCountButtons = $('.diff-deleted-line-count, .diff-added-line-count');
  var off = { 'disabled':true, 'title':'' }; 
  var disableAllLineCountButtons = function() {
    allLineCountButtons.attr(off);
  };

  $('.filename').click(function() {
    var tr = $(this).parent().parent();
    disableAllLineCountButtons();
    tr.find('.diff-deleted-line-count')
        .attr('disabled', false)
        .attr('title', 'Toggle deleted lines on/off');
    tr.find('.diff-added-line-count')
        .attr('disabled', false)
        .attr('title', 'Toggle added lines on/off');
  });

  $('.diff-deleted-line-count').clickToggle(
    function() { display(this, 'deleted', 'none' ); },
    function() { display(this, 'deleted', 'block'); }    
  );

  $('.diff-added-line-count').clickToggle(
    function() { display(this, 'deleted', 'none' ); },
    function() { display(this, 'deleted', 'block'); }    
  );

  disableAllLineCountButtons();
  $('#' + '<%= @current_filename_id %>').click();  
  $('input[type=radio]').hide();
  
});

//--></script>

<table cellpadding="0" cellspacing="0"><commit_msg>stupid copy/paste error<commit_after>
<script language="javascript" type="text/javascript"><!--

(function($) {
  // http://stackoverflow.com/questions/4911577/jquery-click-toggle-between-two-functions
  // $(..).toggle() no longer exists in JQuery
  $.fn.clickToggle = function(func1, func2) {
    var funcs = [func1, func2];
    this.data('toggleclicked', 0);
    this.click(function() {
      var data = $(this).data();
      var tc = data.toggleclicked;
      $.proxy(funcs[tc], this)();
      data.toggleclicked = (tc + 1) % 2;
    });
    return this;
  };
}(jQuery));

$(document).ready(function() {

  cd.buildDiffFilenameHandlers(<%= @diffs.to_json.html_safe %>);
  
  var display = function(node, name, value) {
    if ($(node).attr('disabled') !== 'disabled') {
      $(name).css('display', value);
    }
  };
  var allLineCountButtons = $('.diff-deleted-line-count, .diff-added-line-count');
  var off = { 'disabled':true, 'title':'' }; 
  var disableAllLineCountButtons = function() {
    allLineCountButtons.attr(off);
  };

  $('.filename').click(function() {
    var tr = $(this).parent().parent();
    disableAllLineCountButtons();
    tr.find('.diff-deleted-line-count')
        .attr('disabled', false)
        .attr('title', 'Toggle deleted lines on/off');
    tr.find('.diff-added-line-count')
        .attr('disabled', false)
        .attr('title', 'Toggle added lines on/off');
  });

  $('.diff-deleted-line-count').clickToggle(
    function() { display(this, 'deleted', 'none' ); },
    function() { display(this, 'deleted', 'block'); }    
  );

  $('.diff-added-line-count').clickToggle(
    function() { display(this, 'added', 'none' ); },
    function() { display(this, 'added', 'block'); }    
  );

  disableAllLineCountButtons();
  $('#' + '<%= @current_filename_id %>').click();  
  $('input[type=radio]').hide();
  
});

//--></script>

<table cellpadding="0" cellspacing="0">
{'fraction_non_alphanumeric': 0.21735710540115363, 'fraction_numerical': 0.008390141583639224, 'mean_word_length': 3.425754060324826, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6593347', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1258, 'n_words': 219}