<commit_before><commit_msg>add select-all plugin<commit_after>(function($){
    'use strict';

    $.fn.selectAll = function(options) {
        var settings = {
            checboxes: false,
            classes: {
                0: 'is-none',
                1: 'is-indeterminate',
                2: 'is-all'
            }
        };

        if (options) {
            $.extend( settings, options );
        }

        return this.each(function () {
            var $this = $(this);
            settings.checkboxes = $this.data('select-all') ? $this.data('select-all') : false;

            // if there are no checkboxes to check, it's pointless
            if (!settings.checkboxes) return false;

            $this.on('change', function() {
                if (this.checked) {
                  $(settings.checkboxes).prop('checked', true);
                } else {
                  $(settings.checkboxes).prop('checked', false);
                }

                $this.attr('class', settings.classes[checkSelected($(settings.checkboxes))]);
            });

            $(document).on('change', settings.checkboxes, function() {
                var state = checkSelected($(settings.checkboxes));

                if(state === 0) {
                    $this.prop({
                        'checked': false,
                        'indeterminate': false
                    });
                } else if (state === 2){
                    $this.prop({
                        'checked': true,
                        'indeterminate': false
                    });
                } else {
                    $this.prop('indeterminate', true);
                }
                $this.attr('class', settings.classes[state]);
            });
        });

        function checkSelected($items) {
            if (0 === $items.filter(':checked').length) {
              return 0;
            } else if ($items.length === $items.filter(':checked').length) {
              return 2;
            } else {
              return 1;
            }
        }

    };
})(window.jQuery);

{'fraction_non_alphanumeric': 0.14038461538461539, 'fraction_numerical': 0.004326923076923077, 'mean_word_length': 1.197465681098205, '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': '4800001', 'n_tokens_mistral': 541, 'n_tokens_neox': 497, 'n_words': 100}