mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(console) rm addNewLine
This commit is contained in:
parent
071e62d099
commit
e2bce6c48a
2 changed files with 4 additions and 15 deletions
|
|
@ -108,25 +108,14 @@ var CloudCmd, Util, DOM, $;
|
|||
|
||||
this.log = function(pText){
|
||||
if (jqconsole)
|
||||
jqconsole.Write( addNewLine(pText), 'log-msg');
|
||||
jqconsole.Write(pText, 'log-msg');
|
||||
};
|
||||
|
||||
this.error = function(pText){
|
||||
if (jqconsole)
|
||||
jqconsole.Write( addNewLine(pText), 'error-msg');
|
||||
jqconsole.Write(pText, 'error-msg');
|
||||
};
|
||||
|
||||
function addNewLine(pText){
|
||||
var lNewLine = '',
|
||||
n = pText && pText.length;
|
||||
|
||||
if(n && pText[n-1] !== '\n')
|
||||
lNewLine = '\n';
|
||||
|
||||
return pText + lNewLine;
|
||||
}
|
||||
|
||||
|
||||
function load(pCallBack){
|
||||
Util.time(Name + ' load');
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ var CloudCmd, Util, DOM, io;
|
|||
CloudCmd.Socket = socket;
|
||||
|
||||
socket.on('connect', function () {
|
||||
outToTerminal({stdout: 'socket connected'});
|
||||
outToTerminal({stdout: 'socket connected\n'});
|
||||
});
|
||||
|
||||
socket.on('message', function (msg) {
|
||||
|
|
@ -37,7 +37,7 @@ var CloudCmd, Util, DOM, io;
|
|||
});
|
||||
|
||||
socket.on('disconnect', function () {
|
||||
outToTerminal({stderr: 'socket disconected'});
|
||||
outToTerminal({stderr: 'socket disconected\n'});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue