{"size": 1836, "ext": "js", "max_stars_repo_path": "static/web/assets/ajax/functions_contact.js", "max_stars_repo_name": "TryNeo/portafolio-personal", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "static/web/assets/ajax/functions_contact.js", "max_issues_repo_name": "TryNeo/portafolio-personal", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "static/web/assets/ajax/functions_contact.js", "max_forks_repo_name": "TryNeo/portafolio-personal", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 49.6216216216, "max_line_length": 149, "alphanum_fraction": 0.4232026144}
document.addEventListener('DOMContentLoaded', function () {
        let formContacto = document.querySelector('#formContacto');
        if (formContacto != null) {
            $(formContacto).on('submit', function (e) {
                e.preventDefault();
                let form_data = $(this).serializeArray();
                document.getElementById('mb-3').innerHTML = "<div class='loading' id='loading'>Cargando..</div>";
                $.ajax({
                    url: 'http://186.68.169.149:8000/contact/',
                    type: 'POST',
                    data: form_data,
                    dataType: 'json'
                }).done(function (data) {
                    setTimeout(function(){
                        let loading = document.getElementById('loading');
                        if (data['status']){
                            loading.remove()
                            setTimeout(function(){
                                document.getElementById('mb-3').innerHTML = '<div class= "sent-message" id="sent-message">'+data['message']+'</div>';
                                setTimeout(function(){
                                    let sent_message = document.getElementById('sent-message');
                                    sent_message.remove();
                                },2000);
                            },2000);
                            document.getElementById('formContacto').reset();
                        }else{
                            mensaje_json('error','Oops..',data['message']);
                            loading.remove();
                        }
                    },1000);
                }).fail(function (jqXHR, textStatus, errorThrown) {
                    console.log(textStatus, errorThrown);
                })
            })
        }
    },
    false);