<commit_before>ignite.panels = function() {
    var init;
    init = function() {
        var triggers = $('h2.trigger'),
            open,
            open_trigger;
        triggers.each(function(index) {
            var that = $(this),
                btn = $('<button class="box" tab-index="-1">' + that.text() + ' <span class="inst">(click to expand)</span></button>'),
                nxt = that.next('div.panel');
            that.html(btn);
            if (index === 0) {
                nxt.addClass('open-panel');
                btn.addClass('open-panel');
                open = nxt;
                open_trigger = btn;
            }
            btn.click(function() {
                open.removeClass('open-panel');
                open_trigger.removeClass('open-panel');
                nxt.addClass('open-panel');
                btn.addClass('open-panel');
                open = nxt;
                open_trigger = btn;
                open_trigger.focus();
            });
        });
    };
    return {
        'init': init
    };
}();
<commit_msg>Including a fix for direct linking to IDs and having what they link to being invisible<commit_after>ignite.panels = function() {
    var init,
        hash = window.location.hash;
    init = function() {
        var triggers = $('h2.trigger'),
            open,
            open_trigger;
        triggers.each(function(index) {
            var that = $(this),
                btn = $('<button class="box" tab-index="-1">' + that.text() + ' <span class="inst">(click to expand)</span></button>'),
                nxt = that.next('div.panel');
            that.html(btn);
            if (index === 0) {
                nxt.addClass('open-panel');
                btn.addClass('open-panel');
                open = nxt;
                open_trigger = btn;
            }
            btn.click(function() {
                open.removeClass('open-panel');
                open_trigger.removeClass('open-panel');
                nxt.addClass('open-panel');
                btn.addClass('open-panel');
                open = nxt;
                open_trigger = btn;
                open_trigger.focus();
            });
        });
        // quick fix to ensure that if we're linking direct to an ID the relevant section is open
        if (hash) {
            var origin = $(hash);
            if (origin.length) {
                origin.closest('section').find('button').click();
            }
        }
    };
    return {
        'init': init
    };
}();

{'fraction_non_alphanumeric': 0.14569273521238588, 'fraction_numerical': 0.0023818975784041284, 'mean_word_length': 1.3908918406072106, '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': '5879535', 'n_tokens_mistral': 693, 'n_tokens_neox': 658, 'n_words': 140}