<commit_before>var device = function() {
		this.deviceData;

		this.$el;
		this.$hardware;
		this.$iframe;
		this.$name;
		this.$size;

		this.elSize = {
			h: null,
			w: null
		};
		this.hardwareSize = {
			h: null,
			w: null
		};
	},
	p = device.prototype;

p.init = function(deviceData) {
	this.createDevice();
	this.events();

	this.update(deviceData);

	return this;
}

p.createDevice = function() {
	// main el
	this.$el = document.createElement('div');
	this.$el.classList.add('device');

	// hardware
	this.$hardware = document.createElement('div');
	this.$hardware.classList.add('hardware');

	// frame
	this.$iframe = document.createElement('iframe');

	// info
	this.$name = document.createElement('div');
	this.$name.classList.add('name');

	this.$size = document.createElement('div');	
	this.$size.classList.add('size');

	this.$el.appendChild(this.$name);
	this.$el.appendChild(this.$size);

	this.$hardware.appendChild(this.$iframe);
	this.$el.appendChild(this.$hardware);

	_stage.$el.appendChild(this.$el);
}

p.events = function() {
	//this.$el.addEventListener('resize', this.$el);
	//this.$iframe.addEventListener('focus', this.$el);

	this.$iframe.addEventListener('load', this.sendIframeLoad);
}

p.update = function(data) {
	this.deviceData = data;

	this.$name.innerText = data.name;
	this.$size.innerText = data.w  + 'x' + data.h;
	this.$iframe.height = data.h;
	this.$iframe.width = data.w;

	// remove other types ... lame
	this.$hardware.classList.add(data.type);

	this.getHardwareSize();
}

p.getHardwareSize = function() {
	var $dummy = this.$el.cloneNode(true),
		$dummyHardware = $dummy.querySelector('.hardware');
	$dummy.classList.add('dummy');
	$dummy.querySelector('iframe').src = '';
	$dummyHardware.style.width = "auto";
	$dummyHardware.style.height = "auto";
	$dummy.style.width = "auto";
	$dummy.style.height = "auto";
	_stage.$el.appendChild($dummy);

	console.log(['dummy Sizing', $dummy.offsetWidth, $dummy.offsetHeight]);
	this.elSize = {
		h: $dummy.offsetHeight,
		w: $dummy.offsetWidth
	};
	this.hardwareSize = {<commit_msg>removed device js load listener<commit_after>var device = function() {
		this.deviceData;

		this.$el;
		this.$hardware;
		this.$iframe;
		this.$name;
		this.$size;

		this.elSize = {
			h: null,
			w: null
		};
		this.hardwareSize = {
			h: null,
			w: null
		};
	},
	p = device.prototype;

p.init = function(deviceData) {
	this.createDevice();
	this.events();

	this.update(deviceData);

	return this;
}

p.createDevice = function() {
	// main el
	this.$el = document.createElement('div');
	this.$el.classList.add('device');

	// hardware
	this.$hardware = document.createElement('div');
	this.$hardware.classList.add('hardware');

	// frame
	this.$iframe = document.createElement('iframe');

	// info
	this.$name = document.createElement('div');
	this.$name.classList.add('name');

	this.$size = document.createElement('div');	
	this.$size.classList.add('size');

	this.$el.appendChild(this.$name);
	this.$el.appendChild(this.$size);

	this.$hardware.appendChild(this.$iframe);
	this.$el.appendChild(this.$hardware);

	_stage.$el.appendChild(this.$el);
}

p.events = function() {
	//this.$el.addEventListener('resize', this.$el);
	//this.$iframe.addEventListener('focus', this.$el);

	//this.$iframe.addEventListener('load', this.sendIframeLoad);
}

p.update = function(data) {
	this.deviceData = data;

	this.$name.innerText = data.name;
	this.$size.innerText = data.w  + 'x' + data.h;
	this.$iframe.height = data.h;
	this.$iframe.width = data.w;

	// remove other types ... lame
	this.$hardware.classList.add(data.type);

	this.getHardwareSize();
}

p.getHardwareSize = function() {
	var $dummy = this.$el.cloneNode(true),
		$dummyHardware = $dummy.querySelector('.hardware');
	$dummy.classList.add('dummy');
	$dummy.querySelector('iframe').src = '';
	$dummyHardware.style.width = "auto";
	$dummyHardware.style.height = "auto";
	$dummy.style.width = "auto";
	$dummy.style.height = "auto";
	_stage.$el.appendChild($dummy);

	// console.log(['dummy Sizing', $dummy.offsetWidth, $dummy.offsetHeight]);
	this.elSize = {
		h: $dummy.offsetHeight,
		w: $dummy.offsetWidth
	};
	this.hardwareSize = {
{'fraction_non_alphanumeric': 0.193718532725965, 'fraction_numerical': 0.0, 'mean_word_length': 4.201995012468828, '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': '51593', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1449, 'n_words': 224}