summaryrefslogtreecommitdiff
path: root/public/scripts/endless_mode.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/scripts/endless_mode.js')
-rw-r--r--public/scripts/endless_mode.js31
1 files changed, 31 insertions, 0 deletions
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