<commit_before>var feeds = new Array ();
<?php foreach ($this->feeds as $feed) { ?>
feeds.push ("<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>");
<?php } ?>

function initProgressBar (init) {
	if (init) {
		$("body").after ("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\
			<?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feeds.length + "</span><br />\
			<progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feeds.length + "\"></progress>\
		</div>");
	} else {
		window.location.reload ();
	}
}
function updateProgressBar (i) {
	$("#actualizeProgressBar").val(i);
	$("#actualizeProgress .progress").html (i + " / " + feeds.length);
}

function updateFeeds () {
	initProgressBar (true);

	var i = 0;
	for (var f in feeds) {
		$.ajax ({
			type: 'POST',
			url: feeds[f],
		}).done (function (data) {
			i++;
			updateProgressBar (i);

			if (i == feeds.length) {
				initProgressBar (false);
			}
		});
	}
}<commit_msg>JavaScript : Bug actualize quand il n'y a aucun flux<commit_after>"use strict";
var feeds = [];
<?php foreach ($this->feeds as $feed) { ?>
feeds.push("<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>");
<?php } ?>

function initProgressBar(init) {
	if (init) {
		$("body").after("\<div id=\"actualizeProgress\" class=\"actualizeProgress\">\
			<?php echo Minz_Translate::t ('refresh'); ?> <span class=\"progress\">0 / " + feeds.length + "</span><br />\
			<progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feeds.length + "\"></progress>\
		</div>");
	} else {
		window.location.reload();
	}
}
function updateProgressBar(i) {
	$("#actualizeProgressBar").val(i);
	$("#actualizeProgress .progress").html(i + " / " + feeds.length);
}

function updateFeeds() {
	if (feeds.length === 0) {
		return;
	}
	initProgressBar(true);

	var i = 0;
	for (var f in feeds) {
		$.ajax({
			type: 'POST',
			url: feeds[f],
		}).done(function (data) {
			i++;
			updateProgressBar(i);

			if (i === feeds.length) {
				initProgressBar(false);
			}
		});
	}
}
{'fraction_non_alphanumeric': 0.24342701722574797, 'fraction_numerical': 0.004079782411604714, 'mean_word_length': 3.8187772925764194, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 39, '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': '1348890', 'n_tokens_mistral': 850, 'n_tokens_neox': 780, 'n_words': 179}