From 3461547dec5782ca871f4ae3f50d9719b8de7f97 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Mon, 20 Oct 2014 19:14:44 +0200 Subject: [PATCH] making it work --- public/js/cryptalk_modules/console.js | 6 +++--- public/js/cryptalk_modules/host.js | 14 +++++++------- server.js | 6 ++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/public/js/cryptalk_modules/console.js b/public/js/cryptalk_modules/console.js index bf7151c..68c9903 100644 --- a/public/js/cryptalk_modules/console.js +++ b/public/js/cryptalk_modules/console.js @@ -79,8 +79,8 @@ define({ } }, - motd: function () { - commands.post('motd', settings.motd); + motd: function (message) { + commands.post('motd', message); }, info: function (message) { @@ -165,7 +165,7 @@ define({ // Shout this command to all modules mediator.emit( - 'console:' + command, + 'command:' + command, payload, function(retvals, recipients) { if(!recipients) { diff --git a/public/js/cryptalk_modules/host.js b/public/js/cryptalk_modules/host.js index 5ebf430..a4a0340 100644 --- a/public/js/cryptalk_modules/host.js +++ b/public/js/cryptalk_modules/host.js @@ -63,7 +63,7 @@ define( } }; }; - + force = (force && force.toLowerCase() === 'force'); // Loop through all the hosts @@ -84,7 +84,7 @@ define( connect = function (toHost, done) { - mediator.emit('console:lockinput'); + mediator.emit('console:lockInput'); var request, @@ -96,7 +96,7 @@ define( mediator.emit('console:error', $.template(templates.messages.already_connected, { host: host.name || 'localhost' })); - mediator.emit('console:unlockinput'); + mediator.emit('console:unlockInput'); return; } @@ -109,7 +109,7 @@ define( } } else { mediator.emit('console:error', 'Undefined host index: ' + toHost); - mediator.emit('console:unlockinput'); + mediator.emit('console:unlockInput'); return; } @@ -125,7 +125,7 @@ define( return connect(toHost, done); }, function () { mediator.emit('console:error', 'Could not fetch host settings: ' + request); - mediator.emit('console:unlockinput'); + mediator.emit('console:unlockInput'); return; }); } @@ -196,7 +196,7 @@ define( mediator.emit('window:title', host.settings.title); // Unlock input - mediator.emit('console:unlockinput'); + mediator.emit('console:unlockInput'); done(); @@ -225,7 +225,7 @@ define( mediator.emit('console:error', templates.messages.socket_error); // Unlock input - mediator.emit('console:unlockinput'); + mediator.emit('console:unlockInput'); }); return; diff --git a/server.js b/server.js index c78e44f..f497c67 100644 --- a/server.js +++ b/server.js @@ -83,6 +83,8 @@ app.io.sockets.on('connection', function(socket) { }); }); -app.listen(8080, function(){ - console.log('listening on *:8080'); +var port = process.env.PORT || 8080; + +app.listen(port, function(){ + console.log('listening on *:'+port); });