<commit_before>$(document).ready(function() {
	$('#file_action_panel').attr('activeAction', false);

	//drag/drop of files
	$('#fileList tr td.filename').draggable(dragOptions);
	$('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions);
	$('div.crumb').droppable(crumbDropOptions);
	$('#plugins>ul>li:first-child').droppable(crumbDropOptions);
	
	// Sets the file-action buttons behaviour :
	$('tr').live('mouseenter',function(event) {
		FileActions.display($(this).children('td.filename'));
	});
	$('tr').live('mouseleave',function(event) {
		FileActions.hide();
	});

	// Sets the file link behaviour :
	$('td.filename a').live('click',function(event) {
		event.preventDefault();
		var filename=$(this).parent().parent().data('file');
		if(!FileList.isLoading(filename)){
			var mime=$(this).parent().parent().data('mime');
			var type=$(this).parent().parent().data('type');
			var action=FileActions.getDefault(mime,type);
			if(action){
				action(filename);
			}
		}
	});
	
	// Sets the select_all checkbox behaviour :
	$('#select_all').click(function() {
		if($(this).attr('checked')){
			// Check all
			$('td.filename input:checkbox').attr('checked', true);
			$('td.filename input:checkbox').parent().parent().addClass('selected');
		}else{
			// Uncheck all
			$('td.filename input:checkbox').attr('checked', false);
			$('td.filename input:checkbox').parent().parent().removeClass('selected');
		}
		procesSelection();
	});
	
	$('td.filename input:checkbox').live('click',function() {
		var selectedCount=$('td.filename input:checkbox:checked').length;
		$(this).parent().parent().toggleClass('selected');
		if(!$(this).attr('checked')){
			$('#select_all').attr('checked',false);
		}else{
			if(selectedCount==$('td.filename input:checkbox').length){
				$('#select_all').attr('checked',true);
			}
		}
		procesSelection();
	});
	
	$('#file_newfolder_form').submit(function(event) {
		event.preventDefault();
		$.ajax({
			url: 'ajax/newfolder.php',
			data: "dir="+$('#dir').val()+"&foldername="+$('#file_newfolder_name').val(),
			complete: function(data){boolOperationFinished(data, function(){
				var date=formatDate(new Date());
				FileList.addDir($('#file_newfolder_name').val(),'0 B',date)
			});}
		});
		$('#file_newfolder_submit').fadeOut(250).trigger('vanish');
	});
	
	$('#file_newfolder_name').click(function(){
		if($('#file_newfolder_name').val() == 'New Folder'){
			$('#file_newfolder_name').val('');
		}
	});
	
	$('#file_newfolder_name').bind('keyup', adjustNewFolderSize);
	
	$('#file_newfolder_submit').bind('vanish', function() {
		$('#file_newfolder_name').bind('keyup', adjustNewFolderSize);
		unsplitSize($('#file_newfolder_name'),$('#file_newfolder_submit'));
	});
	
	$('#file_newfolder_name').focusout(function(){
		if($('#file_newfolder_name').val() == '') {
			$('#file_newfolder_form')[0].reset();
			$('#file_newfolder_submit').fadeOut(250).trigger('vanish');
		}
	});
	
	$('.download').click('click',function(event) {
		var files=getSelectedFiles('name').join(';');
		
		//send the browser to the download location
		var dir=$('#dir').val()||'/';
// 		alert(files);
		window.location='ajax/download.php?files='+encodeURIComponent(files)+'&dir='+encodeURIComponent(dir);
		return false;
	});
	
	$('.delete').click(function(event) {
		var files=getSelectedFiles('name').join(';');
		
		$.ajax({
			url: 'ajax/delete.php',
			data: "dir="+$('#dir').val()+"&files="+encodeURIComponent(files),
			complete: function(data){
				boolOperationFinished(data, function(){
					$('td.filename input:checkbox:checked').parent().parent().each(function(i,element){
						FileList.remove($(element).data('file'));
					});
				});
			}
		});
		
		return false;
	});

	$('.file_upload_start').live('change',function(){
		var form=$(this).parent().parent();
		var uploadId=form.attr('data-upload-id');
		var files=this.files;
		var target=form.children('iframe');<commit_msg>no longer show deleted files as selected<commit_after>$(document).ready(function() {
	$('#file_action_panel').attr('activeAction', false);

	//drag/drop of files
	$('#fileList tr td.filename').draggable(dragOptions);
	$('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions);
	$('div.crumb').droppable(crumbDropOptions);
	$('#plugins>ul>li:first-child').droppable(crumbDropOptions);
	
	// Sets the file-action buttons behaviour :
	$('tr').live('mouseenter',function(event) {
		FileActions.display($(this).children('td.filename'));
	});
	$('tr').live('mouseleave',function(event) {
		FileActions.hide();
	});

	// Sets the file link behaviour :
	$('td.filename a').live('click',function(event) {
		event.preventDefault();
		var filename=$(this).parent().parent().data('file');
		if(!FileList.isLoading(filename)){
			var mime=$(this).parent().parent().data('mime');
			var type=$(this).parent().parent().data('type');
			var action=FileActions.getDefault(mime,type);
			if(action){
				action(filename);
			}
		}
	});
	
	// Sets the select_all checkbox behaviour :
	$('#select_all').click(function() {
		if($(this).attr('checked')){
			// Check all
			$('td.filename input:checkbox').attr('checked', true);
			$('td.filename input:checkbox').parent().parent().addClass('selected');
		}else{
			// Uncheck all
			$('td.filename input:checkbox').attr('checked', false);
			$('td.filename input:checkbox').parent().parent().removeClass('selected');
		}
		procesSelection();
	});
	
	$('td.filename input:checkbox').live('click',function() {
		var selectedCount=$('td.filename input:checkbox:checked').length;
		$(this).parent().parent().toggleClass('selected');
		if(!$(this).attr('checked')){
			$('#select_all').attr('checked',false);
		}else{
			if(selectedCount==$('td.filename input:checkbox').length){
				$('#select_all').attr('checked',true);
			}
		}
		procesSelection();
	});
	
	$('#file_newfolder_form').submit(function(event) {
		event.preventDefault();
		$.ajax({
			url: 'ajax/newfolder.php',
			data: "dir="+$('#dir').val()+"&foldername="+$('#file_newfolder_name').val(),
			complete: function(data){boolOperationFinished(data, function(){
				var date=formatDate(new Date());
				FileList.addDir($('#file_newfolder_name').val(),'0 B',date)
			});}
		});
		$('#file_newfolder_submit').fadeOut(250).trigger('vanish');
	});
	
	$('#file_newfolder_name').click(function(){
		if($('#file_newfolder_name').val() == 'New Folder'){
			$('#file_newfolder_name').val('');
		}
	});
	
	$('#file_newfolder_name').bind('keyup', adjustNewFolderSize);
	
	$('#file_newfolder_submit').bind('vanish', function() {
		$('#file_newfolder_name').bind('keyup', adjustNewFolderSize);
		unsplitSize($('#file_newfolder_name'),$('#file_newfolder_submit'));
	});
	
	$('#file_newfolder_name').focusout(function(){
		if($('#file_newfolder_name').val() == '') {
			$('#file_newfolder_form')[0].reset();
			$('#file_newfolder_submit').fadeOut(250).trigger('vanish');
		}
	});
	
	$('.download').click('click',function(event) {
		var files=getSelectedFiles('name').join(';');
		
		//send the browser to the download location
		var dir=$('#dir').val()||'/';
// 		alert(files);
		window.location='ajax/download.php?files='+encodeURIComponent(files)+'&dir='+encodeURIComponent(dir);
		return false;
	});
	
	$('.delete').click(function(event) {
		var files=getSelectedFiles('name').join(';');
		
		$.ajax({
			url: 'ajax/delete.php',
			data: "dir="+$('#dir').val()+"&files="+encodeURIComponent(files),
			complete: function(data){
				boolOperationFinished(data, function(){
					var files=getSelectedFiles('name');
					for(var i=0;i<files.length;i++){
						FileList.remove(files[i]);
					}
					procesSelection();
				});
			}
		});
		
		return false;
	});

	$('.file_upload_start').live('change',function(){
		var form=$(this).parent().parent();
		var uploadId=form.attr('data-upload-id');
		var files=this.files;
		var target=form.children('iframe');
{'fraction_non_alphanumeric': 0.2351969504447268, 'fraction_numerical': 0.0021601016518424396, 'mean_word_length': 5.636593591905565, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7011788', 'n_tokens_mistral': 2845, 'n_tokens_neox': 2572, 'n_words': 312}