<commit_before>function pageLoad(){
	
	
    $(document).ready(function() {
        $("#progressbar").css({"width":"100%"});
$("#loading").delay(1500).fadeOut();
	 $("#results").show();
	   });
	
	top10();
}

function ajaxFunction(){


 var ajaxRequest;  // The variable that makes Ajax possible!
 
 try{
   // Opera 8.0+, Firefox, Safari
   ajaxRequest = new XMLHttpRequest();
 }catch (e){
   // Internet Explorer Browsers
   try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
   }catch (e) {
      try{
         ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      }catch (e){
         // Something went wrong
         alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data
// sent from the server and will update
// div section in the same page.
ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
    var ajaxDisplay = document.getElementById('results');
    ajaxDisplay.innerHTML = ajaxRequest.responseText;
    }
}
// Now get the value from user and pass it to
// server script.
var limit = document.getElementById('limit').value;
 var queryString = "?limit=" + limit ;
 ajaxRequest.open("GET", "includes/highscores/results-ajax.php" + 
                              queryString, true);
 ajaxRequest.send(null); 
}

function searchFunction(){

    var ajaxRequest;  // The variable that makes Ajax possible!

    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    }catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }
// Create a function that will receive data
// sent from the server and will update
// div section in the same page.
    ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
            var ajaxDisplay = document.getElementById('search_results');
            ajaxDisplay.innerHTML = ajaxRequest.responseText;
        }
    }
// Now get the value from user and pass it to
// server script.
    var search_username = document.getElementById('search_username').value;
    var queryString = "?search_username=" + search_username ;
    ajaxRequest.open("GET", "/includes/highscores/searchuser.php" +
        queryString, true);
    ajaxRequest.send(null);
}

function top10(){
	document.getElementById('limit').value="10";
	document.getElementById('top10n').className="active";
	document.getElementById('top50n').className="";
    document.getElementById('top100n').className="";
	ajaxFunction();
}

function top50(){
		document.getElementById('limit').value="50";
        document.getElementById('top50n').className="active";
        document.getElementById('top10n').className="";
        document.getElementById('top100n').className="";
	ajaxFunction();
}

function top100(){
	document.getElementById('limit').value="100";
    document.getElementById('top100n').className="active";
    document.getElementById('top10n').className="";
    document.getElementById('top50n').className="";
	ajaxFunction();
}

function submitsearch(){
    searchFunction();
}


//-->
<commit_msg>Run top 10 on search<commit_after>function pageLoad(){
	
	
    $(document).ready(function() {
        $("#progressbar").css({"width":"100%"});
$("#loading").delay(1500).fadeOut();
	 $("#results").show();
	   });
	
	top10();
}

function ajaxFunction(){


 var ajaxRequest;  // The variable that makes Ajax possible!
 
 try{
   // Opera 8.0+, Firefox, Safari
   ajaxRequest = new XMLHttpRequest();
 }catch (e){
   // Internet Explorer Browsers
   try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
   }catch (e) {
      try{
         ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      }catch (e){
         // Something went wrong
         alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data
// sent from the server and will update
// div section in the same page.
ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
    var ajaxDisplay = document.getElementById('results');
    ajaxDisplay.innerHTML = ajaxRequest.responseText;
    }
}
// Now get the value from user and pass it to
// server script.
var limit = document.getElementById('limit').value;
 var queryString = "?limit=" + limit ;
 ajaxRequest.open("GET", "includes/highscores/results-ajax.php" + 
                              queryString, true);
 ajaxRequest.send(null); 
}

function searchFunction(){

    var ajaxRequest;  // The variable that makes Ajax possible!

    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    }catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }
// Create a function that will receive data
// sent from the server and will update
// div section in the same page.
    ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
            var ajaxDisplay = document.getElementById('search_results');
            ajaxDisplay.innerHTML = ajaxRequest.responseText;
        }
    }
// Now get the value from user and pass it to
// server script.
    var search_username = document.getElementById('search_username').value;
    var queryString = "?search_username=" + search_username ;
    ajaxRequest.open("GET", "/includes/highscores/searchuser.php" +
        queryString, true);
    ajaxRequest.send(null);
}

function top10(){
	document.getElementById('limit').value="10";
	document.getElementById('top10n').className="active";
	document.getElementById('top50n').className="";
    document.getElementById('top100n').className="";
	ajaxFunction();
}

function top50(){
		document.getElementById('limit').value="50";
        document.getElementById('top50n').className="active";
        document.getElementById('top10n').className="";
        document.getElementById('top100n').className="";
	ajaxFunction();
}

function top100(){
	document.getElementById('limit').value="100";
    document.getElementById('top100n').className="active";
    document.getElementById('top10n').className="";
    document.getElementById('top50n').className="";
	ajaxFunction();
}

function submitsearch(){
    top10();
    searchFunction();
}


//-->

{'fraction_non_alphanumeric': 0.14003511852502196, 'fraction_numerical': 0.015803336259877086, 'mean_word_length': 3.0064478311840563, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4168555', 'n_tokens_mistral': 1971, 'n_tokens_neox': 1799, 'n_words': 451}