<commit_before>define(["dojo/_base/declare", "dojo/on", "./List", "put-selector/put", "dojo/has"], function(declare, listen, List, put, has){
return declare([List], {
	// summary:
	// 		Add selection capabilities to a grid. The grid will have a selection property and
	//		fire "select" and "deselect" events.
	
	create: function(){
		this.selection = {};
		return this.inherited(arguments);
	},
	postCreate: function(){
		this.inherited(arguments);
		var lastRow, mode = this.selectionMode;
		var grid = this;		
		if(this.selectionMode != "none"){
			// this is to stop IE 8's web accelerator and selection
			listen(grid.domNode, "selectstart", function(event){
				event.preventDefault();
			});
			function focus(event){
				if(!event._selected && (event.type == "mousedown" || !event.ctrlKey || event.keyCode == 32)){
					event._selected = true;
					var row = event.target;
					console.log("in focus");
					if(mode == "single" && lastRow && event.ctrlKey){
						grid.deselect(lastRow);
						if(lastRow == row){
							return;
						}
					}
					if(!event.ctrlKey){
						if(mode != "multiple"){
							grid.clearSelection();
						}
						grid.select(row);
					}else{
						grid.select(row, null, null);
					}
					if(event.shiftKey && mode != "single"){
						grid.select(lastRow, row);
					}else{
						lastRow = row;
					}
					if(event.type == "mousedown" && (event.shiftKey || event.ctrlKey)){
						// prevent selection in firefox
						event.preventDefault();
					}
				}
				
			}
			// listen for actions that should cause selections<commit_msg>testing selection<commit_after>define(["dojo/_base/declare", "dojo/on", "./List", "put-selector/put", "dojo/has"], function(declare, listen, List, put, has){
return declare([List], {
	// summary:
	// 		Add selection capabilities to a grid. The grid will have a selection property and
	//		fire "select" and "deselect" events.
	
	create: function(){
		this.selection = {};
		return this.inherited(arguments);
	},
	postCreate: function(){
		this.inherited(arguments);
		var lastRow, mode = this.selectionMode;
		var grid = this;		
		if(this.selectionMode != "none"){
			// this is to stop IE 8's web accelerator and selection
			listen(grid.domNode, "selectstart", function(event){
				event.preventDefault();
			});
			function focus(event){
				if(!event._selected && (event.type == "mousedown" || !event.ctrlKey || event.keyCode == 32)){
					event._selected = true;
					var row = event.target;
					console.log("in focus");
					if(mode == "single" && lastRow && event.ctrlKey){
						console.log("1");
						grid.deselect(lastRow);
						if(lastRow == row){
							return;
						}
					}
					if(!event.ctrlKey){
						console.log("2");
						if(mode != "multiple"){
							console.log("3");
							grid.clearSelection();
						}
						grid.select(row);
					}else{
						console.log("4");
						grid.select(row, null, null);
					}
					if(event.shiftKey && mode != "single"){
						console.log("5");
						grid.select(lastRow, row);
					}else{
						console.log("6");
						lastRow = row;
					}
					if(event.type == "mousedown" && (event.shiftKey || event.ctrlKey)){
						// prevent selection in firefox
						event.preventDefault();
					}
				}
				
			}
			// listen for actions that should cause selections
{'fraction_non_alphanumeric': 0.16226071103008205, 'fraction_numerical': 0.0036463081130355514, 'mean_word_length': 2.7709049255441007, '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': '4685452', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1015, 'n_words': 244}