making it work

This commit is contained in:
Hexagon 2014-10-20 19:14:44 +02:00
parent e221e9b662
commit 3461547dec
3 changed files with 14 additions and 12 deletions

View File

@ -79,8 +79,8 @@ define({
} }
}, },
motd: function () { motd: function (message) {
commands.post('motd', settings.motd); commands.post('motd', message);
}, },
info: function (message) { info: function (message) {
@ -165,7 +165,7 @@ define({
// Shout this command to all modules // Shout this command to all modules
mediator.emit( mediator.emit(
'console:' + command, 'command:' + command,
payload, payload,
function(retvals, recipients) { function(retvals, recipients) {
if(!recipients) { if(!recipients) {

View File

@ -84,7 +84,7 @@ define(
connect = function (toHost, done) { connect = function (toHost, done) {
mediator.emit('console:lockinput'); mediator.emit('console:lockInput');
var var
request, request,
@ -96,7 +96,7 @@ define(
mediator.emit('console:error', $.template(templates.messages.already_connected, { mediator.emit('console:error', $.template(templates.messages.already_connected, {
host: host.name || 'localhost' host: host.name || 'localhost'
})); }));
mediator.emit('console:unlockinput'); mediator.emit('console:unlockInput');
return; return;
} }
@ -109,7 +109,7 @@ define(
} }
} else { } else {
mediator.emit('console:error', 'Undefined host index: ' + toHost); mediator.emit('console:error', 'Undefined host index: ' + toHost);
mediator.emit('console:unlockinput'); mediator.emit('console:unlockInput');
return; return;
} }
@ -125,7 +125,7 @@ define(
return connect(toHost, done); return connect(toHost, done);
}, function () { }, function () {
mediator.emit('console:error', 'Could not fetch host settings: ' + request); mediator.emit('console:error', 'Could not fetch host settings: ' + request);
mediator.emit('console:unlockinput'); mediator.emit('console:unlockInput');
return; return;
}); });
} }
@ -196,7 +196,7 @@ define(
mediator.emit('window:title', host.settings.title); mediator.emit('window:title', host.settings.title);
// Unlock input // Unlock input
mediator.emit('console:unlockinput'); mediator.emit('console:unlockInput');
done(); done();
@ -225,7 +225,7 @@ define(
mediator.emit('console:error', templates.messages.socket_error); mediator.emit('console:error', templates.messages.socket_error);
// Unlock input // Unlock input
mediator.emit('console:unlockinput'); mediator.emit('console:unlockInput');
}); });
return; return;

View File

@ -83,6 +83,8 @@ app.io.sockets.on('connection', function(socket) {
}); });
}); });
app.listen(8080, function(){ var port = process.env.PORT || 8080;
console.log('listening on *:8080');
app.listen(port, function(){
console.log('listening on *:'+port);
}); });