From 4bdabbd39fd111c6c12d5953bd4bd6de2ae3903d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 3 Jun 2014 23:41:19 +0200 Subject: Fix theme Origine2 It should be equivalent to Origine (modulo some improvements) See https://github.com/marienfressinaud/FreshRSS/issues/320 --- app/views/javascript/actualize.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/javascript/actualize.phtml') diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 3b12ad774..6a92e5642 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -9,7 +9,7 @@ var feeds = [\ + $("body").after("\
\ 0 / " + feed_count + "
\ \
"); -- cgit v1.2.3 From ab9d656135e5afcafb824e73a49ff2e9fd2a2dbd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 9 Jul 2014 20:20:17 +0200 Subject: Block user to click many times on the refresh button See https://github.com/marienfressinaud/FreshRSS/issues/513 --- app/views/javascript/actualize.phtml | 6 ++++-- p/scripts/main.js | 13 +++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'app/views/javascript/actualize.phtml') diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 6a92e5642..d08dc47d1 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -10,7 +10,7 @@ var feeds = [\ - 0 / " + feed_count + "
\ + 0 / " + feed_count + "
\ \ "); } else { @@ -24,7 +24,8 @@ function updateProgressBar(i) { function updateFeeds() { if (feed_count === 0) { - openNotification("", "good"); + openNotification("", "good"); + ajax_loading = false; return; } initProgressBar(true); @@ -39,6 +40,7 @@ function updateFeed() { if (feed == undefined) { return; } + $.ajax({ type: 'POST', url: feed, diff --git a/p/scripts/main.js b/p/scripts/main.js index 54ee7f0fd..243159ca5 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,7 +1,8 @@ "use strict"; var $stream = null, isCollapsed = true, - shares = 0; + shares = 0, + ajax_loading = false; function is_normal_mode() { return $stream.hasClass('normal'); @@ -684,14 +685,22 @@ function init_actualize() { var auto = false; $("#actualize").click(function () { + if (ajax_loading) { + return false; + } + + ajax_loading = true; + $.getScript('./?c=javascript&a=actualize').done(function () { if (auto && feed_count < 1) { auto = false; - return; + ajax_loading = false; + return false; } updateFeeds(); }); + return false; }); -- cgit v1.2.3 From 6655c1b4299897944dea06309261137a7fa91ad7 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 10 Aug 2014 15:28:54 +0200 Subject: Improve design of actualize notification - Remove progress bar - Show title of updated feed --- app/views/javascript/actualize.phtml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'app/views/javascript/actualize.phtml') 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 = [feeds as $feed) { - echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n"; - } - ?>], +var feeds = [feeds as $feed) { ?>{url: " 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'); ?>",title: "name(); ?>"},], feed_processed = 0, feed_count = feeds.length; function initProgressBar(init) { if (init) { $("body").after("\
\ - 0 / " + feed_count + "
\ - \ +
/
\ + 0 / " + feed_count + "\
"); } 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); -- cgit v1.2.3