<commit_before>// WebSentials
// By GeekyGamer14 (https://github.com/GeekyGamer14/WebSentials) - Open source web essentials.
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js


//hide error/success
function hideError(elem, method){
		if(method == 'slide'){
			$(elem).slideUp();
			$(elem).css('opacity', '0');
			$(elem).attr('desc', '(hidden) '.concat($(elem).attr('desc')));
			console.log('hid error with method slide');
		}else{
			if(method == 'fade'){
				$(elem).css('opacity', '0');
				$(elem).attr('desc', '(hidden) '.concat($(elem).attr('desc')));
				setTimeout(function(){
					$(elem).css('display', 'none');
				}, 400);
				console.log('hid error with method fade');
			}else{
				console.error('websentials.hideError: invalid hide method. valid methods are slide or fade.');
		}
	}
}
//restore error (or just show one)
function restoreError(elem){
	var elemID = elem.replace('#', '');
	if($(elem).attr('class') != 'error'){
		if($(elem).attr('class') != 'success'){
			console.error(elem && ' is not an error or a success message, ignoring command.');
		}else{
			$(elem).css('display', 'block');
			setTimeout(function(){
				$(elem).css('opacity', '1');
			}, 50);
		}
	}else{
		$(elem).css('display', 'block');
		setTimeout(function(){
			$(elem).css('opacity', '1');
		}, 50);
	}
}
// list errors
function listErrors(){
	return $('.error').attr('desc');
}
//list success messages
function listSuccess(){
	return $('.success').attr('desc');
}

/*progress bars*/

function progressBar(progressBarId, percentage, label){
	$(progressBarId).css('width', percentage);
	if(label == 'none'){
		console.log('no label selected, ignoring');
	}else{
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		setTimeout(function(){
			$(label).text(percentage);
		}, 1000);
	}
}

/*accept button*/
if($('#accept') != []){
	$("body").keyup(function(event){
		if(event.keyCode == 13){
			$("#accept").click();
		}
	});
}

/* built-in function creator!*/
function functionCreator(str){
	var s1 = str.replace(/create a variable/gi, 'var');
	var s2 = s1.replace(/that is equal to/gi, '=');
	var s3 = s2.replace(/then/gi, ';');
	var final = s3.replace(/that is an array/gi, '= new Array()');
	console.log('Your function: ');
	return final;
}

/*tooltips*/
function createTooltip(elem, tooltipText){
	$(elem).attr('onmouseout', 'deleteTooltips()');
	$(elem).after('<p class="tooltip">' + tooltipText + '</p>');
	setTimeout(function(){
		$('.tooltip').css('opacity', '1');
	});
}

function deleteTooltips(){
	$('.tooltip').css('opacity', '0');
	var tooltipsRemoved = $('.tooltip').size();
	setTimeout(function(){
		$('.tooltip').remove();
	}, 200);
	if(tooltipsRemoved > 1){
		console.log(tooltipsRemoved + ' tooltips removed, sir.');
	}else{
		console.log(tooltipsRemoved + ' tooltip removed, sir.');
	}
}

/*dialogs*/
function createDialog(header, content, accept, acceptAction, deny){
	var thescript = "hideError('.dialog','slide')";
	$('body').prepend('<div class="dialog"><div class="dialog-header">' + header + '</div><div class="dialog-content">' + content +'</div><div class="dialog-footer"><button class="btn-green" onClick="' + acceptAction +'">' + accept + '</button><button onClick='+ thescript +'>' + deny + '</button></div>');
	setTimeout(function(){
		$('.dialog').css('opacity' ,'1');
	}, 1);
}
<commit_msg>added newline at the end of ws.js<commit_after>// WebSentials
// By GeekyGamer14 (https://github.com/GeekyGamer14/WebSentials) - Open source web essentials.
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js


//hide error/success
function hideError(elem, method){
		if(method == 'slide'){
			$(elem).slideUp();
			$(elem).css('opacity', '0');
			$(elem).attr('desc', '(hidden) '.concat($(elem).attr('desc')));
			console.log('hid error with method slide');
		}else{
			if(method == 'fade'){
				$(elem).css('opacity', '0');
				$(elem).attr('desc', '(hidden) '.concat($(elem).attr('desc')));
				setTimeout(function(){
					$(elem).css('display', 'none');
				}, 400);
				console.log('hid error with method fade');
			}else{
				console.error('websentials.hideError: invalid hide method. valid methods are slide or fade.');
		}
	}
}
//restore error (or just show one)
function restoreError(elem){
	var elemID = elem.replace('#', '');
	if($(elem).attr('class') != 'error'){
		if($(elem).attr('class') != 'success'){
			console.error(elem && ' is not an error or a success message, ignoring command.');
		}else{
			$(elem).css('display', 'block');
			setTimeout(function(){
				$(elem).css('opacity', '1');
			}, 50);
		}
	}else{
		$(elem).css('display', 'block');
		setTimeout(function(){
			$(elem).css('opacity', '1');
		}, 50);
	}
}
// list errors
function listErrors(){
	return $('.error').attr('desc');
}
//list success messages
function listSuccess(){
	return $('.success').attr('desc');
}

/*progress bars*/

function progressBar(progressBarId, percentage, label){
	$(progressBarId).css('width', percentage);
	if(label == 'none'){
		console.log('no label selected, ignoring');
	}else{
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		setTimeout(function(){
			$(label).text(Math.random() * (100 - 0.0) + 0);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		}, 100);
		setTimeout(function(){
			$(label).text(percentage);
		}, 1000);
	}
}

/*accept button*/
if($('#accept') != []){
	$("body").keyup(function(event){
		if(event.keyCode == 13){
			$("#accept").click();
		}
	});
}

/* built-in function creator!*/
function functionCreator(str){
	var s1 = str.replace(/create a variable/gi, 'var');
	var s2 = s1.replace(/that is equal to/gi, '=');
	var s3 = s2.replace(/then/gi, ';');
	var final = s3.replace(/that is an array/gi, '= new Array()');
	console.log('Your function: ');
	return final;
}

/*tooltips*/
function createTooltip(elem, tooltipText){
	$(elem).attr('onmouseout', 'deleteTooltips()');
	$(elem).after('<p class="tooltip">' + tooltipText + '</p>');
	setTimeout(function(){
		$('.tooltip').css('opacity', '1');
	});
}

function deleteTooltips(){
	$('.tooltip').css('opacity', '0');
	var tooltipsRemoved = $('.tooltip').size();
	setTimeout(function(){
		$('.tooltip').remove();
	}, 200);
	if(tooltipsRemoved > 1){
		console.log(tooltipsRemoved + ' tooltips removed, sir.');
	}else{
		console.log(tooltipsRemoved + ' tooltip removed, sir.');
	}
}

/*dialogs*/
function createDialog(header, content, accept, acceptAction, deny){
	var thescript = "hideError('.dialog','slide')";
	$('body').prepend('<div class="dialog"><div class="dialog-header">' + header + '</div><div class="dialog-content">' + content +'</div><div class="dialog-footer"><button class="btn-green" onClick="' + acceptAction +'">' + accept + '</button><button onClick='+ thescript +'>' + deny + '</button></div>');
	setTimeout(function(){
		$('.dialog').css('opacity' ,'1');
	}, 1);
}


{'fraction_non_alphanumeric': 0.24471077412253883, 'fraction_numerical': 0.029350617585911704, 'mean_word_length': 4.306943543153796, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '5734373', 'n_tokens_mistral': 3242, 'n_tokens_neox': 2845, 'n_words': 580}