<commit_before>(function($) {
    $.fn.extend({
    'barebox': function(options) {
        options = $.extend({
            centered: true,
            bodyClass: 'noscroll'
        }, options);

        var body = $('body');
        var target = $($(this).data('target'));
        var overlay = $('<div id="barebox_overlay">').appendTo(body);

        if (target.length < 1)
            target = $(this);

        var mother = target.parent();

        overlay.click(function(e) {
            if (e.target !== this && (options.centered && e.target.id !== "barebox_cell"))
                return;

            target.barebox_close();
        });

        body.addClass(options.bodyClass);

        overlay.show();
        target.appendTo(overlay);
        target.show();
        target.data({
            bareboxed: true,
            barebox_options: options,
            barebox_mother: mother });

        if (options.centered === true) {
            overlay.css('display', 'table');
            target.wrap($('<div id="barebox_cell">').css({
                display: 'table-cell',
                'vertical-align': 'middle',
                'text-align': 'center' }));
            target.css('display', 'inline-block');
        }
        return target;
    },
    'barebox_close': function() {
        var target = $(this);
        var overlay = $('#barebox_overlay');
        var mother = target.data('barebox_mother');
        var options = target.data('barebox_options');

        if (target.data('bareboxed') !== true)
            throw 'barebox_close() must only be called on an active barebox';

        target.trigger('barebox_close');
        target.prependTo(mother);
        target.hide();
        $('body').removeClass(options.bodyClass);
        overlay.remove();
    }});
})(jQuery);<commit_msg>use simpler, more reliable sanity check in barebox_close<commit_after>(function($) {
    $.fn.extend({
    'barebox': function(options) {
        options = $.extend({
            centered: true,
            bodyClass: 'noscroll'
        }, options);

        var body = $('body');
        var target = $($(this).data('target'));
        var overlay = $('<div id="barebox_overlay">').appendTo(body);

        if (target.length < 1)
            target = $(this);

        var mother = target.parent();

        overlay.click(function(e) {
            if (e.target !== this && (options.centered && e.target.id !== "barebox_cell"))
                return;

            target.barebox_close();
        });

        body.addClass(options.bodyClass);

        overlay.show();
        target.appendTo(overlay);
        target.show();
        target.data({
            barebox_options: options,
            barebox_mother: mother });

        if (options.centered === true) {
            overlay.css('display', 'table');
            target.wrap($('<div id="barebox_cell">').css({
                display: 'table-cell',
                'vertical-align': 'middle',
                'text-align': 'center' }));
            target.css('display', 'inline-block');
        }
        return target;
    },
    'barebox_close': function() {
        var target = $(this);
        var overlay = $('#barebox_overlay');
        var mother = target.data('barebox_mother');
        var options = target.data('barebox_options');

        if (target.parents('#barebox_overlay').length < 1)
            throw 'barebox_close() must only be called on an active barebox';

        target.trigger('barebox_close');
        target.prependTo(mother);
        target.hide();
        $('body').removeClass(options.bodyClass);
        overlay.remove();
    }});
})(jQuery);
{'fraction_non_alphanumeric': 0.16145833333333334, 'fraction_numerical': 0.0008223684210526315, 'mean_word_length': 1.9642567018683996, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, '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': '574881', 'n_tokens_mistral': 1052, 'n_tokens_neox': 979, 'n_words': 202}