<commit_before>define([
    'jquery',
    '/customize/application_config.js',
    '/common/cryptpad-common.js',
    '/customize/header.js',
], function ($, Config, Cryptpad) {

    window.APP = {
        Cryptpad: Cryptpad,
    };

    var Messages = Cryptpad.Messages;

    $(function () {
        var $main = $('#mainBlock');

        $(window).click(function () {
            $('.cryptpad-dropdown').hide();
        });

        // main block is hidden in case javascript is disabled
        $main.removeClass('hidden');

        // Make sure we don't display non-translated content (empty button)
        $main.find('#data').removeClass('hidden');

        if (Cryptpad.isLoggedIn()) {
            var name = localStorage[Cryptpad.userNameKey] || sessionStorage[Cryptpad.userNameKey];
            var $loggedInBlock = $main.find('#loggedIn');
            var $hello = $loggedInBlock.find('#loggedInHello');
            var $logout = $loggedInBlock.find('#loggedInLogOut');

            if (name) {
                $hello.text(Messages._getKey('login_hello', [name]));
            } else {
                $hello.text(Messages.login_helloNoName);
            }
            $('#buttons').find('.nologin').hide();

            $logout.click(function () {
                Cryptpad.logout(function () {
                    window.location.reload();
                });
            });

            $loggedInBlock.removeClass('hidden');
        }
        else {
            $main.find('#userForm').removeClass('hidden');
            $('#name').focus();
        }

        var displayCreateButtons = function () {
            var $parent = $('#buttons');
            var options = [];
            var $container = $('<div>', {'class': 'dropdown-bar'}).appendTo($parent);
            Config.availablePadTypes.forEach(function (el) {
                if (el === 'drive') { return; }<commit_msg>redirect to drive if logged in<commit_after>define([
    'jquery',
    '/customize/application_config.js',
    '/common/cryptpad-common.js',
    '/customize/header.js',
], function ($, Config, Cryptpad) {

    window.APP = {
        Cryptpad: Cryptpad,
    };

    var Messages = Cryptpad.Messages;

    $(function () {
        var $main = $('#mainBlock');

        $(window).click(function () {
            $('.cryptpad-dropdown').hide();
        });

        // main block is hidden in case javascript is disabled
        $main.removeClass('hidden');

        // Make sure we don't display non-translated content (empty button)
        $main.find('#data').removeClass('hidden');

        if (Cryptpad.isLoggedIn()) {
            if (window.location.pathname === '/') {
                window.location = '/drive/';
            }

            var name = localStorage[Cryptpad.userNameKey] || sessionStorage[Cryptpad.userNameKey];
            var $loggedInBlock = $main.find('#loggedIn');
            var $hello = $loggedInBlock.find('#loggedInHello');
            var $logout = $loggedInBlock.find('#loggedInLogOut');

            if (name) {
                $hello.text(Messages._getKey('login_hello', [name]));
            } else {
                $hello.text(Messages.login_helloNoName);
            }
            $('#buttons').find('.nologin').hide();

            $logout.click(function () {
                Cryptpad.logout(function () {
                    window.location.reload();
                });
            });

            $loggedInBlock.removeClass('hidden');
        }
        else {
            $main.find('#userForm').removeClass('hidden');
            $('#name').focus();
        }

        var displayCreateButtons = function () {
            var $parent = $('#buttons');
            var options = [];
            var $container = $('<div>', {'class': 'dropdown-bar'}).appendTo($parent);
            Config.availablePadTypes.forEach(function (el) {
                if (el === 'drive') { return; }
{'fraction_non_alphanumeric': 0.1620998719590269, 'fraction_numerical': 0.0, 'mean_word_length': 1.8933333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?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': '622737', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1038, 'n_words': 185}