<commit_before>$(function() {
	
	$("form :button").each(function(){
		
		var button = $(this);
		
		if ($(button).attr('id') == 'cancel') {
			$(button).click(function(e){
				e.preventDefault();
				history.back();
			});
		} 
		else {
			$(button).click(function(e){
				
				var buttonId = $(button).attr('id');
				
				if (typeof buttonId !== 'undefined') {
					
					e.preventDefault();
					var form = $(this).closest('form');
					var originalActionUrl = $(form).attr('action');
					
					if ($(form).valid()) {
						
						if (buttonId == "plan" || buttonId == "apply") {
							$('#myModal').modal('toggle');
						}
						
						var submit = true;
						
						if (buttonId.startsWith('delete')) {
							submit = confirm('Do you really want to delete this item?');
							if (submit) {
								$('#myModal').modal('toggle');
							}
						}
							
						if (submit) {
							$(form).attr('action', originalActionUrl + "/" + buttonId);
							$(form).submit();
							$(form).attr('action', originalActionUrl);
						}
					}
				}
			});
		}
	});
	
	$('#datatable').DataTable({
        responsive: true,
        order: [[ 0, 'desc' ]]
    });
});<commit_msg>Fix for vm list ordering<commit_after>$(function() {
	
	$("form :button").each(function(){
		
		var button = $(this);
		
		if ($(button).attr('id') == 'cancel') {
			$(button).click(function(e){
				e.preventDefault();
				history.back();
			});
		} 
		else {
			$(button).click(function(e){
				
				var buttonId = $(button).attr('id');
				
				if (typeof buttonId !== 'undefined') {
					
					e.preventDefault();
					var form = $(this).closest('form');
					var originalActionUrl = $(form).attr('action');
					
					if ($(form).valid()) {
						
						if (buttonId == "plan" || buttonId == "apply") {
							$('#myModal').modal('toggle');
						}
						
						var submit = true;
						
						if (buttonId.startsWith('delete')) {
							submit = confirm('Do you really want to delete this item?');
							if (submit) {
								$('#myModal').modal('toggle');
							}
						}
							
						if (submit) {
							$(form).attr('action', originalActionUrl + "/" + buttonId);
							$(form).submit();
							$(form).attr('action', originalActionUrl);
						}
					}
				}
			});
		}
	});
	
	$('#datatable').DataTable({
        responsive: true,
        order: [[ 0, 'asc' ]]
    });
});
{'fraction_non_alphanumeric': 0.21101694915254238, 'fraction_numerical': 0.000847457627118644, 'mean_word_length': 2.135458167330677, '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': '1466851', 'n_tokens_mistral': 1089, 'n_tokens_neox': 720, 'n_words': 138}