removing obsolete notify, first hooks to GUI.log

10.3.x-maintenance
cTn 2014-02-03 08:45:21 +01:00
parent 7fb560acb1
commit a30569077a
5 changed files with 6 additions and 20 deletions

View File

@ -277,9 +277,4 @@ input[type="number"]::-webkit-inner-spin-button {
border-top: 1px solid #7d7d79;
background-color: #bfbeb5;
}
#status-bar .notify {
float: right;
}
#status-bar .notify span {
}
}

View File

@ -134,7 +134,7 @@ function onOpen(openInfo) {
// disconnect after 10 seconds with error if we don't get IDENT data
GUI.timeout_add('connecting', function() {
if (!configuration_received) {
notify('Did not received configuration within <span style="color: red">10 seconds</span>, communication <span style="color: red">failed</span> - Disconnecting');
GUI.log('Did not received configuration within <span style="color: red">10 seconds</span>, communication <span style="color: red">failed</span> - Disconnecting');
$('div#port-picker a.connect').click(); // disconnect
}
@ -155,7 +155,7 @@ function onOpen(openInfo) {
});
} else {
console.log('Failed to open serial port');
notify('Failed to open serial port', 'red');
GUI.log('Failed to open serial port', 'red');
$('div#port-picker a.connect').text('Connect');
$('div#port-picker a.connect').removeClass('active');
@ -174,7 +174,7 @@ function onClosed(result) {
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
tab_initialize_default();
} else { // Something went wrong
notify('Failed to close serial port', 'red');
GUI.log('Failed to close serial port', 'red');
}
}

View File

@ -117,7 +117,6 @@
Packet error: <span class="packet-error">0</span> |
Firmware Version: <span class="software-version">0.0</span> |
Cycle Time: <span class="cycle-time">0</span>
<span class="notify"></span>
</div>
</div>
</div>

10
main.js
View File

@ -35,7 +35,7 @@ $(document).ready(function() {
$('a', tabs).click(function() {
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active
if (configuration_received == false) { // if there is no active connection, return
notify('You need to connect before you can view any of the tabs', 'red');
GUI.log('You need to connect before you can view any of the tabs', 'red');
return;
}
@ -151,14 +151,6 @@ $(document).ready(function() {
});
});
function notify(message, color) {
$('span.notify').html('<span style="color: ' + color + '">' + message + '</span>');+
$('span.notify span').fadeOut(5000, function() {
$(this).remove();
});
}
function microtime() {
var now = new Date().getTime() / 1000;

View File

@ -102,7 +102,7 @@ function tab_initialize_firmware_flasher() {
if (!GUI.connect_lock) { // button disabled while flashing is in progress
tab_initialize_default();
} else {
notify('You <span style="color: red">can\'t</span> do this right now, please wait for current operation to finish ...');
GUI.log('You <span style="color: red">can\'t</span> do this right now, please wait for current operation to finish ...');
}
});
});