<commit_before>function loadHome(callback) {
    $('#content').load(`/_home.html`, function () {
        $('.message .close')
            .on('click', function () {
                $(this)
                    .closest('.message')
                    .transition('fade');
            });
        $('#home_go_button').on('click', createTask);
        callback();
    });
}

function createTask() {
    const owner = $('#home_owner_input').val();
    const repository = $('#home_repository_input').val();
    $(this).addClass('loading');
    $.post(`/api/task/${owner}/${repository}`)
        .done((result) => {
            show($('#home_success'));
            $(this).removeClass('loading');
        })
        .fail((error) => {
            show($('#home_fail'));
            $(this).removeClass('loading');
        });

    function show(element) {
        if (element.hasClass('hidden')) {
            element.transition('fade');
            setTimeout(() => {
                if (element.hasClass('visible')) {
                    element.transition('fade');
                }<commit_msg>adapted home to new routing system #57.<commit_after>function bindHomeListeners() {
    $('.message .close')
        .on('click', function () {
            $(this)
                .closest('.message')
                .transition('fade');
        });
    $('#home_go_button').on('click', createTask);
}

function createTask() {
    var owner = $('#home_owner_input').val();
    var repository = $('#home_repository_input').val();
    var btn = $(this);
    btn.addClass('loading');
    $.post(`/api/task/${owner}/${repository}`)
        .done(function (result) {
            show($('#home_success'));
            btn.removeClass('loading');
            $('#home_owner_input').val('');
            $('#home_repository_input').val('');
        })
        .fail(function (error) {
            show($('#home_fail'));
            btn.removeClass('loading');
        });

    function show(element) {
        if (element.hasClass('hidden')) {
            element.transition('fade');
            setTimeout(function () {
                if (element.hasClass('visible')) {
                    element.transition('fade');
                }
{'fraction_non_alphanumeric': 0.19360648356596127, 'fraction_numerical': 0.0009004952723998199, 'mean_word_length': 1.9198423127463864, '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': '5592292', 'n_tokens_mistral': 586, 'n_tokens_neox': 576, 'n_words': 88}