<commit_before><html>
<head>
<script src="../OLLoader.js"></script>
<script type="text/javascript">

var log, events, layer1, style, logevt, map, lonlat, pixel;

window.onload = init;

function init() {

	style = new OpenLayers.StyleMap({
		 'default': OpenLayers.Util.applyDefaults(
		     {label: "${l}", pointRadius: 30},
		     OpenLayers.Feature.Vector.style["default"]
		 ),
		 'select': OpenLayers.Util.applyDefaults(
		     {pointRadius: 30},
		     OpenLayers.Feature.Vector.style.select
		 )
	});
	
	layer1 = new OpenLayers.Layer.Vector("Layer 1", {
		 styleMap: style
	});

	layer1.addFeatures([
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1}),
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1}),
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1}),
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1})
	]);

	map = new OpenLayers.Map({
		div: "map",
		allOverlays: true,
		zoom: 6,
		center: [0, 0]
	});
	
	map.addLayers([layer1]);
	
	/**Uncomment to view behavior w/in featureclick.html
	map.events.on({featureclick: logEvent});
	logevt = [];
	events = map.events;
	
	var lonlat = new OpenLayers.LonLat(0,0);
	var pixel = map.getPixelFromLonLat(lonlat);
	
	trigger('mousedown', pixel);
	trigger('mouseup', pixel);

	alert("logevt length = " + logevt.length);
	//*/
}


function logEvent(e) {

	//alert("Does this happen?");
	logevt.push(e);
}

function trigger(type, pxl) {

	events.triggerEvent(type, {
		xy: pxl, 
		clientX: pxl.x, 
		clientY: pxl.y, 
		which: 1  // which == 1 means left-click
	}); 	
}

// TESTS

function test_onClick23(t) {
	t.plan(1);
	logevt = [];
	map.events.on({featureclick: logEvent()});
	events = map.events;
	lonlat = new OpenLayers.LonLat(0,0);
	pixel = map.getPixelFromLonLat(lonlat);
	trigger('mousedown', pixel);
	trigger('mouseup', pixel);
	t.eq(logevt.length, 2, "testing log length");
	t.wait_result( 3 );
}

// END TESTS

</script>
</head>
<body onload="init()">
<div id="map" style="width: 600px; height: 300px;"></div>
</body>
</html><commit_msg>added pagePosition to clientX, clientY<commit_after><html>
<head>
<script src="../OLLoader.js"></script>
<script type="text/javascript">

var events, layer1, style, logevt, map, lonlat, pixel, element;

window.onload = init;

function init() {

	element = document.getElementById("map");

	style = new OpenLayers.StyleMap({
		 'default': OpenLayers.Util.applyDefaults(
		     {label: "${l}", pointRadius: 30},
		     OpenLayers.Feature.Vector.style["default"]
		 ),
		 'select': OpenLayers.Util.applyDefaults(
		     {pointRadius: 30},
		     OpenLayers.Feature.Vector.style.select
		 )
	});
	
	layer1 = new OpenLayers.Layer.Vector("Layer 1", {
		 styleMap: style
	});

	layer1.addFeatures([
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1}),
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1}),
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1}),
		 new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(0 0)"), {l:1})
	]);

	map = new OpenLayers.Map({
		div: "map",
		allOverlays: true,
		zoom: 6,
		center: [0, 0]
	});
	
	map.addLayers([layer1]);
	
	/**Uncomment to view behavior w/in featureclick.html
	map.events.on({featureclick: logEvent});
	logevt = [];
	events = map.events;
	
	lonlat = new OpenLayers.LonLat(0,0);
	pixel = map.getPixelFromLonLat(lonlat);
	
	trigger('mousedown', pixel);
	trigger('mouseup', pixel);

	alert("logevt length = " + logevt.length);
	//*/
}


function logEvent(e) {

	//alert("Does this happen?");
	logevt.push(e);
}

function trigger(type, pxl) {

	var map_position = OpenLayers.Util.pagePosition(element);

	pxl.x = pxl.x + map_position[0];
	pxl.y = pxl.y + map_position[1];

	events.triggerEvent(type, {
		xy: pxl, 
		clientX: pxl.x, 
		clientY: pxl.y, 
		which: 1  // which == 1 means left-click
	}); 	
}

// TESTS

function test_onClick25(t) {
	window.onload = init();
	t.plan(1);
	logevt = [];
	map.events.on({'featureclick': logEvent});
	events = map.events;
	lonlat = new OpenLayers.LonLat(0,0);
	pixel = map.getPixelFromLonLat(lonlat);
	trigger('mousedown', pixel);
	trigger('mouseup', pixel);
	t.eq(logevt.length, 2, "testing log length");
}

// END TESTS

</script>
</head>
<body onload="init()">
<div id="map" style="width: 600px; height: 300px;"></div>
</body>
</html>
{'fraction_non_alphanumeric': 0.1835130278526505, 'fraction_numerical': 0.018643306379155435, 'mean_word_length': 4.214285714285714, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '1759886', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1664, 'n_words': 324}