<commit_before>const SELECTED = 'warpjs-vocabulary-letter-selected';

module.exports = ($) => {
    $(document).on('click', '.warpjs-panel-items-vocabulary .warpjs-vocabulary-letters .warpjs-vocabulary-letter', function() {
        const vocabularyPanelItem = $(this).closest('.warpjs-panel-items-vocabulary');

        $('.warpjs-vocabulary-letters .warpjs-vocabulary-letter', vocabularyPanelItem).removeClass(SELECTED);
        $(this).addClass(SELECTED);

        $('.warpjs-vocabulary-definitions .warpjs-vocabulary-definition', vocabularyPanelItem).hide();
        $(`.warpjs-vocabulary-definitions .warpjs-vocabulary-definition[data-warpjs-letter="${$(this).data('warpjsLetter')}"]`, vocabularyPanelItem).show();
    });
};<commit_msg>- #133: Auto-open first vocabulary element<commit_after>const SELECTED = 'warpjs-vocabulary-letter-selected';

module.exports = ($) => {
    $(document).on('click', '.warpjs-panel-items-vocabulary .warpjs-vocabulary-letters .warpjs-vocabulary-letter', function() {
        const vocabularyPanelItem = $(this).closest('.warpjs-panel-items-vocabulary');

        $('.warpjs-vocabulary-letters .warpjs-vocabulary-letter', vocabularyPanelItem).removeClass(SELECTED);
        $(this).addClass(SELECTED);

        $('.warpjs-vocabulary-definitions .warpjs-vocabulary-definition', vocabularyPanelItem).hide();
        $(`.warpjs-vocabulary-definitions .warpjs-vocabulary-definition[data-warpjs-letter="${$(this).data('warpjsLetter')}"]`, vocabularyPanelItem).show();
    });

    // Auto-open every first letter.
    $('.warpjs-relationship-style-Vocabulary').each((i, element) => {
        $('.warpjs-panel-items-vocabulary .warpjs-vocabulary-letters .warpjs-vocabulary-letter:first-child', element).trigger('click');
    });
};
{'fraction_non_alphanumeric': 0.18150879183210436, 'fraction_numerical': 0.0017016449234259785, 'mean_word_length': 4.582278481012659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3809739', 'n_tokens_mistral': 591, 'n_tokens_neox': 565, 'n_words': 59}