<commit_before>'use strict';

/* Constants */
//messages
const HIDE_MENU_MSG = 'hide_menu';
const MENU_MSG = 'menu';
const NEXTIMAGE_MSG = 'menu_next_image';
const SETTINGS_MSG = 'menu_settings';
//preferences
const SHOW_MENU_PREF = 'show_menu';

//called on document ready
$(function() {
    //register click handlers
    $('#settings').click(function(event) {
        TabTrekkerMenu.handleClick(SETTINGS_MSG, event);
    });
    $('#next_image').click(function(event) {
        if(TabTrekkerImages.shouldShowNextImage()) {
            TabTrekkerMenu.handleClick(NEXTIMAGE_MSG, event);
        }
    });
});

/**
 * Menu module.
 */
var TabTrekkerMenu = {

    initMenu: function(data) {
        if(!data) {
            return;
        }
        TabTrekkerMenu.setMenuVisibility(data[SHOW_MENU_PREF]);
    },

    /**
     * Handles a click event by sending a message of the event to the addon. 
     */
    handleClick: function(message, event) {<commit_msg>Add fade animation to history dropdown<commit_after>'use strict';

/* Constants */
//messages
const HIDE_MENU_MSG = 'hide_menu';
const MENU_MSG = 'menu';
const NEXTIMAGE_MSG = 'menu_next_image';
const SETTINGS_MSG = 'menu_settings';
//preferences
const SHOW_MENU_PREF = 'show_menu';
//other
const DROPDOWN_TRANSITION = 200;

//called on document ready
$(function() {
    //register click handlers
    $('#settings').click(function(event) {
        TabTrekkerMenu.handleClick(SETTINGS_MSG, event);
    });
    $('#next_image').click(function(event) {
        if(TabTrekkerImages.shouldShowNextImage()) {
            TabTrekkerMenu.handleClick(NEXTIMAGE_MSG, event);
        }
    });
    //dropdown animation
    $('.dropdown').on('show.bs.dropdown hide.bs.dropdown', function(event) {
        $(this).find('.dropdown-menu').first().stop(true, true)
            .fadeToggle(DROPDOWN_TRANSITION);
    });
});

/**
 * Menu module.
 */
var TabTrekkerMenu = {

    initMenu: function(data) {
        if(!data) {
            return;
        }
        TabTrekkerMenu.setMenuVisibility(data[SHOW_MENU_PREF]);
    },

    /**
     * Handles a click event by sending a message of the event to the addon. 
     */
    handleClick: function(message, event) {
{'fraction_non_alphanumeric': 0.13961922030825022, 'fraction_numerical': 0.0013599274705349048, 'mean_word_length': 3.0794824399260627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3787567', 'n_tokens_mistral': 725, 'n_tokens_neox': 707, 'n_words': 139}