mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-26 14:21:01 +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";
|
"use strict";
|
||||||
|
|
||||||
var Author = require("./author");
|
var Author = require("./author");
|
||||||
|
var count = 0;
|
||||||
|
|
||||||
function Message (o) {
|
function Message (o) {
|
||||||
|
this.id = count++;
|
||||||
this.author = Author(o.author);
|
this.author = Author(o.author);
|
||||||
this.content = o.content;
|
this.content = o.content;
|
||||||
this.createdAt = new Date();
|
this.createdAt = new Date();
|
||||||
|
@ -10,6 +12,7 @@ function Message (o) {
|
||||||
|
|
||||||
Message.prototype.toJson = function () {
|
Message.prototype.toJson = function () {
|
||||||
return {
|
return {
|
||||||
|
id: this.id,
|
||||||
author: this.author,
|
author: this.author,
|
||||||
content: this.content,
|
content: this.content,
|
||||||
createdAt: this.createdAt
|
createdAt: this.createdAt
|
||||||
|
|
|
@ -85,7 +85,7 @@ module.exports = function (namespace) {
|
||||||
method.call(gather, selectedPlayer.user);
|
method.call(gather, selectedPlayer.user);
|
||||||
|
|
||||||
if (gather.can("confirmSelection")) {
|
if (gather.can("confirmSelection")) {
|
||||||
gather.confirmSelection(user);
|
gather.confirmSelection(socket._user);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshGather();
|
refreshGather();
|
||||||
|
|
|
@ -536,18 +536,7 @@ var Gatherers = React.createClass({
|
||||||
|
|
||||||
var CompletedGather = React.createClass({
|
var CompletedGather = React.createClass({
|
||||||
votedMaps: function () {
|
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 () {
|
votedServer: function () {
|
||||||
|
|
||||||
|
@ -560,14 +549,11 @@ var CompletedGather = React.createClass({
|
||||||
</div>
|
</div>
|
||||||
<div className="panel-body">
|
<div className="panel-body">
|
||||||
<h3>Join Up:</h3>
|
<h3>Join Up:</h3>
|
||||||
<p>{this.votedMaps()
|
<p>Map Voted: To be completed</p>
|
||||||
.map(function (map) {return map.name})
|
<p>Server Voted: To be completed</p>
|
||||||
.join(",")}</p>
|
|
||||||
</div>
|
</div>
|
||||||
<GatherTeams gather={this.props.gather} />
|
<GatherTeams gather={this.props.gather} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -536,18 +536,7 @@ var Gatherers = React.createClass({displayName: "Gatherers",
|
||||||
|
|
||||||
var CompletedGather = React.createClass({displayName: "CompletedGather",
|
var CompletedGather = React.createClass({displayName: "CompletedGather",
|
||||||
votedMaps: function () {
|
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 () {
|
votedServer: function () {
|
||||||
|
|
||||||
|
@ -560,9 +549,8 @@ var CompletedGather = React.createClass({displayName: "CompletedGather",
|
||||||
),
|
),
|
||||||
React.createElement("div", {className: "panel-body"},
|
React.createElement("div", {className: "panel-body"},
|
||||||
React.createElement("h3", null, "Join Up:"),
|
React.createElement("h3", null, "Join Up:"),
|
||||||
React.createElement("p", null, this.votedMaps()
|
React.createElement("p", null, "Map Voted: To be completed"),
|
||||||
.map(function (map) {return map.name})
|
React.createElement("p", null, "Server Voted: To be completed")
|
||||||
.join(","))
|
|
||||||
),
|
),
|
||||||
React.createElement(GatherTeams, {gather: this.props.gather})
|
React.createElement(GatherTeams, {gather: this.props.gather})
|
||||||
)
|
)
|
||||||
|
@ -570,8 +558,6 @@ var CompletedGather = React.createClass({displayName: "CompletedGather",
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var socket;
|
var socket;
|
||||||
|
|
Loading…
Reference in a new issue