mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-22 12:41:11 +00:00
Stuff
This commit is contained in:
parent
973015e927
commit
be3eb07795
4 changed files with 10 additions and 35 deletions
|
@ -1,8 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
var Author = require("./author");
|
||||
var count = 0;
|
||||
|
||||
function Message (o) {
|
||||
this.id = count++;
|
||||
this.author = Author(o.author);
|
||||
this.content = o.content;
|
||||
this.createdAt = new Date();
|
||||
|
@ -10,6 +12,7 @@ function Message (o) {
|
|||
|
||||
Message.prototype.toJson = function () {
|
||||
return {
|
||||
id: this.id,
|
||||
author: this.author,
|
||||
content: this.content,
|
||||
createdAt: this.createdAt
|
||||
|
|
|
@ -85,7 +85,7 @@ module.exports = function (namespace) {
|
|||
method.call(gather, selectedPlayer.user);
|
||||
|
||||
if (gather.can("confirmSelection")) {
|
||||
gather.confirmSelection(user);
|
||||
gather.confirmSelection(socket._user);
|
||||
}
|
||||
|
||||
refreshGather();
|
||||
|
|
|
@ -536,18 +536,7 @@ var Gatherers = React.createClass({
|
|||
|
||||
var CompletedGather = React.createClass({
|
||||
votedMaps: function () {
|
||||
var maps = this.props.maps;
|
||||
var mapVotes = this.props.gather.gatherers.map(function (gatherer) {
|
||||
return gatherer.mapVote;
|
||||
}).filter(function (elem) {
|
||||
return elem !== null;
|
||||
}).map(function (mapId) {
|
||||
var result;
|
||||
maps.forEach(function (map) {
|
||||
if (map.id === mapId) result = map;
|
||||
});
|
||||
return result;
|
||||
});
|
||||
|
||||
},
|
||||
votedServer: function () {
|
||||
|
||||
|
@ -560,14 +549,11 @@ var CompletedGather = React.createClass({
|
|||
</div>
|
||||
<div className="panel-body">
|
||||
<h3>Join Up:</h3>
|
||||
<p>{this.votedMaps()
|
||||
.map(function (map) {return map.name})
|
||||
.join(",")}</p>
|
||||
<p>Map Voted: To be completed</p>
|
||||
<p>Server Voted: To be completed</p>
|
||||
</div>
|
||||
<GatherTeams gather={this.props.gather} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -536,18 +536,7 @@ var Gatherers = React.createClass({displayName: "Gatherers",
|
|||
|
||||
var CompletedGather = React.createClass({displayName: "CompletedGather",
|
||||
votedMaps: function () {
|
||||
var maps = this.props.maps;
|
||||
var mapVotes = this.props.gather.gatherers.map(function (gatherer) {
|
||||
return gatherer.mapVote;
|
||||
}).filter(function (elem) {
|
||||
return elem !== null;
|
||||
}).map(function (mapId) {
|
||||
var result;
|
||||
maps.forEach(function (map) {
|
||||
if (map.id === mapId) result = map;
|
||||
});
|
||||
return result;
|
||||
});
|
||||
|
||||
},
|
||||
votedServer: function () {
|
||||
|
||||
|
@ -560,9 +549,8 @@ var CompletedGather = React.createClass({displayName: "CompletedGather",
|
|||
),
|
||||
React.createElement("div", {className: "panel-body"},
|
||||
React.createElement("h3", null, "Join Up:"),
|
||||
React.createElement("p", null, this.votedMaps()
|
||||
.map(function (map) {return map.name})
|
||||
.join(","))
|
||||
React.createElement("p", null, "Map Voted: To be completed"),
|
||||
React.createElement("p", null, "Server Voted: To be completed")
|
||||
),
|
||||
React.createElement(GatherTeams, {gather: this.props.gather})
|
||||
)
|
||||
|
@ -570,8 +558,6 @@ var CompletedGather = React.createClass({displayName: "CompletedGather",
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
"use strict";
|
||||
|
||||
var socket;
|
||||
|
|
Loading…
Reference in a new issue