<commit_before>$(document).ready(
    function() {
	    $("button").click(function(event) {
		    var actionType = $(this).attr('id');
		    $.post('?action=' + actionType, {
			    dirName : $("#dirName").val() });
		    event.preventDefault();
	    });

	    $("a.file").live('click', function(event) {
		    var fileName = $(this).text();
		    $.post('?action=getDownloadToken', {
			    fileName : fileName }, function(data) {
			    var resp = jQuery.parseJSON(data);
			    window.location.href = resp.downloadLocation;
		    });
		    event.preventDefault();
	    });

	    $("a.menu").live(
	        'click',
	        function(event) {
		        var actionType = $(this).attr('id');

		        $.getJSON('?action=' + actionType, function(data) {
			        var items = [];

			        if (actionType === 'getFileList') {
				        $.each(data.files, function(key, val) {
					        if (val.isDirectory) {
						        items.push('<tr><th>' + key + '</th><td>[DIR]</td></tr>>');
					        } else {
						        items.push('<tr><th><a href="#" class="file">' + key
						            + '</a></th><td>' + val.fileSize + '</td></tr>>');
					        }
				        });
			        } else {
				        $.each(data, function(key, val) {
					        items.push('<tr><th>' + key + '</th><td>' + val
					            + '</td></tr>>');
				        });
			        }
			        $("#output").html($('<table/>', {
			          'class' : 'my-new-list',
			          html : items.join('') }));

		        });
		        event.preventDefault();
	        });

	    $("input").change(function(event) {
		    var f = this.files[0];

		    var fileName = $(this).text();
		    $.post('?action=getUploadToken', {
		      fileName : f.name,
		      fileSize : f.size }, function(data) {
			    var resp = jQuery.parseJSON(data);
			    var uploadUrl = resp.uploadLocation;
			    alert(uploadUrl);
		    });
		    event.preventDefault();

		    // var xhr = new XMLHttpRequest();
		    // xhr.open("PUT", 'http://192.87.110.161<?php echo
		    // $_SERVER['SCRIPT_NAME']; ?>?action=upload&fileName='+file.name,
		    // true);
		    // xhr.setRequestHeader('X-File-Name', file.name);
		    // xhr.send(file);
	    });
    });<commit_msg>not bad!<commit_after>$(document).ready(
    function() {
	    $("button").click(function(event) {
		    var actionType = $(this).attr('id');
		    $.post('?action=' + actionType, {
			    dirName : $("#dirName").val() });
		    event.preventDefault();
	    });

	    $("a.file").live('click', function(event) {
		    var fileName = $(this).text();
		    $.post('?action=getDownloadToken', {
			    fileName : fileName }, function(data) {
			    var resp = jQuery.parseJSON(data);
			    window.location.href = resp.downloadLocation;
		    });
		    event.preventDefault();
	    });

	    $("a.menu").live(
	        'click',
	        function(event) {
		        var actionType = $(this).attr('id');

		        $.getJSON('?action=' + actionType, function(data) {
			        var items = [];

			        if (actionType === 'getFileList') {
				        $.each(data.files, function(key, val) {
					        if (val.isDirectory) {
						        items.push('<tr><th>' + key + '</th><td>[DIR]</td></tr>>');
					        } else {
						        items.push('<tr><th><a href="#" class="file">' + key
						            + '</a></th><td>' + val.fileSize + '</td></tr>>');
					        }
				        });
			        } else {
				        $.each(data, function(key, val) {
					        items.push('<tr><th>' + key + '</th><td>' + val
					            + '</td></tr>>');
				        });
			        }
			        $("#output").html($('<table/>', {
			          'class' : 'my-new-list',
			          html : items.join('') }));

		        });
		        event.preventDefault();
	        });

	    $("input").change(function(event) {
		    var f = this.files[0];

		    var fileName = $(this).text();
		    $.post('?action=getUploadToken', {
		      fileName : f.name,
		      fileSize : f.size }, function(data) {
			    var resp = jQuery.parseJSON(data);
			    var uploadUrl = resp.uploadLocation;
			    alert(uploadUrl);
				
				var xhr = new XMLHttpRequest();
				xhr.open("PUT", uploadUrl, true);
				xhr.send(f);

		    });
		    event.preventDefault();
	    });
    });
{'fraction_non_alphanumeric': 0.21046484466246204, 'fraction_numerical': 0.003036673674375146, 'mean_word_length': 1.8060288335517694, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6490935', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1272, 'n_words': 206}