<commit_before>/*
filedrag.js - HTML5 File Drag & Drop demonstration
Featured on SitePoint.com
Developed by <NAME> (@craigbuckler) of OptimalWorks.net
 */

(function() {

	// getElementById
	function $id(id) {
		return document.getElementById(id);
	}

	// initialize
	function Init() {

		$("#upload").submit(function(event){

			event.preventDefault();
			
			var xhr = new XMLHttpRequest();
			
			// file received/failed
			xhr.onreadystatechange = function(e) {
				if (xhr.readyState == 4) {
					$id("fileselect").value = '';
					//progress.className = (xhr.status == 200 ? "success" : "failure")
					if (xhr.status == 200) {
						//var response = xhr.responseText.split('$$$');						
						alert("Application(s) submitted successfully! Please check the 'Report' section.");//+response);
					} else {
						alert("Submission failed! Please check your inputs. ("+xhr.responseText+")");
					}
				}
			};

			// start upload
			xhr.open("POST", $id("upload").action, true);
			var formData = new FormData();
			var inputs = $("#upload input")
			$.each(inputs, function (i, v) {
				var name = $(v).attr("id");
				if ("fileselect"==name) {
					$.each(v.files, function (index,file){
						var filename = $(file).attr("data-filename");
						formData.append(name,file,filename)						
					})
				} else {
					formData.append(name,v.value)
				}
			})
			xhr.send(formData);
		})

	}

	// call initialization file
	if (window.File && window.FileList && window.FileReader) {
		Init();
	}

})();<commit_msg>Fixed chrome incompatibility<commit_after>/*
filedrag.js - HTML5 File Drag & Drop demonstration
Featured on SitePoint.com
Developed by <NAME> (@craigbuckler) of OptimalWorks.net
 */

(function() {

	// getElementById
	function $id(id) {
		return document.getElementById(id);
	}

	// initialize
	function Init() {

		$("#upload").submit(function(event){

			event.preventDefault();
			
			var xhr = new XMLHttpRequest();
			
			// file received/failed
			xhr.onreadystatechange = function(e) {
				if (xhr.readyState == 4) {
					$id("fileselect").value = '';
					//progress.className = (xhr.status == 200 ? "success" : "failure")
					if (xhr.status == 200) {
						//var response = xhr.responseText.split('$$$');						
						alert("Application(s) submitted successfully! Please check the 'Report' section.");//+response);
					} else {
						alert("Submission failed! Please check your inputs. ("+xhr.responseText+")");
					}
				}
			};

			// start upload
			xhr.open("POST", $id("upload").action, true);
			var formData = new FormData();
			var inputs = $("#upload input")
			$.each(inputs, function (i, v) {
				var name = $(v).attr("id");
				if ("fileselect"==name) {
					$.each(v.files, function (index,file){
						var filename = $(file).attr("name");
						formData.append(name,file,filename)						
					})
				} else {
					formData.append(name,v.value)
				}
			})
			xhr.send(formData);
		})

	}

	// call initialization file
	if (window.File && window.FileList && window.FileReader) {
		Init();
	}

})();
{'fraction_non_alphanumeric': 0.17555994729907773, 'fraction_numerical': 0.005270092226613966, 'mean_word_length': 2.9544270833333335, 'pattern_counts': {'":': 0, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5775542', 'n_tokens_mistral': 1254, 'n_tokens_neox': 972, 'n_words': 214}