<commit_before>/*
 * Image drag and drop upload
 */
Dropzone.options.imageDropZone = {
	// Prevents Dropzone from uploading dropped files immediately
	autoProcessQueue : false,
	parallelUploads: 1000, // upload up to 1000 images in parallel
	addRemoveLinks: true,
	//	acceptedFiles: 'application/image',
	init : function() {
		var submitButton = document.querySelector("#submit-all")
		imageDropZone = this;

		submitButton.addEventListener("click", function() {
			imageDropZone.processQueue();  // Tell Dropzone to process all queued files.
		});
		// You might want to show the submit button only when
		// files are dropped here:
		this.on("addedfile", function() {
			// Show submit button here and/or inform user to click it.
		});
		this.on("success", function(file, responseText, e) {
			var json = responseText['json'];
			var imageTable = $('#image_table'); 
			imageTable.dataTable().fnAddData(json);
		});
	}
};<commit_msg>UI changes to dropzone to make it batch upload friendly<commit_after>/*
 * Image drag and drop upload
 */
var MAX_NUM_THUMBNAILS = 5;
var filesEnqueuedIcon = null;

Dropzone.options.imageDropZone = {
	// Prevents Dropzone from uploading dropped files immediately
	autoProcessQueue : false,
	parallelUploads: 1000, // upload up to 1000 images in parallel
	addRemoveLinks: true,
	init : function() {
		var submitButton = document.querySelector("#submit-all")
		imageDropZone = this;

		// display message showing number of files enqueued
		filesEnqueuedMessage = document.createElement("div");
		filesEnqueuedMessage.innerHTML = "<strong> Files enqueued: </strong> " + this.files.length; 
		this.previewsContainer.appendChild(filesEnqueuedMessage);
		
		submitButton.addEventListener("click", function() {
			imageDropZone.processQueue();  // Tell Dropzone to process all queued files.
		});
		
		this.on("addedfile", function(file) {
			if (this.files.length == MAX_NUM_THUMBNAILS) {
				filesEnqueuedIcon = file;
			}
			if (this.files.length > MAX_NUM_THUMBNAILS) {
				// if there are more than four files uploaded at once, don't display them as thumbnails.
				this.previewsContainer.removeChild(file.previewElement);
				// update icon to show number of files enqueued
				var numAdditionalFiles = this.files.length - MAX_NUM_THUMBNAILS + 1;
				filesEnqueuedIcon.previewElement.innerHTML = "<div class='dz-image more-files-enqueued-icon'>" +
				"<div class='num-files-enqueued-text'> <strong> +" +
				numAdditionalFiles + 
				" files </strong></div>" + 
				"</div>";
				// update message to show number of files enqueued.
				filesEnqueuedMessage.innerHTML = "<strong> Files enqueued: </strong> " + this.files.length; 
			}
		});
		this.on("complete", function(file) {
			// automatically remove a file when it’s finished uploading
			this.removeFile(file);
		});
		this.on("success", function(file, responseText, e) {
			var json = responseText['json'];
			var imageTable = $('#image_table'); 
			imageTable.dataTable().fnAddData(json);			
		});
		this.on("error", function(file, response) {
			console.log("error response: ", response);
			// here, list the files that have errored on the page so that user can do them again.
		});
	}
};
{'fraction_non_alphanumeric': 0.12311557788944724, 'fraction_numerical': 0.005653266331658292, 'mean_word_length': 3.9765625, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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': '1553729', 'n_tokens_mistral': 1078, 'n_tokens_neox': 943, 'n_words': 267}