<commit_before>(function(module) {

	var _MIN_SCALE = 0;
	var _MAX_SCALE = 1000;
	
	var _instances = {};

	var _class = function(id, fragmentsUrl, scale, orderBy, ascending) {
		_instances[id] = this;
		
		this.id = id;
		this.rootDiv = jQuery("#" + id);
		this.fragmentsUrl = fragmentsUrl;
		this.scale = scale;
		this.orderBy = orderBy;
		this.ascending = ascending;
		this.highlight = null;
		this.highlighted = false;
		this.headerDiv = this.rootDiv.find("div.view-header");
		this.contentDiv = this.rootDiv.find("div.view-content");
		this.pageIndex = 0;
		this.queryable = false;
		this.query = null;
		this.tagsToInclude = null;
		this.tagsToExclude = null;
		this.initialParams = {};
	};
	
	_class.refreshViews = function(highlightId) {
		jQuery.each(_instances, function(id) {
			this.refresh(highlightId);
		});
	};
	
	_class.prototype = jQuery.extend({
		
	  init: function () {
	    var outer = this;
	    this.rootDiv.find(".view-slider").slider({ 
	      max: _MAX_SCALE,
	      min: _MIN_SCALE,
	      value: outer.scale,
	      change: function(event, ui) {
	        outer.scale = ui.value;
	        outer.loadFirstSet();
	      }
	    });
	    this.rootDiv.find(".select-orderBy").change(function () {
	      outer.orderBy = jQuery(this).val();
	      outer.loadFirstSet();
	    });
	    this.rootDiv.find(".select-ascending-or-not button").click(function () {
	    	var button = jQuery(this);
	      if (!clickSelectSwitch(button)) return;     
	      outer.ascending = (button.attr("name") == "ascending");
	      outer.loadFirstSet();
	    });
	    
	    if (this.queryable) {
	    	this.headerDiv.find("span.label span.toggle").show();
		    this.headerDiv.find("span.label")
		    	.css("cursor", "pointer")
		    	.click(function() {
		    		var criteriaDiv = outer.headerDiv.find("div.fragments-criteria");
		    		criteriaDiv.toggle();
		    		
		    		jQuery(this).css("border-bottom-style", criteriaDiv.is(":visible") ? "none" : "solid");
		    		
		    		var icon = jQuery(this).find("span.toggle img");
		    		icon.attr("src", criteriaDiv.is(":visible") ? 
		    			icon.attr("src").replace("down", "up") : 
		    			icon.attr("src").replace("up", "down"))
		    	});
		    this.headerDiv.find("input.keywords")
			    .keyup(function() {
			    	outer.setCriteria();
			    	outer.loadFirstSet({lazyDisplay: true});
			    });
		    
		    var tagitConfig = {
          allowSpaces: true,
          autocomplete: {<commit_msg>added UI logic <commit_after>(function(module) {

	var _MIN_SCALE = 0;
	var _MAX_SCALE = 1000;
	
	var _instances = {};

	var _class = function(id, fragmentsUrl, scale, orderBy, ascending) {
		_instances[id] = this;
		
		this.id = id;
		this.rootDiv = jQuery("#" + id);
		this.fragmentsUrl = fragmentsUrl;
		this.scale = scale;
		this.orderBy = orderBy;
		this.ascending = ascending;
		this.highlight = null;
		this.highlighted = false;
		this.headerDiv = this.rootDiv.find("div.view-header");
		this.contentDiv = this.rootDiv.find("div.view-content");
		this.pageIndex = 0;
		this.queryable = false;
		this.query = null;
		this.tagsToInclude = null;
		this.tagsToExclude = null;
		this.initialParams = {};
	};
	
	_class.refreshViews = function(highlightId) {
		jQuery.each(_instances, function(id) {
			this.refresh(highlightId);
		});
	};
	
	_class.prototype = jQuery.extend({
		
	  init: function () {
	    var outer = this;
	    this.rootDiv.find(".view-slider").slider({ 
	      max: _MAX_SCALE,
	      min: _MIN_SCALE,
	      value: outer.scale,
	      change: function(event, ui) {
	        outer.scale = ui.value;
	        outer.loadFirstSet();
	      }
	    });
	    this.rootDiv.find(".select-orderBy").change(function () {
	      outer.orderBy = jQuery(this).val();
	      outer.loadFirstSet();
	    });
	    this.rootDiv.find(".select-ascending-or-not button").click(function () {
	    	var button = jQuery(this);
	      if (!clickSelectSwitch(button)) return;     
	      outer.ascending = (button.attr("name") == "ascending");
	      outer.loadFirstSet();
	    });
	    
	    if (this.queryable) {
	    	this.headerDiv.find("span.label span.toggle").show();
		    this.headerDiv.find("span.label")
		    	.css("cursor", "pointer")
		    	.click(function() {
		    		var criteriaDiv = outer.headerDiv.find("div.fragments-criteria");
		    		criteriaDiv.toggle();
		    		
		    		jQuery(this).css("border-bottom-style", criteriaDiv.is(":visible") ? "none" : "solid");
		    		
		    		var icon = jQuery(this).find("span.toggle img");
		    		icon.attr("src", criteriaDiv.is(":visible") ? 
		    			icon.attr("src").replace("down", "up") : 
		    			icon.attr("src").replace("up", "down"))
		    			
		    		var widthOfAndOr = outer.headerDiv.find(".tags-include-and-or").width();
		    		outer.headerDiv.find("div.tags-include").css("padding-right", widthOfAndOr + 10);
		    	});
		    this.headerDiv.find("input.keywords")
			    .keyup(function() {
			    	outer.setCriteria();
			    	outer.loadFirstSet({lazyDisplay: true});
			    });
		    
		    var tagitConfig = {
          allowSpaces: true,
          autocomplete: {
{'fraction_non_alphanumeric': 0.1628408867961546, 'fraction_numerical': 0.00274671375318815, 'mean_word_length': 2.6544802867383512, 'pattern_counts': {'":': 4, '<': 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': '5101672', 'n_tokens_mistral': 1917, 'n_tokens_neox': 1662, 'n_words': 263}