<commit_before>// #####################################################################################################################
// #BASE#
// Basic logic django filer
'use strict';

var Cl = window.Cl || {};
/* global Mediator */

(function ($) {
    $(function () {
        window.showError = function (message) {
            var messages = $('.messagelist');
            var header = $('#header');
            var tpl = '<ul class="messagelist"><li class="error">{msg}</li></ul>';
            var msg = tpl.replace('{msg}', message);

            messages.length ? messages.replaceWith(msg) : header.after(msg);
        };

        // mediator init
        Cl.mediator = new Mediator();

        // Focal point logic init
        if (Cl.FocalPoint) {
            new Cl.FocalPoint();
        }

        // Toggler init
        if (Cl.Toggler) {
            new Cl.Toggler();
        }

        $(document).on('click', '.dropdown-menu-checkboxes', function (clickEvent) {
            clickEvent.stopPropagation();
        });

        // Focus on the search field on page load
        (function () {
            var filter = $('.js-filter-files');

            if (filter.length) {
                filter.focus();
            }
        }());

        // show counter if file is selected
        (function () {
            var table = $('.navigator-table').find('tr');
            var actionCounter = $('.action-counter');
            var actionSelect = $('.action-select, .column-checkbox');

            actionSelect.each(function () {
                $(this).on('click', function () {
                    if (table.hasClass('selected')) {
                        actionCounter.addClass('action-selected');
                    } else {
                        actionCounter.removeClass('action-selected');
                    }
                });
            });
        }());

        (function () {<commit_msg>rewrite if else<commit_after>// #####################################################################################################################
// #BASE#
// Basic logic django filer
'use strict';

var Cl = window.Cl || {};
/* global Mediator */

(function ($) {
    $(function () {
        window.showError = function (message) {
            var messages = $('.messagelist');
            var header = $('#header');
            var tpl = '<ul class="messagelist"><li class="error">{msg}</li></ul>';
            var msg = tpl.replace('{msg}', message);

            messages.length ? messages.replaceWith(msg) : header.after(msg);
        };

        // mediator init
        Cl.mediator = new Mediator();

        // Focal point logic init
        if (Cl.FocalPoint) {
            new Cl.FocalPoint();
        }

        // Toggler init
        if (Cl.Toggler) {
            new Cl.Toggler();
        }

        $(document).on('click', '.dropdown-menu-checkboxes', function (clickEvent) {
            clickEvent.stopPropagation();
        });

        // Focus on the search field on page load
        (function () {
            var filter = $('.js-filter-files');

            if (filter.length) {
                filter.focus();
            }
        }());

        // show counter if file is selected
        (function () {
            var table = $('.navigator-table').find('tr');
            var actionCounter = $('.action-counter');
            var actionSelect = $('.action-select, .column-checkbox');

            actionSelect.each(function () {
                $(this).on('click', function () {
                    actionCounter.toggleClass('action-selected', table.hasClass('selected'));
                });
            });
        }());

        (function () {
{'fraction_non_alphanumeric': 0.2114656571119524, 'fraction_numerical': 0.0, 'mean_word_length': 1.7039473684210527, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '217400', 'n_tokens_mistral': 953, 'n_tokens_neox': 895, 'n_words': 201}