<commit_before>/*
tableSortFilter is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
created by: <NAME> http://mc706.com
*/
/*
Table must have thead and tbody elements, and an equal amount of th elemnts in thead as td elements in body
 */
/**
 * table_selector               - jquery selector for the table you wish to sort (ie "#table1")
 * search_selector              - jquery selector for the search field you wish to filter with (ie "#search")
 * non_sort_class               - classname for icon for columns not being sorted by
 *                                                                      (ie bootstrap 2: "icon icon-resize-vertical")
 * ascending_sort_class:        - classname for icon for column being sorted ascendning by:
 *                                                                      (ie bootstrap 2: "icon icon-arrow-up")
 * descending_sort_class:       - classname for icon for column being sorted ascendning by:
 *                                                                      (ie bootstrap 2: "icon icon-arrow-up")
 */
(function ($, undefined) {
    $.tableSortFilter = function (opt) {

        var options = $.extend({
            table_selector: null,
            search_selector: null,
            non_sort_class: null,
            ascending_sort_class: null,
            descending_sort_class: null
        }, opt);
        var local = {
            columns: [],
            table: {},
            sortkey: ""
        };

        function setupSortFilter() {
            $(options.table_selector + ' thead th').each(function () {
                local.columns.push($(this).text());
                $(this).append("<i class='sorter " + options.non_sort_class + "' style='float:right;'></i>");
            });
            $(options.table_selector + ' tbody tr').each(function (index, element) {
                local.table[index] = {};
                $(this).children('td').each(function (i, element) {
                    local.table[index][local.columns[i]] = $(this).text();
                });
            });
            $(options.search_selector).keyup(function () {
                search();
            });
            $('.sorter').click(function () {
                $('.sorter').attr('class', 'sorter ' + options.non_sort_class); //resents all icons
                var new_sort = $(this).parent().text();
                if (local.sortkey == new_sort) {
                    local.sortkey = "-" + local.sortkey;
                    $(this).removeClass(options.non_sort_class).addClass(options.descending_sort_class);<commit_msg><i> to <span><commit_after>/*
tableSortFilter is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
created by: <NAME> http://mc706.com
*/
/*
Table must have thead and tbody elements, and an equal amount of th elemnts in thead as td elements in body
 */
/**
 * table_selector               - jquery selector for the table you wish to sort (ie "#table1")
 * search_selector              - jquery selector for the search field you wish to filter with (ie "#search")
 * non_sort_class               - classname for icon for columns not being sorted by
 *                                                                      (ie bootstrap 2: "icon icon-resize-vertical")
 * ascending_sort_class:        - classname for icon for column being sorted ascendning by:
 *                                                                      (ie bootstrap 2: "icon icon-arrow-up")
 * descending_sort_class:       - classname for icon for column being sorted ascendning by:
 *                                                                      (ie bootstrap 2: "icon icon-arrow-up")
 */
(function ($, undefined) {
    $.tableSortFilter = function (opt) {

        var options = $.extend({
            table_selector: null,
            search_selector: null,
            non_sort_class: null,
            ascending_sort_class: null,
            descending_sort_class: null
        }, opt);
        var local = {
            columns: [],
            table: {},
            sortkey: ""
        };

        function setupSortFilter() {
            $(options.table_selector + ' thead th').each(function () {
                local.columns.push($(this).text());
                $(this).append("<span class='sorter " + options.non_sort_class + "' style='float:right;'></i>");
            });
            $(options.table_selector + ' tbody tr').each(function (index, element) {
                local.table[index] = {};
                $(this).children('td').each(function (i, element) {
                    local.table[index][local.columns[i]] = $(this).text();
                });
            });
            $(options.search_selector).keyup(function () {
                search();
            });
            $('.sorter').click(function () {
                $('.sorter').attr('class', 'sorter ' + options.non_sort_class); //resents all icons
                var new_sort = $(this).parent().text();
                if (local.sortkey == new_sort) {
                    local.sortkey = "-" + local.sortkey;
                    $(this).removeClass(options.non_sort_class).addClass(options.descending_sort_class);
{'fraction_non_alphanumeric': 0.12354623450905625, 'fraction_numerical': 0.002669208770257388, 'mean_word_length': 1.6322127446061214, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '788584', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1272, 'n_words': 337}