Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 350b79a59db17dca15f4b6a3e0a69e45b983bd8b 1 parent 23b422e
@philipbjorge authored
Showing with 69 additions and 0 deletions.
  1. +5 −0 content/index.markdown
  2. +64 −0 templates/index.html
View
5 content/index.markdown
@@ -0,0 +1,5 @@
+---
+title: Me
+type: index
+url: /index.php
+---
View
64 templates/index.html
@@ -0,0 +1,64 @@
+{% extends "base.html" %}
+
+{% block js %}
+ <script src="/js/jquery.isotope.min.js"></script>
+ <script src="/js/jquery.infinitescroll.min.js"></script>
+{% endblock %}
+{% block css %}
+ <link rel="stylesheet" type="text/css" href="/css/isotope.css">
+ <link rel="stylesheet" type="text/css" href="/css/networks.css">
+{% endblock %}
+{% block content %}
+<div id="social-container" class="variable-sizes clearfix infinite-scrolling">
+<?php require_once('get_stream.php'); ?>
+</div>
+<div id="new-content"></div>
+<script>
+ var $container = $('#social-container');
+
+ $container.isotope({
+ itemSelector : '.social-item',
+ animationEngine : 'best-available',
+ animationOptions : {
+ duration: 750,
+ easing: 'linear',
+ queue: false
+ },
+ getSortData: {
+ time: function( $elem ) {
+ return $elem.find('time').attr('datetime');
+ }
+ },
+ sortBy: 'time',
+ sortAscending: false
+ });
+
+ $("#new-content").load('update_stream.php', function() {
+ $container.isotope('insert', $(this).children('.social-item'));
+ $("time").timeago();
+ });
+
+ if ($("time").length)
+ $("time").timeago();
+
+ $container.infinitescroll({
+ navSelector : '#social-nav', // selector for the paged navigation
+ nextSelector : '#social-nav a', // selector for the NEXT link (to page 2)
+ itemSelector : '.social-item', // selector for all items you'll retrieve
+ loading: {
+ finishedMsg: 'No more pages to load.',
+ img: 'images/loader.gif'
+ }
+ },
+ // call Isotope as a callback
+ function( newElements ) {
+ var $newElems = $( newElements ).css({ opacity: 0 });
+ $newElems.imagesLoaded(function(){
+ $("time").timeago();
+ $container.isotope('appended', $newElems );
+ $newElems.animate({ opacity: 1 });
+ });
+ }
+ );
+</script>
+{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.