mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 15:21:56 +00:00
Added babel
This commit is contained in:
parent
c15418723f
commit
6072e124df
4 changed files with 1069 additions and 5 deletions
|
@ -36,6 +36,10 @@ module.exports = function (namespace) {
|
|||
servers: Server.list
|
||||
});
|
||||
});
|
||||
|
||||
namespace.emit("gather:history", {
|
||||
gatherHistory: previousGathers.slice(0,5).map(function (gather) { return gather.toJson(); });
|
||||
});
|
||||
};
|
||||
|
||||
var newGather = function () {
|
||||
|
@ -43,6 +47,10 @@ module.exports = function (namespace) {
|
|||
gather = Gather({
|
||||
onEvent: function () {
|
||||
refreshGather();
|
||||
},
|
||||
onDone:function () {
|
||||
newGather();
|
||||
refreshGather();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,10 +19,18 @@ function Gather (options) {
|
|||
return new Gather(options);
|
||||
}
|
||||
|
||||
if (options && typeof options.onEvent === 'function') {
|
||||
this.onEvent = options.onEvent;
|
||||
} else {
|
||||
this.onEvent = function () {}; // Noop
|
||||
if (options) {
|
||||
if (typeof options.onEvent === 'function') {
|
||||
this.onEvent = options.onEvent;
|
||||
} else {
|
||||
this.onEvent = function () {}; // Noop
|
||||
}
|
||||
|
||||
if (typof options.onDone === 'function') {
|
||||
this.onDone = options.onDone;
|
||||
} else {
|
||||
this.onDone = function () {};
|
||||
}
|
||||
}
|
||||
|
||||
this.TEAM_SIZE = 6;
|
||||
|
@ -218,7 +226,7 @@ StateMachine.create({
|
|||
callbacks: {
|
||||
// Callbacks for events
|
||||
onafterevent: function () {
|
||||
this.onEvent();
|
||||
this.onEvent.call(this);
|
||||
},
|
||||
|
||||
// Gathering State
|
||||
|
@ -289,6 +297,11 @@ StateMachine.create({
|
|||
// Remove gatherer event
|
||||
onbeforeremoveGatherer: function (event, from, to, user) {
|
||||
this.removeUser(user);
|
||||
},
|
||||
|
||||
// On enter done
|
||||
onenterdone: function () {
|
||||
this.onDone.call(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
1042
npm-shrinkwrap.json
generated
1042
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load diff
|
@ -39,6 +39,7 @@
|
|||
"mongoose": "~4.1.1",
|
||||
"morgan": "~1.6.1",
|
||||
"react-tools": "~0.13.3",
|
||||
"babel": "~5.8.21",
|
||||
"request": "~2.60.0",
|
||||
"serve-favicon": "~2.3.0",
|
||||
"socket.io": "~1.3.5",
|
||||
|
|
Loading…
Reference in a new issue