Commit 68f85ece authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

input and output logged

parent 40cbc1d0
......@@ -42,4 +42,12 @@
position: absolute;
margin-left: 10px;
margin-top: 12px;
}
span.incoming {
color: #999;
}
span.outgoing {
font-weight:700;
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ define(['backbone'], function(Backbone){
var SerialMonitor = Backbone.Model.extend({
defaults: {
autoscroll: false
autoscroll: true
}
});
......
......@@ -62,8 +62,12 @@ define(['jquery', 'underscore', 'commParentMenu', 'serialComm', 'text!SerialMoni
$("#serialMonitorOutput").html("");
},
__sendMessage: function(message){
$("#serialMonitorOutput").append("<span class='outgoing'>" + message + "</span><br/>");
},
_updateIncomingMessage: function(){
$("#serialMonitorOutput").append(serialComm.get("lastMessageReceived") + "<br/>");
$("#serialMonitorOutput").append("<span class='incoming'>" + serialComm.get("lastMessageReceived") + "</span><br/>");
},
template: _.template(template)
......
......@@ -37,6 +37,7 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'serialComm', 'commPlist'
$("#sendSerialMessage").val("");
if (message == "") return;
serialComm.send(message);
if (this.__sendMessage) this.__sendMessage(message);
},
_updateIncomingMessage: function(){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment