<commit_before>// Adds custom remove event (https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L16)
var _oldCreanData = $.cleanData;
$.cleanData = function(elems) {
    if (elems.length) {
        try {
            $(document).triggerHandler('remove', elems);
        } catch(e) {}
    }

    _oldCreanData(elems);
};

jQuery(function($) {
    var $window        = $(window);
    var $document      = $(document);
    var $globalWrapper = $('#global_wrapper');
    var $pageHeader    = $('#page_header');
    var $pageContent   = $('#page_content');
    var $pageFooter    = $('#page_footer');

    $document.on('click', '[data-action-confirm]', function(e) {
        if (!window.confirm($(this).data('action-confirm'))) {
            e.preventDefault();
            e.stopImmediatePropagation();
        }
    });

    PR.checkToggle();
    PR.clickToggle();
    PR.visibilityToggle();
    PR.lazyLoad();
    PR.colorPicker('.color-picker-input');
    PR.bindAjaxPopupAnimations();

    PR.cursorTooltipInit();

    $('.selectify-select').selectify();

    // Language select
    if ($('.language-select').length) {
        $('.language-select').selectify();
        $('.language-select').on('change', function(e) {
            e.preventDefault();

            window.location.href = $(this).val();
        });
    }

    // Header scroll
    var prevScrollTop = 0;
    var scrollTop = 0;
    $globalWrapper.on('scroll', function() {
        scrollTop = $globalWrapper.scrollTop();

        if (scrollTop > prevScrollTop) {
            // down
            if (scrollTop > 150) {
                if (!$globalWrapper.hasClass('scrolling')) {
                    $globalWrapper.addClass('scrolling');
                }

                $pageHeader.css('top', $globalWrapper.scrollTop());
            }
        } else {
            // up
            if ($globalWrapper.hasClass('scrolling')) {
                if (PR.hasVerticalScrollbar($globalWrapper)) {
                    $globalWrapper.addClass('scroll-back').stop(true, true).delay(300).queue(function(next) {
                        $globalWrapper.removeClass('scrolling scroll-back');
                        $pageHeader.css('top', 0);

                        next();
                    });
                } else {
                    $globalWrapper.removeClass('scrolling scroll-back');
                    $pageHeader.css('top', 0);
                }
            }
        }

        prevScrollTop = scrollTop;
    });

    // hide dropdowns on box mouseout
    $document.on('mouseleave', '.featured', function() {
        $(this).find('.dropdown-menu').removeClass('active');
    });

    // new popup window links
    $document.on('click', 'a[data-window]', function(e) {
        e.preventDefault();

        PR.windowOpen(
            $(this).attr('href'),
            $(this).data('width'),
            $(this).data('height'),
            $(this).data('window')
        );
    });

    // alert manual and auto close handles
    $document.on('click', '.alert .close', function() {
        $(this).closest('.alert').stop(true, true).slideUp(300);
    });

    // global ajax events
    var requestLoaderTimeout = null;
    $document.ajaxStart(function() {
        if (requestLoaderTimeout) {
            clearTimeout(requestLoaderTimeout);
        }
        requestLoaderTimeout = setTimeout(function() {
            if (PR.AUTO_LOADER) {
                PR.showLoader();
            }
        }, 500);
    }).ajaxSuccess(function (event, request, settings) {
        PR.lazyLoad();
        PR.colorPicker('.color-picker-input');
        $('.selectify-select').selectify();

        if (PR.isObject(request) && PR.isObject(request.responseJSON)) {
            PR.addNotification(request.responseJSON.message, request.responseJSON.success ? 'success' : 'danger');
        }
    }).ajaxError(function(event, request, settings) {
        PR.addNotification('An error occured! Please try again.', 'danger');
    }).ajaxComplete(function() {
        if (requestLoaderTimeout) {
            clearTimeout(requestLoaderTimeout);
        }
        PR.hideLoader();
        PR.visibilityToggle();

        if (!PR.AUTO_LOADER) {
            PR.AUTO_LOADER = true;
        }
    });

    // Page load identifier
    $window.on('load', function() {
        $('html').addClass('loaded');<commit_msg>renamed global loaded css class<commit_after>// Adds custom remove event (https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L16)
var _oldCreanData = $.cleanData;
$.cleanData = function(elems) {
    if (elems.length) {
        try {
            $(document).triggerHandler('remove', elems);
        } catch(e) {}
    }

    _oldCreanData(elems);
};

jQuery(function($) {
    var $window        = $(window);
    var $document      = $(document);
    var $globalWrapper = $('#global_wrapper');
    var $pageHeader    = $('#page_header');
    var $pageContent   = $('#page_content');
    var $pageFooter    = $('#page_footer');

    $document.on('click', '[data-action-confirm]', function(e) {
        if (!window.confirm($(this).data('action-confirm'))) {
            e.preventDefault();
            e.stopImmediatePropagation();
        }
    });

    PR.checkToggle();
    PR.clickToggle();
    PR.visibilityToggle();
    PR.lazyLoad();
    PR.colorPicker('.color-picker-input');
    PR.bindAjaxPopupAnimations();

    PR.cursorTooltipInit();

    $('.selectify-select').selectify();

    // Language select
    if ($('.language-select').length) {
        $('.language-select').selectify();
        $('.language-select').on('change', function(e) {
            e.preventDefault();

            window.location.href = $(this).val();
        });
    }

    // Header scroll
    var prevScrollTop = 0;
    var scrollTop = 0;
    $globalWrapper.on('scroll', function() {
        scrollTop = $globalWrapper.scrollTop();

        if (scrollTop > prevScrollTop) {
            // down
            if (scrollTop > 150) {
                if (!$globalWrapper.hasClass('scrolling')) {
                    $globalWrapper.addClass('scrolling');
                }

                $pageHeader.css('top', $globalWrapper.scrollTop());
            }
        } else {
            // up
            if ($globalWrapper.hasClass('scrolling')) {
                if (PR.hasVerticalScrollbar($globalWrapper)) {
                    $globalWrapper.addClass('scroll-back').stop(true, true).delay(300).queue(function(next) {
                        $globalWrapper.removeClass('scrolling scroll-back');
                        $pageHeader.css('top', 0);

                        next();
                    });
                } else {
                    $globalWrapper.removeClass('scrolling scroll-back');
                    $pageHeader.css('top', 0);
                }
            }
        }

        prevScrollTop = scrollTop;
    });

    // hide dropdowns on box mouseout
    $document.on('mouseleave', '.featured', function() {
        $(this).find('.dropdown-menu').removeClass('active');
    });

    // new popup window links
    $document.on('click', 'a[data-window]', function(e) {
        e.preventDefault();

        PR.windowOpen(
            $(this).attr('href'),
            $(this).data('width'),
            $(this).data('height'),
            $(this).data('window')
        );
    });

    // alert manual and auto close handles
    $document.on('click', '.alert .close', function() {
        $(this).closest('.alert').stop(true, true).slideUp(300);
    });

    // global ajax events
    var requestLoaderTimeout = null;
    $document.ajaxStart(function() {
        if (requestLoaderTimeout) {
            clearTimeout(requestLoaderTimeout);
        }
        requestLoaderTimeout = setTimeout(function() {
            if (PR.AUTO_LOADER) {
                PR.showLoader();
            }
        }, 500);
    }).ajaxSuccess(function (event, request, settings) {
        PR.lazyLoad();
        PR.colorPicker('.color-picker-input');
        $('.selectify-select').selectify();

        if (PR.isObject(request) && PR.isObject(request.responseJSON)) {
            PR.addNotification(request.responseJSON.message, request.responseJSON.success ? 'success' : 'danger');
        }
    }).ajaxError(function(event, request, settings) {
        PR.addNotification('An error occured! Please try again.', 'danger');
    }).ajaxComplete(function() {
        if (requestLoaderTimeout) {
            clearTimeout(requestLoaderTimeout);
        }
        PR.hideLoader();
        PR.visibilityToggle();

        if (!PR.AUTO_LOADER) {
            PR.AUTO_LOADER = true;
        }
    });

    // Page load identifier
    $window.on('load', function() {
        $('html').addClass('page-loaded');
{'fraction_non_alphanumeric': 0.1621590779413443, 'fraction_numerical': 0.004108182129407737, 'mean_word_length': 2.0075497597803706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4579160', 'n_tokens_mistral': 2482, 'n_tokens_neox': 2391, 'n_words': 395}