A free, self-hostable news aggregator…
Demande rafraîchissement page quand nvx articles
Marien Fressinaud2a6443a0f0f5
diff --git a/app/i18n/en.php b/app/i18n/en.phpindex 683d7ca22..5d9b01f0b 100644--- a/app/i18n/en.php+++ b/app/i18n/en.php@@ -241,6 +241,7 @@ return array ('today' => 'Today','yesterday' => 'Yesterday','before_yesterday' => 'Before yesterday',+ 'new_article' => 'There are new available articles, click to refresh the page.','by_author' => 'By <em>%s</em>','related_tags' => 'Related tags','no_feed_to_display' => 'There is no article to show.',diff --git a/app/i18n/fr.php b/app/i18n/fr.phpindex c20bf98e7..fd2257c70 100644--- a/app/i18n/fr.php+++ b/app/i18n/fr.php@@ -241,6 +241,7 @@ return array ('today' => 'Aujourd’hui','yesterday' => 'Hier','before_yesterday' => 'À partir d’avant-hier',+ 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.','by_author' => 'Par <em>%s</em>','related_tags' => 'Tags associés','no_feed_to_display' => 'Il n’y a aucun article à afficher.',diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtmlindex a1df87579..af5ff03fe 100644--- a/app/views/helpers/view/normal_view.phtml+++ b/app/views/helpers/view/normal_view.phtml@@ -63,6 +63,13 @@ if (!empty($this->entries)) {$display_others = false;}+ if ($this->entries[0]->id () === $item->id ()) {+ ?><div id="new-article">+ <a href="<?php echo _url(); ?>"><?php+ echo Minz_Translate::t ('new_article');+ ?></a></div><?php+ }+?><div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"><ul class="horizontal-list flux_header"><?phpif ($this->loginOk) {diff --git a/p/scripts/main.js b/p/scripts/main.jsindex 3f6352baf..0c3a5fa3d 100644--- a/p/scripts/main.js+++ b/p/scripts/main.js@@ -519,12 +519,21 @@ function init_notifications() {function refreshUnreads() {$.getJSON('./?c=javascript&a=nbUnreadsPerFeed').done(function (data) {+ var new_article = false;$.each(data, function(feed_id, nbUnreads) {feed_id = 'f_' + feed_id;var elem = $('#' + feed_id + '>.feed').get(0),feed_unreads = elem ? (parseInt(elem.getAttribute('data-unread'), 10) || 0) : 0;incUnreadsFeed(null, feed_id, nbUnreads - feed_unreads);++ if (nbUnreads - feed_unreads > 0) {+ new_article = true;+ }});++ if (new_article) {+ $('#new-article').show();+ }});}diff --git a/p/themes/Dark/freshrss.css b/p/themes/Dark/freshrss.cssindex c394ad98b..2ad30fab2 100644--- a/p/themes/Dark/freshrss.css+++ b/p/themes/Dark/freshrss.css@@ -224,6 +224,25 @@text-align: right;}+#new-article {+ display: none;+ min-height: 40px;+ background: #26303F;+ text-align: center;+}+ #new-article:hover {+ background: #4A5D7A;+ }+ #new-article a {+ display: block;+ line-height: 40px;+ color: #fff;+ font-weight: bold;+ }+ #new-article a:hover {+ text-decoration: none;+ }+.flux {border-left: 3px solid #aaa;background: #1c1c1c;diff --git a/p/themes/Flat/freshrss.css b/p/themes/Flat/freshrss.cssindex b2d92f86b..80e0da330 100644--- a/p/themes/Flat/freshrss.css+++ b/p/themes/Flat/freshrss.css@@ -217,6 +217,25 @@ body {z-index: -10;}+#new-article {+ display: none;+ min-height: 40px;+ background: #3498db;+ text-align: center;+}+ #new-article:hover {+ background: #2980b9;+ }+ #new-article a {+ display: block;+ line-height: 40px;+ color: #fff;+ font-weight: bold;+ }+ #new-article a:hover {+ text-decoration: none;+ }+.flux {border-left: 3px solid #ecf0f1;}diff --git a/p/themes/Origine/freshrss.css b/p/themes/Origine/freshrss.cssindex 86745af1a..bedeff695 100644--- a/p/themes/Origine/freshrss.css+++ b/p/themes/Origine/freshrss.css@@ -230,6 +230,25 @@text-align: right;}+#new-article {+ display: none;+ min-height: 40px;+ background: #0084CC;+ text-align: center;+}+ #new-article:hover {+ background: #0066CC;+ }+ #new-article a {+ display: block;+ line-height: 40px;+ color: #fff;+ font-weight: bold;+ }+ #new-article a:hover {+ text-decoration: none;+ }+.flux {border-left: 3px solid #aaa;background: #fafafa;