/*** @jsx React.DOM */ var valid_versions = Object.keys(window.versions); var pagenav = new History(valid_versions); var profile_view = React.createClass({ getInitialState: function(props) { var profiles = Object.keys(window.player); return { player: window.player, profiles: profiles, version: pagenav.getInitialState(profiles[profiles.length - 1]), }; }, componentDidMount: function() { pagenav.onChange(function(version) { this.setState({version: version}); }.bind(this)); this.refreshProfile(); }, refreshProfile: function() { AJAX.get( Link.get('refresh'), function(response) { var profiles = Object.keys(response.player); this.setState({ player: response.player, profiles: profiles, }); setTimeout(this.refreshProfile, 5000); }.bind(this) ); }, render: function() { if (this.state.player[this.state.version]) { var player = this.state.player[this.state.version]; return (