<commit_before>var App;
App = (function() {

    var that = {};

    /**
     * @return {string}
     */
    that.GetBaseUrl = function() {
        return window.location.protocol + "//" + window.location.host + "/";
    };

    /**
     * @return {string}
     */
    that.GetSegmentUrl = function(segment) {
        var pathArray = window.location.pathname.split('/');
        return pathArray[segment];
    };

    that.init = function() {
        $(function() {
            $('[data-toggle="tooltip"]').tooltip({
                container: "body"
            })
        });
        that.scroll_top();
        if (that.GetSegmentUrl(1) != "topic") {
            that.ChatBox();
        }
    };

    that.ChatBox = function() {
        var divmessages = $('.scroll-chatbox-messages');
        var divusers = $('.scroll-chatbox-users');
        var expandbtn = $('.expand-chat');

        //Initialize scrollbar
        divmessages.scrollTop(divmessages[0].scrollHeight);
        divmessages.scrollbar();
        divusers.scrollbar();

        //Expand chatbox
        if (!Cookies.get('chatbox_expanded')) {
            Cookies.set("chatbox_expanded", "container")
        }

        $(".chatbox-bloc").parent().addClass(Cookies.get('chatbox_expanded'));

        $(".chatbox-bloc").slideToggle();

        expandbtn.click(function() {
            if ($(".chatbox-bloc").parent().hasClass("container")) {
                $(".chatbox-bloc").parent().removeClass("container").addClass("container-fluid");
                Cookies.set("chatbox_expanded", "container-fluid")
            } else {
                $(".chatbox-bloc").parent().removeClass("container-fluid").addClass("container");
                Cookies.set("chatbox_expanded", "container")
            }
        });

    };
    that.scroll_top = function() {
        $(document).on('scroll', function() {
            if ($(window).scrollTop() > 100) {
                $('.scroll-top-wrapper').addClass('show');
                $("header").addClass("fixed");
                $("body").css("margin-top", "25px");
            } else {
                $('.scroll-top-wrapper').removeClass('show');
                $("header").removeClass("fixed");
                $("body").css("margin-top", "56px");
            }
        });

        $('.scroll-top-wrapper').on('click', scrollToTop);

        function scrollToTop() {
            verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
            element = $('body');
            offset = element.offset();
            offsetTop = offset.top;
            $('html, body').animate({
                scrollTop: offsetTop
            }, 500, 'linear');
        }
    };


    return that;

})();

$(document).ready(function() {
    App.init();<commit_msg>Typo in button for scroll to top<commit_after>var App;
App = (function() {

    var that = {};

    /**
     * @return {string}
     */
    that.GetBaseUrl = function() {
        return window.location.protocol + "//" + window.location.host + "/";
    };

    /**
     * @return {string}
     */
    that.GetSegmentUrl = function(segment) {
        var pathArray = window.location.pathname.split('/');
        return pathArray[segment];
    };

    that.init = function() {
        $(function() {
            $('[data-toggle="tooltip"]').tooltip({
                container: "body"
            })
        });
        that.scroll_top();
        if (that.GetSegmentUrl(1) != "topic") {
            that.ChatBox();
        }
    };

    that.ChatBox = function() {
        var divmessages = $('.scroll-chatbox-messages');
        var divusers = $('.scroll-chatbox-users');
        var expandbtn = $('.expand-chat');

        //Initialize scrollbar
        divmessages.scrollTop(divmessages[0].scrollHeight);
        divmessages.scrollbar();
        divusers.scrollbar();

        //Expand chatbox
        if (!Cookies.get('chatbox_expanded')) {
            Cookies.set("chatbox_expanded", "container")
        }

        $(".chatbox-bloc").parent().addClass(Cookies.get('chatbox_expanded'));

        $(".chatbox-bloc").slideToggle();

        expandbtn.click(function() {
            if ($(".chatbox-bloc").parent().hasClass("container")) {
                $(".chatbox-bloc").parent().removeClass("container").addClass("container-fluid");
                Cookies.set("chatbox_expanded", "container-fluid")
            } else {
                $(".chatbox-bloc").parent().removeClass("container-fluid").addClass("container");
                Cookies.set("chatbox_expanded", "container")
            }
        });

    };
    that.scroll_top = function() {

        $(window).on('scroll', function() {
            if ($(this).scrollTop() > 100) {
                if ($(this).scrollTop() > $(document).height() - $(this).height() - 100) {
                    $('.scroll-top-wrapper').css("bottom", "230px");
                } else {
                    $('.scroll-top-wrapper').css("bottom", "30px");
                }
                $('.scroll-top-wrapper').addClass('show');
                $("header").addClass("fixed");
                $("body").css("margin-top", "25px");
            } else {
                $('.scroll-top-wrapper').removeClass('show');
                $("header").removeClass("fixed");
                $("body").css("margin-top", "56px");
            }
        });

        $(".scroll-top-wrapper").click(function() {
            $("html, body").animate({
                scrollTop: 0
            }, 600);
            return false;
        });

    };


    return that;

})();

$(document).ready(function() {
    App.init();
{'fraction_non_alphanumeric': 0.18738898756660746, 'fraction_numerical': 0.006039076376554174, 'mean_word_length': 1.8239719157472418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2987455', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1526, 'n_words': 218}