<commit_before>// © 2009–2010 EPFL/LAMP
// code by <NAME> with contributions by <NAME> and <NAME>

$(document).ready(function(){

    var controls = {
        visibility: {
            publicOnly: $("#visbl").find("> ol > li.public"),
            all: $("#visbl").find("> ol > li.all")
        }
    };

    // Escapes special characters and returns a valid jQuery selector
    function escapeJquery(str){
        return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=<>\|])/g, '\\$1');
    }

    function toggleVisibilityFilter(ctrlToEnable, ctrToDisable) {
        if (ctrlToEnable.hasClass("out")) {
            ctrlToEnable.removeClass("out").addClass("in");
            ctrToDisable.removeClass("in").addClass("out");
            filter();
        }
    }

    controls.visibility.publicOnly.click(function () {
        toggleVisibilityFilter(controls.visibility.publicOnly, controls.visibility.all);
    });

    controls.visibility.all.click(function () {
        toggleVisibilityFilter(controls.visibility.all, controls.visibility.publicOnly);
    });

    function exposeMember(jqElem) {
        var jqElemParent = jqElem.parent(),
            parentName = jqElemParent.attr("name"),
            linearizationName = /^([^#]*)(#.*)?$/gi.exec(parentName)[1];

        // switch visibility filter if necessary
        if (jqElemParent.attr("visbl") == "prt") {
            toggleVisibilityFilter(controls.visibility.all, controls.visibility.publicOnly);
        }

        // toggle appropriate linearization buttons
        if (linearizationName) {
            $("#linearization li.out[name='" + linearizationName + "']").removeClass("out").addClass("in");
        }

        filter();
        window.scrollTo(0, 0);
        jqElemParent.effect("highlight", {color: "#FFCC85"}, 3000);
        $('html,body').animate({scrollTop: jqElemParent.offset().top}, 1000);
    }

    var isHiddenClass = function (name) {
        return name == 'scala.Any' ||
               name == 'scala.AnyRef';
    };

    var isHidden = function (elem) {
        return $(elem).attr("data-hidden") == 'true';
    };

    $("#linearization li:gt(0)").filter(function(){
        return isHiddenClass($(this).attr("name"));
    }).removeClass("in").addClass("out");

    $("#implicits li").filter(function(){
        return isHidden(this);
    }).removeClass("in").addClass("out");

    // Pre-filter members
    filter();

    // Member filter box
    var input = $("#textfilter input");
    input.bind("keyup", function(event) {

        switch ( event.keyCode ) {

        case 27: // escape key
            input.val("");
            filter(true);
            break;

        case 38: // up
            input.val("");
            filter(false);
            window.scrollTo(0, $("body").offset().top);
            input.focus();
            break;

        case 33: //page up
            input.val("");
            filter(false);
            break;

        case 34: //page down
            input.val("");
            filter(false);
            break;

        default:
            window.scrollTo(0, $("#mbrsel").offset().top);
            filter(true);
            break;

        }
    });
    input.focus(function(event) {
        input.select();
    });
    $("#textfilter > .post").click(function() {
        $("#textfilter input").attr("value", "");
        filter();
    });
    $(document).keydown(function(event) {

        if (event.keyCode == 9) { // tab
            $("#index-input", window.parent.document).focus();
            input.attr("value", "");
            return false;
        }
    });

    $("#linearization li").click(function(){
        if ($(this).hasClass("in")) {
            $(this).removeClass("in");
            $(this).addClass("out");
        }
        else if ($(this).hasClass("out")) {
            $(this).removeClass("out");
            $(this).addClass("in");
        }
        filter();
    });

    $("#implicits li").click(function(){
        if ($(this).hasClass("in")) {
            $(this).removeClass("in");
            $(this).addClass("out");
        }
        else if ($(this).hasClass("out")) {
            $(this).removeClass("out");
            $(this).addClass("in");
        }
        filter();
    });

    $("#mbrsel > div.ancestors > ol > li.hideall").click(function() {
        $("#linearization li.in").removeClass("in").addClass("out");
        $("#linearization li:first").removeClass("out").addClass("in");
        $("#implicits li.in").removeClass("in").addClass("out");

        if ($(this).hasClass("out") && $("#mbrsel > div.ancestors > ol > li.showall").hasClass("in")) {
            $(this).removeClass("out").addClass("in");
            $("#mbrsel > div.ancestors > ol > li.showall").removeClass("in").addClass("out");
        }

        filter();
    })
    $("#mbrsel > div.ancestors > ol > li.showall").click(function() {
        var filteredLinearization =
            $("#linearization li.out").filter(function() {
                return ! isHiddenClass($(this).attr("name"));
            });
        filteredLinearization.removeClass("out").addClass("in");

        var filteredImplicits =
        $("#implicits li.out").filter(function() {
            return ! isHidden(this);
        });
        filteredImplicits.removeClass("out").addClass("in");

        if ($(this).hasClass("out") && $("#mbrsel > div.ancestors > ol > li.hideall").hasClass("in")) {
            $(this).removeClass("out").addClass("in");
            $("#mbrsel > div.ancestors > ol > li.hideall").removeClass("in").addClass("out");
        }

        filter();
    });
    $("#visbl > ol > li.public").click(function() {
        if ($(this).hasClass("out")) {<commit_msg>SI-8940 Scaladoc: Fix "Order by Alphabetical" button<commit_after>// © 2009–2010 EPFL/LAMP
// code by <NAME> with contributions by <NAME> and <NAME>

$(document).ready(function(){

    var controls = {
        visibility: {
            publicOnly: $("#visbl").find("> ol > li.public"),
            all: $("#visbl").find("> ol > li.all")
        }
    };

    // Escapes special characters and returns a valid jQuery selector
    function escapeJquery(str){
        return str.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=<>\|])/g, '\\$1');
    }

    function toggleVisibilityFilter(ctrlToEnable, ctrToDisable) {
        if (ctrlToEnable.hasClass("out")) {
            ctrlToEnable.removeClass("out").addClass("in");
            ctrToDisable.removeClass("in").addClass("out");
            filter();
        }
    }

    controls.visibility.publicOnly.click(function () {
        toggleVisibilityFilter(controls.visibility.publicOnly, controls.visibility.all);
    });

    controls.visibility.all.click(function () {
        toggleVisibilityFilter(controls.visibility.all, controls.visibility.publicOnly);
    });

    function exposeMember(jqElem) {
        var jqElemParent = jqElem.parent(),
            parentName = jqElemParent.attr("name"),
            linearizationName = /^([^#]*)(#.*)?$/gi.exec(parentName)[1];

        // switch visibility filter if necessary
        if (jqElemParent.attr("visbl") == "prt") {
            toggleVisibilityFilter(controls.visibility.all, controls.visibility.publicOnly);
        }

        // toggle appropriate linearization buttons
        if (linearizationName) {
            $("#linearization li.out[name='" + linearizationName + "']").removeClass("out").addClass("in");
        }

        filter();
        window.scrollTo(0, 0);
        jqElemParent.effect("highlight", {color: "#FFCC85"}, 3000);
        $('html,body').animate({scrollTop: jqElemParent.offset().top}, 1000);
    }

    var isHiddenClass = function (name) {
        return name == 'scala.Any' ||
               name == 'scala.AnyRef';
    };

    var isHidden = function (elem) {
        return $(elem).attr("data-hidden") == 'true';
    };

    $("#linearization li:gt(0)").filter(function(){
        return isHiddenClass($(this).attr("name"));
    }).removeClass("in").addClass("out");

    $("#implicits li").filter(function(){
        return isHidden(this);
    }).removeClass("in").addClass("out");

    // Pre-filter members
    filter();

    // Member filter box
    var input = $("#textfilter input");
    input.bind("keyup", function(event) {

        switch ( event.keyCode ) {

        case 27: // escape key
            input.val("");
            filter(true);
            break;

        case 38: // up
            input.val("");
            filter(false);
            window.scrollTo(0, $("body").offset().top);
            input.focus();
            break;

        case 33: //page up
            input.val("");
            filter(false);
            break;

        case 34: //page down
            input.val("");
            filter(false);
            break;

        default:
            window.scrollTo(0, $("#mbrsel").offset().top);
            filter(true);
            break;

        }
    });
    input.focus(function(event) {
        input.select();
    });
    $("#textfilter > .post").click(function() {
        $("#textfilter input").attr("value", "");
        filter();
    });
    $(document).keydown(function(event) {

        if (event.keyCode == 9) { // tab
            $("#index-input", window.parent.document).focus();
            input.attr("value", "");
            return false;
        }
    });

    $("#linearization li").click(function(){
        if ($(this).hasClass("in")) {
            $(this).removeClass("in");
            $(this).addClass("out");
        }
        else if ($(this).hasClass("out")) {
            $(this).removeClass("out");
            $(this).addClass("in");
        }
        filter();
    });

    $("#implicits li").click(function(){
        if ($(this).hasClass("in")) {
            $(this).removeClass("in");
            $(this).addClass("out");
        }
        else if ($(this).hasClass("out")) {
            $(this).removeClass("out");
            $(this).addClass("in");
        }
        filter();
    });

    $("#mbrsel > div.ancestors > ol > li.hideall").click(function() {
        $("#linearization li.in").removeClass("in").addClass("out");
        $("#linearization li:first").removeClass("out").addClass("in");
        $("#implicits li.in").removeClass("in").addClass("out");

        if ($(this).hasClass("out") && $("#mbrsel > div.ancestors > ol > li.showall").hasClass("in")) {
            $(this).removeClass("out").addClass("in");
            $("#mbrsel > div.ancestors > ol > li.showall").removeClass("in").addClass("out");
        }

        filter();
    })
    $("#mbrsel > div.ancestors > ol > li.showall").click(function() {
        var filteredLinearization =
            $("#linearization li.out").filter(function() {
                return ! isHiddenClass($(this).attr("name"));
            });
        filteredLinearization.removeClass("out").addClass("in");

        var filteredImplicits =
        $("#implicits li.out").filter(function() {
            return ! isHidden(this);
        });
        filteredImplicits.removeClass("out").addClass("in");

        if ($(this).hasClass("out") && $("#mbrsel > div.ancestors > ol > li.hideall").hasClass("in")) {
            $(this).removeClass("out").addClass("in");
            $("#mbrsel > div.ancestors > ol > li.hideall").removeClass("in").addClass("out");
        }

        filter();
    });
    $("#order > ol > li.alpha").click(function() {
        if ($(this).hasClass("out")) {
{'fraction_non_alphanumeric': 0.1966468739084876, 'fraction_numerical': 0.0062871114215857496, 'mean_word_length': 2.1690647482014387, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 61, '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': '2891254', 'n_tokens_mistral': 3308, 'n_tokens_neox': 3222, 'n_words': 536}