<commit_before>var searchrequest;
var counter = 0;
var borrowrequest;
var recentrequest;
window.addEventListener('load', function(){
    //change username in form field on load based on session. For time being, hardcoded
    searchrequest = new XMLHttpRequest();
    borrowrequest = new XMLHttpRequest();
    recentrequest = new XMLHttpRequest();

}, false);
function hideFilters(){
    $('#portfolioModal').modal('hide');
}
function loadRecents(){
    recentrequest.open('GET', '/recentitems', true);
    recentrequest.addEventListener('load', function(e){
         if (recentrequest.status == 200) {
             // do something with the loaded content
                var content = recentrequest.responseText;
                // check if there is prior messages to load at all
                console.log(content);
                if(content.length>0){
                    // list appending code
                    // should be array of message objects
                    var data = JSON.parse(content);

                    var ul = document.getElementById('mod_results');
                    var ul2 = document.getElementById('popup_portfolio');
                    // create a new li element for the message, and append it
                    ul.innerHTML="";
                    var curid;
                    for(i = 0;i<data.length;i++){
                        //add only new messages to list
                        var li = document.createElement('li');
                        var li2 = document.createElement('li');
                        //construct list element

                        li.innerHTML = "<div class='col-sm-4 portfolio-item'><a href='#portfolioModal" + counter + "' class='portfolio-link' data-toggle='modal'><div class='caption'><div class='caption-content'><i class='fa fa-search-plus fa-3x'></i></div></div><img height = \'300 em\' width = \'300 em\' src='" + data[i].image + "' class='img-responsive' alt=''></a></div>"
                        li2.innerHTML = '<div class="portfolio-modal modal fade" id="portfolioModal' + counter + '" tabindex="-1" role="dialog" aria-hidden="true" style = "background-color:white"><div class="modal-content"><div class="close-modal" data-dismiss="modal"><div class="lr"><div class="rl"></div></div></div><div class="container"><div class="row"><div class="col-lg-8 col-lg-offset-2"><div style="bottom:300px!important;" class="modal-body"><h2>Item</h2><hr class="star-primary"><img src="' + data[i].image + '" class="img-responsive img-centered"> <ul> <li> <div class="logo" style="color: grey!important;"> Username: <a href="profile/' + data[i].username + '">' + data[i].username + '</a></div> <br> <li><div class="logo" style="color: grey!important;"> Price: $' + data[i].price + '</div> <br></li><li><div class="logo" style="color: grey!important;"> Description:' + data[i].description + '</div> <br></li><li><input type="button" class="btn btn-success" value="Borrow!" onclick="borrowThing(' +data[i].itemid +','+counter+ ');return false;"></li></ul></div></div></div></div></div></div>'
                        ul.appendChild(li,ul.childNodes[0]);
                        ul2.appendChild(li2, ul.childNodes[0]);
                        counter++;
<commit_msg>update search<commit_after>var searchrequest;
var counter = 0;
var borrowrequest;
var recentrequest;
window.addEventListener('load', function(){
    //change username in form field on load based on session. For time being, hardcoded
    searchrequest = new XMLHttpRequest();
    borrowrequest = new XMLHttpRequest();
    recentrequest = new XMLHttpRequest();

}, false);
function hideFilters(){
    $('#portfolioModal').modal('hide');
}
function loadRecents(){
    recentrequest.open('GET', '/recentitems', true);
    recentrequest.addEventListener('load', function(e){
         if (recentrequest.status == 200) {
             // do something with the loaded content
                var content = recentrequest.responseText;
                // check if there is prior messages to load at all
                console.log(content);
                if(content.length>0){
                    // list appending code
                    // should be array of message objects
                    var data = JSON.parse(content);

                    var ul = document.getElementById('mod_results');
                    var ul2 = document.getElementById('popup_portfolio');
                    // create a new li element for the message, and append it
                    ul.innerHTML="";
                    var curid;
                    for(i = 0;i<data.length;i++){
                        //add only new messages to list
                        var li = document.createElement('li');
                        var li2 = document.createElement('li');
                        //construct list element

                        li.innerHTML = "<div class='col-sm-4 portfolio-item'><a href='#portfolioModal" + counter + "' class='portfolio-link' data-toggle='modal'><div class='caption'><div class='caption-content'><i class='fa fa-search-plus fa-3x'></i></div></div><img height = \'300 em\' width = \'300 em\' src='" + data[i].image + "' class='img-responsive' alt=''></a></div>"
                        li2.innerHTML = '<div class="portfolio-modal modal fade" id="portfolioModal' + counter + '" tabindex="-1" role="dialog" aria-hidden="true" style = "background-color:white"><div class="modal-content"><div class="close-modal" data-dismiss="modal"><div class="lr"><div class="rl"></div></div></div><div class="container"><div class="row"><div class="col-lg-8 col-lg-offset-2"><div style="bottom:300px!important;" class="modal-body"><h2>' + data[i].name +'</h2><hr class="star-primary"><img src="' + data[i].image + '" class="img-responsive img-centered"> <ul> <li> <div class="logo" style="color: grey!important;"> Username: <a href="profile/' + data[i].username + '">' + data[i].username + '</a></div> <br> <li><div class="logo" style="color: grey!important;"> Price: $' + data[i].price + '</div> <br></li><li><div class="logo" style="color: grey!important;"> Description:' + data[i].description + '</div> <br></li><li><input type="button" class="btn btn-success" value="Borrow!" onclick="borrowThing(' +data[i].itemid +','+counter+ ');return false;"></li></ul></div></div></div></div></div></div>'
                        ul.appendChild(li,ul.childNodes[0]);
                        ul2.appendChild(li2, ul.childNodes[0]);
                        counter++;

{'fraction_non_alphanumeric': 0.17280715276707262, 'fraction_numerical': 0.00894095884075844, 'mean_word_length': 2.711670480549199, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, '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': '1254887', 'n_tokens_mistral': 1797, 'n_tokens_neox': 1706, 'n_words': 423}