From 9e219cbf5014c8f4f52f3ca6722f7a20cdcc13dd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 12 May 2013 19:21:39 +0200 Subject: Fix issue #70 : lorsqu'on rencontre un problème avec un flux, on l'indique à l'utilisateur (couleur rouge) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 77f1787d0..a41d7a33f 100755 --- a/app/controllers/feedController.php +++ b/app/controllers/feedController.php @@ -159,8 +159,7 @@ class feedController extends ActionController { $feedDAO->updateLastUpdate ($feed->id ()); } catch (FeedException $e) { Log::record ($e->getMessage (), Log::ERROR); - // TODO si on a une erreur ici, il faut mettre - // le flux à jour en BDD (error = 1) (issue #70) + $feedDAO->isInError ($feed->id ()); } // On arrête à 10 flux pour ne pas surcharger le serveur -- cgit v1.2.3 From 1863153b966af00078869b6634df1daa22cdcbfe Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sat, 15 Jun 2013 15:55:44 +0200 Subject: Fix issue #71 : remise en place du mode endless + correction bug à l'importation OPML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/feedController.php | 4 ++-- app/controllers/indexController.php | 1 + app/views/helpers/pagination.phtml | 2 +- lib/minz/Request.php | 8 +++++--- public/scripts/endless_mode.js | 31 +++++++++++++++++++++++++++++++ public/theme/freshrss.css | 4 ++++ public/theme/loader.gif | Bin 0 -> 4167 bytes 7 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 public/scripts/endless_mode.js create mode 100644 public/theme/loader.gif (limited to 'app/controllers/feedController.php') diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php index 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.php index 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.phtml index f029f281a..80c0976ad 100755 --- a/app/views/helpers/pagination.phtml +++ b/app/views/helpers/pagination.phtml @@ -8,7 +8,7 @@
  • next != '') { ?> next; ?> - + diff --git a/lib/minz/Request.php b/lib/minz/Request.php index 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.js new file mode 100644 index 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 file diff --git a/public/theme/freshrss.css b/public/theme/freshrss.css index 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.gif new file mode 100644 index 000000000..5ff26f0e3 Binary files /dev/null and b/public/theme/loader.gif differ -- cgit v1.2.3