<commit_before>(function($)
{

	$(document).ready(function()
	{
		$.initAjaxPost();
		$.initAjaxCouchdbForm();
	});

	$.initAjaxPost = function() 
	{

		var notificationError = $('#ajax_form_error_notification');
		var notificationProgress = $('#ajax_form_progress_notification');

		$(document).ajaxError(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationError.show();
				}
			}
		);

		$(document).ajaxSuccess(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationError.hide();
				}
			}
		);

		$(document).ajaxSend(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationError.hide();
					notificationProgress.show();
				}
			}
		);

		$(document).ajaxComplete(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationProgress.hide();
				}
			}
		);
	};

	$.initAjaxCouchdbForm = function() 
	{
		$(document).ajaxSuccess(
			function(event, xhr, settings) {
				if (settings.type === "POST") {

					var data = null;

					try {
						var data = jQuery.parseJSON(xhr.response);
					} catch (err) {

					}

					if (!(data && data.document && data.document.id && data.document.revision)) {
						
						return ;
					}
					
					$("input[data-id="+ data.document.id + "]").val(data.document.revision);
				}
			}
		);	

	};
})(jQuery);<commit_msg>Correction d'un bug suite au up de jquery<commit_after>(function($)
{

	$(document).ready(function()
	{
		$.initAjaxPost();
		$.initAjaxCouchdbForm();
	});

	$.initAjaxPost = function() 
	{

		var notificationError = $('#ajax_form_error_notification');
		var notificationProgress = $('#ajax_form_progress_notification');

		$(document).ajaxError(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationError.show();
				}
			}
		);

		$(document).ajaxSuccess(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationError.hide();
				}
			}
		);

		$(document).ajaxSend(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationError.hide();
					notificationProgress.show();
				}
			}
		);

		$(document).ajaxComplete(
			function(event, xhr, settings) {
				if (settings.type === "POST") {
					notificationProgress.hide();
				}
			}
		);
	};

	$.initAjaxCouchdbForm = function() 
	{
		$(document).ajaxSuccess(
			function(event, xhr, settings) {
				if (settings.type === "POST") {

					var data = null;

					try {
						var data = jQuery.parseJSON(xhr.responseText);
					} catch (err) {

					}

					if (!(data && data.document && data.document.id && data.document.revision)) {
						
						return ;
					}
					
					$("input[data-id="+ data.document.id + "]").val(data.document.revision);
				}
			}
		);	

	};
})(jQuery);
{'fraction_non_alphanumeric': 0.1803105151729005, 'fraction_numerical': 0.0, 'mean_word_length': 2.8207547169811322, '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': '1269564', 'n_tokens_mistral': 1221, 'n_tokens_neox': 923, 'n_words': 152}