{"size": 3865, "ext": "js", "max_stars_repo_path": "static/sept10th/sept10th.js", "max_stars_repo_name": "Js695/net-neut", "max_stars_repo_stars_event_min_datetime": "2017-05-26T17:01:11.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T07:18:10.000Z", "max_issues_repo_path": "static/sept10th/sept10th.js", "max_issues_repo_name": "fightforthefuture/battleforthenet", "max_issues_repo_issues_event_min_datetime": "2017-06-07T14:18:32.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-06T18:05:55.000Z", "max_forks_repo_path": "static/sept10th/sept10th.js", "max_forks_repo_name": "Js695/net-neut", "max_forks_repo_forks_event_min_datetime": "2017-05-18T22:10:03.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-01T22:36:23.000Z"}
{"max_stars_count": 211, "max_issues_count": 50, "max_forks_count": 34, "avg_line_length": 27.027972028, "max_line_length": 116, "alphanum_fraction": 0.5076326003}
function AJAX(params) {
    this.async = params.async || true;
    this.error = params.error;
    this.method = params.method || 'GET';
    this.success = params.success;
    this.form = params.form;
    this.url = params.url;

    this.request = new XMLHttpRequest();
    this.request.open(this.method, this.url, this.async);

    if (this.success) {
        this.request.onload = this.success;
    }

    if (this.error) {
        this.request.onerror = this.error;
    }

    if (this.form) {
        var params = this.serializeForm(this.form);
        this.request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        this.request.send(params);
    } else {
        this.request.send();
    }

}

AJAX.prototype.serializeForm = function(form) {
    if (!form || form.nodeName !== "FORM") {
        return;
    }

    var i, j, q = [];
    for (i = form.elements.length - 1; i >= 0; i = i - 1) {
        if (form.elements[i].name === "") {
            continue;
        }
        switch (form.elements[i].nodeName) {
        case 'INPUT':
            switch (form.elements[i].type) {
            case 'text':
            case 'hidden':
            case 'password':
            case 'button':
            case 'reset':
            case 'submit':
                q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
                break;
            case 'checkbox':
            case 'radio':
                if (form.elements[i].checked) {
                    q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
                }
                break;
            case 'file':
                break;
            }
            break;
        case 'TEXTAREA':
            q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
            break;
        case 'SELECT':
            switch (form.elements[i].type) {
            case 'select-one':
                q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
                break;
            case 'select-multiple':
                for (j = form.elements[i].options.length - 1; j >= 0; j = j - 1) {
                    if (form.elements[i].options[j].selected) {
                        q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].options[j].value));
                    }
                }
                break;
            }
            break;
        case 'BUTTON':
            switch (form.elements[i].type) {
            case 'reset':
            case 'submit':
            case 'button':
                q.push(form.elements[i].name + "=" + encodeURIComponent(form.elements[i].value));
                break;
            }
            break;
        }
    }

    return q.join("&");
};

function $(query, callback) {
    var node = document.querySelector(query);

    if (callback && node) {
        callback(node);
    }

    return node;
}

function $$(query, callback) {
    var nodeList = document.querySelectorAll(query);
    var nodes = Array.prototype.slice.call(nodeList);

    if (callback) {
        nodes.forEach(callback);
    }

    return nodes;
}

// Setup AJAX form submissions
var form = $('#form');
form.addEventListener('submit', function(e) {
    e.preventDefault();

    $('.signup').style.display = 'none';
    $('.signup-thanks').style.display = 'block';

    new AJAX({
        form: form,
        method: 'POST',
        success: function(res) {
            console.log(res);
        },
        url: form.getAttribute('action')
    });
}, false);

// Show all button
$('.show_all a').addEventListener('click', function(e) {
    e.preventDefault();

    $('.row.obscured', function(el) {
        el.className = el.className.replace(/obscured/, ' ');
        el.style.height = 'auto';
    });

}, false);
