<commit_before>$(function() {
  var showInfoBox = function(){
    $(".infoMsgBox").addClass("hide");
    $(this).find(".infoMsgBox").removeClass("hide");

    $(document).one("click", function(){
      $(".infoMsgBox").addClass("hide");
    });
    return false;
  }

  var toggleInstanceTableStatus = function(e,target) {
    if(typeof target === "undefined") {
        var maxCount = $(this).closest('tr').siblings().length;
        var myClass = $(this).closest('td').attr('data-cb');
        var count = $(this).closest('tbody').find('td[data-cb="' + myClass + '"]').find('input:checked').length;
    } else {
        var myClass = target;
        var maxCount = $('td[data-cb="' + myClass + '"]').length;
        var count = $('td[data-cb="' + myClass + '"]').closest('tbody').find('td[data-cb="' + myClass + '"]').find('input:checked').length;
    }

    // none checked
    if(count === 0) {
        $('#' + myClass).removeClass().addClass('iconCheckbox');
    // all checked
    } else if(maxCount === count) {
        $('#' + myClass).removeClass().addClass('iconCheckboxActive');
    // some checked
    } else {
        $('#' + myClass).removeClass().addClass('iconCheckboxHalf');
    }
  }

  var toggleInstanceRowsStatus = function() {
  	var myClass = $(this).attr('id');

		$(this).closest('table')
			.find('td[data-cb="' + myClass + '"]')
			.find('input').prop("checked", !$(this).hasClass("iconCheckboxActive"))
			.change();

  	toggleInstanceTableStatus(null, myClass);
  }

  $("#instanceTable").on("click", ".iconInfo", showInfoBox); 
  $('#instanceTable').on("click", ".checkbox", toggleInstanceTableStatus);
  $('#instanceTable').on("click", "thead span", toggleInstanceRowsStatus);

  toggleInstanceTableStatus(null, 'cb-active');
  toggleInstanceTableStatus(null, 'cb-select-on');
  toggleInstanceTableStatus(null, 'cb-select-allow');
	toggleInstanceTableStatus(null, 'cb-info-on');
	toggleInstanceTableStatus(null, 'cb-info-allow');
	toggleInstanceTableStatus(null, 'cb-toggle-on');
	toggleInstanceTableStatus(null, 'cb-toggle-allow');
	toggleInstanceTableStatus(null, 'cb-recorder-allow');

});<commit_msg>Disabled checkboxes<commit_after>$(function() {
  var showInfoBox = function(){
    $(".infoMsgBox").addClass("hide");
    $(this).find(".infoMsgBox").removeClass("hide");

    $(document).one("click", function(){
      $(".infoMsgBox").addClass("hide");
    });
    return false;
  }

  var toggleInstanceTableStatus = function(e,target) {
    if(typeof target === "undefined") {
        var maxCount = $(this).closest('tr').siblings().length;
        var myClass = $(this).closest('td').attr('data-cb');
        var count = $(this).closest('tbody').find('td[data-cb="' + myClass + '"]').find('input:checked').length;
        var disabled = $(this).closest('tbody').find('td[data-cb="' + myClass + '"]').find('.checkboxDisabled').length
    } else {
        var myClass = target;
        var maxCount = $('td[data-cb="' + myClass + '"]').length;
        var count = $('td[data-cb="' + myClass + '"]').closest('tbody').find('td[data-cb="' + myClass + '"]').find('input:checked').length;
        var disabled = $('td[data-cb="' + myClass + '"]').closest('tbody').find('td[data-cb="' + myClass + '"]').find('.checkboxDisabled').length;
    }

    // none checked
    if(count === 0) {
        $('#' + myClass).removeClass().addClass('iconCheckbox');
    // all checked
    } else if((maxCount - disabled) === count) {
        $('#' + myClass).removeClass().addClass('iconCheckboxActive');
    // some checked
    } else {
        $('#' + myClass).removeClass().addClass('iconCheckboxHalf');
    }
  }

  var toggleInstanceRowsStatus = function() {
  	var myClass = $(this).attr('id');

		$(this).closest('table')
			.find('td[data-cb="' + myClass + '"]')
      .find('div:not(.checkboxDisabled)')
			.find('input').prop("checked", !$(this).hasClass("iconCheckboxActive"))
			.change();

  	toggleInstanceTableStatus(null, myClass);
  }

  $("#instanceTable").on("click", ".iconInfo", showInfoBox); 
  $('#instanceTable').on("click", ".checkbox", toggleInstanceTableStatus);
  $('#instanceTable').on("click", "thead span", toggleInstanceRowsStatus);

  toggleInstanceTableStatus(null, 'cb-active');
  toggleInstanceTableStatus(null, 'cb-select-on');
  toggleInstanceTableStatus(null, 'cb-select-allow');
	toggleInstanceTableStatus(null, 'cb-info-on');
	toggleInstanceTableStatus(null, 'cb-info-allow');
	toggleInstanceTableStatus(null, 'cb-toggle-on');
	toggleInstanceTableStatus(null, 'cb-toggle-allow');
	toggleInstanceTableStatus(null, 'cb-recorder-allow');

});
{'fraction_non_alphanumeric': 0.21992603872090494, 'fraction_numerical': 0.00043506634761801175, 'mean_word_length': 4.207248018120045, 'pattern_counts': {'":': 0, '<': 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': '4822336', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1414, 'n_words': 213}