From a15664c0ab7bf063b7ecc48a52fbdc41dab6dd2c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 24 Sep 2012 07:22:46 -0400 Subject: [PATCH] added ability to freeze terminal screen on connection lost --- ChangeLog | 3 ++- cloudcmd.js | 5 +++-- lib/client/socket.js | 2 ++ lib/client/terminal.js | 7 +++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1932e22..9020307f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -64,7 +64,8 @@ disabled in browsers. * Added ability convert charset from win to unicode on win32. -* From now on disconnecting - trying to do new connection. +* Added ability to freeze terminal screen on connection lost + 2012.08.24, Version 0.1.6 diff --git a/cloudcmd.js b/cloudcmd.js index 772c7b29..613c07d2 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -29,14 +29,15 @@ function readConfig(){ var lConfig = cloudRequire('./config'); if(lConfig){ console.log('config.json readed'); - console.log(process.argv); + /* if command line parameter testing resolved * setting config to testing, so server * not created, just init and * all logs writed to screen */ - var lArg = process.argv[process.argv.length - 1]; + var lArg = process.argv[process.argv.length - 1]; if ( lArg === 'test' || lArg === 'test\r') { + console.log(process.argv); lConfig.server = false; lConfig.logs = false; } diff --git a/lib/client/socket.js b/lib/client/socket.js index 557f283d..835be672 100644 --- a/lib/client/socket.js +++ b/lib/client/socket.js @@ -17,6 +17,7 @@ var CloudCommander, io; socket.on('connect', function () { outToTerminal('socket connected'); + JqueryTerminal.Term.resume(); }); socket.on('message', function (msg) { @@ -26,6 +27,7 @@ var CloudCommander, io; socket.on('disconnect', function () { outToTerminal('socket disconected'); + JqueryTerminal.Term.pause(); }); }, diff --git a/lib/client/terminal.js b/lib/client/terminal.js index 09df8382..cd6d5610 100644 --- a/lib/client/terminal.js +++ b/lib/client/terminal.js @@ -57,13 +57,12 @@ var CloudCommander, $; KeyBinding.unSet(); $(function($, undefined) { - $('#terminal').terminal(function(command, term) { - JqueryTerminal.Term = term; + JqueryTerminal.Term = $('#terminal').terminal(function(command, term){ term.echo(''); cloudcmd.Socket.send(command); }, { - greetings: 'Javascript Interpreter', - prompt: 'cloudcmd>' + greetings : 'Javascript Interpreter', + prompt : 'cloudcmd> ' }); }); };