<commit_before>function loadView(){
	document.getElementById("welcomeView").innerHTML = document.getElementById("welcomeBody").innerHTML;
}

function validateLogin(){
	var bool=true;
	var x = document.forms["login"]["username"].value;
	if (x==null||x=="")
	{
		changeBorderColor(document.getElementById("username"), 2);
		bool=false;
	}
	else{
	}

	x = document.forms["login"]["password"].value;
	if (x==null||x=="")
	{
		changeBorderColor(document.getElementById("password"), 2);
		bool=false;
	}
	else{
	}
	return bool;
}

function validateSignup(){
	var bool=true;
	var x = document.forms["signup"]["firstName"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("firstName"), 2);
		bool=false;
	}

	x = document.forms["signup"]["familyName"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("familyName"), 2);
		bool=false;
	}

	x = document.forms["signup"]["city"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("city"), 2);
		bool=false;
	}

	x = document.forms["signup"]["country"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("country"), 2);
		bool=false;
	}

	x = document.forms["signup"]["email"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("email"), 2);
		bool=false;
	}

	x = document.forms["signup"]["newPassword"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("newPassword"), 2);
		bool=false;
	}

	y = document.forms["signup"]["confirmPassword"].value;
	if(y==null||y=="")
	{
		changeBorderColor(document.getElementById("confirmPassword"), 2);
		bool=false;
	}

	if (x!=y)
		{
			changeBorderColor(document.getElementById("newPassword"), 2);
			changeBorderColor(document.getElementById("confirmPassword"), 2);
			bool=false;
		};

return bool;

}


function changeBorderColor(inputfield, color){
	if (color==1)  //1 gives the standard black border color
	{
		inputfield.className="dotBorder";
	}
	else 		//anything else and we change to red border color
	{
		inputfield.className="invalidEntry";
	}
}


// displayView = function(){
//    // the code required to display a view.
// };
// document.onload = function(){
//     //code that is executed as the page is loaded.
// };<commit_msg>Changed the signup validation js so that the password fields are reset when their value differ.<commit_after>function loadView(){
	document.getElementById("welcomeView").innerHTML = document.getElementById("welcomeBody").innerHTML;
}

function validateLogin(){
	var bool=true;
	var x = document.forms["login"]["username"].value;
	if (x==null||x=="")
	{
		changeBorderColor(document.getElementById("username"), 2);
		bool=false;
	}
	else{
	}

	x = document.forms["login"]["password"].value;
	if (x==null||x=="")
	{
		changeBorderColor(document.getElementById("password"), 2);
		bool=false;
	}
	else{
	}
	return bool;
}

function validateSignup(){
	var bool=true;
	var x = document.forms["signup"]["firstName"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("firstName"), 2);
		bool=false;
	}

	x = document.forms["signup"]["familyName"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("familyName"), 2);
		bool=false;
	}

	x = document.forms["signup"]["city"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("city"), 2);
		bool=false;
	}

	x = document.forms["signup"]["country"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("country"), 2);
		bool=false;
	}

	x = document.forms["signup"]["email"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("email"), 2);
		bool=false;
	}

	x = document.forms["signup"]["newPassword"].value;
	if(x==null||x=="")
	{
		changeBorderColor(document.getElementById("newPassword"), 2);
		bool=false;
	}

	y = document.forms["signup"]["confirmPassword"].value;
	if(y==null||y=="")
	{
		changeBorderColor(document.getElementById("confirmPassword"), 2);
		bool=false;
	}

	if (x!=y)
		{
			changeBorderColor(document.getElementById("newPassword"), 2);
			changeBorderColor(document.getElementById("confirmPassword"), 2);
			document.forms["signup"]["newPassword"].value="";
			document.forms["signup"]["confirmPassword"].value="";
			bool=false;
		};

return bool;

}


function changeBorderColor(inputfield, color){
	if (color==1)  //1 gives the standard black border color
	{
		inputfield.className="dotBorder";
	}
	else 		//anything else and we change to red border color
	{
		inputfield.className="invalidEntry";
	}
}


// displayView = function(){
//    // the code required to display a view.
// };
// document.onload = function(){
//     //code that is executed as the page is loaded.
// };
{'fraction_non_alphanumeric': 0.19199830651989838, 'fraction_numerical': 0.00550381033022862, 'mean_word_length': 5.225296442687747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1809257', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1640, 'n_words': 271}