<commit_before>/* Bootstrap JavaScript stuff */
$(document).ready(function() {
    /* Scroll to top (shamelessly copied from PHP.net) */
    (function() {
        var settings = {
            text: 'To Top',
            min: 800,
            inDelay: 600,
            outDelay: 400,
            containerID: 'to-top',
            containerHoverID: 'to-top-hover',
            scrollSpeed: 400,
            easingType: 'linear'
        };

        var toTopHidden = true;
        var toTop = $('#' + settings.containerID);

        toTop.click(function(e) {
            e.preventDefault();
            $.scrollTo(0, settings.scrollSpeed, {easing: settings.easingType});
        });

        Mousetrap.bind("t t", function(e) {
            $.scrollTo(0, settings.scrollSpeed, {easing: settings.easingType});
        });

        $(window).scroll(function() {
            var sd = $(this).scrollTop();
            if (sd > settings.min && toTopHidden)
            {
              toTop.fadeIn(settings.inDelay);
              toTopHidden = false;
            }
            else if(sd <= settings.min && ! toTopHidden)
            {
              toTop.fadeOut(settings.outDelay);
              toTopHidden = true;
            }
        });
    })();

    /* Fancy scroll the whole window */
    $('#faq #content a').click(function(){
        $.scrollTo(this.hash, 500);
    });

    /* Check for stuff that needs to be toggled */
    if ( (typeof toggle_items != 'undefined' && toggle_items instanceof Array) ) {
        enable_toggle(toggle_items);
    }

    $("#translations .more").click(function () {
        $("#translations #incomplete").toggle();
    });

    /* Mousetraps */
    Mousetrap.bind("t u x enter", function(e) {
        $("header #logo i").removeClass("fa-home").addClass("fa-linux");
    });
});

/* Enable toggle for elements with ID in array $items */
function enable_toggle(items) {
    for (var i=0; i < items.length; i++) {
        (function(i) {
            var id = items[i];
            $("#"+id).click(function () {
                $("#"+id+"-toggee").toggle();
                /* Toggle Font Awesome icon if present */
                if ( $("#"+id).has(".fa") )
                    toggle_item_fa_icon(id);
            });
        })(i);
    }
}

/* Toggles the Font Awesome icon for a toggle item */
function toggle_item_fa_icon(id) {
    var icon = $("#"+id+" .fa");
    if ( $("#"+id+"-toggee").is(":visible") )
        icon.removeClass("fa-plus-square-o").addClass("fa-minus-square-o");
    else
        icon.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");
}
<commit_msg>Show the To Top button earlier<commit_after>/* Bootstrap JavaScript stuff */
$(document).ready(function() {
    /* Scroll to top (shamelessly copied from PHP.net) */
    (function() {
        var settings = {
            text: 'To Top',
            min: 200,
            inDelay: 600,
            outDelay: 400,
            containerID: 'to-top',
            containerHoverID: 'to-top-hover',
            scrollSpeed: 400,
            easingType: 'linear'
        };

        var toTopHidden = true;
        var toTop = $('#' + settings.containerID);

        toTop.click(function(e) {
            e.preventDefault();
            $.scrollTo(0, settings.scrollSpeed, {easing: settings.easingType});
        });

        Mousetrap.bind("t t", function(e) {
            $.scrollTo(0, settings.scrollSpeed, {easing: settings.easingType});
        });

        $(window).scroll(function() {
            var sd = $(this).scrollTop();
            if (sd > settings.min && toTopHidden)
            {
              toTop.fadeIn(settings.inDelay);
              toTopHidden = false;
            }
            else if(sd <= settings.min && ! toTopHidden)
            {
              toTop.fadeOut(settings.outDelay);
              toTopHidden = true;
            }
        });
    })();

    /* Fancy scroll the whole window */
    $('#faq #content a').click(function(){
        $.scrollTo(this.hash, 500);
    });

    /* Check for stuff that needs to be toggled */
    if ( (typeof toggle_items != 'undefined' && toggle_items instanceof Array) ) {
        enable_toggle(toggle_items);
    }

    $("#translations .more").click(function () {
        $("#translations #incomplete").toggle();
    });

    /* Mousetraps */
    Mousetrap.bind("t u x enter", function(e) {
        $("header #logo i").removeClass("fa-home").addClass("fa-linux");
    });
});

/* Enable toggle for elements with ID in array $items */
function enable_toggle(items) {
    for (var i=0; i < items.length; i++) {
        (function(i) {
            var id = items[i];
            $("#"+id).click(function () {
                $("#"+id+"-toggee").toggle();
                /* Toggle Font Awesome icon if present */
                if ( $("#"+id).has(".fa") )
                    toggle_item_fa_icon(id);
            });
        })(i);
    }
}

/* Toggles the Font Awesome icon for a toggle item */
function toggle_item_fa_icon(id) {
    var icon = $("#"+id+" .fa");
    if ( $("#"+id+"-toggee").is(":visible") )
        icon.removeClass("fa-plus-square-o").addClass("fa-minus-square-o");
    else
        icon.removeClass("fa-minus-square-o").addClass("fa-plus-square-o");
}

{'fraction_non_alphanumeric': 0.16663496290660074, 'fraction_numerical': 0.0068480121742438655, 'mean_word_length': 1.863834422657952, 'pattern_counts': {'":': 2, '<': 7, '<?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': '2579177', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1539, 'n_words': 327}