<commit_before>$(document).ready(function() {
	var droppedFiles = [];

	$("#dropbox").on('drag dragstart dragend dragover dragenter dragleave drop', function(e) {
		e.preventDefault();
		e.stopPropagation();
	})
	.on('dragover dragenter', function() {
		$(this).addClass("active");
	})
	.on('dragleave dragend drop', function() {
		$(this).removeClass("active");
	})
	.on('drop', function(e) {
		droppedFiles = e.originalEvent.dataTransfer.files;
    $("#file-count").html(droppedFiles.length + " files ready for upload");
	});


	$("#upload-button").on("click", function(e) {
		e.preventDefault();

		var formData = new FormData(document.querySelector("#upload-form"));

		for (var i = 0; i < droppedFiles.length; i++) {
			formData.append("files[]", droppedFiles[i]);
		}

		$.ajax({
			url: "/v0/submissions",
			data: formData,
			type: "POST",
			contentType: false,
			processData: false,
			beforeSend: function() {
				$("#progressDialog").modal("show");
        $("#progress").html("Sending and signing submission with steward's private key...");
			},
			success: function(data) {
				$("#progressDialog").modal("hide");
				if (data.status === "error") {
					window.alert(data.msg);
					return;
				} else {
					window.location.href = "/submission.html?multihash=" + data.multihash;
				}
			},
		})
	});
});<commit_msg>Check for and display error message when adding via html<commit_after>$(document).ready(function() {
	var droppedFiles = [];

	$("#dropbox").on('drag dragstart dragend dragover dragenter dragleave drop', function(e) {
		e.preventDefault();
		e.stopPropagation();
	})
	.on('dragover dragenter', function() {
		$(this).addClass("active");
	})
	.on('dragleave dragend drop', function() {
		$(this).removeClass("active");
	})
	.on('drop', function(e) {
		droppedFiles = e.originalEvent.dataTransfer.files;
    $("#file-count").html(droppedFiles.length + " files ready for upload");
	});


	$("#upload-button").on("click", function(e) {
		e.preventDefault();

		var formData = new FormData(document.querySelector("#upload-form"));

		for (var i = 0; i < droppedFiles.length; i++) {
			formData.append("files[]", droppedFiles[i]);
		}

		$.ajax({
			url: "/v0/submissions",
			data: formData,
			type: "POST",
			contentType: false,
			processData: false,
			beforeSend: function() {
				$("#progressDialog").modal("show");
        $("#progress").html("Sending and signing submission with steward's private key...");
			},
			success: function(data) {
				$("#progressDialog").modal("hide");
				if (data.status === "error") {
					window.alert(data.msg);
					return;
				} else {
					window.location.href = "/submission.html?multihash=" + data.multihash;
				}
			},
      error: function(request, status, error) {
				$("#progressDialog").modal("hide");
        alert(request.responseJSON.message);
      }
		})
	});
});
{'fraction_non_alphanumeric': 0.19775596072931276, 'fraction_numerical': 0.001402524544179523, 'mean_word_length': 3.893653516295026, 'pattern_counts': {'":': 0, '<': 5, '<?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': '209790', 'n_tokens_mistral': 1026, 'n_tokens_neox': 909, 'n_words': 177}