{"size": 582, "ext": "js", "max_stars_repo_path": "views/js/greeting.js", "max_stars_repo_name": "ivanmirandastavenuiter/space-frog-recruit-on-app", "max_stars_repo_stars_event_min_datetime": "2021-03-23T08:12:44.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-23T08:12:44.000Z", "max_issues_repo_path": "views/js/greeting.js", "max_issues_repo_name": "ims-opensolutions/space-frog-recruit-on-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "views/js/greeting.js", "max_forks_repo_name": "ims-opensolutions/space-frog-recruit-on-app", "max_forks_repo_forks_event_min_datetime": "2020-11-05T11:31:51.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-05T11:31:51.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 26.4545454545, "max_line_length": 73, "alphanum_fraction": 0.6237113402}
let form = document.forms[0];

let referrer = document.referrer;

if (document.referrer && document.referrer.indexOf('upload') > -1) {
    let badRequestMessage = form.querySelector('span.error-bad-request');
    badRequestMessage.style.display = 'block';
}

form.onsubmit = (e) => {
    e.preventDefault();
    let name = form.querySelector('input.name');
    
    if (!name || name.value.trim() === '') {
        let errorMessage = form.querySelector('span.error-message');
        errorMessage.style.display = 'block';
        return;
    } else {
        form.submit();
    }

}