/*** @jsx React.DOM */ var dancemates_view = createReactClass({ getInitialState: function(props) { return { name: window.name, version: window.version, dancemates: window.dancemates, profiles: window.profiles, }; }, componentDidMount: function() { this.refreshDanceMates(); }, refreshDanceMates: function() { AJAX.get( Link.get('refresh'), function(response) { this.setState({ name: response.name, version: response.version, dancemates: response.dancemates, profiles: response.profiles, }); setTimeout(this.refreshDanceMates, 5000); }.bind(this) ); }, renderDanceMates: function(player) { return( ; }, sort: function(aid, bid) { return aid.last_played - bid.last_played; }.bind(this), }, ]} defaultsort='Name' rows={this.state.dancemates} paginate={10} /> ); }, render: function() { return (

{this.state.name}'s Dance Mates

{this.renderDanceMates()}

); }, }); ReactDOM.render( React.createElement(dancemates_view, null), document.getElementById('content') );