summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-15 15:55:44 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-15 15:55:44 +0200
commit1863153b966af00078869b6634df1daa22cdcbfe (patch)
tree72f8fb178fe5555f5d951253807033d1902af830
parent6d184ad1b8b84ab31e342f539844e0dc5738423b (diff)
Fix issue #71 : remise en place du mode endless + correction bug à l'importation OPML
-rwxr-xr-xapp/controllers/feedController.php4
-rwxr-xr-xapp/controllers/indexController.php1
-rwxr-xr-xapp/views/helpers/pagination.phtml2
-rw-r--r--lib/minz/Request.php8
-rw-r--r--public/scripts/endless_mode.js31
-rw-r--r--public/theme/freshrss.css4
-rw-r--r--public/theme/loader.gifbin0 -> 4167 bytes
7 files changed, 44 insertions, 6 deletions
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 @@
<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.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
--- /dev/null
+++ b/public/theme/loader.gif
Binary files differ