<commit_before>document.addEventListener('click', hzClick, false);
document.addEventListener('mousemove', hzMotion, true);
document.addEventListener('wheel', function(event) { self.port.emit('wheel', event.deltaY) }, true);

var c = document.getElementById('panelContainer');
var i = document.getElementById('panelImg');
var v = document.getElementById('panelVid');

self.port.on('image', function(img, x, y, txt) {
	v.style.display = 'none';
	i.style.display = 'block';
	i.width = x;
	i.height = y;
	if(y < c.offsetHeight) {
		i.style.marginTop = Math.round((c.offsetHeight - y) / 2).toString();
	} else {
		i.style.marginTop = "0";
	}
	i.src = img;
	hzCaption(txt);
//	console.log("panel: set image to "+img);
});

self.port.on('video', function(vid, x, y, txt) {
	i.style.display = 'none';
	v.style.display = 'block';
	v.width = x;
	v.height = y;
    v.src = vid;
	hzCaption(txt);
//	console.log("panel: set video to "+vid);
});

var t = document.getElementById('panelText');
function hzCaption(str) {
	str = str || "";
	while(t.firstChild) { t.removeChild(t.firstChild) }
	t.appendChild(document.createTextNode(str));
}

function hzClick(event) {
	if(event.button == 0) { self.port.emit('click', true) }
	else { self.port.emit('click', false) }
}

//this is a hack but works well enough for now...<commit_msg>the panels are fighting with quick mouseovers<commit_after>document.addEventListener('click', hzClick, false);
document.addEventListener('mousemove', hzMotion, true);
document.addEventListener('wheel', function(event) { self.port.emit('wheel', event.deltaY) }, true);

var c = document.getElementById('panelContainer');
var i = document.getElementById('panelImg');
var v = document.getElementById('panelVid');

self.port.on('image', function(img, x, y, txt) {
	v.src = "blank.gif";
	v.style.display = 'none';
	i.style.display = 'block';
	i.width = x;
	i.height = y;
	if(y < c.offsetHeight) {
		i.style.marginTop = Math.round((c.offsetHeight - y) / 2).toString();
	} else {
		i.style.marginTop = "0";
	}
	i.src = img;
	hzCaption(txt);
//	console.log("panel: set image to "+img);
});

self.port.on('video', function(vid, x, y, txt) {
	i.src = "blank.gif";
	i.style.display = 'none';
	v.style.display = 'block';
	v.width = x;
	v.height = y;
    v.src = vid;
	hzCaption(txt);
//	console.log("panel: set video to "+vid);
});

var t = document.getElementById('panelText');
function hzCaption(str) {
	str = str || "";
	while(t.firstChild) { t.removeChild(t.firstChild) }
	t.appendChild(document.createTextNode(str));
}

function hzClick(event) {
	if(event.button == 0) { self.port.emit('click', true) }
	else { self.port.emit('click', false) }
}

//this is a hack but works well enough for now...
{'fraction_non_alphanumeric': 0.19096965210954847, 'fraction_numerical': 0.0022205773501110288, 'mean_word_length': 4.505091649694501, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1490866', 'n_tokens_mistral': 979, 'n_tokens_neox': 967, 'n_words': 209}