<commit_before>var jQuery = require('jquery');
var $ = jQuery;


function height( target, selector ) { 
	selector.css({ 'min-height': $(window).height() * target }); 
}

function height_strict( target, selector ) { 
	selector.css({ 'height': $(window).height() * target }); 
}

function width( target, selector ) { 
	selector.css({ 'width': $(window).width() * target }); 
}

function equal_height( target, selector ) {
	selector.css({'height': selector.width() });
}

function equal_width( target, selector ) {
	selector.css({'width': selector.height() });
}

var actionmap = 
{ 
	'.five': {callback:height, target: 0.05},
	'.ten': {callback:height, target: 0.1},
	'.ten-strict': {callback:height_strict, target: 0.1},
	'.one-quarter': {callback:height, target: 0.25},
	'.one-quarter-strict': {callback:height_strict, target: 0.25},
	'.forty-five': {callback:height, target: 0.45},
	'.half': {callback:height_strict, target: 0.5},
	'.half-strict': {callback:height_strict, target: 0.5},
	'.half-h': {callback:width, target: 0.5},
	'.ninety': {callback: height, target: 0.9},
	'.ninety-h': {callback:width, target: 0.9},
	'.three-quarter': {callback: height, target: 0.75},
	'.three-quarter-strict': {callback: height_strict, target: 0.75},
	'.all': {callback: height, target: 1},
	'.all-h': {callback:width, target: 1},
	'.all-strict': {callback:height_strict, target: 1},
	//'.double': {callback: height, target: 2},
	'.eighty-five': {callback: height, target: 0.85},
	'.eighty': {callback: height_strict, target: 0.8},
	'.height-is-width': {callback: equal_height, target: undefined },
	//'.width-is-height': {callback: equal_width, target: undefined }
};

function recalculate() {
	for ( var selector in actionmap ) {
		if ( actionmap.hasOwnProperty( selector ) ) {
			var els = $(selector);
			if ( els.length > 0 ) {
				actionmap[ selector ].callback( 
					actionmap[ selector ].target,
					els
				); 
			}
		}	
	}

	$(document).trigger('dom-is-sized');
}

$( document ).ready( function() {
	$(window).on('resize', recalculate);
	recalculate();
});<commit_msg>added a resize-force hook to force recalculation of page element sizes<commit_after>var jQuery = require('jquery');
var $ = jQuery;


function height( target, selector ) { 
	selector.css({ 'min-height': $(window).height() * target }); 
}

function height_strict( target, selector ) { 
	selector.css({ 'height': $(window).height() * target }); 
}

function width( target, selector ) { 
	selector.css({ 'width': $(window).width() * target }); 
}

function equal_height( target, selector ) {
	selector.css({'height': selector.width() });
}

function equal_width( target, selector ) {
	selector.css({'width': selector.height() });
}

var actionmap = 
{ 
	'.five': {callback:height, target: 0.05},
	'.ten': {callback:height, target: 0.1},
	'.ten-strict': {callback:height_strict, target: 0.1},
	'.one-quarter': {callback:height, target: 0.25},
	'.one-quarter-strict': {callback:height_strict, target: 0.25},
	'.forty-five': {callback:height, target: 0.45},
	'.half': {callback:height_strict, target: 0.5},
	'.half-strict': {callback:height_strict, target: 0.5},
	'.half-h': {callback:width, target: 0.5},
	'.ninety': {callback: height, target: 0.9},
	'.ninety-h': {callback:width, target: 0.9},
	'.three-quarter': {callback: height, target: 0.75},
	'.three-quarter-strict': {callback: height_strict, target: 0.75},
	'.all': {callback: height, target: 1},
	'.all-h': {callback:width, target: 1},
	'.all-strict': {callback:height_strict, target: 1},
	//'.double': {callback: height, target: 2},
	'.eighty-five': {callback: height, target: 0.85},
	'.eighty': {callback: height_strict, target: 0.8},
	'.height-is-width': {callback: equal_height, target: undefined },
	//'.width-is-height': {callback: equal_width, target: undefined }
};

function recalculate() {
	for ( var selector in actionmap ) {
		if ( actionmap.hasOwnProperty( selector ) ) {
			var els = $(selector);
			if ( els.length > 0 ) {
				actionmap[ selector ].callback( 
					actionmap[ selector ].target,
					els
				); 
			}
		}	
	}

	$(document).trigger('dom-is-sized');
}

$( document ).ready( function() {
	$(window).on('resize', recalculate);
	$(document).on('force-resize', recalculate);
	recalculate();
});
{'fraction_non_alphanumeric': 0.20598633042658496, 'fraction_numerical': 0.019797313221777045, 'mean_word_length': 4.490297542043985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7192370', 'n_tokens_mistral': 1560, 'n_tokens_neox': 1435, 'n_words': 344}