initial log window implementation

10.3.x-maintenance
cTn 2014-02-03 06:19:06 +01:00
parent cc3b2a3f36
commit 2ebd108f43
4 changed files with 38 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -92,6 +92,10 @@
</ul>
</div>
<div class="clear-both"></div>
<div id="log">
<div class="wrapper">
</div>
</div>
<div id="tabs">
<ul>
<li class="tab_initial_setup"><a href="#">Initial Setup</a></li>