Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into remove-deprecated-middleware
- Loading branch information
Showing
47 changed files
with
803 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
language: node_js | ||
node_js: | ||
- "12" | ||
- "10" | ||
- "8" | ||
- "6" | ||
script: "npm run lint && npm run test-cover" | ||
# Send coverage data to Coveralls | ||
after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
var React = require('react'); | ||
var Leaderboard = require('./Leaderboard.jsx'); | ||
|
||
var Body = React.createClass({ | ||
render: function() { | ||
return ( | ||
<div className="app"> | ||
<div className="outer"> | ||
<div className="logo"></div> | ||
<h1 className="title">Leaderboard</h1> | ||
<div className="subtitle">Select a scientist to give them points</div> | ||
<Leaderboard /> | ||
</div> | ||
function Body() { | ||
return ( | ||
<div className="app"> | ||
<div className="outer"> | ||
<div className="logo"></div> | ||
<h1 className="title">Leaderboard</h1> | ||
<div className="subtitle">Select a scientist to give them points</div> | ||
<Leaderboard /> | ||
</div> | ||
); | ||
} | ||
}); | ||
</div> | ||
); | ||
} | ||
|
||
module.exports = Body; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
var PropTypes = require('prop-types'); | ||
var React = require('react'); | ||
var Player = require('./Player.jsx'); | ||
var _ = require('underscore'); | ||
|
||
var PlayerList = React.createClass({ | ||
propTypes: { | ||
players: React.PropTypes.array.isRequired, | ||
selectedPlayerId: React.PropTypes.string | ||
}, | ||
function PlayerList(props) { | ||
var { players, selectedPlayerId } = props; | ||
var other = _.omit(props, 'players', 'selectedPlayerId'); | ||
|
||
render: function() { | ||
var { players, selectedPlayerId } = this.props; | ||
var other = _.omit(this.props, 'players', 'selectedPlayerId'); | ||
var playerNodes = players.map(function(player, index) { | ||
var selected = selectedPlayerId === player.id; | ||
|
||
var playerNodes = players.map(function(player, index) { | ||
var selected = selectedPlayerId === player.id; | ||
|
||
return ( | ||
<Player {...other} doc={player} key={player.id} selected={selected} /> | ||
); | ||
}); | ||
return ( | ||
<div className="playerList"> | ||
{playerNodes} | ||
</div> | ||
<Player {...other} doc={player} key={player.id} selected={selected} /> | ||
); | ||
} | ||
}); | ||
}); | ||
return ( | ||
<div className="playerList"> | ||
{playerNodes} | ||
</div> | ||
); | ||
} | ||
|
||
PlayerList.propTypes = { | ||
players: PropTypes.array.isRequired, | ||
selectedPlayerId: PropTypes.string | ||
}; | ||
|
||
module.exports = PlayerList; | ||
module.exports = PlayerList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
var PropTypes = require('prop-types'); | ||
var React = require('react'); | ||
|
||
var PlayerSelector = React.createClass({ | ||
propTypes: { | ||
selectedPlayer: React.PropTypes.object | ||
}, | ||
function PlayerSelector({ selectedPlayer, onAddPoints }) { | ||
var node; | ||
|
||
render: function() { | ||
var node; | ||
if (selectedPlayer) { | ||
node = <div className="details"> | ||
<div className="name">{selectedPlayer.data.name}</div> | ||
<button className="inc" onClick={onAddPoints}>Add 5 points</button> | ||
</div>; | ||
} else { | ||
node = <div className="message">Click a player to select</div>; | ||
} | ||
|
||
if (this.props.selectedPlayer) { | ||
node = <div className="details"> | ||
<div className="name">{this.props.selectedPlayer.data.name}</div> | ||
<button className="inc" onClick={this.props.onAddPoints}>Add 5 points</button> | ||
</div>; | ||
} else { | ||
node = <div className="message">Click a player to select</div>; | ||
} | ||
return node; | ||
} | ||
|
||
return node; | ||
} | ||
}); | ||
PlayerSelector.propTypes = { | ||
selectedPlayer: PropTypes.object | ||
}; | ||
|
||
module.exports = PlayerSelector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
var ReconnectingWebSocket = require('reconnecting-websocket'); | ||
var sharedb = require('sharedb/lib/client'); | ||
|
||
// Expose a singleton WebSocket connection to ShareDB server | ||
var socket = new WebSocket('ws://' + window.location.host); | ||
var socket = new ReconnectingWebSocket('ws://' + window.location.host); | ||
var connection = new sharedb.Connection(socket); | ||
module.exports = connection; |
Oops, something went wrong.