initial log window implementation
parent
cc3b2a3f36
commit
2ebd108f43
|
@ -2,7 +2,11 @@ function start_app() {
|
|||
chrome.app.window.create('main.html', {
|
||||
id: 'main-window',
|
||||
frame: 'none',
|
||||
resizable: false
|
||||
resizable: false,
|
||||
minWidth: 962,
|
||||
minHeight: 729,
|
||||
maxWidth: 962,
|
||||
maxHeight: 729
|
||||
}, function(window_child) {
|
||||
window_child.onClosed.addListener(function() {
|
||||
// connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference
|
||||
|
|
|
@ -193,7 +193,22 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
}
|
||||
#sensor-status .on {
|
||||
background-color: #0d8b13;
|
||||
}
|
||||
}
|
||||
#log {
|
||||
margin-bottom: 10px;
|
||||
|
||||
height: 90px;
|
||||
|
||||
border: 1px solid silver;
|
||||
background-color: white;
|
||||
|
||||
overflow-y: scroll;
|
||||
}
|
||||
#log .wrapper {
|
||||
padding: 5px;
|
||||
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
#tabs {
|
||||
position: absolute;
|
||||
margin-top: 1px;
|
||||
|
@ -236,7 +251,7 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
background-color: white;
|
||||
}
|
||||
#content {
|
||||
margin-top: 27px;
|
||||
margin-top: 37px;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
|
|
12
js/gui.js
12
js/gui.js
|
@ -163,6 +163,18 @@ GUI_control.prototype.timeout_kill_all = function() {
|
|||
return timers_killed;
|
||||
};
|
||||
|
||||
// message = string
|
||||
GUI_control.prototype.log = function(message) {
|
||||
var command_log = $('div#log');
|
||||
var d = new Date();
|
||||
var time = ((d.getHours() < 10) ? '0' + d.getHours(): d.getHours())
|
||||
+ ':' + ((d.getMinutes() < 10) ? '0' + d.getMinutes(): d.getMinutes())
|
||||
+ ':' + ((d.getSeconds() < 10) ? '0' + d.getSeconds(): d.getSeconds());
|
||||
|
||||
$('div.wrapper', command_log).append('<p>' + time + ' -- ' + message + '</p>');
|
||||
command_log.scrollTop($('div.wrapper', command_log).height());
|
||||
};
|
||||
|
||||
// Method is called every time a valid tab change event is received
|
||||
// callback = code to run when cleanup is finished
|
||||
// default switch doesn't require callback to be set
|
||||
|
|
Loading…
Reference in New Issue