aboutsummaryrefslogtreecommitdiff
path: root/app/views/javascript
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-24 15:29:09 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-24 15:29:09 +0200
commit07444280d1a03daa7880c1539bde3a6e80945dab (patch)
treec328a11f59e07d12e624576ed86b11ada1b9d198 /app/views/javascript
parent1d2527b8bc2a125cc8b8508402417f60d314e330 (diff)
parentd1f79fee69a3667913f419cd9726ffb11f410bd0 (diff)
Merge branch 'dev' into beta
Conflicts: README.md
Diffstat (limited to 'app/views/javascript')
-rw-r--r--app/views/javascript/actualize.phtml21
1 files changed, 10 insertions, 11 deletions
diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml
index d08dc47d1..74cef4998 100644
--- a/app/views/javascript/actualize.phtml
+++ b/app/views/javascript/actualize.phtml
@@ -1,25 +1,24 @@
"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";
- }
- ?>],
+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'); ?> <span class=\"progress\">0 / " + feed_count + "</span><br />\
- <progress id=\"actualizeProgressBar\" value=\"0\" max=\"" + feed_count + "\"></progress>\
+ <?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) {
- $("#actualizeProgressBar").val(i);
+function updateProgressBar(i, title_feed) {
$("#actualizeProgress .progress").html(i + " / " + feed_count);
+ $("#actualizeProgress .title").html(title_feed);
}
function updateFeeds() {
@@ -43,10 +42,10 @@ function updateFeed() {
$.ajax({
type: 'POST',
- url: feed,
+ url: feed['url'],
}).complete(function (data) {
feed_processed++;
- updateProgressBar(feed_processed);
+ updateProgressBar(feed_processed, feed['title']);
if (feed_processed === feed_count) {
initProgressBar(false);