<commit_before>(function(global) {
    'use strict';

    var HISTORY_API_SUPPORTED = !!history.pushState;

    function toggleFolder(evt) {
        if ($(evt.target).closest('.actions').length) {
            // ignore if it comes from inside the action panel
            return;
        }
        $(this)
            .toggleClass('collapsed')
            .next('.sub-tree')
            .find('td > div')
                .slideToggle(150);
    }

    $(document).ready(function() {
        $('.attachments > .dropdown').parent().dropdown();
        if (!window.indicoOfflineSite) {
            setupAttachmentPreview();
        }
    });

    global.setupAttachmentPreview = function setupAttachmentPreview() {
        var attachment = $('.js-preview-dialog');
        var pageURL = location.href.replace(/#.*$/, '');

        $(window).on('hashchange', function(e, initial) {
            if (location.hash.indexOf('#preview:') != 0) {
                $('.attachment-preview-dialog').trigger('ajaxDialog:close', [true]);
            } else {
                if (initial && HISTORY_API_SUPPORTED) {
                    var hash = location.hash;
                    // start with a clean state, i.e. [..., page, page+preview]
                    history.replaceState({}, document.title, pageURL);
                    history.pushState({}, document.title, location.href + hash);
                }
                var id = location.hash.split('#preview:')[1];
                previewAttachment(id);
            }
        }).triggerHandler('hashchange', [true]);

        attachment.on('click', function(e) {
            if (e.which != 1 || e.shiftKey) {
                // ignore middle clicks and shift-clicks - people should be able to open an attachment in a new tab/window
                return;
            }
            e.preventDefault();
            location.hash = '#preview:{0}'.format($(this).data('attachmentId'));
        });

        function clearHash() {
            if (HISTORY_API_SUPPORTED) {
                // if we have the history api, we can assume that the previous state is the same page without<commit_msg>Check other modifiers to skip the previewer<commit_after>(function(global) {
    'use strict';

    var HISTORY_API_SUPPORTED = !!history.pushState;

    function toggleFolder(evt) {
        if ($(evt.target).closest('.actions').length) {
            // ignore if it comes from inside the action panel
            return;
        }
        $(this)
            .toggleClass('collapsed')
            .next('.sub-tree')
            .find('td > div')
                .slideToggle(150);
    }

    $(document).ready(function() {
        $('.attachments > .dropdown').parent().dropdown();
        if (!window.indicoOfflineSite) {
            setupAttachmentPreview();
        }
    });

    global.setupAttachmentPreview = function setupAttachmentPreview() {
        var attachment = $('.js-preview-dialog');
        var pageURL = location.href.replace(/#.*$/, '');

        $(window).on('hashchange', function(e, initial) {
            if (location.hash.indexOf('#preview:') != 0) {
                $('.attachment-preview-dialog').trigger('ajaxDialog:close', [true]);
            } else {
                if (initial && HISTORY_API_SUPPORTED) {
                    var hash = location.hash;
                    // start with a clean state, i.e. [..., page, page+preview]
                    history.replaceState({}, document.title, pageURL);
                    history.pushState({}, document.title, location.href + hash);
                }
                var id = location.hash.split('#preview:')[1];
                previewAttachment(id);
            }
        }).triggerHandler('hashchange', [true]);

        attachment.on('click', function(e) {
            if (e.which != 1 || e.shiftKey || e.metaKey || e.ctrlKey || e.altKey) {
                // ignore middle clicks and modifier-clicks - people should be able to open
                // an attachment in a new tab/window skipping the previewer, even if they use
                // a weird mouse with less than three buttons.
                return;
            }
            e.preventDefault();
            location.hash = '#preview:{0}'.format($(this).data('attachmentId'));
        });

        function clearHash() {
            if (HISTORY_API_SUPPORTED) {
                // if we have the history api, we can assume that the previous state is the same page without
{'fraction_non_alphanumeric': 0.13852716659182757, 'fraction_numerical': 0.003143242029636282, 'mean_word_length': 1.784375, 'pattern_counts': {'":': 0, '<': 3, '<?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': '405857', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1127, 'n_words': 275}