{"size": 1566, "ext": "js", "max_stars_repo_path": "Mini-Project2/src/assets/js/main.js", "max_stars_repo_name": "AlphaBAT69/MEAN-Stack", "max_stars_repo_stars_event_min_datetime": "2019-01-29T18:46:55.000Z", "max_stars_repo_stars_event_max_datetime": "2019-01-29T18:46:55.000Z", "max_issues_repo_path": "Mini-Project2/src/assets/js/main.js", "max_issues_repo_name": "AlphaBAT69/MEAN-Stack", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Mini-Project2/src/assets/js/main.js", "max_forks_repo_name": "AlphaBAT69/MEAN-Stack", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 48.9375, "max_line_length": 137, "alphanum_fraction": 0.5446998723}
/* This is the upload function logic */

function upload(){
    var name = $("#inputuname").val();
    var caption = $("#inputcaption").val();
    var image = $("#inputimage").val();
    var avatar = $("#inputuimage").val();

    if(name == "" || caption == "" || image == "" || avatar == "" || name == null || caption == null || image == null || avatar == null){
        if(name=='' || name==null) $("#inputuname").css('border-color', 'red');
        if(caption=='' || caption==null) $("#inputcaption").css('border-color', 'red');
        if(image=='' || image==null) $("#inputimage").css('border-color', 'red');
        if(avatar=='' || avatar==null) $("#inputuimage").css('border-color', 'red');
    }
    else{
        var card_layout = $("#layout").clone();
        
        /* changing the content */
        $("a img", card_layout).attr("src", image);
        $("div div.d-flex.align-items-center.px-2 div.avatar", card_layout).attr("style", "background-image: url(\'"+avatar+"\')")
        $("div div.d-flex.align-items-center.px-2 div div", card_layout).text(name);
        $("div div.d-flex.align-items-center.px-2 div small", card_layout).text("few seconds ago");
        $("div div.d-flex.align-items-center.px-2 div div.photogram-caption", card_layout).text(caption);
        
        $("#uploads").prepend(card_layout);
        var name = $("#inputuname").val("");
        var caption = $("#inputcaption").val("");
        var image = $("#inputimage").val("");
        var avatar = $("#inputuimage").val("");
        $('#form').modal('toggle');
    }
}