<commit_before>$(document).ready(function(){

	function toggleUpload() {
		$("#toggle-division-bar").css("right", "80%");
		$(".toggle").removeClass('btn-default')
		.addClass('btn-primary')
		.html("Topic Clouds")
		.css({"right": "-5%"});
		$(".toggle-options").css("background-color", "#1ABC9C");
		$("#multicloudtopicfile").prop('checked', true);
		$("#multiclouduserfiles").prop('checked', false);
		$("#multicloud-selection").hide();
		$("#multicloud-upload").show();
	}

	function toggleSelect() {
		$("#toggle-division-bar").css("right", "0");
		$(".toggle").removeClass('btn-primary')
		.addClass('btn-default')
		.html("Document Clouds")
		.css("right", "15%");
		$(".toggle-options").css("background-color", "#2ECC71");
		$("#multiclouduserfiles").prop('checked', true);
		$("#multicloudtopicfile").prop('checked', false);
		$("#multicloud-selection").show();
		$("#multicloud-upload").hide();
	}

	$(".toggle-options").click(function(){
		if ($(".toggle").hasClass('btn-default')) {
			toggleUpload();
		} else { 
			toggleSelect();
		}
	});

	if ($(".toggle").hasClass('btn-default')) {
		toggleSelect();
	} else {
		toggleUpload();
	}

	$("#multicloud-selection").click(function(){
		toggleSelect();
	});

	$("#multicloud-upload").click(function(){
		toggleUpload();
	});

	// Error handler
	$("form").submit(function(e){
		if ($("#multicloudtopicfile").is(":checked") && $("input[name='optuploadname']").val() == ""){
			console.log("here");
			$('#error-message').text("No MALLET topic file uploaded.");
			$('#error-message').show().fadeOut(3000, "easeInOutCubic");
			return false;
		} else if ($("#multiclouduserfiles").is(":checked") && $("input[name='segmentlist']:checked").length < 1) {
			$('#error-message').text("No documents selected from actives.");
			$('#error-message').show().fadeOut(3000, "easeInOutCubic");
			return false;
		} else{
			$("#status-visualize").css({"visibility":"visible", "z-index": "400000"}); 
			return true;
		}
	});

	// Show filename of uploaded file
	$('.multicloud-upload').change(function(ev) {
		filename = ev.target.files[0].name;

		$(this).siblings('.bttnfilelabels').html(filename);
	});

	$("#allCheckBoxSelector").click(function(){
		if (this.checked) {
			$(".minifilepreview:not(:checked)").trigger('click');
		} else {
			$(".minifilepreview:checked").trigger('click');
		}
	});

	var prev = -1; //initialize variable<commit_msg>Fix Multicloud upload MALLET bug<commit_after>$(document).ready(function(){

	function toggleUpload() {
		$("#toggle-division-bar").css("right", "80%");
		$(".toggle").removeClass('btn-default')
		.addClass('btn-primary')
		.html("Topic Clouds")
		.css({"right": "-5%"});
		$(".toggle-options").css("background-color", "#1ABC9C");
		$("#multicloudtopicfile").prop('checked', true);
		$("#multiclouduserfiles").prop('checked', false);
		$("#multicloud-selection").hide();
		$("#multicloud-upload").show();
	}

	function toggleSelect() {
		$("#toggle-division-bar").css("right", "0");
		$(".toggle").removeClass('btn-primary')
		.addClass('btn-default')
		.html("Document Clouds")
		.css("right", "15%");
		$(".toggle-options").css("background-color", "#2ECC71");
		$("#multiclouduserfiles").prop('checked', true);
		$("#multicloudtopicfile").prop('checked', false);
		$("#multicloud-selection").show();
		$("#multicloud-upload").hide();
	}

	$(".toggle-options").click(function(){
		if ($(".toggle").hasClass('btn-default')) {
			toggleUpload();
		} else { 
			toggleSelect();
		}
	});

	if (($(".toggle").hasClass('btn-default')) && ($("#multiclouduserfiles").prop('checked') == true)) {
		toggleSelect();
	} else {
		toggleUpload();
	}

	$("#multicloud-selection").click(function(){
		toggleSelect();
	});

	$("#multicloud-upload").click(function(){
		toggleUpload();
	});

	// Error handler
	$("form").submit(function(e){
		if ($("#multicloudtopicfile").is(":checked") && $("#mcfilesselectbttnlabel").html() == ""){
			$('#error-message').text("No MALLET topic file uploaded.");
			$('#error-message').show().fadeOut(3000, "easeInOutCubic");
			return false;
		} else if ($("#multiclouduserfiles").is(":checked") && $("input[name='segmentlist']:checked").length < 1) {
			$('#error-message').text("No documents selected from actives.");
			$('#error-message').show().fadeOut(3000, "easeInOutCubic");
			return false;
		} else{
			$("#status-visualize").css({"visibility":"visible", "z-index": "400000"}); 
			return true;
		}
	});

	// Show filename of uploaded file
	$('.multicloud-upload').change(function(ev) {
		filename = ev.target.files[0].name;

		$(this).siblings('.bttnfilelabels').html(filename);
	});

	$("#allCheckBoxSelector").click(function(){
		if (this.checked) {
			$(".minifilepreview:not(:checked)").trigger('click');
		} else {
			$(".minifilepreview:checked").trigger('click');
		}
	});

	var prev = -1; //initialize variable
{'fraction_non_alphanumeric': 0.2597482979162368, 'fraction_numerical': 0.011553538271095523, 'mean_word_length': 5.2233632862644415, 'pattern_counts': {'":': 10, '<': 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': '948965', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1641, 'n_words': 220}