<commit_before>(function(){
	
	var init = function init(){
		$('.issue-col').each(function(){
			this.addEventListener('drop', onDrop);
		});
		$('.issue').each(function(){
			this.addEventListener('dragstart', startDrag);
		});

		configFilterOptions();

		firebaseRef.child("issues").on("child_changed", updateIssues);
		firebaseRef.child("issues").on("child_added", updateIssues);
	};

	var resizeColumns = function resizeColumns(){
		var colHeight =  -1;
	    $('.issue-col').each(function() {
	    	$(this).height('initial');
	        var h = $(this).height();
	        colHeight = h > colHeight ? h : colHeight;
	    });
		$('.issue-col').height(colHeight);
	};

	var startDrag = function startDrag(e){
		e.dataTransfer.setData('text/plain', this.id);
	};
	var onDrop = function onDrop(e){
		var $issue = $('#'+event.dataTransfer.getData('text/plain'));
		var $newCol = $(e.target).closest('.issue-col');
		$issue.remove().appendTo($newCol);
		firebaseRef.child("issues").child($issue.attr('id')).update({
			"id":$issue.attr('id'),
			"column":$newCol.attr('id')
		})
	};

	var updateIssues = function updateIssues(snapshot){
		var $issue = $('#'+snapshot.val().id);
		var column = '#'+snapshot.val().column;
		if($issue.parents(column).length == 0){
			$issue.remove().appendTo(column);
		}
		$('.progress').remove();
		resizeColumns();
	};

	var configFilterOptions = function configFilterOptions(){
		var saveFilter = function saveFilter(){
			var formInputs = document.getElementById('filterForm').elements;
			var i=0, len = formInputs.length;
			var formValues = {};
			for(;i<len;i++){
				if(formInputs[i].type === "checkbox"){
					formValues[formInputs[i].id.replace(/\./g,'&46;')] = formInputs[i].checked;
				}else{
					formValues[formInputs[i].id.replace(/\./g,'&46;')] = formInputs[i].value;
				}
			}
			firebaseRef.child("filter").child(userId).update(formValues);

			filterIssues();
		};
		var loadFilter = function saveFilter(){
			firebaseRef.child("filter").child(userId).once("value", function(snapshot){
				var formValues = snapshot.val();
				if(formValues){
					Object.keys(formValues).forEach(function(key){
						if(formValues.hasOwnProperty(key)){
							var inputElement = document.getElementById(key.replace(/&46;/g,'.'));
							if(inputElement.type === "checkbox"){
								inputElement.checked = formValues[key];
							}else{
								inputElement.value = formValues[key];
							}
						}
					})
				}
				filterIssues();
			});			
		};
		var filterIssues = function filterIssues(){
			$('.issue').show();
			$('.js-githubuser').not(':checked').each(function(){
				$('.issue[data-username="'+$(this).parent().text().trim()+'"]').hide();
			});
			$('.js-label').not(':checked').each(function(){
				$('.issue[data-label*="'+$(this).parent().text().trim()+'"]').hide();
			});
			$('.js-repo').not(':checked').each(function(){
				$('.issue[data-repo="'+$(this).parent().text().trim()+'"]').hide();
			});			
			$('.js-state').not(':checked').each(function(){
				$('.issue[data-state="'+$(this).parent().text().trim()+'"]').hide();
			});
			$('.issue').each(function(){
				var lastUpdated = $(this).data('updated');
				var weeks = $('#dateRange').val();
				if(moment(lastUpdated).isBefore(moment().subtract(weeks, 'weeks'))){
					$(this).hide();
				}
			})

			$('#filterModal').modal('hide');
			resizeColumns();
		};
		var toggleAll = function toggleAll(e){
			var formInputs = $(this).parent().next().find('input');
			if(formInputs.not(':checked').length){
				formInputs.each(function(){
					this.checked = true;
				});
			}else{
				formInputs.each(function(){
					this.checked = false;
				});
			}
			e.preventDefault();
		};

		$('#saveFilterButton').on('click', saveFilter);
		$('[data-action="toggleAll"]').on('click', toggleAll);
		loadFilter();
	};

	$(document).on('firebase-ready', init);
	resizeColumns();
}());<commit_msg>More performant hide/show<commit_after>(function(){
	
	var init = function init(){
		$('.issue-col').each(function(){
			this.addEventListener('drop', onDrop);
		});
		$('.issue').each(function(){
			this.addEventListener('dragstart', startDrag);
		});

		configFilterOptions();

		firebaseRef.child("issues").on("child_changed", updateIssues);
		firebaseRef.child("issues").on("child_added", updateIssues);
	};

	var resizeColumns = function resizeColumns(){
		var colHeight =  -1;
	    $('.issue-col').each(function() {
	    	$(this).height('initial');
	        var h = $(this).height();
	        colHeight = h > colHeight ? h : colHeight;
	    });
		$('.issue-col').height(colHeight);
	};

	var startDrag = function startDrag(e){
		e.dataTransfer.setData('text/plain', this.id);
	};
	var onDrop = function onDrop(e){
		var $issue = $('#'+event.dataTransfer.getData('text/plain'));
		var $newCol = $(e.target).closest('.issue-col');
		$issue.remove().appendTo($newCol);
		firebaseRef.child("issues").child($issue.attr('id')).update({
			"id":$issue.attr('id'),
			"column":$newCol.attr('id')
		})
	};

	var updateIssues = function updateIssues(snapshot){
		var $issue = $('#'+snapshot.val().id);
		var column = '#'+snapshot.val().column;
		if($issue.parents(column).length == 0){
			$issue.remove().appendTo(column);
		}
		$('.progress').remove();
		resizeColumns();
	};

	var filterIssues = function filterIssues(){
		$('.issue').removeClass('hide');
		$('.js-githubuser').not(':checked').each(function(){
			$('.issue[data-username="'+$(this).parent().text().trim()+'"]').addClass('hide');
		});
		$('.js-label').not(':checked').each(function(){
			$('.issue[data-label*="'+$(this).parent().text().trim()+'"]').addClass('hide');
		});
		$('.js-repo').not(':checked').each(function(){
			$('.issue[data-repo="'+$(this).parent().text().trim()+'"]').addClass('hide');
		});			
		$('.js-state').not(':checked').each(function(){
			$('.issue[data-state="'+$(this).parent().text().trim()+'"]').addClass('hide');
		});
		$('.issue').each(function(){
			var lastUpdated = $(this).data('updated');
			var weeks = $('#dateRange').val();
			if(moment(lastUpdated).isBefore(moment().subtract(weeks, 'weeks'))){
				$(this).addClass('hide');
			}
		})

		$('#filterModal').modal('hide');
		resizeColumns();
	};

	var configFilterOptions = function configFilterOptions(){
		var saveFilter = function saveFilter(){
			var formInputs = document.getElementById('filterForm').elements;
			var i=0, len = formInputs.length;
			var formValues = {};
			for(;i<len;i++){
				if(formInputs[i].type === "checkbox"){
					formValues[formInputs[i].id.replace(/\./g,'&46;')] = formInputs[i].checked;
				}else{
					formValues[formInputs[i].id.replace(/\./g,'&46;')] = formInputs[i].value;
				}
			}
			firebaseRef.child("filter").child(userId).update(formValues);

			filterIssues();
		};
		var loadFilter = function saveFilter(){
			firebaseRef.child("filter").child(userId).once("value", function(snapshot){
				var formValues = snapshot.val();
				if(formValues){
					Object.keys(formValues).forEach(function(key){
						if(formValues.hasOwnProperty(key)){
							var inputElement = document.getElementById(key.replace(/&46;/g,'.'));
							if(inputElement.type === "checkbox"){
								inputElement.checked = formValues[key];
							}else{
								inputElement.value = formValues[key];
							}
						}
					})
				}
				filterIssues();
			});			
		};
		var toggleAll = function toggleAll(e){
			var formInputs = $(this).parent().next().find('input');
			if(formInputs.not(':checked').length){
				formInputs.each(function(){
					this.checked = true;
				});
			}else{
				formInputs.each(function(){
					this.checked = false;
				});
			}
			e.preventDefault();
		};

		$('#saveFilterButton').on('click', saveFilter);
		$('[data-action="toggleAll"]').on('click', toggleAll);
		loadFilter();
	};

	$(document).on('firebase-ready', init);
	resizeColumns();
}());
{'fraction_non_alphanumeric': 0.23654679928589645, 'fraction_numerical': 0.0022953328232593728, 'mean_word_length': 4.0763754045307445, 'pattern_counts': {'":': 4, '<': 5, '<?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': '5684610', 'n_tokens_mistral': 2995, 'n_tokens_neox': 2552, 'n_words': 338}