var React = require('react'); var Postboard = require("../common/Postboard.js"); var NewPostModalButton = require("../home/NewPostModalButton.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var StreamMixin = require("../common/StreamMixin.js"); var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); var EventListenerMixin = require('../common/EventListenerMixin.js'); var ReactBootstrap = require('react-bootstrap') , NavItem = ReactBootstrap.NavItem , Nav = ReactBootstrap.Nav , ListGroup = ReactBootstrap.ListGroup , ListGroupItem = ReactBootstrap.ListGroupItem , Panel = ReactBootstrap.Panel , Glyphicon = ReactBootstrap.Glyphicon , Button = ReactBootstrap.Button module.exports = Home = React.createClass({displayName: "Home", mixins: [ StreamMixin, SetIntervalMixin, SafeStateChangeMixin, EventListenerMixin('scrolledtobottom'), EventListenerMixin('newpostbyuser') ], contextTypes: { router: React.PropTypes.func }, getInitialState: function() { return { data: [], postIdentifiers: {}, usernames: [], postrange: ( Date.now()/1000 - 12*60*60 ), min_posts: 30 }; }, addUser: function(username) { var thisComponent = this; this.setStateSafe(function(previousState, currentProps){ previousState.usernames.push(username); return previousState; },function(){ Twister.getUser(username).doLatestPostsUntil(function(post){ if (post!==null) { if(post.getTimestamp()