<commit_before>"use strict";
var feeds = [<?php
	foreach ($this->feeds as $feed) {
		echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n";
	}
	?>],
	feed_processed = 0,
	feed_count = feeds.length;

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

function updateFeeds() {
	if (feed_count === 0) {
		openNotification("<?php echo _t('no_feed_to_refresh'); ?>", "good");
		ajax_loading = false;
		return;
	}
	initProgressBar(true);

	for (var i = 0; i < 10; i++) {
		updateFeed();
	}
}

function updateFeed() {
	var feed = feeds.pop();
	if (feed == undefined) {
		return;
	}

	$.ajax({
		type: 'POST',
		url: feed,
	}).complete(function (data) {
		feed_processed++;
		updateProgressBar(feed_processed);

		if (feed_processed === feed_count) {
			initProgressBar(false);
		} else {
			updateFeed();<commit_msg>Improve design of actualize notification<commit_after>"use strict";
var feeds = [<?php foreach ($this->feeds as $feed) { ?>{<?php
	?>url: "<?php echo Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'); ?>",<?php
	?>title: "<?php echo $feed->name(); ?>"<?php
?>},<?php } ?>],
	feed_processed = 0,
	feed_count = feeds.length;

function initProgressBar(init) {
	if (init) {
		$("body").after("\<div id=\"actualizeProgress\" class=\"notification good\">\
			<?php echo _t('refresh'); ?><br /><span class=\"title\">/</span><br />\
			<span class=\"progress\">0 / " + feed_count + "</span>\
		</div>");
	} else {
		window.location.reload();
	}
}
function updateProgressBar(i, title_feed) {
	$("#actualizeProgress .progress").html(i + " / " + feed_count);
	$("#actualizeProgress .title").html(title_feed);
}

function updateFeeds() {
	if (feed_count === 0) {
		openNotification("<?php echo _t('no_feed_to_refresh'); ?>", "good");
		ajax_loading = false;
		return;
	}
	initProgressBar(true);

	for (var i = 0; i < 10; i++) {
		updateFeed();
	}
}

function updateFeed() {
	var feed = feeds.pop();
	if (feed == undefined) {
		return;
	}

	$.ajax({
		type: 'POST',
		url: feed['url'],
	}).complete(function (data) {
		feed_processed++;
		updateProgressBar(feed_processed, feed['title']);

		if (feed_processed === feed_count) {
			initProgressBar(false);
		} else {
			updateFeed();
{'fraction_non_alphanumeric': 0.23189964157706094, 'fraction_numerical': 0.005376344086021506, 'mean_word_length': 4.388030888030888, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 45, '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': '7041332', 'n_tokens_mistral': 1064, 'n_tokens_neox': 994, 'n_words': 212}