<commit_before>// Browser detection for when you get desparate. A measure of last resort.
// http://rog.ie/post/9089341529/html5boilerplatejs

// var b = document.documentElement;
// b.setAttribute('data-useragent',  navigator.userAgent);
// b.setAttribute('data-platform', navigator.platform);

// sample CSS: html[data-useragent*='Chrome/13.0'] { ... }


// remap jQuery to $
(function($){
	var STATES = Object.freeze({EMPTY:0,UNLOADED:1,LOADING:2,LOADED:3});

	var typeTimeout = -1;
	var loadTimeout = -1;
	var averageRespTime = 100;
	var state = STATES.EMPTY;
	var search = null;
	
	var KEYTIMEOUT = 1000;

	/* trigger when page is ready */
	$(document).ready(function (){
		var searchDiv = $(".search")
		var searchBar = $(".search .search-bar");
		var searchProgress = $(".search .search-progress");
		var resultsDiv = $(".content");
		var footer = $("footer");
		
		searchBar.eq(0).focus();
		
		var progress = new ProgressIndicator(searchProgress);
		var pos = new BoxPos(searchDiv);
		
		var hash = location.hash;
		var results = new ResultsDisplayer(resultsDiv,SEARCHSTRING[hash]);
		
		//to stop flash at top before centred.
		searchDiv.transition({opacity:1},500);
		
		searchBar.keyup(function(ev){
			//enter
			if(ev.keyCode == 13) {
				searchBar.blur();
			}
		});
		
		searchBar.bind('input propertychange', function(d,e,f) {

			var l = searchBar.val().length;
			
			if(l > 2) {
				progress.startForward();
				pos.startForward();
				results.startSearch(searchBar.val());
			} else if (l == 0 /* AND showing results */){
				progress.startBackwards();
				pos.startBackwards();
				results.clear();
			}
			
		});
		
		footer.click(function(){
			$(".moreinfo",footer).remodal().open();
		});
	});	
	
	$(window).resize(function (){
		if(state == STATES.EMPTY){
			$('.search').css({
				top: ($(window).height() - $('.search').outerHeight())/2
			});
		}
    });
	<commit_msg>Make so attribution popup can open multiple times<commit_after>// Browser detection for when you get desparate. A measure of last resort.
// http://rog.ie/post/9089341529/html5boilerplatejs

// var b = document.documentElement;
// b.setAttribute('data-useragent',  navigator.userAgent);
// b.setAttribute('data-platform', navigator.platform);

// sample CSS: html[data-useragent*='Chrome/13.0'] { ... }


// remap jQuery to $
(function($){
	var STATES = Object.freeze({EMPTY:0,UNLOADED:1,LOADING:2,LOADED:3});

	var typeTimeout = -1;
	var loadTimeout = -1;
	var averageRespTime = 100;
	var state = STATES.EMPTY;
	var search = null;
	
	var KEYTIMEOUT = 1000;

	/* trigger when page is ready */
	$(document).ready(function (){
		var searchDiv = $(".search")
		var searchBar = $(".search .search-bar");
		var searchProgress = $(".search .search-progress");
		var resultsDiv = $(".content");
		var footer = $("footer");
		
		searchBar.eq(0).focus();
		
		var progress = new ProgressIndicator(searchProgress);
		var pos = new BoxPos(searchDiv);
		
		var hash = location.hash;
		var results = new ResultsDisplayer(resultsDiv,SEARCHSTRING[hash]);
		
		//to stop flash at top before centred.
		searchDiv.transition({opacity:1},500);
		
		searchBar.keyup(function(ev){
			//enter
			if(ev.keyCode == 13) {
				searchBar.blur();
			}
		});
		
		searchBar.bind('input propertychange', function(d,e,f) {

			var l = searchBar.val().length;
			
			if(l > 2) {
				progress.startForward();
				pos.startForward();
				results.startSearch(searchBar.val());
			} else if (l == 0 /* AND showing results */){
				progress.startBackwards();
				pos.startBackwards();
				results.clear();
			}
			
		});
		
		var attrInfo = $(".moreinfo",footer).remodal()
		
		footer.click(function(){
			attrInfo.open();
		});
	});	
	
	$(window).resize(function (){
		if(state == STATES.EMPTY){
			$('.search').css({
				top: ($(window).height() - $('.search').outerHeight())/2
			});
		}
    });
	
{'fraction_non_alphanumeric': 0.17845117845117844, 'fraction_numerical': 0.019166019166019167, 'mean_word_length': 3.403648802736602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6017885', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1254, 'n_words': 272}