<commit_before>/*
 * Depends on jquery 1.10
 */

window.gEnableTocStatusUpdate = true;
window.gEnableTocListAutoScroll = true;
window.gMouseInSidebarTocList = false;
window.gFixedHeaderHeight = 32;
window.gFixedTocListOffsetTop = 111;
window.gFootnotePopoverMaxWidth = 300;
window.gActiveTocClass = 'niu2-active-toc'

$(document).ready(function() {
    initGoogleCSEAnimation();
});

function onContentLoaded() {
    initFootnote();
    $(window).scroll(function() {
        toggleSidebarTocFixed();
        locateTocInViewport();
    });
    //window.setInterval(updateFootnoteStatus, 500);
    updateFootnoteStatus();

    // detach toc list before inserting many
    // toc index <span>, for performance reason
    getTocList().detach();
    initTocListIndex(getTocList());
    getTocList().appendTo(getSidebarToc());

    initTocLinkScrollAnimation();
    initAllTocsCtrl();
    locateTocInViewport();
}

function toggleSidebarTocFixed() {
    var sidebarToc = $('#niu2-sidebar-toc');
    var sidebarMeta = $('#niu2-sidebar-meta');
    var vtop = $(window).scrollTop();
    var vpos = sidebarMeta.offset().top + sidebarMeta.height() - 55;
    if (vtop > vpos && 'niu2-sidebar' == sidebarToc.attr('class')) {
        sidebarToc.attr('class', 'niu2-sidebar niu2-sidebar-toc-fixed');
    } else if (vtop <= vpos && 'niu2-sidebar' != sidebarToc.attr('class')) {
        sidebarToc.attr('class', 'niu2-sidebar');
    }<commit_msg>set max-width of sidebar toc<commit_after>/*
 * Depends on jquery 1.10
 */

window.gEnableTocStatusUpdate = true;
window.gEnableTocListAutoScroll = true;
window.gMouseInSidebarTocList = false;
window.gFixedHeaderHeight = 32;
window.gFixedTocListOffsetTop = 111;
window.gFootnotePopoverMaxWidth = 300;
window.gActiveTocClass = 'niu2-active-toc'

$(document).ready(function() {
    initGoogleCSEAnimation();
});

function onContentLoaded() {
    initFootnote();
    $(window).scroll(function() {
        toggleSidebarTocFixed();
        locateTocInViewport();
    });
    //window.setInterval(updateFootnoteStatus, 500);
    updateFootnoteStatus();

    // detach toc list before inserting many
    // toc index <span>, for performance reason
    getTocList().detach();
    initTocListIndex(getTocList());
    getTocList().appendTo(getSidebarToc());

    setSidebarTocMaxWidth();

    initTocLinkScrollAnimation();
    initAllTocsCtrl();
    locateTocInViewport();
}

function setSidebarTocMaxWidth() {
    getSidebarToc.attr('style', 'max-width:' + getSidebarToc().width() + 'px;');
}

function toggleSidebarTocFixed() {
    var sidebarToc = $('#niu2-sidebar-toc');
    var sidebarMeta = $('#niu2-sidebar-meta');
    var vtop = $(window).scrollTop();
    var vpos = sidebarMeta.offset().top + sidebarMeta.height() - 55;
    if (vtop > vpos && 'niu2-sidebar' == sidebarToc.attr('class')) {
        sidebarToc.attr('class', 'niu2-sidebar niu2-sidebar-toc-fixed');
    } else if (vtop <= vpos && 'niu2-sidebar' != sidebarToc.attr('class')) {
        sidebarToc.attr('class', 'niu2-sidebar');
    }
{'fraction_non_alphanumeric': 0.15254798146922569, 'fraction_numerical': 0.01588352084712111, 'mean_word_length': 4.123728813559322, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2438303', 'n_tokens_mistral': 1063, 'n_tokens_neox': 991, 'n_words': 171}