<commit_before>// Settings
var contentWidth = 2000;
var contentHeight = 2000;
var cellWidth = 100;
var cellHeight = 100;

// Intialize layout
var container = document.getElementById("container");
var content = document.getElementById("content");
var clientWidth = 0;
var clientHeight = 0;

// Initialize Scroller
this.scroller = new Scroller(function(left, top, zoom) {
	render(left, top, zoom);

	document.getElementById("scrollLeft").value = left.toFixed(2);
	document.getElementById("scrollTop").value = top.toFixed(2);
	document.getElementById("zoomLevel").value = zoom.toFixed(2);
}, {
	zooming: true
});


var rect = container.getBoundingClientRect();
scroller.setPosition(rect.left + container.clientLeft, rect.top + container.clientTop);


// Reflow handling
var reflow = function() {
	clientWidth = container.clientWidth;
	clientHeight = container.clientHeight;
	scroller.setDimensions(clientWidth, clientHeight, contentWidth, contentHeight);
};

window.addEventListener("resize", reflow, false);
reflow();<commit_msg>disabled writing demo values back to inputs in render callback to fix demo perf issues (see http://paulbakaus.com/2011/10/10/scroller-vs-scrollability-deathmatch/)<commit_after>// Settings
var contentWidth = 2000;
var contentHeight = 2000;
var cellWidth = 100;
var cellHeight = 100;

// Intialize layout
var container = document.getElementById("container");
var content = document.getElementById("content");
var clientWidth = 0;
var clientHeight = 0;

// Initialize Scroller
this.scroller = new Scroller(function(left, top, zoom) {
	render(left, top, zoom);
	
	
	// don't run those updates on iOS etc. as they're very CPU heavy. See http://paulbakaus.com/2011/10/10/scroller-vs-scrollability-deathmatch/ for details
	if(!/android|iphone|ipad|webos/i.test(navigator.userAgent)) {
		document.getElementById("scrollLeft").value = left.toFixed(2);
		document.getElementById("scrollTop").value = top.toFixed(2);
		document.getElementById("zoomLevel").value = zoom.toFixed(2);
	}
	
}, {
	zooming: true
});

var rect = container.getBoundingClientRect();
scroller.setPosition(rect.left + container.clientLeft, rect.top + container.clientTop);


// Reflow handling
var reflow = function() {
	clientWidth = container.clientWidth;
	clientHeight = container.clientHeight;
	scroller.setDimensions(clientWidth, clientHeight, contentWidth, contentHeight);
};

window.addEventListener("resize", reflow, false);
reflow();
{'fraction_non_alphanumeric': 0.13081036610448374, 'fraction_numerical': 0.02221308103661045, 'mean_word_length': 5.7368421052631575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1936724', 'n_tokens_mistral': 762, 'n_tokens_neox': 704, 'n_words': 172}