-
+
-
User Name
-
Online
+
{username}
+ {connectionStatus}
diff --git a/public/app.js b/public/app.js
index a695db8..9755f5d 100644
--- a/public/app.js
+++ b/public/app.js
@@ -1662,7 +1662,8 @@ var App = React.createClass({
showEventsPanel: showEventsPanel,
soundController: new SoundController(),
showMessageBox: true,
- collapseMenu: false
+ collapseMenu: false,
+ connectionState: "connected"
};
},
updateTitle: function updateTitle() {
@@ -1766,6 +1767,22 @@ var App = React.createClass({
});
});
+ socket.on("connect", function () {
+ _this2.setState({ connectionState: "connected" });
+ });
+
+ socket.on("disconnect", function () {
+ _this2.setState({ connectionState: "disconnected" });
+ });
+
+ socket.on("reconnecting", function () {
+ _this2.setState({ connectionState: "reconnecting" });
+ });
+
+ socket.on("reconnect", function () {
+ _this2.setState({ connectionState: "connected" });
+ });
+
socket.emit("users:refresh");
socket.emit("message:refresh");
socket.emit("gather:refresh");
@@ -1805,10 +1822,43 @@ var App = React.createClass({
);
}
+ var user = this.state.user;
+ var username = undefined,
+ avatar = undefined;
+ if (user) {
+ username = user.username;
+ avatar = user.avatar;
+ }
+
var appClass = ["skin-blue", "sidebar-mini", "fixed"];
if (this.state.showMessageBox) appClass.push("control-sidebar-open");
if (this.state.collapseMenu) appClass.push("sidebar-collapse");
+ var connectionStatus = undefined;
+ var connectionState = this.state.connectionState;
+ if (connectionState === "connected") {
+ connectionStatus = React.createElement(
+ "a",
+ { href: "#" },
+ React.createElement("i", { className: "fa fa-circle text-success" }),
+ " Online"
+ );
+ } else if (connectionState === "reconnecting") {
+ connectionStatus = React.createElement(
+ "a",
+ { href: "#" },
+ React.createElement("i", { className: "fa fa-circle text-warning" }),
+ " Reconnecting"
+ );
+ } else if (connectionState === "disconnected") {
+ connectionStatus = React.createElement(
+ "a",
+ { href: "#" },
+ React.createElement("i", { className: "fa fa-circle text-danger" }),
+ " Disconnected"
+ );
+ }
+
return React.createElement(
"div",
{ className: appClass.join(" ") },
@@ -1895,7 +1945,7 @@ var App = React.createClass({
React.createElement(
"div",
{ className: "pull-left image" },
- React.createElement("img", { src: "http://www.ensl.org/images/icons/noavatar.png", className: "img-circle", alt: "User Image" })
+ React.createElement("img", { src: avatar, className: "img-circle", alt: "User Image" })
),
React.createElement(
"div",
@@ -1903,14 +1953,9 @@ var App = React.createClass({
React.createElement(
"p",
null,
- "User Name"
+ username
),
- React.createElement(
- "a",
- { href: "#" },
- React.createElement("i", { className: "fa fa-circle text-success" }),
- " Online"
- )
+ connectionStatus
)
),
React.createElement(
diff --git a/public/app.js.map b/public/app.js.map
index 77f6957..d818a3c 100644
--- a/public/app.js.map
+++ b/public/app.js.map
@@ -1 +1 @@
-{"version":3,"sources":["app.js","event.js","gather.js","main.js","message.js","settings.js","snowMachine.js","sound.js","teamspeak.js","user.js","helper.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,QAAQ,QAAQ,OAAR,CAAR;AACN,IAAM,WAAW,QAAQ,WAAR,CAAX;AACN,IAAM,MAAM,QAAQ,6BAAR,CAAN;;AAEN,OAAO,OAAP,GAAiB,UAAU,KAAV,EAAiB;AACjC,UAAS,MAAT,CAAgB,oBAAC,GAAD,OAAhB,EAAyB,KAAzB,EADiC;CAAjB;;;;;;ACJjB,IAAM,QAAQ,QAAQ,OAAR,CAAR;AACN,IAAM,SAAS,QAAQ,MAAR,GAAiB,MAAM,WAAN,CAAkB;;;AACjD,YAAW;AACV,UAAQ,MAAM,SAAN,CAAgB,KAAhB,CAAsB,UAAtB;EADT;;AAIA,2BAAQ,YAAY;AACnB,SAAO,IAAK,IAAJ,CAAS,UAAT,CAAD,CAAuB,YAAvB,GAAsC,KAAtC,CAA4C,SAA5C,EAAuD,CAAvD,CAAP,CADmB;EAL6B;AASjD,2BAAS;;;AACR,MAAI,kBAAJ,CADQ;AAER,MAAI,KAAK,KAAL,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AU,KAAV,EAAiB;AACvB,SAAO,MAAM,EAAN,CADgB;EAAjB,CANA,CAQJ,GARI,CAQA,UAAU,EAAV,EAAc;AACpB,SAAO,WAAW,MAAX,CAAkB,UAAU,GAAV,EAAe,SAAf,EAA0B;AAClD,OAAI,UAAU,EAAV,KAAiB,EAAjB,EAAqB,OAAO,SAAP,CAAzB;AACA,UAAO,GAAP,CAFkD;GAA1B,CAAzB,CADoB;EAAd,CARP,CAxBkE;CAA7B;;AAwCtC,IAAM,UAAU,QAAQ,OAAR,GAAkB,UAAC,QAAD,EAAc;AAC/C,uCAAoC,SAAS,EAAT,CADW;CAAd;;AAIlC,IAAM,UAAU,QAAQ,OAAR,GAAkB,UAAC,QAAD,EAAc;AAC/C,KAAM,SAAS,SAAS,IAAT,CAAc,IAAd,CAAmB,EAAnB,CADgC;AAE/C,KAAI,MAAJ,EAAY;AACX,wDAAoD,MAApD,CADW;EAAZ,MAEO;AACN,SAAO,IAAP,CADM;EAFP;CAFiC;;AASlC,IAAM,UAAU,QAAQ,OAAR,GAAkB,UAAC,IAAD,EAAU;AAC3C,wBAAqB,KAAK,EAAL,CADsB;CAAV;;AAIlC,IAAM,mBAAmB,QAAQ,gBAAR,GAA2B,UAAC,IAAD,EAAU;AAC7D,KAAI;AACH,MAAI,UAAU,OAAO,IAAP,CAAV;MACH,IAAI,kBAAJ,CAFE;AAGH,UAAQ,OAAR,CAAgB,CAAhB,EAAmB,CAAnB,EAHG;AAIH,UAAQ,UAAR,CAAmB,CAAnB,EAJG;AAKH,SAAO,IAAP,CALG;EAAJ,CAOA,OAAM,CAAN,EAAS;AACR,SAAO,KAAP,CADQ;EAAT;CARmD","file":"public/app.js","sourcesContent":["const React = require(\"react\");\nconst ReactDOM = require(\"react-dom\");\nconst App = require(\"javascripts/components/main\");\n\nmodule.exports = function (mount) { \n\tReactDOM.render(, mount);\n};\n","const React = require(\"react\");\nconst Events = exports.Events = React.createClass({\n\tpropTypes: {\n\t\tevents: React.PropTypes.array.isRequired\n\t},\n\n\tgetTime(timeString) {\n\t\treturn (new Date(timeString)).toTimeString().match(/^[\\d:]*/)[0];\n\t},\n\n\trender() {\n\t\tlet events;\n\t\tif (this.props.events.length) {\n\t\t\tevents = this.props.events.map(event => {\n\t\t\t\treturn `${this.getTime(event.createdAt)} ${event.description}`;\n\t\t\t}).join(\"\\n\");\n\t\t\treturn (\n\t\t\t\t
\n\t\t\t\t\t{events}\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\tListening for new events...\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\t}\n});\n","import {AssumeUserIdButton} from \"javascripts/components/user\";\n\nconst React = require(\"react\");\nconst helper = require(\"javascripts/helper\");\nconst enslUrl = helper.enslUrl;\nconst rankVotes = helper.rankeVotes;\nconst hiveUrl = helper.hiveUrl;\n\nconst SelectPlayerButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgatherer: React.PropTypes.object.isRequired\n\t},\n\n\tselectPlayer(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:select\", {\n\t\t\tplayer: parseInt(e.target.value, 10)\n\t\t});\n\t},\n\n\trender() {\n\t\tlet button;\n\t\tif (this.props.gatherer.leader) {\n\t\t\tbutton = ;\n\t\t} else if (this.props.gatherer.team !== \"lobby\") {\n\t\t\tbutton = ;\n\t\t} else {\n\t\t\tbutton = ;\n\t\t}\n\t\treturn button;\n\t}\n});\n\nconst GathererList = React.createClass({\n\tmemberList() {\n\t\tconst self = this;\n\t\treturn this.props.gather.gatherers\n\t\t\t.filter(gatherer => gatherer.team === self.props.team)\n\t\t\t.sort(gatherer => { return gatherer.leader ? 1 : -1 });\n\t},\n\n\trender() {\n\t\tconst extractGatherer = gatherer => {\n\t\t\tlet image;\n\t\t\tif (gatherer.leader) {\n\t\t\t\timage = ;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{image}{gatherer.user.username}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t | \n\t\t\t\t
\n\t\t\t);\n\t\t};\n\t\tconst members = this.memberList()\n\t\t\t.map(extractGatherer);\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{members}\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst GatherTeams = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tMarines\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tAliens\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ElectionProgressBar = React.createClass({\n\tcomponentDidMount() {\n\t\tconst self = this;\n\t\tthis.timer = setInterval(() => {\n\t\t\tself.forceUpdate();\n\t\t}, 900);\n\t},\n\n\tprogress() {\n\t\tconst interval = this.props.gather.election.interval;\n\t\tconst startTime = (new Date(this.props.gather.election.startTime)).getTime();\n\t\tconst msTranspired = Math.floor((new Date()).getTime() - startTime);\n\n\t\treturn {\n\t\t\tnum: msTranspired,\n\t\t\tden: interval,\n\t\t\tbarMessage: Math.floor((interval - msTranspired) / 1000) + \"s remaining\"\n\t\t}\n\t},\n\n\tcomponentWillUnmount() {\n\t\tclearInterval(this.timer);\n\t},\n\n\trender() {\n\t\treturn ();\n\t}\n});\n\nconst ProgressBar = React.createClass({\n\trender() {\n\t\tconst progress = this.props.progress;\n\t\tconst style = {\n\t\t\twidth: Math.round((progress.num / progress.den * 100)) + \"%\"\n\t\t};\n\t\tconst barMessage = progress.barMessage || \"\";\n\t\treturn (\n\t\t\t\n\t\t\t\t
{barMessage}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst GatherProgress = React.createClass({\n\tstateDescription() {\n\t\tswitch(this.props.gather.state) {\n\t\t\tcase \"gathering\":\n\t\t\t\treturn \"Waiting for more gatherers.\";\n\t\t\tcase \"election\":\n\t\t\t\treturn \"Currently voting for team leaders.\";\n\t\t\tcase \"selection\":\n\t\t\t\treturn \"Waiting for leaders to pick teams.\";\n\t\t\tcase \"done\":\n\t\t\t\treturn \"Gather completed.\";\n\t\t\tdefault:\n\t\t\t\treturn \"Initialising gather.\";\n\t\t}\n\t},\n\n\tgatheringProgress() {\n\t\tconst num = this.props.gather.gatherers.length;\n\t\tconst den = 12;\n\t\tconst remaining = den - num;\n\t\tconst message = (remaining === 1) ? \n\t\t\t\"Waiting for last player\" : `Waiting for ${remaining} more players`;\n\t\treturn {\n\t\t\tnum: num,\n\t\t\tden: den,\n\t\t\tmessage: message\n\t\t};\n\t},\n\n\telectionProgress() {\n\t\tconst num = this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.leaderVote) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t\tconst den = 12;\n\t\treturn {\n\t\t\tnum: num,\n\t\t\tden: den,\n\t\t\tmessage: den - num + \" more votes required\"\n\t\t};\n\t},\n\n\tselectionProgress() {\n\t\tconst num = this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.team !== \"lobby\") acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t\tconst den = 12;\n\n\t\treturn {\n\t\t\tnum: num,\n\t\t\tden: den,\n\t\t\tmessage: `${num} out of ${den} players assigned. Waiting \n\t\t\t\ton ${_.capitalize(this.props.gather.pickingTurn)}s to pick next...`\n\t\t};\n\t},\n\n\trender() {\n\t\tlet progress, progressBar;\n\t\tconst gatherState = this.props.gather.state;\n\t\tif (gatherState === 'gathering' && this.props.gather.gatherers.length) {\n\t\t\tprogress = this.gatheringProgress();\n\t\t\tprogressBar = ();\n\t\t} else if (gatherState === 'election') {\n\t\t\tprogress = this.electionProgress();\n\t\t\tprogressBar = ();\n\t\t} else if (gatherState === 'selection') {\n\t\t\tprogress = this.selectionProgress();\n\t\t\tprogressBar = ();\n\t\t}\n\n\t\tif (!progress) return false;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
{this.stateDescription()} {progress.message}
\n\t\t\t\t{progressBar}\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst JoinGatherButton = React.createClass({\n\tpropTypes: {\n\t\tthisGatherer: React.PropTypes.object,\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired\n\t},\n\n\tcomponentDidMount() {\n\t\tconst self = this;\n\t\tthis.timer = setInterval(() => {\n\t\t\tself.forceUpdate();\n\t\t}, 30000);\n\t},\n\n\tcomponentWillUnmount() {\n\t\tclearInterval(this.timer);\n\t},\n\n\tjoinGather(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:join\");\n\t},\n\n\tleaveGather(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:leave\");\n\t},\n\n\tcooldownTime() {\n\t\tlet user = this.props.user;\n\t\tif (!user) return false;\n\t\tlet cooloffTime = this.props.gather.cooldown[user.id];\n\t\tif (!cooloffTime) return false;\n\t\tlet timeRemaining = new Date(cooloffTime) - new Date();\n\t\treturn timeRemaining > 0 ? timeRemaining : false;\n\t},\n\n\trender() {\n\t\tlet gather = this.props.gather;\n\t\tlet thisGatherer = this.props.thisGatherer;\n\t\tif (thisGatherer) {\n\t\t\treturn ;\n\t\t} \n\t\tif (gather.state === 'gathering') {\n\t\t\tlet cooldownTime = this.cooldownTime();\n\t\t\tif (cooldownTime) {\n\t\t\t\treturn ;\n\t\t\t} else {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n});\n\nconst CooloffButton = React.createClass({\n\tpropTypes: {\n\t\ttimeRemaining: React.PropTypes.number.isRequired\n\t},\n\n\ttimeRemaining() {\n\t\treturn `${Math.floor(this.props.timeRemaining / 60000) + 1} minutes remaining`;\n\t},\n\n\trender() {\n\t\treturn \n\t}\n})\n\nconst GatherActions = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object\n\t},\n\n\tvoteRegather(e) {\n\t\te.preventDefault(e);\n\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\tregather: (e.target.value === \"true\")\n\t\t});\n\t},\n\n\tregatherVotes() {\n\t\tlet gather = this.props.gather;\n\t\tif (!gather) return 0;\n\t\treturn gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.regatherVote) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t},\n\n\trender() {\n\t\tlet regatherButton;\n\t\tconst user = this.props.user;\n\t\tconst gather = this.props.gather;\n\t\tconst socket = this.props.socket;\n\t\tconst thisGatherer = this.props.thisGatherer;\n\t\tif (thisGatherer) {\n\t\t\tlet regatherVotes = this.regatherVotes();\n\t\t\tif (thisGatherer.regatherVote) {\n\t\t\t\tregatherButton = ;\n\t\t\t} else {\n\t\t\t\tregatherButton = ;\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t{regatherButton}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst VoteButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tcandidate: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object\n\t},\n\n\tcancelVote(e) {\n\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\tleader: {\n\t\t\t\tcandidate: null\n\t\t\t}\n\t\t});\n\t},\n\n\tvote(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\tleader: {\n\t\t\t\tcandidate: parseInt(e.target.value, 10)\n\t\t\t}\n\t\t});\n\t},\n\n\tstopGatherMusic() {\n\t\tsoundController.stop();\n\t},\n\n\trender() {\n\t\tlet candidate = this.props.candidate;\n\t\tlet thisGatherer = this.props.thisGatherer;\n\t\tif (thisGatherer === null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (thisGatherer.leaderVote === candidate.id) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t}\n});\n\nconst ServerVoting = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object,\n\t\tservers: React.PropTypes.array.isRequired,\n\t},\n\n\tvoteHandler(serverId) {\n\t\treturn e => {\n\t\t\te.preventDefault();\n\t\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\t\tserver: {\n\t\t\t\t\tid: serverId\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\tvotesForServer(server) {\n\t\treturn this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.serverVote.some(voteId => voteId === server.id)) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t},\n\n\trender() {\n\t\tlet self = this;\n\t\tlet thisGatherer = self.props.thisGatherer;\n\t\tlet servers = self.props.servers.sort((a, b) => {\n\t\t\t\tconst aVotes = self.votesForServer(a);\n\t\t\t\tconst bVotes = self.votesForServer(b);\n\t\t\t\treturn bVotes - aVotes;\n\t\t\t}).map(server => {\n\t\t\tlet votes = self.votesForServer(server);\n\t\t\tlet style = thisGatherer.serverVote.some(voteId => voteId === server.id) ? \n\t\t\t\t\"list-group-item list-group-item-success\" : \"list-group-item\";\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{votes}\n\t\t\t\t\t{server.name || server.description}\n\t\t\t\t\n\t\t\t);\n\t\t});\n\n\t\tlet votes = thisGatherer.serverVote.length;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{votes === 2 ? \"Server Votes\" : \n\t\t\t\t\t`Please Vote for a Server. ${2 - votes} votes remaining` }\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{servers}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n})\n\nconst MapVoting = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object,\n\t\tmaps: React.PropTypes.array.isRequired,\n\t},\n\n\tvoteHandler(mapId) {\n\t\treturn e => {\n\t\t\te.preventDefault();\n\t\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\t\tmap: {\n\t\t\t\t\tid: mapId\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\tvotesForMap(map) {\n\t\treturn this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.mapVote.some(voteId => voteId === map.id)) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t},\n\n\trender() {\n\t\tconst self = this;\n\t\tlet thisGatherer = self.props.thisGatherer\n\t\tlet maps = self.props.maps.sort((a, b) => {\n\t\t\t\t\tconst aVotes = self.votesForMap(a);\n\t\t\t\t\tconst bVotes = self.votesForMap(b);\n\t\t\t\t\treturn bVotes - aVotes;\n\t\t\t\t}).map(map => {\n\t\t\t\tlet votes = self.votesForMap(map);\n\t\t\t\tlet style = thisGatherer.mapVote.some(voteId => voteId === map.id) ? \n\t\t\t\t\t\"list-group-item list-group-item-success\" : \"list-group-item\";\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t\t\t\t{votes}\n\t\t\t\t\t\t\t{map.name}\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t});\n\n\t\tlet votes = thisGatherer.mapVote.length;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{votes === 2 ? \"Map Votes\" : \n\t\t\t\t\t\t`Please Vote for a Map. ${2 - votes} votes remaining` }\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{maps}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n})\n\nconst Gather = exports.Gather = React.createClass({\n\tpropTypes: {\n\t\tthisGatherer: React.PropTypes.object,\n\t\tmaps: React.PropTypes.array.isRequired,\n\t\tservers: React.PropTypes.array.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired\n\t},\n\n\trender() {\n\t\tconst socket = this.props.socket;\n\t\tconst gather = this.props.gather;\n\t\tconst thisGatherer = this.props.thisGatherer;\n\t\tconst servers = this.props.servers;\n\t\tconst maps = this.props.maps;\n\t\tconst user = this.props.user;\n\t\tif (gather === null) return ;\n\n\t\tlet voting;\n\t\tif (thisGatherer) {\n\t\t\tlet state = gather.state;\n\t\t\tif (state === 'gathering' || state === 'election') {\n\t\t\t\tvoting = (\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvoting = ;\n\t\t\t}\n\t\t}\n\n\t\tlet gatherTeams;\n\t\tif (gather.state === 'selection') {\n\t\t\tgatherTeams = ;\n\t\t}\n\n\t\tif (gather.gatherers.length > 0) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
Current Gather
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{gatherTeams}\n\t\t\t\t\t{voting}\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
Current Gather
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t}\n});\n\nconst LifeformIcons = exports.LifeformIcons = React.createClass({\n\tavailableLifeforms() {\n\t\treturn [\"skulk\", \"gorge\", \"lerk\", \"fade\", \"onos\", \"commander\"];\n\t},\n\n\tgathererLifeforms() {\n\t\tlet lifeforms = [];\n\t\tlet gatherer = this.props.gatherer;\n\t\tlet abilities = gatherer.user.profile.abilities;\n\t\tfor (let attr in abilities) {\n\t\t\tif (abilities[attr]) lifeforms.push(_.capitalize(attr));\n\t\t}\n\t\treturn lifeforms;\n\t},\n\n\trender() {\n\t\tlet lifeforms = this.gathererLifeforms();\t\n\t\tlet availableLifeforms = this.availableLifeforms();\n\t\tlet icons = availableLifeforms.map(lifeform => {\n\t\t\tlet containsAbility = lifeforms.some(gathererLifeform => {\n\t\t\t\treturn gathererLifeform.toLowerCase() === lifeform.toLowerCase()\n\t\t\t});\n\t\t\tif (containsAbility) {\n\t\t\t\treturn \n\t\t\t} else {\n\t\t\t\treturn \n\t\t\t}\n\t\t});\n\t\treturn {icons}\n\t}\n});\n\nconst Gatherers = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object,\n\t\tthisGatherer: React.PropTypes.object,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired\n\t},\n\n\tjoinGather(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:join\");\n\t},\n\n\tbootGatherer(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:leave\", {\n\t\t\tgatherer: parseInt(e.target.value, 10) || null\n\t\t});\n\t},\n\n\trender() {\n\t\tconst self = this;\n\t\tconst user = this.props.user;\n\t\tconst socket = this.props.socket;\n\t\tconst gather = this.props.gather;\n\t\tconst thisGatherer = this.props.thisGatherer;\n\t\tconst admin = (user && user.admin) || (user && user.moderator);\n\t\tconst gatherers = gather.gatherers\n\t\t.sort((a, b) => {\n\t\t\t\treturn (b.user.hive.skill || 1000) - (a.user.hive.skill || 1000);\n\t\t\t})\n\t\t.map(gatherer => {\n\t\t\tlet country;\n\t\t\tif (gatherer.user.country) {\n\t\t\t\tcountry = (\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tlet skill = gatherer.user.profile.skill || \"Not Available\";\n\n\t\t\tlet hiveStats = [];\n\t\t\tif (gatherer.user.hive.skill) hiveStats.push(`${gatherer.user.hive.skill} ELO`);\n\n\t\t\tif (gatherer.user.hive.playTime) {\n\t\t\t\thiveStats.push(`${Math.floor(gatherer.user.hive.playTime / 3600)} Hours`);\n\t\t\t}\n\n\t\t\tlet hive = (hiveStats.length) ? hiveStats.join(\", \") : \"Not Available\";\n\t\t\t\n\t\t\tlet team = (gatherer.user.team) ? gatherer.user.team.name : \"None\";\n\n\t\t\tlet action;\n\t\t\tif (gather.state === \"election\") {\n\t\t\t\tlet votes = gather.gatherers.reduce((acc, voter) => {\n\t\t\t\t\tif (voter.leaderVote === gatherer.id) acc++;\n\t\t\t\t\treturn acc;\n\t\t\t\t}, 0)\n\t\t\t\taction = (\n\t\t\t\t\t\n\t\t\t\t\t\t{votes + \" votes\"}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (gather.state === 'selection') {\n\t\t\t\tif (thisGatherer && \n\t\t\t\t\t\tthisGatherer.leader &&\n\t\t\t\t\t\tthisGatherer.team === gather.pickingTurn) {\n\t\t\t\t\taction = (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tif (gatherer.leader) {\n\t\t\t\t\t\taction = (Leader);\n\t\t\t\t\t} else if (gatherer.team !== \"lobby\") {\n\t\t\t\t\t\taction = ({_.capitalize(gatherer.team)});\n\t\t\t\t\t} else {\n\t\t\t\t\t\taction = (\n\t\t\t\t\t\t\tLobby);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet adminOptions;\n\t\t\tif (admin) {\n\t\t\t\tadminOptions = [\n\t\t\t\t\t
,\n\t\t\t\t\tAdmin,\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t]\n\t\t\t}\n\n\t\t\tlet tabColor = gatherer.team !== \"lobby\" ? `panel-${gatherer.team}` : \"panel-info\";\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{country} {gatherer.user.username}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tInfo \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{action}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t- Skill Level
\n\t\t\t\t\t\t\t\t- {skill}
\n\t\t\t\t\t\t\t\t- Team
\n\t\t\t\t\t\t\t\t- {team}
\n\t\t\t\t\t\t\t\t- Hive Stats
\n\t\t\t\t\t\t\t\t- {hive}
\n\t\t\t\t\t\t\t\t- Links
\n\t\t\t\t\t\t\t\t- \n\t\t\t\t\t\t\t\t\tENSL Profile \n\t\t\t\t\t\t\t\t\tHive Profile\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{adminOptions}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t);\n\t\t})\n\t\tif (gather.gatherers.length) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{gatherers}\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\t}\n});\n\nconst CompletedGather = React.createClass({\n\tcompletionDate() {\n\t\tlet d = new Date(this.props.gather.done.time);\n\t\tif (d) {\n\t\t\treturn d.toLocaleTimeString();\n\t\t} else {\n\t\t\treturn \"Completed Gather\"\n\t\t}\n\t},\n\n\tgetInitialState() {\n\t\treturn {\n\t\t\tshow: !!this.props.show\n\t\t};\n\t},\n\n\ttoggleGatherInfo() {\n\t\tlet newState = !this.state.show;\n\t\tthis.setState({\n\t\t\tshow: newState\n\t\t});\n\t},\n\n\trender() {\n\t\tlet gatherInfo = [];\n\t\tlet gather = this.props.gather;\n\t\tlet maps = this.props.maps;\n\t\tlet servers = this.props.servers;\n\t\tif (this.state.show) {\n\t\t\tgatherInfo.push();\n\t\t\tgatherInfo.push();\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
{this.completionDate()}
\n\t\t\t\t
\n\t\t\t\t{gatherInfo}\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst GatherVotingResults = React.createClass({\n\t// Returns an array of ids voted for e.g. [1,2,5,1,1,3,2]\n\tcountVotes(voteType) {\n\t\treturn this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tlet votes = gatherer[voteType];\n\n\t\t\t// Temporary fix because some mapvotes are ints and not arrays\n\t\t\tif (!Array.isArray(votes)) votes = [votes];\n\n\t\t\tif (votes.length > 0) votes.forEach(vote => acc.push(vote));\n\t\t\treturn acc;\n\t\t}, []);\n\t},\n\n\tselectedMaps() {\n\t\treturn rankVotes(this.countVotes('mapVote'), this.props.maps).slice(0, 2)\n\t},\n\n\tselectedServer() {\n\t\treturn rankVotes(this.countVotes('serverVote'), this.props.servers).slice(0, 1);\n\t},\n\n\trender() {\n\t\tlet maps = this.selectedMaps();\n\t\tlet server = this.selectedServer().pop();\n\t\tlet password;\n\t\tif (server.password) {\n\t\t\tpassword = [\n\t\t\t\tPassword,\n\t\t\t\t{server.password}\n\t\t\t];\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\tServer\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t- Maps
\n\t\t\t\t\t\t- {maps.map(map => map.name).join(\" & \")}
\n\t\t\t\t\t\t- Server
\n\t\t\t\t\t\t- {server.name}
\n\t\t\t\t\t\t- Address
\n\t\t\t\t\t\t- {server.ip}:{server.port}
\n\t\t\t\t\t\t{password}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tJoin Server\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ArchivedGathers = exports.ArchivedGathers = React.createClass({\n\tpropTypes: {\n\t\tarchive: React.PropTypes.array.isRequired,\n\t\tservers: React.PropTypes.array.isRequired,\n\t\tmaps: React.PropTypes.array.isRequired\n\t},\n\n\trender() {\n\t\tlet archive = this.props.archive\n\t\t\t.sort((a, b) => {\n\t\t\t\treturn new Date(b.createdAt) - new Date(a.createdAt);\n\t\t\t})\n\t\t\t.map((archivedGather, index) => {\n\t\t\t\treturn \n\t\t\t});\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
Archived Gathers
\n\t\t\t\t
\n\t\t\t\t\t{archive}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n","import {Events} from \"javascripts/components/event\";\nimport {CurrentUser, AdminPanel, ProfileModal, UserMenu} from \"javascripts/components/user\";\nimport {SoundPanel} from \"javascripts/components/sound\";\nimport {TeamSpeakButton, TeamSpeakModal} from \"javascripts/components/teamspeak\";\nimport {SettingsPanel} from \"javascripts/components/settings\";\nimport {Chatroom} from \"javascripts/components/message\";\nimport {Gather, ArchivedGathers} from \"javascripts/components/gather\"\n\nconst React = require(\"react\");\nconst Sound = require(\"javascripts/components/sound\");\nconst SoundController = Sound.SoundController;\nconst helper = require(\"javascripts/helper\");\nconst storageAvailable = helper.storageAvailable;\nconst SplashScreen = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tstatus: \"connecting\",\n\t\t\tsocket: null\n\t\t}\n\t},\n\n\tcomponentDidMount() {\n\t\tconst socketUrl = window.location.protocol + \"//\" + window.location.host;\n\t\tlet socket = io(socketUrl)\n\t\t\t.on(\"connect\", () => {\n\t\t\t\tconsole.log(\"Connected\");\n\t\t\t\tthis.setState({ status: \"connected\" });\n\t\t\t\tsocket\n\t\t\t\t\t.on(\"reconnect\", () => {\n\t\t\t\t\t\tconsole.log(\"Reconnected\");\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"disconnect\", () => {\n\t\t\t\t\t\tconsole.log(\"Disconnected\")\n\t\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"error\", error => {\n\t\t\t\tconsole.log(error);\n\t\t\t\tif (error === \"Authentication Failed\") {\n\t\t\t\t\tthis.setState({ status: \"authFailed\" });\n\t\t\t\t} else if (error === \"Gather Banned\") {\n\t\t\t\t\tthis.setState({ status: \"banned\" });\n\t\t\t\t}\n\t\t\t});\n\n\t\tthis.setState({ socket: socket });\n\t},\n\n\trender() {\n\t\tconst status = this.state.status;\n\n\t\tif (status === \"connected\") {\n\t\t\treturn ;\n\t\t} \n\n\t\tlet splash;\n\t\tif (status === \"authFailed\") {\n\t\t\tsplash = ;\n\t\t} else if (status === \"banned\") {\n\t\t\tsplash = ;\n\t\t} else if (status === \"connecting\") {\n\t\t\tsplash = ;\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{splash}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst AuthFailedSplash = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
You need to be logged in to the ENSL website to access gathers
\n\t\t\t\t\t\t
If you are logged on, try visiting a few pages on ENSL.org so the server can update your cookies
\n\t\t\t\t\t\t
If this error persists please contact an admin to fix it
\n\t\t\t\t\t\t
\n\t\t\t\t\t
Go to website
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst BannedSplash = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
You're currently barred from joining gathers
\n\t\t\t\t\t\t
Either wait for the ban to expire or talk to an admin to get it lifted
\n\t\t\t\t\t\t
\n\t\t\t\t\t
See the ban list
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ConnectingSplash = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
Authenticating your ENSL account
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst App = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\tgetInitialState() {\n\t\tlet updateTitle = true;\n\t\tlet showEventsPanel = true;\n\n\t\tif (storageAvailable('localStorage')) {\n\t\t\tif (localStorage.getItem(\"updateTitle\") !== null) {\n\t\t\t\tupdateTitle = JSON.parse(localStorage.getItem(\"updateTitle\"));\n\t\t\t}\n\t\t\tif (localStorage.getItem(\"showEventsPanel\") !== null) {\n\t\t\t\tshowEventsPanel = JSON.parse(localStorage.getItem(\"showEventsPanel\"));\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tgather: {\n\t\t\t\tgatherers: []\n\t\t\t},\n\t\t\tusers: [],\n\t\t\tmessages: [],\n\t\t\tmaps: [],\n\t\t\tuser: null,\n\t\t\tservers: [],\n\t\t\tarchive: [],\n\t\t\tsocket: null,\n\t\t\tevents: [],\n\t\t\tupdateTitle: updateTitle,\n\t\t\tshowEventsPanel: showEventsPanel,\n\t\t\tsoundController: new SoundController(),\n\t\t\tshowMessageBox: true,\n\t\t\tcollapseMenu: false\n\t\t};\n\t},\n\n\tupdateTitle() {\n\t\tlet gather = this.state.gather;\n\t\tif (gather && this.state.updateTitle) {\n\t\t\tdocument.title = `NSL Gathers (${gather.gatherers.length}/12)`;\n\t\t\treturn;\n\t\t}\n\t\tdocument.title = \"NSL Gathers\";\n\t},\n\n\ttoggleEventsPanel(event) {\n\t\tlet newState = event.target.checked;\n\t\tthis.setState({ showEventsPanel: newState });\n\t\tif (storageAvailable('localStorage')) {\n\t\t\tlocalStorage.setItem(\"showEventsPanel\", newState)\n\t\t}\n\t},\n\n\ttoggleUpdateTitle(event) {\n\t\tlet newState = event.target.checked;\n\t\tthis.setState({ updateTitle: newState });\n\t\tif (storageAvailable('localStorage')) {\n\t\t\tlocalStorage.setItem(\"updateTitle\", newState)\n\t\t}\n\t\tthis.updateTitle();\n\t},\n\n\tthisGatherer() {\n\t\tlet gather = this.state.gather;\n\t\tlet user = this.state.user;\n\t\tif (gather && user && gather.gatherers.length) {\n\t\t\treturn gather.gatherers\n\t\t\t\t.filter(gatherer => gatherer.id === user.id)\n\t\t\t\t.pop() || null;\n\t\t}\n\t\treturn null;\n\t},\n\n\tcomponentDidMount() {\n\t\tlet self = this;\n\t\tlet socket = this.props.socket;\n\t\tlet soundController = this.state.soundController;\n\n\t\tthis.updateTitle();\n\n\t\tsocket.on('stateChange', data => {\n\t\t\tlet state = data.state;\n\t\t\t\n\t\t\tif (state.from === 'gathering'\n\t\t\t\t\t&& state.to === 'election'\n\t\t\t\t\t&& this.thisGatherer()) {\n\t\t\t\tsoundController.playGatherMusic();\n\t\t\t}\n\n\t\t\tif (state.from === 'election'\n\t\t\t\t\t&& state.to === 'gathering') {\n\t\t\t\tsoundController.stop();\n\t\t\t}\n\t\t});\n\n\t\tsocket.on('event:append', data => {\n\t\t\tlet events = self.state.events;\n\t\t\tevents.unshift(data);\n\t\t\tself.setState({\n\t\t\t\tevents: events.slice(0, 20)\n\t\t\t});\n\t\t});\n\n\t\tsocket.on('users:update', \n\t\t\tdata => self.setState({\n\t\t\t\tusers: data.users,\n\t\t\t\tuser: data.currentUser\n\t\t\t})\n\t\t);\n\n\t\tsocket.on(\"message:append\", data => {\n\t\t\tself.setState({\n\t\t\t\tmessages: self.state.messages.concat(data.messages)\n\t\t\t\t\t.sort((a, b) => {\n\t\t\t\t\t\treturn new Date(a.createdAt) - new Date(b.createdAt);\n\t\t\t\t\t})\n\t\t\t});\n\t\t});\n\n\t\tsocket.on(\"message:refresh\", data => {\n\t\t\tself.setState({\n\t\t\t\tmessages: data.messages\n\t\t\t});\n\t\t});\n\n\t\tsocket.on(\"gather:refresh\", (data) => {\n\t\t\tself.setState({\n\t\t\t\tgather: data.gather,\n\t\t\t\tmaps: data.maps,\n\t\t\t\tservers: data.servers,\n\t\t\t\tpreviousGather: data.previousGather\n\t\t\t});\n\t\t\tthis.updateTitle();\n\t\t});\n\n\t\tsocket.on(\"gather:archive:refresh\", data => {\n\t\t\tself.setState({\n\t\t\t\tarchive: data.archive,\n\t\t\t\tmaps: data.maps,\n\t\t\t\tservers: data.servers\n\t\t\t});\n\t\t});\n\n\t\tsocket.emit(\"users:refresh\");\n\t\tsocket.emit(\"message:refresh\");\n\t\tsocket.emit(\"gather:refresh\");\n\t},\n\n\ttoggleMessageBox(e) {\n\t\te.preventDefault();\n\t\tconsole.log(\"FOO\")\n\t\tthis.setState({\n\t\t\tshowMessageBox: !this.state.showMessageBox\n\t\t});\n\t},\n\n\ttoggleCollapseMenu(e) {\n\t\te.preventDefault();\n\t\tthis.setState({\n\t\t\tcollapseMenu: !this.state.collapseMenu\n\t\t});\n\t},\n\n\trender() {\n\t\tconst socket = this.props.socket;\n\n\t\tlet eventsPanel;\n\t\tif (this.state.showEventsPanel) {\n\t\t\teventsPanel = ;\n\t\t}\n\n\t\tlet profileModal, chatroom, currentUser;\n\t\tif (this.state.user) {\n\t\t\tprofileModal = ;\n\t\t\tchatroom = ;\n\t\t\tcurrentUser = (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\n\t\tlet appClass = [\"skin-blue\", \"sidebar-mini\", \"fixed\"];\n\t\tif (this.state.showMessageBox) appClass.push(\"control-sidebar-open\");\n\t\tif (this.state.collapseMenu) appClass.push(\"sidebar-collapse\");\n\n\t\treturn (\n\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t Gathersbeta
\n\t\t\t \n\t\t\t\t
\n\t\t\t\t \tFoo
\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t
\n\t\t);\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{profileModal}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{chatroom}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{eventsPanel}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nmodule.exports = SplashScreen;\n","const React = require(\"react\");\nconst ReactDOM = require(\"react-dom\");\nconst ReactEmoji = require(\"react-emoji\");\nconst ReactAutolink = require(\"react-autolink\");\nconst MessageBrowser = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tbrowserState: \"\",\n\t\t\tmessages: [],\n\t\t\tpage: 0,\n\t\t\tlimit: 250,\n\t\t\tsearch: \"\"\n\t\t}\n\t},\n\n\thandleNextPage(e) {\n\t\te.preventDefault();\n\t\tconst page = this.state.page;\n\t\tthis.setState({ page: page + 1 });\n\t\tthis.loadMessages();\n\t},\n\n\thandlePreviousPage(e) {\n\t\te.preventDefault();\n\t\tconst page = this.state.page;\n\t\tif (page < 1) return;\n\t\tthis.setState({ page: page - 1 });\n\t\tthis.loadMessages();\n\t},\n\n\tpageHandlers() {\n\t\tlet previous;\n\t\tif (this.state.page > 0) {\n\t\t\tprevious = (\n\t\t\t\tPrev\n\t\t\t);\n\t\t}\n\t\tlet next;\n\t\tif (this.state.messages.length === this.state.limit) {\n\t\t\tnext = (\n\t\t\t\tNext\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t{previous}\n\t\t\t\t\n\t\t\t\t\t{this.state.page}\n\t\t\t\t\n\t\t\t\t{next}\n\t\t\t
\n\t\t);\n\t},\n\n\tloadMessages() {\n\t\tconst limit = this.state.limit;\n\t\tconst page = this.state.page;\n\t\tlet data = {\n\t\t\tlimit: limit,\n\t\t\tpage: page\n\t\t};\n\n\t\tif (this.state.search.length) {\n\t\t\tdata.query = this.state.search;\n\t\t}\n\n\t\tthis.setState({ browserState: \"Retrieving messages\"});\n\t\t$.ajax({\n\t\t\turl: \"/api/messages\",\n\t\t\tdata: data\n\t\t})\n\t\t.done(data => {\n\t\t\tthis.setState({\n\t\t\t\tmessages: data.messages,\n\t\t\t\tbrowserState: \"\"\n\t\t\t});\n\t\t})\n\t\t.fail(error => {\n\t\t\tconsole.error(error);\n\t\t\tthis.setState({\n\t\t\t\tbrowserState: `Unable to retrieve messages.`\n\t\t\t});\n\t\t})\n\t},\n\n\tcomponentDidMount() {\n\t\tthis.loadMessages();\n\t},\n\n\tupdateLimit(e) {\n\t\tlet newLimit = parseInt(e.target.value, 10);\n\t\tif (isNaN(newLimit) || newLimit > 250) newLimit = 250;\n\t\tthis.setState({ limit: newLimit });\n\t},\n\n\tupdateSearch(e) {\n\t\tthis.setState({ search: e.target.value });\n\t},\n\n\trender() {\n\t\tlet browserState;\n\t\tif (this.state.browserState.length) {\n\t\t\tbrowserState = (\n\t\t\t\t\n\t\t\t\t\t
{this.state.browserState}
\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\t\tconst messages = this.state.messages.map(message => {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{(new Date(message.createdAt)).toString()} | \n\t\t\t\t\t{message.author.username} | \n\t\t\t\t\t{message.content} | \n\t\t\t\t\t{message._id} | \n\t\t\t\t
\n\t\t\t);\n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t \t
\n\t\t\t\t\t\t \t\n\t\t\t\t\t \t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \t
Page Control
\n\t\t\t\t\t\t \t{this.pageHandlers()}\n\t\t\t\t\t \t
\n\t\t\t\t \t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{browserState}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tDate | \n\t\t\t\t\t\t\t\tAuthor | \n\t\t\t\t\t\t\t\tMessage | \n\t\t\t\t\t\t\t\tID | \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{messages}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst Chatroom = exports.Chatroom = React.createClass({\n\tpropTypes: {\n\t\tmessages: React.PropTypes.array.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tuser: React.PropTypes.object.isRequired\n\t},\n\n\tgetInitialState() {\n\t\treturn {\n\t\t\tautoScroll: true\n\t\t};\n\t},\n\n\tcomponentDidMount() {\n\t\tlet self = this;\n\n\t\tthis.scrollListener = _.debounce((event) => {\n\t\t\tself.temporarilyDisableAutoScroll(event);\n\t\t}, 300, {\n\t\t leading: false,\n\t\t trailing: true\n\t\t});\n\n\t\tlet node = ReactDOM.findDOMNode(this.refs.messageContainer);\n\t\tnode.addEventListener('scroll', this.scrollListener);\n\n\t\tthis.scrollToBottom();\n\t},\n\n\tcomponentWillUnmount() {\n\t\tnode.removeEventListener('scroll', this.scrollListener);\n\t\tclearTimeout(this.disableScrollTimer);\n\t},\n\n\tloadMoreMessages() {\n\t\tconst earliestMessage = this.props.messages[0];\n\t\tif (earliestMessage === undefined) return;\n\t\tthis.props.socket.emit(\"message:refresh\", {\n\t\t\tbefore: earliestMessage.createdAt\n\t\t});\n\t},\n\n\tsendMessage(message) {\n\t\tthis.props.socket.emit(\"newMessage\", {message: message});\n\t},\n\n\tclearAutoScrollTimeout() {\n\t\tif (this.disableScrollTimer) clearTimeout(this.disableScrollTimer);\n\t},\n\n\ttemporarilyDisableAutoScroll(event) {\n\t\tlet self = this;\n\t\tlet node = event.target;\n\t\tif (node) {\n\t\t\tif (node.scrollHeight - node.scrollTop === node.clientHeight) {\n\t\t\t\tthis.setState({ autoScroll: true });\n\t\t\t\tthis.clearAutoScrollTimeout();\n\t\t\t}\n\t\t\tif (node.scrollHeight - node.scrollTop - node.clientHeight < 50) return;\n\t\t}\n\t\tthis.setState({ autoScroll: false });\n\t\tthis.clearAutoScrollTimeout();\n\t\tthis.disableScrollTimer = setTimeout(() => {\n\t\t\tself.setState({\n\t\t\t\tautoScroll: true\n\t\t\t})\n\t\t}, 10000);\n\t},\n\n\tcomponentDidUpdate() {\n\t\tthis.scrollToBottom();\n\t},\n\n\tscrollToBottom() {\n\t\tif (!this.state.autoScroll) return;\n\t\tlet node = ReactDOM.findDOMNode(this.refs.messageContainer);\n\t node.scrollTop = node.scrollHeight;\n\t},\n\n\trender() {\n\t\tconst socket = this.props.socket;\n\t\tconst messages = this.props.messages.map(message => {\n\t\t\tif (message) {\n\t\t\t\treturn \n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t
Gather Chat
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst imgurRegex = /^(https?:\\/\\/i\\.imgur\\.com\\/\\S*\\.(jpg|png))$/i;\n\nconst ChatMessage = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tmessage: React.PropTypes.object.isRequired\n\t},\n\n\tmixins: [\n ReactAutolink,\n ReactEmoji\n ],\n\n getInitialState() {\n \treturn {\n \t\tcreatedAt: \"\"\n \t}\n },\n\n updateCreatedAt() {\n \tlet self = this;\n \tif (this.props.message.createdAt) {\n \t\tself.setState({\n \t\t\tcreatedAt: $.timeago(self.props.message.createdAt)\n \t\t})\n \t}\n },\n\n componentWillMount() {\n\t\tthis.updateCreatedAt();\n },\n\n\tcomponentDidMount() {\n\t\tthis.interval = setInterval(this.updateCreatedAt, 60000);\n\t},\n\n\tcomponentWillUnmount: function () {\n\t\tclearInterval(this.interval);\n\t},\n\n\tmessageContent: function () {\n\t\tlet self = this;\n\t\tlet message = self.props.message.content\n\t\tif (message.match(imgurRegex)) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\n\t\treturn self.autolink(message, { \n\t\t\ttarget: \"_blank\", \n\t\t\trel: \"nofollow\" \n\t\t}).map((elem) => {\n\t\t\tif (_.isString(elem)) {\n\t\t\t\treturn self.emojify(elem);\n\t\t\t} else {\n\t\t\t\treturn elem;\n\t\t\t}\n\t\t});\n\t},\n\n\trender() {\n\t\tlet deleteButton;\n\t\tlet user = this.props.user;\n\t\tif (user && user.admin) {\n\t\t\tdeleteButton = ;\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{this.props.message.author.username}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{deleteButton}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t{this.state.createdAt}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
{this.messageContent()}
\n\t\t\t\t
\n\t\t\t\n\t\t);\n\t}\n});\n\nconst DeleteMessageButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\thandleClick (e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"message:delete\", {\n\t\t\tid: this.props.messageId\n\t\t});\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n})\n\nconst MessageBar = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\tsendMessage(content) {\n\t\tthis.props.socket.emit(\"message:new\", {\n\t\t\tcontent: content\n\t\t});\n\t},\n\n\tgetInitialState() {\n\t\treturn {\n\t\t\tstatusMessage: null\n\t\t};\n\t},\n\n\tcheckInputLength() {\n\t\tconst input = ReactDOM.findDOMNode(this.refs.content).value;\n\t\tconst currentStatusMessage = this.state.statusMessage;\n\t\tif (input.length > 256) {\n\t\t\treturn this.setState({\n\t\t\t\tstatusMessage: \"Maximum of 256 characters will be saved\"\n\t\t\t})\n\t\t}\n\t\tif (currentStatusMessage !== null) {\n\t\t\tthis.setState({\n\t\t\t\tstatusMessage: null\n\t\t\t});\n\t\t}\n\t},\n\n\thandleInputChange() {\n\t\t// Noop, later assigned as debounced method in componentWillMount\n\t},\n\n\thandleSubmit(e) {\n\t\te.preventDefault();\n\t\tlet content = ReactDOM.findDOMNode(this.refs.content).value.trim();\n\t\tif (!content) return;\n\t\tReactDOM.findDOMNode(this.refs.content).value = '';\n\t\tthis.sendMessage(content);\n\t\treturn;\n\t},\n\n\tcomponentWillMount() {\n\t\tthis.handleInputChange = _.debounce(this.checkInputLength, {\n\t\t\tleading: false,\n\t\t\ttrailing: true\n\t\t});\n\t},\n\n\trender() {\n\t\tlet statusMessage;\n\t\tif (this.state.statusMessage !== null) {\n\t\t\tstatusMessage = \n\t\t\t\t{this.state.statusMessage}\n\t\t\t
;\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n});\n","const React = require(\"react\");\n\nconst SettingsPanel = exports.SettingsPanel = React.createClass({\n\tpropTypes: {\n\t\ttoggleUpdateTitle: React.PropTypes.func.isRequired,\n\t\tupdateTitle: React.PropTypes.bool.isRequired,\n\t\ttoggleEventsPanel: React.PropTypes.func.isRequired,\n\t\tshowEventsPanel: React.PropTypes.bool.isRequired\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
Settings
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n","const React = require(\"react\");\n\nvar SnowMachineMenu = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tsnowMachine: null\n\t\t}\n\t},\n\n\tcomponentDidMount() {\n\t\tconst snowMachine = new SnowMachine();\n\t\tsnowMachine.start();\n\t\tthis.setState({ snowMachine: snowMachine });\n\t},\n\n\ttoggle() {\n\t\tconst snowMachine = this.state.snowMachine;\n\t\tif (snowMachine.timer) {\n\t\t\tsnowMachine.stop();\n\t\t} else {\n\t\t\tsnowMachine.start();\n\t\t}\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t );\n\t}\n});\n","const $ = require(\"jquery\");\nconst React = require(\"react\");\nconst Howl = require(\"howler\").Howl;\nconst Howler = require(\"howler\").Howler;\nconst helper = require(\"javascripts/helper\");\nconst storageAvailable = helper.storageAvailable;\n\nclass SoundController {\n\tconstructor () {\n\t\tif (Howl === undefined) {\n\t\t\tthrow new Error(\"Howl.js required to created sound controller\");\n\t\t}\n\n\t\tthis.MINIMUM_PLAY_INTERVAL = 20000;\n\n\t\tthis.playGatherMusic = _.throttle(() => {\n\t\t\tthis.gather.music.play();\n\t\t}, this.MINIMUM_PLAY_INTERVAL);\n\n\t\tthis.isMuted = Howler._muted;\n\t\t\n\t\tlet gatherMusic;\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\tlet volume = localStorage.getItem(\"gatherVolume\");\n\t\t\tif (volume !== undefined) Howler.volume(volume);\n\t\t\tgatherMusic = localStorage.getItem(\"gatherMusic\");\n\t\t}\n\n\t\tthis.tunes = {\n\t\t\t\"classic\": {\n\t\t\t\tdescription: \"Gathers Classic\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/gather-1.mp3'\n\t\t\t},\n\t\t\t\"nights\": {\n\t\t\t\tdescription: \"Nights\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/nights.mp3'\n\t\t\t},\n\t\t\t\"robby\": {\n\t\t\t\tdescription: \"Robby\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/robby.mp3'\n\t\t\t},\n\t\t\t\"america\": {\n\t\t\t\tdescription: \"Infamous\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/america.mp3'\n\t\t\t},\n\t\t\t\"prommah\": {\n\t\t\t\tdescription: \"Prommah\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/prommah.mp3'\n\t\t\t},\n\t\t\t\"turts\": {\n\t\t\t\tdescription: \"Gorges Rock your Ass\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/turts.mp3'\n\t\t\t},\n\t\t\t\"skyice\": {\n\t\t\t\tdescription: \"Skyice\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/skyice.mp3'\n\t\t\t},\n\t\t\t\"justwannahavefun\": {\n\t\t\t\tdescription: \"Gorges just want to have fun\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/justwannahavefun.mp3'\n\t\t\t},\n\t\t\t\"eyeofthegorgie\": {\n\t\t\t\tdescription: \"Eye of the Gorgie\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/eyeofthegorgie.mp3'\n\t\t\t},\n\t\t\t\"boondock\": {\n\t\t\t\tdescription: \"Boondock Marines\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/boondock.mp3'\n\t\t\t},\n\t\t\t\"preclassic\": {\n\t\t\t\tdescription: \"Old Gathers Classic\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/gather-5.mp3'\n\t\t\t}\n\t\t}\n\n\t\tthis.setupGatherMusic(gatherMusic);\n\t}\n\n\tmute() {\n\t\tthis.isMuted = true;\n\t\treturn Howler.mute();\n\t}\n\n\tunMute() {\n\t\tthis.isMuted = false;\n\t\treturn Howler.unmute();\n\t}\n\n\tgetVolume() {\n\t\treturn Howler.volume();\n\t}\n\n\tsetVolume(val) {\n\t\tif (val === undefined || \n\t\t\t\ttypeof val !== 'number' || \n\t\t\t\tMath.abs(val) > 1) return;\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\tlocalStorage.setItem(\"gatherVolume\", val);\n\t\t}\n\t\treturn Howler.volume(val);\n\t}\n\n\tplay(music) {\n\t\tif (this.gather && this.gather.music) return this.gather.music.play();\n\t}\n\n\tstop(music) {\n\t\tif (this.gather && this.gather.music) return this.gather.music.stop();\n\t}\n\n\tdefaultGatherMusic() {\n\t\treturn \"classic\";\n\t}\n\n\tsetupGatherMusic (musicName) {\n\t\tlet self = this;\n\t\tlet gatherMusic = self.tunes[musicName];\n\n\t\tif (!gatherMusic) {\n\t\t\tmusicName = this.defaultGatherMusic();\n\t\t\tgatherMusic = self.tunes[musicName]; \n\t\t}\n\n\t\tif (self.gather && self.gather.name === musicName) return;\n\n\t\t// Stop if already playing\n\t\tif (self.gather && self.gather.music) {\n\t\t\tself.gather.music.stop();\n\t\t}\n\n\t\tlet tune = self.tunes[musicName];\n\t\tself.gather = {\n\t\t\tname: musicName,\n\t\t\tdescription: tune.description,\n\t\t\turl: tune.url,\n\t\t\tmusic: new Howl({\n\t\t\t\turls: [tune.url]\n\t\t\t})\n\t\t};\n\t}\n}\n\nvar MusicSelector = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tmusic: this.selectedMusic()\n\t\t}\n\t},\n\n\tselectedMusic() {\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\treturn localStorage.getItem(\"gatherMusic\") \n\t\t\t\t|| this.props.soundController.defaultGatherMusic();\n\t\t} else {\n\t\t\treturn this.props.soundController.defaultGatherMusic(); \n\t\t}\n\t},\n\n\tsetMusic(event) {\n\t\tlet name = event.target.value;\n\t\tlet soundController = this.props.soundController;\n\t\tlet selectedTune = soundController.tunes[name];\n\t\tif (selectedTune === undefined) return;\n\t\tthis.setState({ music: name });\n\t\tsoundController.setupGatherMusic(name);\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\tlocalStorage.setItem(\"gatherMusic\", name);\n\t\t}\n\t},\n\n\trender() {\n\t\tlet soundController = this.props.soundController;\n\t\tlet tunes = [];\n\t\tfor (var attr in soundController.tunes) {\n\t\t\tlet o = soundController.tunes[attr];\n\t\t\to.id = attr;\n\t\t\ttunes.push(o);\n\t\t}\n\t\tlet options = tunes.map(tune => {\n\t\t\treturn ;\n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n})\n\nvar SoundPanel = React.createClass({\n\tcomponentDidMount() {\n\t\tlet soundController = this.props.soundController;\n\t\tlet scale = 10;\n\n\t\t$('a#sound-dropdown').on('click', function (event) {\n\t\t\t$(this).parent().toggleClass('open');\n\t\t});\n\n\t\t$(\"#volume-slide\").slider({\n\t\t\tmin: 0,\n\t\t\tmax: scale,\n\t\t\tstep: 1\n\t\t}).on(\"slideStop\", ({value}) => {\n\t\t\tsoundController.setVolume(value / scale);\n\t\t}).slider('setValue', soundController.getVolume() * scale);\n\t},\n\n\tmute() {\n\t\tthis.props.soundController.mute();\n\t\tthis.forceUpdate();\n\t},\n\n\tunMute() {\n\t\tthis.props.soundController.unMute();\n\t\tthis.forceUpdate();\n\t},\n\n\tplay() {\n\t\tthis.props.soundController.play();\n\t},\n\n\tstop() {\n\t\tthis.props.soundController.stop();\n\t},\n\n\trender() {\n\t\tlet soundController = this.props.soundController;\n\t\tlet mutedIcon, mutedButton;\n\t\tif (soundController.isMuted) {\n\t\t\tmutedIcon = ;\n\t\t\tmutedButton = \n\t\t\t\t\n\t\t\t\t\t{mutedIcon} Muted\n\t\t\t\t\n\t\t\t;\n\t\t} else {\n\t\t\tmutedIcon = ;\n\t\t\tmutedButton = \n\t\t\t\t\n\t\t\t\t\t{mutedIcon} Unmuted\n\t\t\t\t\n\t\t\t;\n\t\t}\n\t\treturn ;\n\t}\n});\n\nmodule.exports = {\n\tSoundController: SoundController,\n\tSoundPanel: SoundPanel\n};\n","const React = require(\"react\");\n\nconst teamspeakDefaults = {\n\turl: \"ts3server://ensl.org/\",\n\tpassword: \"ns2gather\",\n\talien: {\n\t\tchannel: \"NS2 Gather/Gather #1/Alien\",\n\t\tpassword: \"ns2gather\"\n\t},\n\tmarine: {\n\t\tchannel: \"NS2 Gather/Gather #1/Marine\",\n\t\tpassword: \"ns2gather\"\n\t}\n};\n\nvar TeamSpeakButton = exports.TeamSpeakButton = React.createClass({\n\tgetDefaultProps() {\n\t\treturn teamspeakDefaults\n\t},\n\tmarineUrl() {\n\t\treturn this.teamSpeakUrl(this.props.marine);\n\t},\n\talienUrl() {\n\t\treturn this.teamSpeakUrl(this.props.alien);\n\t},\n\tteamSpeakUrl(conn) {\n\t\tlet params = `channel=${encodeURIComponent(conn.channel)}&\n\t\t\tchannelpassword=${encodeURIComponent(conn.password)}`;\n\t\treturn (`${this.props.url}?${params}`);\n\t},\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n});\n\nvar TeamSpeakModal = exports.TeamSpeakModal = React.createClass({\n\tgetDefaultProps() {\n\t\treturn teamspeakDefaults;\n\t},\n\n\trender() {\n\t\treturn \n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
Teamspeak Server Information
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t- Server
\n\t\t\t\t\t\t\t- {this.props.url}
\n\t\t\t\t\t\t\t- Password
\n\t\t\t\t\t\t\t- {this.props.password}
\n\t\t\t\t\t\t\t- Marine Channel
\n\t\t\t\t\t\t\t- {this.props.marine.channel}
\n\t\t\t\t\t\t\t- Alien Channel
\n\t\t\t\t\t\t\t- {this.props.alien.channel}
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t}\n});\n","import {LifeformIcons} from \"javascripts/components/gather\";\nconst React = require(\"react\");\nconst helper = require(\"javascripts/helper\");\nconst enslUrl = helper.enslUrl;\nconst hiveUrl = helper.hiveUrl;\nconst modalId = helper.modalId;\n\nconst UserLogin = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\tauthorizeId(id) {\n\t\tthis.props.socket.emit(\"users:authorize\", {\n\t\t\tid: parseInt(id, 10)\n\t\t});\n\t},\n\n\thandleSubmit(e) {\n\t\te.preventDefault();\n\t\tlet id = React.findDOMNode(this.refs.authorize_id).value.trim();\n\t\tif (!id) return;\n\t\tReact.findDOMNode(this.refs.authorize_id).value = '';\n\t\tthis.authorizeId(id);\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n});\n\nconst DisconnectUserButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tid: React.PropTypes.number.isRequired\n\t},\n\n\tgetDefaultProps() {\n\t\treturn {\n\t\t\tid: null\n\t\t};\n\t},\n\n\tdisconnectUser() {\n\t\tthis.props.socket.emit(\"users:disconnect\", {\n\t\t\tid: this.props.id\n\t\t});\n\t},\n\t\n\trender() {\n\t\treturn \n\t}\n});\n\nconst UserModal = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tcurrentUser: React.PropTypes.object.isRequired\n\t},\n\n\trender() {\n\t\tconst currentUser = this.props.currentUser;\n\t\tconst user = this.props.user;\n\t\tlet hiveStats;\n\t\tif (user.hive.id) {\n\t\t\thiveStats = [\n\t\t\tHive Stats | |
,\n\t\t\t\n\t\t\t\tELO | \n\t\t\t\t{user.hive.skill} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tHours Played | \n\t\t\t\t{Math.round(user.hive.playTime / 3600)} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tWins | \n\t\t\t\t{user.hive.wins} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tLosses | \n\t\t\t\t{user.hive.loses} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tKills (/min) | \n\t\t\t\t{user.hive.kills} ({_.round(user.hive.kills / (user.hive.playTime / 60), 1)}) | \n\t\t\t
,\n\t\t\t\n\t\t\t\tAssists (/min) | \n\t\t\t\t{user.hive.assists} ({_.round(user.hive.assists / (user.hive.playTime / 60), 1)}) | \n\t\t\t
,\n\t\t\t\n\t\t\t\tDeaths (/min) | \n\t\t\t\t{user.hive.deaths} ({_.round(user.hive.deaths / (user.hive.playTime / 60), 1)}) | \n\t\t\t
\n\t\t\t]\n\t\t}\n\t\tlet adminOptions;\n\t\tif (currentUser.admin) {\n\t\t\tadminOptions = ;\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t{user.username}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tLifeforms | \n\t\t\t\t\t\t\t\t\t\t | \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tLinks | \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tENSL Profile \n\t\t\t\t\t\t\t\t\t\t\tHive Profile\n\t\t\t\t\t\t\t\t\t\t | \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{hiveStats}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{adminOptions}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n})\n\nconst UserItem = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tcurrentUser: React.PropTypes.object.isRequired\n\t},\n\n\trender() {\n\t\tconst user = this.props.user;\n\t\tconst currentUser = this.props.currentUser;\n\t\treturn (\n\t\t\t\n\t\t\t\t{user.username}\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n});\n\nconst UserMenu = exports.UserMenu = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tusers: React.PropTypes.array.isRequired\n\t},\n\n\trender() {\n\t\tconst users = this.props.users\n\t\t.sort((a, b) => (a.username.toLowerCase() > b.username.toLowerCase()) ? 1 : -1)\n\t\t.map(user => {\n\t\t\treturn \n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t Online\n\t\t\t\t\t\t{this.props.users.length}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{users}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst AdminPanel = exports.AdminPanel = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\thandleGatherReset() {\n\t\tthis.props.socket.emit(\"gather:reset\");\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
Administration Panel
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ProfileModal = exports.ProfileModal = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired\n\t},\n\n\thandleUserUpdate(e) {\n\t\te.preventDefault();\n\t\tlet abilities = {\n\t\t\tskulk: React.findDOMNode(this.refs.skulk).checked,\n\t\t\tlerk: React.findDOMNode(this.refs.lerk).checked,\n\t\t\tgorge: React.findDOMNode(this.refs.gorge).checked,\n\t\t\tfade: React.findDOMNode(this.refs.fade).checked,\n\t\t\tonos: React.findDOMNode(this.refs.onos).checked,\n\t\t\tcommander: React.findDOMNode(this.refs.commander).checked\n\t\t};\n\t\tlet skill = React.findDOMNode(this.refs.playerskill).value;\n\t\tsocket.emit(\"users:update:profile\", {\n\t\t\tid: this.props.user.id,\n\t\t\tprofile: {\n\t\t\t\tabilities: abilities,\n\t\t\t\tskill: skill\n\t\t\t}\n\t\t});\n\t},\n\n\trender() {\n\t\tif (!this.props.user) return false;\n\t\tlet abilities = this.props.user.profile.abilities;\n\t\tlet abilitiesForm = [];\n\t\tfor (let lifeform in abilities) {\n\t\t\tabilitiesForm.push(\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\tlet skillLevel = this.props.user.profile.skill;\n\t\tlet skillLevels = _.uniq([\"Low Skill\", \"Medium Skill\", \"High Skill\", skillLevel])\n\t\t\t.filter(skill => { return typeof skill === 'string' })\n\t\t\t.map(skill => { return });\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
Profile
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst CurrentUser = exports.CurrentUser = React.createClass({\n\trender() {\n\t\tif (this.props.user) {\n\t\t\tlet adminOptions;\n\t\t\tif (this.props.user.admin || this.props.user.moderator) {\n\t\t\t\tadminOptions = (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t Administration\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{this.props.user.username} \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t Profile\n\t\t\t\t\t\t
\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t Settings\n\t\t\t\t\t\t
\n\t\t\t\t\t\t{adminOptions}\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n});\n\nvar AssumeUserIdButton = exports.AssumeUserIdButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgatherer: React.PropTypes.object.isRequired,\n\t\tcurrentUser: React.PropTypes.object.isRequired,\n\t},\n\n\tassumeId(e) {\n\t\te.preventDefault();\n\t\tif (this.props.gatherer) {\n\t\t\tthis.props.socket.emit(\"users:authorize\", {\n\t\t\t\tid: this.props.gatherer.id\n\t\t\t});\n\t\t\t// Refresh Gather list\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.props.socket.emit(\"gather:refresh\");\n\t\t\t}, 5000);\n\t\t}\n\t},\n\n\trender() {\n\t\tlet currentUser = this.props.currentUser;\n\t\tlet gatherer = this.props.gatherer;\n\t\tif (currentUser && gatherer) {\n\t\t\treturn \n\t\t}\n\t}\n});\n","// Accepts an array of IDs voted\n// 1. Creates an array of tally objects, \n//\t\twith ID as prop and vote count as val { 12: 0 }\n// 2. Increments ID vote tally for every vote\n// 3. Sorts \n\nconst rankVotes = exports.rankVotes = function (votes, candidates) {\n\tvar initial = candidates.reduce(function (acc, candidate) {\n\t\tacc[candidate.id] = 0;\n\t\treturn acc;\n\t}, {});\n\n\tvar scores = votes.reduce(function (acc, id) {\n\t\tif (acc[id] !== undefined) {\n\t\t\tacc[id]++;\n\t\t}\n\t\treturn acc;\n\t}, initial);\n\n\tvar rank = [];\n\n\tfor (var id in scores) {\n\t\tif (scores.hasOwnProperty(id)) {\n\t\t\trank.push({\n\t\t\t\tid: parseInt(id, 10),\n\t\t\t\tcount: scores[id]\n\t\t\t});\n\t\t}\n\t}\n\n\treturn rank.sort(function (a, b) {\n\t\tif (b.count === a.count) {\n\t\t\treturn b.id - a.id;\n\t\t} else {\n\t\t\treturn b.count - a.count;\n\t\t}\n\t}).map(function (tally) {\n\t\treturn tally.id\n\t}).map(function (id) {\n\t\treturn candidates.reduce(function (acc, candidate) {\n\t\t\tif (candidate.id === id) return candidate;\n\t\t\treturn acc;\n\t\t});\n\t});\n};\n\nconst enslUrl = exports.enslUrl = (gatherer) => {\n\treturn `http://www.ensl.org/users/${gatherer.id}`\n};\n\nconst hiveUrl = exports.hiveUrl = (gatherer) => {\n\tconst hiveId = gatherer.user.hive.id;\n\tif (hiveId) {\n\t\treturn `http://hive.naturalselection2.com/profile/${hiveId}`;\n\t} else {\n\t\treturn null;\n\t}\n};\n\nconst modalId = exports.modalId = (user) => {\n\treturn `user-modal-${user.id}`;\n};\n\nconst storageAvailable = exports.storageAvailable = (type) => {\n\ttry {\n\t\tvar storage = window[type],\n\t\t\tx = '__storage_test__';\n\t\tstorage.setItem(x, x);\n\t\tstorage.removeItem(x);\n\t\treturn true;\n\t}\n\tcatch(e) {\n\t\treturn false;\n\t}\n};\n"]}
\ No newline at end of file
+{"version":3,"sources":["app.js","event.js","gather.js","main.js","message.js","settings.js","snowMachine.js","sound.js","teamspeak.js","user.js","helper.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,QAAQ,QAAQ,OAAR,CAAR;AACN,IAAM,WAAW,QAAQ,WAAR,CAAX;AACN,IAAM,MAAM,QAAQ,6BAAR,CAAN;;AAEN,OAAO,OAAP,GAAiB,UAAU,KAAV,EAAiB;AACjC,UAAS,MAAT,CAAgB,oBAAC,GAAD,OAAhB,EAAyB,KAAzB,EADiC;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,CAAmB,CAAnB,EAJG;AAKH,SAAO,IAAP,CALG;EAAJ,CAOA,OAAM,CAAN,EAAS;AACR,SAAO,KAAP,CADQ;EAAT;CARmD","file":"public/app.js","sourcesContent":["const React = require(\"react\");\nconst ReactDOM = require(\"react-dom\");\nconst App = require(\"javascripts/components/main\");\n\nmodule.exports = function (mount) { \n\tReactDOM.render(, mount);\n};\n","const React = require(\"react\");\nconst Events = exports.Events = React.createClass({\n\tpropTypes: {\n\t\tevents: React.PropTypes.array.isRequired\n\t},\n\n\tgetTime(timeString) {\n\t\treturn (new Date(timeString)).toTimeString().match(/^[\\d:]*/)[0];\n\t},\n\n\trender() {\n\t\tlet events;\n\t\tif (this.props.events.length) {\n\t\t\tevents = this.props.events.map(event => {\n\t\t\t\treturn `${this.getTime(event.createdAt)} ${event.description}`;\n\t\t\t}).join(\"\\n\");\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{events}\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\tListening for new events...\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\t}\n});\n","import {AssumeUserIdButton} from \"javascripts/components/user\";\n\nconst React = require(\"react\");\nconst helper = require(\"javascripts/helper\");\nconst enslUrl = helper.enslUrl;\nconst rankVotes = helper.rankeVotes;\nconst hiveUrl = helper.hiveUrl;\n\nconst SelectPlayerButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgatherer: React.PropTypes.object.isRequired\n\t},\n\n\tselectPlayer(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:select\", {\n\t\t\tplayer: parseInt(e.target.value, 10)\n\t\t});\n\t},\n\n\trender() {\n\t\tlet button;\n\t\tif (this.props.gatherer.leader) {\n\t\t\tbutton = ;\n\t\t} else if (this.props.gatherer.team !== \"lobby\") {\n\t\t\tbutton = ;\n\t\t} else {\n\t\t\tbutton = ;\n\t\t}\n\t\treturn button;\n\t}\n});\n\nconst GathererList = React.createClass({\n\tmemberList() {\n\t\tconst self = this;\n\t\treturn this.props.gather.gatherers\n\t\t\t.filter(gatherer => gatherer.team === self.props.team)\n\t\t\t.sort(gatherer => { return gatherer.leader ? 1 : -1 });\n\t},\n\n\trender() {\n\t\tconst extractGatherer = gatherer => {\n\t\t\tlet image;\n\t\t\tif (gatherer.leader) {\n\t\t\t\timage = ;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{image}{gatherer.user.username}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t | \n\t\t\t\t
\n\t\t\t);\n\t\t};\n\t\tconst members = this.memberList()\n\t\t\t.map(extractGatherer);\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{members}\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst GatherTeams = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tMarines\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tAliens\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ElectionProgressBar = React.createClass({\n\tcomponentDidMount() {\n\t\tconst self = this;\n\t\tthis.timer = setInterval(() => {\n\t\t\tself.forceUpdate();\n\t\t}, 900);\n\t},\n\n\tprogress() {\n\t\tconst interval = this.props.gather.election.interval;\n\t\tconst startTime = (new Date(this.props.gather.election.startTime)).getTime();\n\t\tconst msTranspired = Math.floor((new Date()).getTime() - startTime);\n\n\t\treturn {\n\t\t\tnum: msTranspired,\n\t\t\tden: interval,\n\t\t\tbarMessage: Math.floor((interval - msTranspired) / 1000) + \"s remaining\"\n\t\t}\n\t},\n\n\tcomponentWillUnmount() {\n\t\tclearInterval(this.timer);\n\t},\n\n\trender() {\n\t\treturn ();\n\t}\n});\n\nconst ProgressBar = React.createClass({\n\trender() {\n\t\tconst progress = this.props.progress;\n\t\tconst style = {\n\t\t\twidth: Math.round((progress.num / progress.den * 100)) + \"%\"\n\t\t};\n\t\tconst barMessage = progress.barMessage || \"\";\n\t\treturn (\n\t\t\t\n\t\t\t\t
{barMessage}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst GatherProgress = React.createClass({\n\tstateDescription() {\n\t\tswitch(this.props.gather.state) {\n\t\t\tcase \"gathering\":\n\t\t\t\treturn \"Waiting for more gatherers.\";\n\t\t\tcase \"election\":\n\t\t\t\treturn \"Currently voting for team leaders.\";\n\t\t\tcase \"selection\":\n\t\t\t\treturn \"Waiting for leaders to pick teams.\";\n\t\t\tcase \"done\":\n\t\t\t\treturn \"Gather completed.\";\n\t\t\tdefault:\n\t\t\t\treturn \"Initialising gather.\";\n\t\t}\n\t},\n\n\tgatheringProgress() {\n\t\tconst num = this.props.gather.gatherers.length;\n\t\tconst den = 12;\n\t\tconst remaining = den - num;\n\t\tconst message = (remaining === 1) ? \n\t\t\t\"Waiting for last player\" : `Waiting for ${remaining} more players`;\n\t\treturn {\n\t\t\tnum: num,\n\t\t\tden: den,\n\t\t\tmessage: message\n\t\t};\n\t},\n\n\telectionProgress() {\n\t\tconst num = this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.leaderVote) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t\tconst den = 12;\n\t\treturn {\n\t\t\tnum: num,\n\t\t\tden: den,\n\t\t\tmessage: den - num + \" more votes required\"\n\t\t};\n\t},\n\n\tselectionProgress() {\n\t\tconst num = this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.team !== \"lobby\") acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t\tconst den = 12;\n\n\t\treturn {\n\t\t\tnum: num,\n\t\t\tden: den,\n\t\t\tmessage: `${num} out of ${den} players assigned. Waiting \n\t\t\t\ton ${_.capitalize(this.props.gather.pickingTurn)}s to pick next...`\n\t\t};\n\t},\n\n\trender() {\n\t\tlet progress, progressBar;\n\t\tconst gatherState = this.props.gather.state;\n\t\tif (gatherState === 'gathering' && this.props.gather.gatherers.length) {\n\t\t\tprogress = this.gatheringProgress();\n\t\t\tprogressBar = ();\n\t\t} else if (gatherState === 'election') {\n\t\t\tprogress = this.electionProgress();\n\t\t\tprogressBar = ();\n\t\t} else if (gatherState === 'selection') {\n\t\t\tprogress = this.selectionProgress();\n\t\t\tprogressBar = ();\n\t\t}\n\n\t\tif (!progress) return false;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
{this.stateDescription()} {progress.message}
\n\t\t\t\t{progressBar}\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst JoinGatherButton = React.createClass({\n\tpropTypes: {\n\t\tthisGatherer: React.PropTypes.object,\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired\n\t},\n\n\tcomponentDidMount() {\n\t\tconst self = this;\n\t\tthis.timer = setInterval(() => {\n\t\t\tself.forceUpdate();\n\t\t}, 30000);\n\t},\n\n\tcomponentWillUnmount() {\n\t\tclearInterval(this.timer);\n\t},\n\n\tjoinGather(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:join\");\n\t},\n\n\tleaveGather(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:leave\");\n\t},\n\n\tcooldownTime() {\n\t\tlet user = this.props.user;\n\t\tif (!user) return false;\n\t\tlet cooloffTime = this.props.gather.cooldown[user.id];\n\t\tif (!cooloffTime) return false;\n\t\tlet timeRemaining = new Date(cooloffTime) - new Date();\n\t\treturn timeRemaining > 0 ? timeRemaining : false;\n\t},\n\n\trender() {\n\t\tlet gather = this.props.gather;\n\t\tlet thisGatherer = this.props.thisGatherer;\n\t\tif (thisGatherer) {\n\t\t\treturn ;\n\t\t} \n\t\tif (gather.state === 'gathering') {\n\t\t\tlet cooldownTime = this.cooldownTime();\n\t\t\tif (cooldownTime) {\n\t\t\t\treturn ;\n\t\t\t} else {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n});\n\nconst CooloffButton = React.createClass({\n\tpropTypes: {\n\t\ttimeRemaining: React.PropTypes.number.isRequired\n\t},\n\n\ttimeRemaining() {\n\t\treturn `${Math.floor(this.props.timeRemaining / 60000) + 1} minutes remaining`;\n\t},\n\n\trender() {\n\t\treturn \n\t}\n})\n\nconst GatherActions = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object\n\t},\n\n\tvoteRegather(e) {\n\t\te.preventDefault(e);\n\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\tregather: (e.target.value === \"true\")\n\t\t});\n\t},\n\n\tregatherVotes() {\n\t\tlet gather = this.props.gather;\n\t\tif (!gather) return 0;\n\t\treturn gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.regatherVote) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t},\n\n\trender() {\n\t\tlet regatherButton;\n\t\tconst user = this.props.user;\n\t\tconst gather = this.props.gather;\n\t\tconst socket = this.props.socket;\n\t\tconst thisGatherer = this.props.thisGatherer;\n\t\tif (thisGatherer) {\n\t\t\tlet regatherVotes = this.regatherVotes();\n\t\t\tif (thisGatherer.regatherVote) {\n\t\t\t\tregatherButton = ;\n\t\t\t} else {\n\t\t\t\tregatherButton = ;\n\t\t\t}\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t{regatherButton}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst VoteButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tcandidate: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object\n\t},\n\n\tcancelVote(e) {\n\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\tleader: {\n\t\t\t\tcandidate: null\n\t\t\t}\n\t\t});\n\t},\n\n\tvote(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\tleader: {\n\t\t\t\tcandidate: parseInt(e.target.value, 10)\n\t\t\t}\n\t\t});\n\t},\n\n\tstopGatherMusic() {\n\t\tsoundController.stop();\n\t},\n\n\trender() {\n\t\tlet candidate = this.props.candidate;\n\t\tlet thisGatherer = this.props.thisGatherer;\n\t\tif (thisGatherer === null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (thisGatherer.leaderVote === candidate.id) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t}\n});\n\nconst ServerVoting = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object,\n\t\tservers: React.PropTypes.array.isRequired,\n\t},\n\n\tvoteHandler(serverId) {\n\t\treturn e => {\n\t\t\te.preventDefault();\n\t\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\t\tserver: {\n\t\t\t\t\tid: serverId\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\tvotesForServer(server) {\n\t\treturn this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.serverVote.some(voteId => voteId === server.id)) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t},\n\n\trender() {\n\t\tlet self = this;\n\t\tlet thisGatherer = self.props.thisGatherer;\n\t\tlet servers = self.props.servers.sort((a, b) => {\n\t\t\t\tconst aVotes = self.votesForServer(a);\n\t\t\t\tconst bVotes = self.votesForServer(b);\n\t\t\t\treturn bVotes - aVotes;\n\t\t\t}).map(server => {\n\t\t\tlet votes = self.votesForServer(server);\n\t\t\tlet style = thisGatherer.serverVote.some(voteId => voteId === server.id) ? \n\t\t\t\t\"list-group-item list-group-item-success\" : \"list-group-item\";\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{votes}\n\t\t\t\t\t{server.name || server.description}\n\t\t\t\t\n\t\t\t);\n\t\t});\n\n\t\tlet votes = thisGatherer.serverVote.length;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{votes === 2 ? \"Server Votes\" : \n\t\t\t\t\t`Please Vote for a Server. ${2 - votes} votes remaining` }\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{servers}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n})\n\nconst MapVoting = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired,\n\t\tthisGatherer: React.PropTypes.object,\n\t\tmaps: React.PropTypes.array.isRequired,\n\t},\n\n\tvoteHandler(mapId) {\n\t\treturn e => {\n\t\t\te.preventDefault();\n\t\t\tthis.props.socket.emit(\"gather:vote\", {\n\t\t\t\tmap: {\n\t\t\t\t\tid: mapId\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\tvotesForMap(map) {\n\t\treturn this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tif (gatherer.mapVote.some(voteId => voteId === map.id)) acc++;\n\t\t\treturn acc;\n\t\t}, 0);\n\t},\n\n\trender() {\n\t\tconst self = this;\n\t\tlet thisGatherer = self.props.thisGatherer\n\t\tlet maps = self.props.maps.sort((a, b) => {\n\t\t\t\t\tconst aVotes = self.votesForMap(a);\n\t\t\t\t\tconst bVotes = self.votesForMap(b);\n\t\t\t\t\treturn bVotes - aVotes;\n\t\t\t\t}).map(map => {\n\t\t\t\tlet votes = self.votesForMap(map);\n\t\t\t\tlet style = thisGatherer.mapVote.some(voteId => voteId === map.id) ? \n\t\t\t\t\t\"list-group-item list-group-item-success\" : \"list-group-item\";\n\t\t\t\treturn (\n\t\t\t\t\t\n\t\t\t\t\t\t\t{votes}\n\t\t\t\t\t\t\t{map.name}\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t});\n\n\t\tlet votes = thisGatherer.mapVote.length;\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{votes === 2 ? \"Map Votes\" : \n\t\t\t\t\t\t`Please Vote for a Map. ${2 - votes} votes remaining` }\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t{maps}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n})\n\nconst Gather = exports.Gather = React.createClass({\n\tpropTypes: {\n\t\tthisGatherer: React.PropTypes.object,\n\t\tmaps: React.PropTypes.array.isRequired,\n\t\tservers: React.PropTypes.array.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired\n\t},\n\n\trender() {\n\t\tconst socket = this.props.socket;\n\t\tconst gather = this.props.gather;\n\t\tconst thisGatherer = this.props.thisGatherer;\n\t\tconst servers = this.props.servers;\n\t\tconst maps = this.props.maps;\n\t\tconst user = this.props.user;\n\t\tif (gather === null) return ;\n\n\t\tlet voting;\n\t\tif (thisGatherer) {\n\t\t\tlet state = gather.state;\n\t\t\tif (state === 'gathering' || state === 'election') {\n\t\t\t\tvoting = (\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvoting = ;\n\t\t\t}\n\t\t}\n\n\t\tlet gatherTeams;\n\t\tif (gather.state === 'selection') {\n\t\t\tgatherTeams = ;\n\t\t}\n\n\t\tif (gather.gatherers.length > 0) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
Current Gather
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{gatherTeams}\n\t\t\t\t\t{voting}\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
Current Gather
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t}\n});\n\nconst LifeformIcons = exports.LifeformIcons = React.createClass({\n\tavailableLifeforms() {\n\t\treturn [\"skulk\", \"gorge\", \"lerk\", \"fade\", \"onos\", \"commander\"];\n\t},\n\n\tgathererLifeforms() {\n\t\tlet lifeforms = [];\n\t\tlet gatherer = this.props.gatherer;\n\t\tlet abilities = gatherer.user.profile.abilities;\n\t\tfor (let attr in abilities) {\n\t\t\tif (abilities[attr]) lifeforms.push(_.capitalize(attr));\n\t\t}\n\t\treturn lifeforms;\n\t},\n\n\trender() {\n\t\tlet lifeforms = this.gathererLifeforms();\t\n\t\tlet availableLifeforms = this.availableLifeforms();\n\t\tlet icons = availableLifeforms.map(lifeform => {\n\t\t\tlet containsAbility = lifeforms.some(gathererLifeform => {\n\t\t\t\treturn gathererLifeform.toLowerCase() === lifeform.toLowerCase()\n\t\t\t});\n\t\t\tif (containsAbility) {\n\t\t\t\treturn \n\t\t\t} else {\n\t\t\t\treturn \n\t\t\t}\n\t\t});\n\t\treturn {icons}\n\t}\n});\n\nconst Gatherers = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object,\n\t\tthisGatherer: React.PropTypes.object,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgather: React.PropTypes.object.isRequired\n\t},\n\n\tjoinGather(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:join\");\n\t},\n\n\tbootGatherer(e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"gather:leave\", {\n\t\t\tgatherer: parseInt(e.target.value, 10) || null\n\t\t});\n\t},\n\n\trender() {\n\t\tconst self = this;\n\t\tconst user = this.props.user;\n\t\tconst socket = this.props.socket;\n\t\tconst gather = this.props.gather;\n\t\tconst thisGatherer = this.props.thisGatherer;\n\t\tconst admin = (user && user.admin) || (user && user.moderator);\n\t\tconst gatherers = gather.gatherers\n\t\t.sort((a, b) => {\n\t\t\t\treturn (b.user.hive.skill || 1000) - (a.user.hive.skill || 1000);\n\t\t\t})\n\t\t.map(gatherer => {\n\t\t\tlet country;\n\t\t\tif (gatherer.user.country) {\n\t\t\t\tcountry = (\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tlet skill = gatherer.user.profile.skill || \"Not Available\";\n\n\t\t\tlet hiveStats = [];\n\t\t\tif (gatherer.user.hive.skill) hiveStats.push(`${gatherer.user.hive.skill} ELO`);\n\n\t\t\tif (gatherer.user.hive.playTime) {\n\t\t\t\thiveStats.push(`${Math.floor(gatherer.user.hive.playTime / 3600)} Hours`);\n\t\t\t}\n\n\t\t\tlet hive = (hiveStats.length) ? hiveStats.join(\", \") : \"Not Available\";\n\t\t\t\n\t\t\tlet team = (gatherer.user.team) ? gatherer.user.team.name : \"None\";\n\n\t\t\tlet action;\n\t\t\tif (gather.state === \"election\") {\n\t\t\t\tlet votes = gather.gatherers.reduce((acc, voter) => {\n\t\t\t\t\tif (voter.leaderVote === gatherer.id) acc++;\n\t\t\t\t\treturn acc;\n\t\t\t\t}, 0)\n\t\t\t\taction = (\n\t\t\t\t\t\n\t\t\t\t\t\t{votes + \" votes\"}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (gather.state === 'selection') {\n\t\t\t\tif (thisGatherer && \n\t\t\t\t\t\tthisGatherer.leader &&\n\t\t\t\t\t\tthisGatherer.team === gather.pickingTurn) {\n\t\t\t\t\taction = (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tif (gatherer.leader) {\n\t\t\t\t\t\taction = (Leader);\n\t\t\t\t\t} else if (gatherer.team !== \"lobby\") {\n\t\t\t\t\t\taction = ({_.capitalize(gatherer.team)});\n\t\t\t\t\t} else {\n\t\t\t\t\t\taction = (\n\t\t\t\t\t\t\tLobby);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet adminOptions;\n\t\t\tif (admin) {\n\t\t\t\tadminOptions = [\n\t\t\t\t\t
,\n\t\t\t\t\tAdmin,\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t]\n\t\t\t}\n\n\t\t\tlet tabColor = gatherer.team !== \"lobby\" ? `panel-${gatherer.team}` : \"panel-info\";\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{country} {gatherer.user.username}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tInfo \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{action}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t- Skill Level
\n\t\t\t\t\t\t\t\t- {skill}
\n\t\t\t\t\t\t\t\t- Team
\n\t\t\t\t\t\t\t\t- {team}
\n\t\t\t\t\t\t\t\t- Hive Stats
\n\t\t\t\t\t\t\t\t- {hive}
\n\t\t\t\t\t\t\t\t- Links
\n\t\t\t\t\t\t\t\t- \n\t\t\t\t\t\t\t\t\tENSL Profile \n\t\t\t\t\t\t\t\t\tHive Profile\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{adminOptions}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t);\n\t\t})\n\t\tif (gather.gatherers.length) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{gatherers}\n\t\t\t\t
\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\t}\n});\n\nconst CompletedGather = React.createClass({\n\tcompletionDate() {\n\t\tlet d = new Date(this.props.gather.done.time);\n\t\tif (d) {\n\t\t\treturn d.toLocaleTimeString();\n\t\t} else {\n\t\t\treturn \"Completed Gather\"\n\t\t}\n\t},\n\n\tgetInitialState() {\n\t\treturn {\n\t\t\tshow: !!this.props.show\n\t\t};\n\t},\n\n\ttoggleGatherInfo() {\n\t\tlet newState = !this.state.show;\n\t\tthis.setState({\n\t\t\tshow: newState\n\t\t});\n\t},\n\n\trender() {\n\t\tlet gatherInfo = [];\n\t\tlet gather = this.props.gather;\n\t\tlet maps = this.props.maps;\n\t\tlet servers = this.props.servers;\n\t\tif (this.state.show) {\n\t\t\tgatherInfo.push();\n\t\t\tgatherInfo.push();\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
{this.completionDate()}
\n\t\t\t\t
\n\t\t\t\t{gatherInfo}\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst GatherVotingResults = React.createClass({\n\t// Returns an array of ids voted for e.g. [1,2,5,1,1,3,2]\n\tcountVotes(voteType) {\n\t\treturn this.props.gather.gatherers.reduce((acc, gatherer) => {\n\t\t\tlet votes = gatherer[voteType];\n\n\t\t\t// Temporary fix because some mapvotes are ints and not arrays\n\t\t\tif (!Array.isArray(votes)) votes = [votes];\n\n\t\t\tif (votes.length > 0) votes.forEach(vote => acc.push(vote));\n\t\t\treturn acc;\n\t\t}, []);\n\t},\n\n\tselectedMaps() {\n\t\treturn rankVotes(this.countVotes('mapVote'), this.props.maps).slice(0, 2)\n\t},\n\n\tselectedServer() {\n\t\treturn rankVotes(this.countVotes('serverVote'), this.props.servers).slice(0, 1);\n\t},\n\n\trender() {\n\t\tlet maps = this.selectedMaps();\n\t\tlet server = this.selectedServer().pop();\n\t\tlet password;\n\t\tif (server.password) {\n\t\t\tpassword = [\n\t\t\t\tPassword,\n\t\t\t\t{server.password}\n\t\t\t];\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\tServer\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t- Maps
\n\t\t\t\t\t\t- {maps.map(map => map.name).join(\" & \")}
\n\t\t\t\t\t\t- Server
\n\t\t\t\t\t\t- {server.name}
\n\t\t\t\t\t\t- Address
\n\t\t\t\t\t\t- {server.ip}:{server.port}
\n\t\t\t\t\t\t{password}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tJoin Server\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ArchivedGathers = exports.ArchivedGathers = React.createClass({\n\tpropTypes: {\n\t\tarchive: React.PropTypes.array.isRequired,\n\t\tservers: React.PropTypes.array.isRequired,\n\t\tmaps: React.PropTypes.array.isRequired\n\t},\n\n\trender() {\n\t\tlet archive = this.props.archive\n\t\t\t.sort((a, b) => {\n\t\t\t\treturn new Date(b.createdAt) - new Date(a.createdAt);\n\t\t\t})\n\t\t\t.map((archivedGather, index) => {\n\t\t\t\treturn \n\t\t\t});\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
Archived Gathers
\n\t\t\t\t
\n\t\t\t\t\t{archive}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n","import {Events} from \"javascripts/components/event\";\nimport {CurrentUser, AdminPanel, ProfileModal, UserMenu} from \"javascripts/components/user\";\nimport {SoundPanel} from \"javascripts/components/sound\";\nimport {TeamSpeakButton, TeamSpeakModal} from \"javascripts/components/teamspeak\";\nimport {SettingsPanel} from \"javascripts/components/settings\";\nimport {Chatroom} from \"javascripts/components/message\";\nimport {Gather, ArchivedGathers} from \"javascripts/components/gather\"\n\nconst React = require(\"react\");\nconst Sound = require(\"javascripts/components/sound\");\nconst SoundController = Sound.SoundController;\nconst helper = require(\"javascripts/helper\");\nconst storageAvailable = helper.storageAvailable;\nconst SplashScreen = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tstatus: \"connecting\",\n\t\t\tsocket: null\n\t\t}\n\t},\n\n\tcomponentDidMount() {\n\t\tconst socketUrl = window.location.protocol + \"//\" + window.location.host;\n\t\tlet socket = io(socketUrl)\n\t\t\t.on(\"connect\", () => {\n\t\t\t\tconsole.log(\"Connected\");\n\t\t\t\tthis.setState({ status: \"connected\" });\n\t\t\t\tsocket\n\t\t\t\t\t.on(\"reconnect\", () => {\n\t\t\t\t\t\tconsole.log(\"Reconnected\");\n\t\t\t\t\t})\n\t\t\t\t\t.on(\"disconnect\", () => {\n\t\t\t\t\t\tconsole.log(\"Disconnected\")\n\t\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"error\", error => {\n\t\t\t\tconsole.log(error);\n\t\t\t\tif (error === \"Authentication Failed\") {\n\t\t\t\t\tthis.setState({ status: \"authFailed\" });\n\t\t\t\t} else if (error === \"Gather Banned\") {\n\t\t\t\t\tthis.setState({ status: \"banned\" });\n\t\t\t\t}\n\t\t\t});\n\n\t\tthis.setState({ socket: socket });\n\t},\n\n\trender() {\n\t\tconst status = this.state.status;\n\n\t\tif (status === \"connected\") {\n\t\t\treturn ;\n\t\t} \n\n\t\tlet splash;\n\t\tif (status === \"authFailed\") {\n\t\t\tsplash = ;\n\t\t} else if (status === \"banned\") {\n\t\t\tsplash = ;\n\t\t} else if (status === \"connecting\") {\n\t\t\tsplash = ;\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{splash}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst AuthFailedSplash = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
You need to be logged in to the ENSL website to access gathers
\n\t\t\t\t\t\t
If you are logged on, try visiting a few pages on ENSL.org so the server can update your cookies
\n\t\t\t\t\t\t
If this error persists please contact an admin to fix it
\n\t\t\t\t\t\t
\n\t\t\t\t\t
Go to website
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst BannedSplash = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
You're currently barred from joining gathers
\n\t\t\t\t\t\t
Either wait for the ban to expire or talk to an admin to get it lifted
\n\t\t\t\t\t\t
\n\t\t\t\t\t
See the ban list
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ConnectingSplash = React.createClass({\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
Authenticating your ENSL account
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst App = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\tgetInitialState() {\n\t\tlet updateTitle = true;\n\t\tlet showEventsPanel = true;\n\n\t\tif (storageAvailable('localStorage')) {\n\t\t\tif (localStorage.getItem(\"updateTitle\") !== null) {\n\t\t\t\tupdateTitle = JSON.parse(localStorage.getItem(\"updateTitle\"));\n\t\t\t}\n\t\t\tif (localStorage.getItem(\"showEventsPanel\") !== null) {\n\t\t\t\tshowEventsPanel = JSON.parse(localStorage.getItem(\"showEventsPanel\"));\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tgather: {\n\t\t\t\tgatherers: []\n\t\t\t},\n\t\t\tusers: [],\n\t\t\tmessages: [],\n\t\t\tmaps: [],\n\t\t\tuser: null,\n\t\t\tservers: [],\n\t\t\tarchive: [],\n\t\t\tsocket: null,\n\t\t\tevents: [],\n\t\t\tupdateTitle: updateTitle,\n\t\t\tshowEventsPanel: showEventsPanel,\n\t\t\tsoundController: new SoundController(),\n\t\t\tshowMessageBox: true,\n\t\t\tcollapseMenu: false,\n\t\t\tconnectionState: \"connected\"\n\t\t};\n\t},\n\n\tupdateTitle() {\n\t\tlet gather = this.state.gather;\n\t\tif (gather && this.state.updateTitle) {\n\t\t\tdocument.title = `NSL Gathers (${gather.gatherers.length}/12)`;\n\t\t\treturn;\n\t\t}\n\t\tdocument.title = \"NSL Gathers\";\n\t},\n\n\ttoggleEventsPanel(event) {\n\t\tlet newState = event.target.checked;\n\t\tthis.setState({ showEventsPanel: newState });\n\t\tif (storageAvailable('localStorage')) {\n\t\t\tlocalStorage.setItem(\"showEventsPanel\", newState)\n\t\t}\n\t},\n\n\ttoggleUpdateTitle(event) {\n\t\tlet newState = event.target.checked;\n\t\tthis.setState({ updateTitle: newState });\n\t\tif (storageAvailable('localStorage')) {\n\t\t\tlocalStorage.setItem(\"updateTitle\", newState)\n\t\t}\n\t\tthis.updateTitle();\n\t},\n\n\tthisGatherer() {\n\t\tlet gather = this.state.gather;\n\t\tlet user = this.state.user;\n\t\tif (gather && user && gather.gatherers.length) {\n\t\t\treturn gather.gatherers\n\t\t\t\t.filter(gatherer => gatherer.id === user.id)\n\t\t\t\t.pop() || null;\n\t\t}\n\t\treturn null;\n\t},\n\n\tcomponentDidMount() {\n\t\tlet self = this;\n\t\tlet socket = this.props.socket;\n\t\tlet soundController = this.state.soundController;\n\n\t\tthis.updateTitle();\n\n\t\tsocket.on('stateChange', data => {\n\t\t\tlet state = data.state;\n\t\t\t\n\t\t\tif (state.from === 'gathering'\n\t\t\t\t\t&& state.to === 'election'\n\t\t\t\t\t&& this.thisGatherer()) {\n\t\t\t\tsoundController.playGatherMusic();\n\t\t\t}\n\n\t\t\tif (state.from === 'election'\n\t\t\t\t\t&& state.to === 'gathering') {\n\t\t\t\tsoundController.stop();\n\t\t\t}\n\t\t});\n\n\t\tsocket.on('event:append', data => {\n\t\t\tlet events = self.state.events;\n\t\t\tevents.unshift(data);\n\t\t\tself.setState({\n\t\t\t\tevents: events.slice(0, 20)\n\t\t\t});\n\t\t});\n\n\t\tsocket.on('users:update', \n\t\t\tdata => self.setState({\n\t\t\t\tusers: data.users,\n\t\t\t\tuser: data.currentUser\n\t\t\t})\n\t\t);\n\n\t\tsocket.on(\"message:append\", data => {\n\t\t\tself.setState({\n\t\t\t\tmessages: self.state.messages.concat(data.messages)\n\t\t\t\t\t.sort((a, b) => {\n\t\t\t\t\t\treturn new Date(a.createdAt) - new Date(b.createdAt);\n\t\t\t\t\t})\n\t\t\t});\n\t\t});\n\n\t\tsocket.on(\"message:refresh\", data => {\n\t\t\tself.setState({\n\t\t\t\tmessages: data.messages\n\t\t\t});\n\t\t});\n\n\t\tsocket.on(\"gather:refresh\", (data) => {\n\t\t\tself.setState({\n\t\t\t\tgather: data.gather,\n\t\t\t\tmaps: data.maps,\n\t\t\t\tservers: data.servers,\n\t\t\t\tpreviousGather: data.previousGather\n\t\t\t});\n\t\t\tthis.updateTitle();\n\t\t});\n\n\t\tsocket.on(\"gather:archive:refresh\", data => {\n\t\t\tself.setState({\n\t\t\t\tarchive: data.archive,\n\t\t\t\tmaps: data.maps,\n\t\t\t\tservers: data.servers\n\t\t\t});\n\t\t});\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tthis.setState({ connectionState: \"connected\" });\n\t\t});\n\n\t\tsocket.on(\"disconnect\", () => {\n\t\t\tthis.setState({ connectionState: \"disconnected\" });\n\t\t});\n\n\t\tsocket.on(\"reconnecting\", () => {\n\t\t\tthis.setState({ connectionState: \"reconnecting\" });\n\t\t});\n\n\t\tsocket.on(\"reconnect\", () => {\n\t\t\tthis.setState({ connectionState: \"connected\" });\n\t\t});\n\n\t\tsocket.emit(\"users:refresh\");\n\t\tsocket.emit(\"message:refresh\");\n\t\tsocket.emit(\"gather:refresh\");\n\t},\n\n\ttoggleMessageBox(e) {\n\t\te.preventDefault();\n\t\tconsole.log(\"FOO\")\n\t\tthis.setState({\n\t\t\tshowMessageBox: !this.state.showMessageBox\n\t\t});\n\t},\n\n\ttoggleCollapseMenu(e) {\n\t\te.preventDefault();\n\t\tthis.setState({\n\t\t\tcollapseMenu: !this.state.collapseMenu\n\t\t});\n\t},\n\n\trender() {\n\t\tconst socket = this.props.socket;\n\n\t\tlet eventsPanel;\n\t\tif (this.state.showEventsPanel) {\n\t\t\teventsPanel = ;\n\t\t}\n\n\t\tlet profileModal, chatroom, currentUser;\n\t\tif (this.state.user) {\n\t\t\tprofileModal = ;\n\t\t\tchatroom = ;\n\t\t\tcurrentUser = (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\n\t\tconst user = this.state.user;\n\t\tlet username, avatar;\n\t\tif (user) {\n\t\t\tusername = user.username;\n\t\t\tavatar = user.avatar;\n\t\t}\n\n\t\tlet appClass = [\"skin-blue\", \"sidebar-mini\", \"fixed\"];\n\t\tif (this.state.showMessageBox) appClass.push(\"control-sidebar-open\");\n\t\tif (this.state.collapseMenu) appClass.push(\"sidebar-collapse\");\n\n\t\tlet connectionStatus;\n\t\tconst connectionState = this.state.connectionState;\n\t\tif (connectionState === \"connected\") {\n\t\t\tconnectionStatus = Online;\n\t\t} else if (connectionState === \"reconnecting\") {\n\t\t\tconnectionStatus = Reconnecting;\n\t\t} else if (connectionState === \"disconnected\") {\n\t\t\tconnectionStatus = Disconnected;\n\t\t}\n\n\t\treturn (\n\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t Gathersbeta
\n\t\t\t \n\t\t\t\t
\n\t\t\t\t \tFoo
\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t
\n\t\t);\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{profileModal}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{chatroom}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{eventsPanel}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nmodule.exports = SplashScreen;\n","const React = require(\"react\");\nconst ReactDOM = require(\"react-dom\");\nconst ReactEmoji = require(\"react-emoji\");\nconst ReactAutolink = require(\"react-autolink\");\nconst MessageBrowser = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tbrowserState: \"\",\n\t\t\tmessages: [],\n\t\t\tpage: 0,\n\t\t\tlimit: 250,\n\t\t\tsearch: \"\"\n\t\t}\n\t},\n\n\thandleNextPage(e) {\n\t\te.preventDefault();\n\t\tconst page = this.state.page;\n\t\tthis.setState({ page: page + 1 });\n\t\tthis.loadMessages();\n\t},\n\n\thandlePreviousPage(e) {\n\t\te.preventDefault();\n\t\tconst page = this.state.page;\n\t\tif (page < 1) return;\n\t\tthis.setState({ page: page - 1 });\n\t\tthis.loadMessages();\n\t},\n\n\tpageHandlers() {\n\t\tlet previous;\n\t\tif (this.state.page > 0) {\n\t\t\tprevious = (\n\t\t\t\tPrev\n\t\t\t);\n\t\t}\n\t\tlet next;\n\t\tif (this.state.messages.length === this.state.limit) {\n\t\t\tnext = (\n\t\t\t\tNext\n\t\t\t);\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t{previous}\n\t\t\t\t\n\t\t\t\t\t{this.state.page}\n\t\t\t\t\n\t\t\t\t{next}\n\t\t\t
\n\t\t);\n\t},\n\n\tloadMessages() {\n\t\tconst limit = this.state.limit;\n\t\tconst page = this.state.page;\n\t\tlet data = {\n\t\t\tlimit: limit,\n\t\t\tpage: page\n\t\t};\n\n\t\tif (this.state.search.length) {\n\t\t\tdata.query = this.state.search;\n\t\t}\n\n\t\tthis.setState({ browserState: \"Retrieving messages\"});\n\t\t$.ajax({\n\t\t\turl: \"/api/messages\",\n\t\t\tdata: data\n\t\t})\n\t\t.done(data => {\n\t\t\tthis.setState({\n\t\t\t\tmessages: data.messages,\n\t\t\t\tbrowserState: \"\"\n\t\t\t});\n\t\t})\n\t\t.fail(error => {\n\t\t\tconsole.error(error);\n\t\t\tthis.setState({\n\t\t\t\tbrowserState: `Unable to retrieve messages.`\n\t\t\t});\n\t\t})\n\t},\n\n\tcomponentDidMount() {\n\t\tthis.loadMessages();\n\t},\n\n\tupdateLimit(e) {\n\t\tlet newLimit = parseInt(e.target.value, 10);\n\t\tif (isNaN(newLimit) || newLimit > 250) newLimit = 250;\n\t\tthis.setState({ limit: newLimit });\n\t},\n\n\tupdateSearch(e) {\n\t\tthis.setState({ search: e.target.value });\n\t},\n\n\trender() {\n\t\tlet browserState;\n\t\tif (this.state.browserState.length) {\n\t\t\tbrowserState = (\n\t\t\t\t\n\t\t\t\t\t
{this.state.browserState}
\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\t\tconst messages = this.state.messages.map(message => {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{(new Date(message.createdAt)).toString()} | \n\t\t\t\t\t{message.author.username} | \n\t\t\t\t\t{message.content} | \n\t\t\t\t\t{message._id} | \n\t\t\t\t
\n\t\t\t);\n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t \t
\n\t\t\t\t\t\t \t\n\t\t\t\t\t \t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t \t
Page Control
\n\t\t\t\t\t\t \t{this.pageHandlers()}\n\t\t\t\t\t \t
\n\t\t\t\t \t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{browserState}\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tDate | \n\t\t\t\t\t\t\t\tAuthor | \n\t\t\t\t\t\t\t\tMessage | \n\t\t\t\t\t\t\t\tID | \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{messages}\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst Chatroom = exports.Chatroom = React.createClass({\n\tpropTypes: {\n\t\tmessages: React.PropTypes.array.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tuser: React.PropTypes.object.isRequired\n\t},\n\n\tgetInitialState() {\n\t\treturn {\n\t\t\tautoScroll: true\n\t\t};\n\t},\n\n\tcomponentDidMount() {\n\t\tlet self = this;\n\n\t\tthis.scrollListener = _.debounce((event) => {\n\t\t\tself.temporarilyDisableAutoScroll(event);\n\t\t}, 300, {\n\t\t leading: false,\n\t\t trailing: true\n\t\t});\n\n\t\tlet node = ReactDOM.findDOMNode(this.refs.messageContainer);\n\t\tnode.addEventListener('scroll', this.scrollListener);\n\n\t\tthis.scrollToBottom();\n\t},\n\n\tcomponentWillUnmount() {\n\t\tnode.removeEventListener('scroll', this.scrollListener);\n\t\tclearTimeout(this.disableScrollTimer);\n\t},\n\n\tloadMoreMessages() {\n\t\tconst earliestMessage = this.props.messages[0];\n\t\tif (earliestMessage === undefined) return;\n\t\tthis.props.socket.emit(\"message:refresh\", {\n\t\t\tbefore: earliestMessage.createdAt\n\t\t});\n\t},\n\n\tsendMessage(message) {\n\t\tthis.props.socket.emit(\"newMessage\", {message: message});\n\t},\n\n\tclearAutoScrollTimeout() {\n\t\tif (this.disableScrollTimer) clearTimeout(this.disableScrollTimer);\n\t},\n\n\ttemporarilyDisableAutoScroll(event) {\n\t\tlet self = this;\n\t\tlet node = event.target;\n\t\tif (node) {\n\t\t\tif (node.scrollHeight - node.scrollTop === node.clientHeight) {\n\t\t\t\tthis.setState({ autoScroll: true });\n\t\t\t\tthis.clearAutoScrollTimeout();\n\t\t\t}\n\t\t\tif (node.scrollHeight - node.scrollTop - node.clientHeight < 50) return;\n\t\t}\n\t\tthis.setState({ autoScroll: false });\n\t\tthis.clearAutoScrollTimeout();\n\t\tthis.disableScrollTimer = setTimeout(() => {\n\t\t\tself.setState({\n\t\t\t\tautoScroll: true\n\t\t\t})\n\t\t}, 10000);\n\t},\n\n\tcomponentDidUpdate() {\n\t\tthis.scrollToBottom();\n\t},\n\n\tscrollToBottom() {\n\t\tif (!this.state.autoScroll) return;\n\t\tlet node = ReactDOM.findDOMNode(this.refs.messageContainer);\n\t node.scrollTop = node.scrollHeight;\n\t},\n\n\trender() {\n\t\tconst socket = this.props.socket;\n\t\tconst messages = this.props.messages.map(message => {\n\t\t\tif (message) {\n\t\t\t\treturn \n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t
Gather Chat
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst imgurRegex = /^(https?:\\/\\/i\\.imgur\\.com\\/\\S*\\.(jpg|png))$/i;\n\nconst ChatMessage = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tmessage: React.PropTypes.object.isRequired\n\t},\n\n\tmixins: [\n ReactAutolink,\n ReactEmoji\n ],\n\n getInitialState() {\n \treturn {\n \t\tcreatedAt: \"\"\n \t}\n },\n\n updateCreatedAt() {\n \tlet self = this;\n \tif (this.props.message.createdAt) {\n \t\tself.setState({\n \t\t\tcreatedAt: $.timeago(self.props.message.createdAt)\n \t\t})\n \t}\n },\n\n componentWillMount() {\n\t\tthis.updateCreatedAt();\n },\n\n\tcomponentDidMount() {\n\t\tthis.interval = setInterval(this.updateCreatedAt, 60000);\n\t},\n\n\tcomponentWillUnmount: function () {\n\t\tclearInterval(this.interval);\n\t},\n\n\tmessageContent: function () {\n\t\tlet self = this;\n\t\tlet message = self.props.message.content\n\t\tif (message.match(imgurRegex)) {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\n\t\treturn self.autolink(message, { \n\t\t\ttarget: \"_blank\", \n\t\t\trel: \"nofollow\" \n\t\t}).map((elem) => {\n\t\t\tif (_.isString(elem)) {\n\t\t\t\treturn self.emojify(elem);\n\t\t\t} else {\n\t\t\t\treturn elem;\n\t\t\t}\n\t\t});\n\t},\n\n\trender() {\n\t\tlet deleteButton;\n\t\tlet user = this.props.user;\n\t\tif (user && user.admin) {\n\t\t\tdeleteButton = ;\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{this.props.message.author.username}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{deleteButton}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t{this.state.createdAt}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t
{this.messageContent()}
\n\t\t\t\t
\n\t\t\t\n\t\t);\n\t}\n});\n\nconst DeleteMessageButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\thandleClick (e) {\n\t\te.preventDefault();\n\t\tthis.props.socket.emit(\"message:delete\", {\n\t\t\tid: this.props.messageId\n\t\t});\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n})\n\nconst MessageBar = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\tsendMessage(content) {\n\t\tthis.props.socket.emit(\"message:new\", {\n\t\t\tcontent: content\n\t\t});\n\t},\n\n\tgetInitialState() {\n\t\treturn {\n\t\t\tstatusMessage: null\n\t\t};\n\t},\n\n\tcheckInputLength() {\n\t\tconst input = ReactDOM.findDOMNode(this.refs.content).value;\n\t\tconst currentStatusMessage = this.state.statusMessage;\n\t\tif (input.length > 256) {\n\t\t\treturn this.setState({\n\t\t\t\tstatusMessage: \"Maximum of 256 characters will be saved\"\n\t\t\t})\n\t\t}\n\t\tif (currentStatusMessage !== null) {\n\t\t\tthis.setState({\n\t\t\t\tstatusMessage: null\n\t\t\t});\n\t\t}\n\t},\n\n\thandleInputChange() {\n\t\t// Noop, later assigned as debounced method in componentWillMount\n\t},\n\n\thandleSubmit(e) {\n\t\te.preventDefault();\n\t\tlet content = ReactDOM.findDOMNode(this.refs.content).value.trim();\n\t\tif (!content) return;\n\t\tReactDOM.findDOMNode(this.refs.content).value = '';\n\t\tthis.sendMessage(content);\n\t\treturn;\n\t},\n\n\tcomponentWillMount() {\n\t\tthis.handleInputChange = _.debounce(this.checkInputLength, {\n\t\t\tleading: false,\n\t\t\ttrailing: true\n\t\t});\n\t},\n\n\trender() {\n\t\tlet statusMessage;\n\t\tif (this.state.statusMessage !== null) {\n\t\t\tstatusMessage = \n\t\t\t\t{this.state.statusMessage}\n\t\t\t
;\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n});\n","const React = require(\"react\");\n\nconst SettingsPanel = exports.SettingsPanel = React.createClass({\n\tpropTypes: {\n\t\ttoggleUpdateTitle: React.PropTypes.func.isRequired,\n\t\tupdateTitle: React.PropTypes.bool.isRequired,\n\t\ttoggleEventsPanel: React.PropTypes.func.isRequired,\n\t\tshowEventsPanel: React.PropTypes.bool.isRequired\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
Settings
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n","const React = require(\"react\");\n\nvar SnowMachineMenu = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tsnowMachine: null\n\t\t}\n\t},\n\n\tcomponentDidMount() {\n\t\tconst snowMachine = new SnowMachine();\n\t\tsnowMachine.start();\n\t\tthis.setState({ snowMachine: snowMachine });\n\t},\n\n\ttoggle() {\n\t\tconst snowMachine = this.state.snowMachine;\n\t\tif (snowMachine.timer) {\n\t\t\tsnowMachine.stop();\n\t\t} else {\n\t\t\tsnowMachine.start();\n\t\t}\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t );\n\t}\n});\n","const $ = require(\"jquery\");\nconst React = require(\"react\");\nconst Howl = require(\"howler\").Howl;\nconst Howler = require(\"howler\").Howler;\nconst helper = require(\"javascripts/helper\");\nconst storageAvailable = helper.storageAvailable;\n\nclass SoundController {\n\tconstructor () {\n\t\tif (Howl === undefined) {\n\t\t\tthrow new Error(\"Howl.js required to created sound controller\");\n\t\t}\n\n\t\tthis.MINIMUM_PLAY_INTERVAL = 20000;\n\n\t\tthis.playGatherMusic = _.throttle(() => {\n\t\t\tthis.gather.music.play();\n\t\t}, this.MINIMUM_PLAY_INTERVAL);\n\n\t\tthis.isMuted = Howler._muted;\n\t\t\n\t\tlet gatherMusic;\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\tlet volume = localStorage.getItem(\"gatherVolume\");\n\t\t\tif (volume !== undefined) Howler.volume(volume);\n\t\t\tgatherMusic = localStorage.getItem(\"gatherMusic\");\n\t\t}\n\n\t\tthis.tunes = {\n\t\t\t\"classic\": {\n\t\t\t\tdescription: \"Gathers Classic\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/gather-1.mp3'\n\t\t\t},\n\t\t\t\"nights\": {\n\t\t\t\tdescription: \"Nights\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/nights.mp3'\n\t\t\t},\n\t\t\t\"robby\": {\n\t\t\t\tdescription: \"Robby\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/robby.mp3'\n\t\t\t},\n\t\t\t\"america\": {\n\t\t\t\tdescription: \"Infamous\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/america.mp3'\n\t\t\t},\n\t\t\t\"prommah\": {\n\t\t\t\tdescription: \"Prommah\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/prommah.mp3'\n\t\t\t},\n\t\t\t\"turts\": {\n\t\t\t\tdescription: \"Gorges Rock your Ass\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/turts.mp3'\n\t\t\t},\n\t\t\t\"skyice\": {\n\t\t\t\tdescription: \"Skyice\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/skyice.mp3'\n\t\t\t},\n\t\t\t\"justwannahavefun\": {\n\t\t\t\tdescription: \"Gorges just want to have fun\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/justwannahavefun.mp3'\n\t\t\t},\n\t\t\t\"eyeofthegorgie\": {\n\t\t\t\tdescription: \"Eye of the Gorgie\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/eyeofthegorgie.mp3'\n\t\t\t},\n\t\t\t\"boondock\": {\n\t\t\t\tdescription: \"Boondock Marines\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/boondock.mp3'\n\t\t\t},\n\t\t\t\"preclassic\": {\n\t\t\t\tdescription: \"Old Gathers Classic\",\n\t\t\t\turl: 'http://www.ensl.org/files/audio/gather-5.mp3'\n\t\t\t}\n\t\t}\n\n\t\tthis.setupGatherMusic(gatherMusic);\n\t}\n\n\tmute() {\n\t\tthis.isMuted = true;\n\t\treturn Howler.mute();\n\t}\n\n\tunMute() {\n\t\tthis.isMuted = false;\n\t\treturn Howler.unmute();\n\t}\n\n\tgetVolume() {\n\t\treturn Howler.volume();\n\t}\n\n\tsetVolume(val) {\n\t\tif (val === undefined || \n\t\t\t\ttypeof val !== 'number' || \n\t\t\t\tMath.abs(val) > 1) return;\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\tlocalStorage.setItem(\"gatherVolume\", val);\n\t\t}\n\t\treturn Howler.volume(val);\n\t}\n\n\tplay(music) {\n\t\tif (this.gather && this.gather.music) return this.gather.music.play();\n\t}\n\n\tstop(music) {\n\t\tif (this.gather && this.gather.music) return this.gather.music.stop();\n\t}\n\n\tdefaultGatherMusic() {\n\t\treturn \"classic\";\n\t}\n\n\tsetupGatherMusic (musicName) {\n\t\tlet self = this;\n\t\tlet gatherMusic = self.tunes[musicName];\n\n\t\tif (!gatherMusic) {\n\t\t\tmusicName = this.defaultGatherMusic();\n\t\t\tgatherMusic = self.tunes[musicName]; \n\t\t}\n\n\t\tif (self.gather && self.gather.name === musicName) return;\n\n\t\t// Stop if already playing\n\t\tif (self.gather && self.gather.music) {\n\t\t\tself.gather.music.stop();\n\t\t}\n\n\t\tlet tune = self.tunes[musicName];\n\t\tself.gather = {\n\t\t\tname: musicName,\n\t\t\tdescription: tune.description,\n\t\t\turl: tune.url,\n\t\t\tmusic: new Howl({\n\t\t\t\turls: [tune.url]\n\t\t\t})\n\t\t};\n\t}\n}\n\nvar MusicSelector = React.createClass({\n\tgetInitialState() {\n\t\treturn {\n\t\t\tmusic: this.selectedMusic()\n\t\t}\n\t},\n\n\tselectedMusic() {\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\treturn localStorage.getItem(\"gatherMusic\") \n\t\t\t\t|| this.props.soundController.defaultGatherMusic();\n\t\t} else {\n\t\t\treturn this.props.soundController.defaultGatherMusic(); \n\t\t}\n\t},\n\n\tsetMusic(event) {\n\t\tlet name = event.target.value;\n\t\tlet soundController = this.props.soundController;\n\t\tlet selectedTune = soundController.tunes[name];\n\t\tif (selectedTune === undefined) return;\n\t\tthis.setState({ music: name });\n\t\tsoundController.setupGatherMusic(name);\n\t\tif (storageAvailable(\"localStorage\")) {\n\t\t\tlocalStorage.setItem(\"gatherMusic\", name);\n\t\t}\n\t},\n\n\trender() {\n\t\tlet soundController = this.props.soundController;\n\t\tlet tunes = [];\n\t\tfor (var attr in soundController.tunes) {\n\t\t\tlet o = soundController.tunes[attr];\n\t\t\to.id = attr;\n\t\t\ttunes.push(o);\n\t\t}\n\t\tlet options = tunes.map(tune => {\n\t\t\treturn ;\n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n})\n\nvar SoundPanel = React.createClass({\n\tcomponentDidMount() {\n\t\tlet soundController = this.props.soundController;\n\t\tlet scale = 10;\n\n\t\t$('a#sound-dropdown').on('click', function (event) {\n\t\t\t$(this).parent().toggleClass('open');\n\t\t});\n\n\t\t$(\"#volume-slide\").slider({\n\t\t\tmin: 0,\n\t\t\tmax: scale,\n\t\t\tstep: 1\n\t\t}).on(\"slideStop\", ({value}) => {\n\t\t\tsoundController.setVolume(value / scale);\n\t\t}).slider('setValue', soundController.getVolume() * scale);\n\t},\n\n\tmute() {\n\t\tthis.props.soundController.mute();\n\t\tthis.forceUpdate();\n\t},\n\n\tunMute() {\n\t\tthis.props.soundController.unMute();\n\t\tthis.forceUpdate();\n\t},\n\n\tplay() {\n\t\tthis.props.soundController.play();\n\t},\n\n\tstop() {\n\t\tthis.props.soundController.stop();\n\t},\n\n\trender() {\n\t\tlet soundController = this.props.soundController;\n\t\tlet mutedIcon, mutedButton;\n\t\tif (soundController.isMuted) {\n\t\t\tmutedIcon = ;\n\t\t\tmutedButton = \n\t\t\t\t\n\t\t\t\t\t{mutedIcon} Muted\n\t\t\t\t\n\t\t\t;\n\t\t} else {\n\t\t\tmutedIcon = ;\n\t\t\tmutedButton = \n\t\t\t\t\n\t\t\t\t\t{mutedIcon} Unmuted\n\t\t\t\t\n\t\t\t;\n\t\t}\n\t\treturn ;\n\t}\n});\n\nmodule.exports = {\n\tSoundController: SoundController,\n\tSoundPanel: SoundPanel\n};\n","const React = require(\"react\");\n\nconst teamspeakDefaults = {\n\turl: \"ts3server://ensl.org/\",\n\tpassword: \"ns2gather\",\n\talien: {\n\t\tchannel: \"NS2 Gather/Gather #1/Alien\",\n\t\tpassword: \"ns2gather\"\n\t},\n\tmarine: {\n\t\tchannel: \"NS2 Gather/Gather #1/Marine\",\n\t\tpassword: \"ns2gather\"\n\t}\n};\n\nvar TeamSpeakButton = exports.TeamSpeakButton = React.createClass({\n\tgetDefaultProps() {\n\t\treturn teamspeakDefaults\n\t},\n\tmarineUrl() {\n\t\treturn this.teamSpeakUrl(this.props.marine);\n\t},\n\talienUrl() {\n\t\treturn this.teamSpeakUrl(this.props.alien);\n\t},\n\tteamSpeakUrl(conn) {\n\t\tlet params = `channel=${encodeURIComponent(conn.channel)}&\n\t\t\tchannelpassword=${encodeURIComponent(conn.password)}`;\n\t\treturn (`${this.props.url}?${params}`);\n\t},\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n});\n\nvar TeamSpeakModal = exports.TeamSpeakModal = React.createClass({\n\tgetDefaultProps() {\n\t\treturn teamspeakDefaults;\n\t},\n\n\trender() {\n\t\treturn \n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
Teamspeak Server Information
\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t- Server
\n\t\t\t\t\t\t\t- {this.props.url}
\n\t\t\t\t\t\t\t- Password
\n\t\t\t\t\t\t\t- {this.props.password}
\n\t\t\t\t\t\t\t- Marine Channel
\n\t\t\t\t\t\t\t- {this.props.marine.channel}
\n\t\t\t\t\t\t\t- Alien Channel
\n\t\t\t\t\t\t\t- {this.props.alien.channel}
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t}\n});\n","import {LifeformIcons} from \"javascripts/components/gather\";\nconst React = require(\"react\");\nconst helper = require(\"javascripts/helper\");\nconst enslUrl = helper.enslUrl;\nconst hiveUrl = helper.hiveUrl;\nconst modalId = helper.modalId;\n\nconst UserLogin = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\tauthorizeId(id) {\n\t\tthis.props.socket.emit(\"users:authorize\", {\n\t\t\tid: parseInt(id, 10)\n\t\t});\n\t},\n\n\thandleSubmit(e) {\n\t\te.preventDefault();\n\t\tlet id = React.findDOMNode(this.refs.authorize_id).value.trim();\n\t\tif (!id) return;\n\t\tReact.findDOMNode(this.refs.authorize_id).value = '';\n\t\tthis.authorizeId(id);\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n});\n\nconst DisconnectUserButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tid: React.PropTypes.number.isRequired\n\t},\n\n\tgetDefaultProps() {\n\t\treturn {\n\t\t\tid: null\n\t\t};\n\t},\n\n\tdisconnectUser() {\n\t\tthis.props.socket.emit(\"users:disconnect\", {\n\t\t\tid: this.props.id\n\t\t});\n\t},\n\t\n\trender() {\n\t\treturn \n\t}\n});\n\nconst UserModal = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tcurrentUser: React.PropTypes.object.isRequired\n\t},\n\n\trender() {\n\t\tconst currentUser = this.props.currentUser;\n\t\tconst user = this.props.user;\n\t\tlet hiveStats;\n\t\tif (user.hive.id) {\n\t\t\thiveStats = [\n\t\t\tHive Stats | |
,\n\t\t\t\n\t\t\t\tELO | \n\t\t\t\t{user.hive.skill} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tHours Played | \n\t\t\t\t{Math.round(user.hive.playTime / 3600)} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tWins | \n\t\t\t\t{user.hive.wins} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tLosses | \n\t\t\t\t{user.hive.loses} | \n\t\t\t
,\n\t\t\t\n\t\t\t\tKills (/min) | \n\t\t\t\t{user.hive.kills} ({_.round(user.hive.kills / (user.hive.playTime / 60), 1)}) | \n\t\t\t
,\n\t\t\t\n\t\t\t\tAssists (/min) | \n\t\t\t\t{user.hive.assists} ({_.round(user.hive.assists / (user.hive.playTime / 60), 1)}) | \n\t\t\t
,\n\t\t\t\n\t\t\t\tDeaths (/min) | \n\t\t\t\t{user.hive.deaths} ({_.round(user.hive.deaths / (user.hive.playTime / 60), 1)}) | \n\t\t\t
\n\t\t\t]\n\t\t}\n\t\tlet adminOptions;\n\t\tif (currentUser.admin) {\n\t\t\tadminOptions = ;\n\t\t}\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t{user.username}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tLifeforms | \n\t\t\t\t\t\t\t\t\t\t | \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tLinks | \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tENSL Profile \n\t\t\t\t\t\t\t\t\t\t\tHive Profile\n\t\t\t\t\t\t\t\t\t\t | \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{hiveStats}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{adminOptions}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n})\n\nconst UserItem = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired,\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tcurrentUser: React.PropTypes.object.isRequired\n\t},\n\n\trender() {\n\t\tconst user = this.props.user;\n\t\tconst currentUser = this.props.currentUser;\n\t\treturn (\n\t\t\t\n\t\t\t\t{user.username}\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n});\n\nconst UserMenu = exports.UserMenu = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tusers: React.PropTypes.array.isRequired\n\t},\n\n\trender() {\n\t\tconst users = this.props.users\n\t\t.sort((a, b) => (a.username.toLowerCase() > b.username.toLowerCase()) ? 1 : -1)\n\t\t.map(user => {\n\t\t\treturn \n\t\t});\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t Online\n\t\t\t\t\t\t{this.props.users.length}\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{users}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst AdminPanel = exports.AdminPanel = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired\n\t},\n\n\thandleGatherReset() {\n\t\tthis.props.socket.emit(\"gather:reset\");\n\t},\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
Administration Panel
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst ProfileModal = exports.ProfileModal = React.createClass({\n\tpropTypes: {\n\t\tuser: React.PropTypes.object.isRequired\n\t},\n\n\thandleUserUpdate(e) {\n\t\te.preventDefault();\n\t\tlet abilities = {\n\t\t\tskulk: React.findDOMNode(this.refs.skulk).checked,\n\t\t\tlerk: React.findDOMNode(this.refs.lerk).checked,\n\t\t\tgorge: React.findDOMNode(this.refs.gorge).checked,\n\t\t\tfade: React.findDOMNode(this.refs.fade).checked,\n\t\t\tonos: React.findDOMNode(this.refs.onos).checked,\n\t\t\tcommander: React.findDOMNode(this.refs.commander).checked\n\t\t};\n\t\tlet skill = React.findDOMNode(this.refs.playerskill).value;\n\t\tsocket.emit(\"users:update:profile\", {\n\t\t\tid: this.props.user.id,\n\t\t\tprofile: {\n\t\t\t\tabilities: abilities,\n\t\t\t\tskill: skill\n\t\t\t}\n\t\t});\n\t},\n\n\trender() {\n\t\tif (!this.props.user) return false;\n\t\tlet abilities = this.props.user.profile.abilities;\n\t\tlet abilitiesForm = [];\n\t\tfor (let lifeform in abilities) {\n\t\t\tabilitiesForm.push(\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t);\n\t\t}\n\n\t\tlet skillLevel = this.props.user.profile.skill;\n\t\tlet skillLevels = _.uniq([\"Low Skill\", \"Medium Skill\", \"High Skill\", skillLevel])\n\t\t\t.filter(skill => { return typeof skill === 'string' })\n\t\t\t.map(skill => { return });\n\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
Profile
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n});\n\nconst CurrentUser = exports.CurrentUser = React.createClass({\n\trender() {\n\t\tif (this.props.user) {\n\t\t\tlet adminOptions;\n\t\t\tif (this.props.user.admin || this.props.user.moderator) {\n\t\t\t\tadminOptions = (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t Administration\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{this.props.user.username} \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t Profile\n\t\t\t\t\t\t
\n\t\t\t\t\t\t- \n\t\t\t\t\t\t\t Settings\n\t\t\t\t\t\t
\n\t\t\t\t\t\t{adminOptions}\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n});\n\nvar AssumeUserIdButton = exports.AssumeUserIdButton = React.createClass({\n\tpropTypes: {\n\t\tsocket: React.PropTypes.object.isRequired,\n\t\tgatherer: React.PropTypes.object.isRequired,\n\t\tcurrentUser: React.PropTypes.object.isRequired,\n\t},\n\n\tassumeId(e) {\n\t\te.preventDefault();\n\t\tif (this.props.gatherer) {\n\t\t\tthis.props.socket.emit(\"users:authorize\", {\n\t\t\t\tid: this.props.gatherer.id\n\t\t\t});\n\t\t\t// Refresh Gather list\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.props.socket.emit(\"gather:refresh\");\n\t\t\t}, 5000);\n\t\t}\n\t},\n\n\trender() {\n\t\tlet currentUser = this.props.currentUser;\n\t\tlet gatherer = this.props.gatherer;\n\t\tif (currentUser && gatherer) {\n\t\t\treturn \n\t\t}\n\t}\n});\n","// Accepts an array of IDs voted\n// 1. Creates an array of tally objects, \n//\t\twith ID as prop and vote count as val { 12: 0 }\n// 2. Increments ID vote tally for every vote\n// 3. Sorts \n\nconst rankVotes = exports.rankVotes = function (votes, candidates) {\n\tvar initial = candidates.reduce(function (acc, candidate) {\n\t\tacc[candidate.id] = 0;\n\t\treturn acc;\n\t}, {});\n\n\tvar scores = votes.reduce(function (acc, id) {\n\t\tif (acc[id] !== undefined) {\n\t\t\tacc[id]++;\n\t\t}\n\t\treturn acc;\n\t}, initial);\n\n\tvar rank = [];\n\n\tfor (var id in scores) {\n\t\tif (scores.hasOwnProperty(id)) {\n\t\t\trank.push({\n\t\t\t\tid: parseInt(id, 10),\n\t\t\t\tcount: scores[id]\n\t\t\t});\n\t\t}\n\t}\n\n\treturn rank.sort(function (a, b) {\n\t\tif (b.count === a.count) {\n\t\t\treturn b.id - a.id;\n\t\t} else {\n\t\t\treturn b.count - a.count;\n\t\t}\n\t}).map(function (tally) {\n\t\treturn tally.id\n\t}).map(function (id) {\n\t\treturn candidates.reduce(function (acc, candidate) {\n\t\t\tif (candidate.id === id) return candidate;\n\t\t\treturn acc;\n\t\t});\n\t});\n};\n\nconst enslUrl = exports.enslUrl = (gatherer) => {\n\treturn `http://www.ensl.org/users/${gatherer.id}`\n};\n\nconst hiveUrl = exports.hiveUrl = (gatherer) => {\n\tconst hiveId = gatherer.user.hive.id;\n\tif (hiveId) {\n\t\treturn `http://hive.naturalselection2.com/profile/${hiveId}`;\n\t} else {\n\t\treturn null;\n\t}\n};\n\nconst modalId = exports.modalId = (user) => {\n\treturn `user-modal-${user.id}`;\n};\n\nconst storageAvailable = exports.storageAvailable = (type) => {\n\ttry {\n\t\tvar storage = window[type],\n\t\t\tx = '__storage_test__';\n\t\tstorage.setItem(x, x);\n\t\tstorage.removeItem(x);\n\t\treturn true;\n\t}\n\tcatch(e) {\n\t\treturn false;\n\t}\n};\n"]}
\ No newline at end of file