<commit_before>$(window).bind('load', function () {

	$('#myForm').bind('submit', function () {
		MyForm.submit();
		return false;
	});

	$(window).bind('resize', function () {
		if ($('#resultContainer').css('height').replace('px','')>200) {$('#resultContainer').css('top', window.innerHeight*0.66+20+'px');}
		else {$('#resultContainer').css('top', '400px');}
	});

	$(window).trigger('resize');

	var MyForm = {};

	MyForm.validate = function () {
		var result = {isValid:true, errorFields:[]};
		var fio=$('#myForm>[name=fio]').val().match(/^[A-Za-zА-Яа-я]+ [A-Za-zА-Яа-я]+ [A-Za-zА-Яа-я]+$/g);
		var email=$('#myForm>[name=email]').val().match(/^([a-z0-9]+[._-]?)*[a-z0-9]@(ya\.ru|yandex\.ru|yandex\.ua|yandex\.by|yandex\.kz|yandex\.com)$/ig);
		var phone=$('#myForm>[name=phone]').val().match(/^\+?7\(?\d{3}\)?\d{3}-?\d{2}-?\d{2}$/g);
		var phoneNumb=0;
		var phoneSum=0;
		if (phone!==null) {
			phoneNumb=$('#myForm>[name=phone]').val().replace(/\+/g,'').replace(/\(/g,'').replace(/\)/g,'').replace(/-/g,'').replace(/ /g,'');
			for (var i=0; i<phoneNumb.length; i++) {
				phoneSum+=Number(phoneNumb.charAt(i));
			}
		}
		if (fio!==null && email!==null && phoneSum>6 && phoneSum<30) {result.isValid=true; $('#submitButton').attr('disabled','true');} else {result.isValid=false;}
		if (fio===null) {result.errorFields.push('fio'); $('#myForm>[name=fio]').addClass('error');} else {$('#myForm>[name=fio]').removeClass('error');}
		if (email===null) {result.errorFields.push('email'); $('#myForm>[name=email]').addClass('error');} else {$('#myForm>[name=email]').removeClass('error');}
		if (phoneSum<6 || phoneSum>30) {result.errorFields.push('phone'); $('#myForm>[name=phone]').addClass('error');} else {$('#myForm>[name=phone]').removeClass('error');}
		//alert(result.isValid + '   ' + result.errorFields[0] + '   ' + result.errorFields[1] + '   ' + result.errorFields[2]);
		return result;
	}

	MyForm.getData = function () {
		result = {'fio':'', 'email':'', 'phone':0};
		result['fio']=$('#myForm>[name=fio]').val();
		result['email']=$('#myForm>[name=email]').val();
		result['phone']=$('#myForm>[name=phone]').val();
		//alert(result['fio'] + '   ' + result['email'] + '   ' + result['phone']);
		return result;
	}

	MyForm.setData = function (data) {
		$('#myForm>[name=fio]').val(data['fio']);
		$('#myForm>[name=email]').val(data['email']);
		$('#myForm>[name=phone]').val(data['phone']);
	}

	MyForm.submit = function () {
		if (MyForm.validate().isValid) {
			$.ajax({
	  			url: "success.json",
	  			dataType: "jsonp",
	  			jsonpCallback: "getstatus",
	  			success: function(data){
	    			alert(data.message);
	  			}
			});
		}
	}
});<commit_msg>index.js<commit_after>$(window).bind('load', function () {

	$('#myForm').bind('submit', function () {
		MyForm.submit();
		return false;
	});

	$(window).bind('resize', function () {
		if ($('#resultContainer').css('height').replace('px','')>200) {$('#resultContainer').css('top', window.innerHeight*0.66+20+'px');}
		else {$('#resultContainer').css('top', '400px');}
	});

	$(window).trigger('resize');

	var MyForm = {};

	MyForm.validate = function () {
		var result = {isValid:true, errorFields:[]};
		var fio=$('#myForm>[name=fio]').val().match(/^[A-Za-zА-Яа-я]+ [A-Za-zА-Яа-я]+ [A-Za-zА-Яа-я]+$/g);
		var email=$('#myForm>[name=email]').val().match(/^([a-z0-9]+[._-]?)*[a-z0-9]@(ya\.ru|yandex\.ru|yandex\.ua|yandex\.by|yandex\.kz|yandex\.com)$/ig);
		var phone=$('#myForm>[name=phone]').val().match(/^\+?7\(?\d{3}\)?\d{3}-?\d{2}-?\d{2}$/g);
		var phoneNumb=0;
		var phoneSum=0;
		if (phone!==null) {
			phoneNumb=$('#myForm>[name=phone]').val().replace(/\+/g,'').replace(/\(/g,'').replace(/\)/g,'').replace(/-/g,'').replace(/ /g,'');
			for (var i=0; i<phoneNumb.length; i++) {
				phoneSum+=Number(phoneNumb.charAt(i));
			}
		}
		if (fio!==null && email!==null && phoneSum>6 && phoneSum<30) {result.isValid=true; $('#submitButton').attr('disabled','true');} else {result.isValid=false;}
		if (fio===null) {result.errorFields.push('fio'); $('#myForm>[name=fio]').addClass('error');} else {$('#myForm>[name=fio]').removeClass('error');}
		if (email===null) {result.errorFields.push('email'); $('#myForm>[name=email]').addClass('error');} else {$('#myForm>[name=email]').removeClass('error');}
		if (phoneSum<6 || phoneSum>30) {result.errorFields.push('phone'); $('#myForm>[name=phone]').addClass('error');} else {$('#myForm>[name=phone]').removeClass('error');}
		//alert(result.isValid + '   ' + result.errorFields[0] + '   ' + result.errorFields[1] + '   ' + result.errorFields[2]);
		return result;
	}

	MyForm.getData = function () {
		result = {'fio':'', 'email':'', 'phone':0};
		result['fio']=$('#myForm>[name=fio]').val();
		result['email']=$('#myForm>[name=email]').val();
		result['phone']=$('#myForm>[name=phone]').val();
		//alert(result['fio'] + '   ' + result['email'] + '   ' + result['phone']);
		return result;
	}

	MyForm.setData = function (data) {
		$('#myForm>[name=fio]').val(data['fio']);
		$('#myForm>[name=email]').val(data['email']);
		$('#myForm>[name=phone]').val(data['phone']);
	}

	MyForm.submit = function () {
		if (MyForm.validate().isValid) {
			$.ajax({
	  			url: "success.json",
	  			dataType: "jsonp",
	  			jsonpCallback: "getstatus",
	  			success: function(data){
	    			alert('check');
	  			}
			});
		}
	}
});
{'fraction_non_alphanumeric': 0.30322338830584705, 'fraction_numerical': 0.012368815592203899, 'mean_word_length': 5.016910935738444, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, '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': '4371340', 'n_tokens_mistral': 2239, 'n_tokens_neox': 2068, 'n_words': 230}