From 7d9a813ed3465ef7175a05355e1ccaef878ab667 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 6 Feb 2014 18:48:49 +0100 Subject: Petite simplification mise à jour JavaScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/marienfressinaud/FreshRSS/pull/414 --- app/views/javascript/actualize.phtml | 19 ++++++++++--------- p/scripts/main.js | 6 ++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 272d1b419..58c3b7c8f 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,10 +1,11 @@ "use strict"; -var feeds = []; -feeds as $feed) { ?> -feeds.push(" 'feed', 'a' => 'actualize', 'params' => array ('id' => $feed->id (), 'ajax' => '1')), 'php'); ?>"); - -var feed_count = feeds.length; -var feed_processed = 0; +var feeds = [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) { @@ -33,10 +34,10 @@ function updateFeeds() { } function updateFeed() { - if (feeds.length === 0) { + var feed = feeds.pop(); + if (feed == undefined) { return; } - var feed = feeds.pop(); $.ajax({ type: 'POST', url: feed, @@ -50,4 +51,4 @@ function updateFeed() { updateFeed(); } }); -} \ No newline at end of file +} diff --git a/p/scripts/main.js b/p/scripts/main.js index 53a365076..8cda62d26 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -648,10 +648,8 @@ function init_actualize() { return false; }); - if(auto_actualize_feeds) { - $.getScript('./?c=javascript&a=actualize').done(function () { - updateFeeds(); - }); + if (auto_actualize_feeds) { + $("#actualize").click(); } } -- cgit v1.2.3