<commit_before>{% load i18n %}
$(document).ready(function() {
	var now = new Date();
	var formatted = now.format("dd.mm.yyyy");
	$('#id_date').val(formatted);
	$('#progress-indicator').hide();
	var bar = $('.bar');
	var percent = $('.percent');

	$('#videoForm').ajaxForm({
		beforeSend: function(xhr) {
			var validator = $("#videoForm").validate({errorClass: "text-error",})
			if (!validator.form()) {
				$("#formError").show();
				xhr.abort();
			} else {
				$("#formError").hide();
				$('#progress-indicator').show();
			}
			var percentVal = '0%';
			bar.width(percentVal)
			percent.html(percentVal);
		},
		uploadProgress: function(event, position, total, percentComplete) {
			var percentVal = percentComplete + '%';
			bar.width(percentVal)
			percent.html(percentVal);
			document.title = 'LambdaCast - {% trans "Upload" %} - ' + percentVal;
		},
		complete: function(xhr) {
			if (xhr.status == 200){
				// TODO: remove alert
				alert({% trans "Thank you, your media will be transcoded and should be available soon." %});
				window.location.href = "/status/";
			}else {
				$("#formError").html({% trans "An error accured. Please, try again or contact the administrator." %});
				$("#formError").show();
			}
		}
	});<commit_msg>fixing javascript on upload page<commit_after>$(document).ready(function() {
	var now = new Date();
	var formatted = now.format("dd.mm.yyyy");
	$('#id_date').val(formatted);
	$('#progress-indicator').hide();
	var bar = $('.bar');
	var percent = $('.percent');

	$('#videoForm').ajaxForm({
		beforeSend: function(xhr) {
			var validator = $("#videoForm").validate({errorClass: "text-error",})
			if (!validator.form()) {
				$("#formError").show();
				xhr.abort();
			} else {
				$("#formError").hide();
				$('#progress-indicator').show();
			}
			var percentVal = '0%';
			bar.width(percentVal)
			percent.html(percentVal);
		},
		uploadProgress: function(event, position, total, percentComplete) {
			var percentVal = percentComplete + '%';
			bar.width(percentVal)
			percent.html(percentVal);
			document.title = 'Upload - ' + percentVal;
		},
		complete: function(xhr) {
			if (xhr.status == 200){
				// TODO: remove alert
				alert("Thank you, your media will be transcoded and should be available soon.");
				window.location.href = "/status/";
			}else {
				$("#formError").html("An error accured. Please, try again or contact the administrator.");
				$("#formError").show();
			}
		}
	});
{'fraction_non_alphanumeric': 0.20269168026101142, 'fraction_numerical': 0.004078303425774877, 'mean_word_length': 3.7816764132553606, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7295401', 'n_tokens_mistral': 907, 'n_tokens_neox': 780, 'n_words': 177}