<commit_before>$(document).ready(function () {
    if (!isTouchDevice) {
        $('#mara-navigation').mouseover(expandNavigation);
        $('#mara-navigation').mouseleave(collapseNavigation);
    }

    var navigationUrl = '/mara-app/navigation-bar';
    $.ajax({
        url: navigationUrl,
        success: function (navigationEntries) {
            $('#mara-navigation').empty().append(navigationEntries).fadeIn(500);

            // enable tooltips
            $('[data-toggle="tooltip"]').tooltip();

            // highlight navigation entry for current uri
            highlightNavigationEntry(window.location.pathname + window.location.search + window.location.hash);

            window.onhashchange = function () {
                highlightNavigationEntry(window.location.pathname + window.location.search + window.location.hash);
            };

            localStorage.setItem('navigation-bar', navigationEntries);
        },
        error: function (xhr, textStatus, errorThrown) {
            showAlert(icon + textStatus + ' while fetching "<a href="' + navigationUrl + '">' + navigationUrl + '</a>": ' + errorThrown,
                'danger');
            $('#mara-navigation').empty().append('<div class="fa fa-bug"> </div>');
        },
    });

    // float headers of all tables with class `.mara-table`
    floatMaraTableHeaders();
});

// the nav entry that matches the current page uri best
var currentNavigationEntry;<commit_msg>fix error handling when navigation bar can't be loaded<commit_after>$(document).ready(function () {
    if (!isTouchDevice) {
        $('#mara-navigation').mouseover(expandNavigation);
        $('#mara-navigation').mouseleave(collapseNavigation);
    }

    var navigationUrl = '/mara-app/navigation-bar';
    $.ajax({
        url: navigationUrl,
        success: function (navigationEntries) {
            $('#mara-navigation').empty().append(navigationEntries).fadeIn(500);

            // enable tooltips
            $('[data-toggle="tooltip"]').tooltip();

            // highlight navigation entry for current uri
            highlightNavigationEntry(window.location.pathname + window.location.search + window.location.hash);

            window.onhashchange = function () {
                highlightNavigationEntry(window.location.pathname + window.location.search + window.location.hash);
            };

            localStorage.setItem('navigation-bar', navigationEntries);
        },
        error: function (xhr, textStatus, errorThrown) {
            showAlert(textStatus + ' while fetching "<a href="' + navigationUrl + '">' + navigationUrl + '</a>": ' + errorThrown,
                'danger');
            $('#mara-navigation').empty().append('<div class="fa fa-bug"> </div>');
        },
    });

    // float headers of all tables with class `.mara-table`
    floatMaraTableHeaders();
});

// the nav entry that matches the current page uri best
var currentNavigationEntry;
{'fraction_non_alphanumeric': 0.14402173913043478, 'fraction_numerical': 0.0020380434782608695, 'mean_word_length': 2.6766541822721597, 'pattern_counts': {'":': 2, '<': 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': '1967519', 'n_tokens_mistral': 761, 'n_tokens_neox': 740, 'n_words': 156}