A free, self-hostable news aggregator…
Fix issue #71 : remise en place du mode endless + correction bug à l'importation OPML
Marien Fressinaud1863153b966a
diff --git a/app/controllers/feedController.php b/app/controllers/feedController.phpindex a41d7a33f..76da41c58 100755--- a/app/controllers/feedController.php+++ b/app/controllers/feedController.php@@ -219,8 +219,8 @@ class feedController extends ActionController {$entryDAO = new EntryDAO ();$feedDAO = new FeedDAO ();- $categories = Request::param ('categories', array ());- $feeds = Request::param ('feeds', array ());+ $categories = Request::param ('categories', array (), true);+ $feeds = Request::param ('feeds', array (), true);// on ajoute les catégories en masse dans une fonction à part$this->addCategories ($categories);diff --git a/app/controllers/indexController.php b/app/controllers/indexController.phpindex f4f0b98b3..5403b82ed 100755--- a/app/controllers/indexController.php+++ b/app/controllers/indexController.php@@ -12,6 +12,7 @@ class indexController extends ActionController {View::appendScript (Url::display ('/scripts/shortcut.js'));View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main')));View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'actualize')));+ View::appendScript (Url::display ('/scripts/endless_mode.js'));}$entryDAO = new EntryDAO ();diff --git a/app/views/helpers/pagination.phtml b/app/views/helpers/pagination.phtmlindex f029f281a..80c0976ad 100755--- a/app/views/helpers/pagination.phtml+++ b/app/views/helpers/pagination.phtml@@ -8,7 +8,7 @@<li class="item pager-next"><?php if ($this->next != '') { ?><?php $params[$getteur] = $this->next; ?>- <a href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a>+ <a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a><?php } else { ?><?php echo Translate::t ('nothing_to_load'); ?><?php } ?>diff --git a/lib/minz/Request.php b/lib/minz/Request.phpindex 3463686bc..bd5fcb95e 100644--- a/lib/minz/Request.php+++ b/lib/minz/Request.php@@ -29,11 +29,13 @@ class Request {public static function params () {return self::$params;}- public static function param ($key, $default = false) {+ public static function param ($key, $default = false, $specialchars = false) {if (isset (self::$params[$key])) {$p = self::$params[$key];- if(is_array($p)) {- return array_map(htmlspecialchars, $p);+ if(is_object($p) || $specialchars) {+ return $p;+ } elseif(is_array($p)) {+ return array_map('htmlspecialchars', $p);} else {return htmlspecialchars($p);}diff --git a/public/scripts/endless_mode.js b/public/scripts/endless_mode.jsnew file mode 100644index 000000000..489b69f30--- /dev/null+++ b/public/scripts/endless_mode.js@@ -0,0 +1,31 @@+var url_load_more = "";+var load = false;++function init_load_more() {+ url_load_more = $("a#load_more").attr("href");++ $("#load_more").click (function () {+ load_more_posts ();++ return false;+ });+}++function load_more_posts () {+ load = true;+ $("#load_more").addClass("loading");+ $.get (url_load_more, function (data) {+ $("#stream .flux:last").after($("#stream .flux", data));+ $(".pagination").html($(".pagination", data).html());++ init_load_more();+ init_posts();++ $("#load_more").removeClass("loading");+ load = false;+ });+}++$(document).ready (function () {+ init_load_more();+});\ No newline at end of filediff --git a/public/theme/freshrss.css b/public/theme/freshrss.cssindex 2a8f24ea7..f5d4f6a83 100644--- a/public/theme/freshrss.css+++ b/public/theme/freshrss.css@@ -357,6 +357,10 @@color: #333;font-style: italic;}+.loading {+ background: url("loader.gif") center center no-repeat;+ font-size: 0;+}/*** NOTIFICATION ***/.notification {diff --git a/public/theme/loader.gif b/public/theme/loader.gifnew file mode 100644index 000000000..5ff26f0e3Binary files /dev/null and b/public/theme/loader.gif differ