<commit_before>// Browser detection for when you get desparate. A measure of last resort.
// http://rog.ie/post/9089341529/html5boilerplatejs

//var b = document.documentElement;
//b.setAttribute('data-useragent',  navigator.userAgent);
//b.setAttribute('data-platform', navigator.platform);

// sample CSS: html[data-useragent*='Chrome/13.0'] { ... }

(function($){



$(document).ready(function (){

	$('form').each(function() {

		$(this).attr('novalidate', 'novalidate');

	});

	$('form').on('submit', function(e) {

		//e.preventDefault();

		errors = 0;

		$(this).find('input[data-isvalid], textarea[data-isvalid]').each(function() {

			if (($(this).attr('data-isvalid') == 'no') || ($(this).attr("required") && ($.trim($(this).val()) == ''))) {

				errors++;

				errorMsg = $(this).attr('data-error');

				if ((errorMsg != '') && ($(this).attr('data-error') != '')) {

					$(this).attr('data-error', '').parent().append('<small class="error-message" role="alert" id="' + $(this).attr('id') + '_error">' + errorMsg + '</span>').addClass('invalid');

				};

				$('.invalid input').on('keyup', function() {
				    $(this).next('.error-message').addClass('none');
				});

			};
		});

		$(this).find('label.invalid input, label.invalid textarea').first().focus();

		if (errors != 0) return false;

	});

	$('*[data-validate="onblur"]').on('blur', function() {

		valType = $(this).attr('data-type');
		value = $(this).val();

		if ($(this).attr("required")) {

			required = true;

		} else {

			required = false;

		};

		//console.log('validating this');

		inputValidation($(this), required, valType, value);

	});

});

})(window.jQuery);
<commit_msg>correction to hide error message when user starts to type<commit_after>// Browser detection for when you get desparate. A measure of last resort.
// http://rog.ie/post/9089341529/html5boilerplatejs

//var b = document.documentElement;
//b.setAttribute('data-useragent',  navigator.userAgent);
//b.setAttribute('data-platform', navigator.platform);

// sample CSS: html[data-useragent*='Chrome/13.0'] { ... }

(function($){



$(document).ready(function (){

	$('form').each(function() {

		$(this).attr('novalidate', 'novalidate');

	});

	$('form').on('submit', function(e) {

		//e.preventDefault();

		errors = 0;

		$(this).find('input[data-isvalid], textarea[data-isvalid]').each(function() {

			if (($(this).attr('data-isvalid') == 'no') || ($(this).attr("required") && ($.trim($(this).val()) == ''))) {

				errors++;

				errorMsg = $(this).attr('data-error');

				if ((errorMsg != '') && ($(this).attr('data-error') != '')) {

					$(this).attr('data-error', '').parent().append('<small class="error-message" role="alert" id="' + $(this).attr('id') + '_error">' + errorMsg + '</span>').addClass('invalid');

				};

			};
		});

		$(this).find('label.invalid input, label.invalid textarea').first().focus();

		if (errors != 0) return false;

	});

	$('*[data-validate="onblur"]').on('blur', function() {

		valType = $(this).attr('data-type');
		value = $(this).val();

		if ($(this).attr("required")) {

			required = true;

		} else {

			required = false;

		};

		//console.log('validating this');

		inputValidation($(this), required, valType, value);

	});

});

$(document).on('keyup','.invalid input', function() {
    $(this).next('.error-message').addClass('none');
});

})(window.jQuery);

{'fraction_non_alphanumeric': 0.25864617203665385, 'fraction_numerical': 0.009459060005911913, 'mean_word_length': 4.0207715133531154, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1322498', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1113, 'n_words': 187}