Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix #9. Moved infinite social wall into index template.

  • Loading branch information...
commit 350b79a59db17dca15f4b6a3e0a69e45b983bd8b 1 parent 23b422e
Philip Bjorge authored
5  content/index.markdown
Source Rendered
... ...
@@ -0,0 +1,5 @@
  1
+---
  2
+title: Me
  3
+type: index
  4
+url: /index.php
  5
+---
64  templates/index.html
... ...
@@ -0,0 +1,64 @@
  1
+{% extends "base.html" %}
  2
+
  3
+{% block js %}
  4
+  <script src="/js/jquery.isotope.min.js"></script>
  5
+  <script src="/js/jquery.infinitescroll.min.js"></script>
  6
+{% endblock %}
  7
+{% block css %}
  8
+  <link rel="stylesheet" type="text/css" href="/css/isotope.css">
  9
+  <link rel="stylesheet" type="text/css" href="/css/networks.css">
  10
+{% endblock %}
  11
+{% block content %}
  12
+<div id="social-container" class="variable-sizes clearfix infinite-scrolling">
  13
+<?php require_once('get_stream.php'); ?>
  14
+</div>
  15
+<div id="new-content"></div>
  16
+<script>
  17
+      var $container = $('#social-container');
  18
+    
  19
+      $container.isotope({
  20
+        itemSelector : '.social-item',
  21
+		animationEngine : 'best-available',
  22
+        animationOptions : {
  23
+            duration: 750,
  24
+            easing: 'linear',
  25
+            queue: false
  26
+        },
  27
+		getSortData: {
  28
+			time: function( $elem ) {
  29
+				return $elem.find('time').attr('datetime');
  30
+			}
  31
+		},
  32
+		sortBy: 'time',
  33
+		sortAscending: false
  34
+      });
  35
+	  
  36
+	  $("#new-content").load('update_stream.php', function() {
  37
+		$container.isotope('insert', $(this).children('.social-item'));
  38
+		$("time").timeago();
  39
+	  });
  40
+	  
  41
+	  if ($("time").length)
  42
+		$("time").timeago();
  43
+      
  44
+      $container.infinitescroll({
  45
+        navSelector  : '#social-nav',    // selector for the paged navigation 
  46
+        nextSelector : '#social-nav a',  // selector for the NEXT link (to page 2)
  47
+        itemSelector : '.social-item',     // selector for all items you'll retrieve
  48
+        loading: {
  49
+            finishedMsg: 'No more pages to load.',
  50
+            img: 'images/loader.gif'
  51
+          }
  52
+        },
  53
+        // call Isotope as a callback
  54
+        function( newElements ) {
  55
+			var $newElems = $( newElements ).css({ opacity: 0 });
  56
+			$newElems.imagesLoaded(function(){
  57
+				$("time").timeago();
  58
+				$container.isotope('appended', $newElems );
  59
+				$newElems.animate({ opacity: 1 });
  60
+			});
  61
+        }
  62
+      );
  63
+</script>
  64
+{% endblock %}

0 notes on commit 350b79a

Please sign in to comment.
Something went wrong with that request. Please try again.