<commit_before>import $ from "jquery";
// Show appropriate pill based on #anchor in URL


$(function () {
    var hash = window.location.hash;
    hash && $('ul.nav a[href="' + hash + '"]').tab('show');

    $('.nav-tabs a').click(function (e) {
        $(this).tab('show');
        var scrollmem = $('body').scrollTop() || $('html').scrollTop();
        window.location.hash = this.hash;
        $('html,body').scrollTop(scrollmem);
    });
});
<commit_msg>Remove jQuery dependency from `tab-anchor.js`<commit_after>// Show appropriate pill based on #anchor in URL
import {Tab} from 'bootstrap';

function navigateToAnchorTab() {
    const hash = window.location.hash;

    if (hash) {
        new Tab(document.querySelector(`ul.nav a[href="${hash}"]`)).show();
    }
}

document.addEventListener('DOMContentLoaded', () => {
    navigateToAnchorTab();

    for (const el of document.querySelectorAll('.nav-tabs a')) {
        el.addEventListener('click', (e) => {
                // XXX in the jQuery variant, was some scrolling mechanism. not sure what it did.
                // const scrollmem = $('body').scrollTop() || $('html').scrollTop();
                window.location.hash = e.currentTarget.hash;
                // $('html,body').scrollTop(scrollmem);
            }
        )
    }
});

{'fraction_non_alphanumeric': 0.18090839107005388, 'fraction_numerical': 0.0, 'mean_word_length': 2.7249283667621778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1858169', 'n_tokens_mistral': 381, 'n_tokens_neox': 367, 'n_words': 89}