<commit_before>"use strict";

function DOMUtils(){}

//Check if a DOM element in completely visible in the viewport
DOMUtils.isVisible = function(element)
{
	var top = element.offsetTop;
	var left = element.offsetLeft;
	var width = element.offsetWidth;
	var height = element.offsetHeight;

	while(element.offsetParent)
	{
		element = element.offsetParent;
		top += element.offsetTop;
		left += element.offsetLeft;
	}

	return top >= window.pageYOffset && left >= window.pageXOffset && (top + height) <= (window.pageYOffset + window.innerHeight) && (left + width) <= (window.pageXOffset + window.innerWidth);
};<commit_msg>DOM Utils vertical horizontal visibility<commit_after>"use strict";

function DOMUtils(){}

//Check if a DOM element in completely visible in the viewport
DOMUtils.isVisible = function(element)
{
	var top = element.offsetTop;
	var left = element.offsetLeft;
	var width = element.offsetWidth;
	var height = element.offsetHeight;

	while(element.offsetParent)
	{
		element = element.offsetParent;
		top += element.offsetTop;
		left += element.offsetLeft;
	}

	return top >= window.pageYOffset && left >= window.pageXOffset && (top + height) <= (window.pageYOffset + window.innerHeight) && (left + width) <= (window.pageXOffset + window.innerWidth);
};

//Check if a DOM element is visible on X axis
DOMUtils.isVisibleX = function(element)
{
	var top = element.offsetTop;
	var height = element.offsetHeight;

	while(element.offsetParent)
	{
		element = element.offsetParent;
		top += element.offsetTop;
	}

	return top >= window.pageYOffset && (top + height) <= (window.pageYOffset + window.innerHeight)
};

//Check if a DOM element is visible on Y axis
DOMUtils.isVisibleY = function(element)
{
	var left = element.offsetLeft;
	var width = element.offsetWidth;

	while(element.offsetParent)
	{
		element = element.offsetParent;
		left += element.offsetLeft;
	}

	return left >= window.pageXOffset && (left + width) <= (window.pageXOffset + window.innerWidth);
};
{'fraction_non_alphanumeric': 0.1236125126135217, 'fraction_numerical': 0.0, 'mean_word_length': 4.61756373937677, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '795491', 'n_tokens_mistral': 618, 'n_tokens_neox': 599, 'n_words': 162}