another run on undefined comparators

10.3.x-maintenance
cTn 2014-08-14 16:41:49 +02:00
parent 468d7f57c8
commit dbf528345e
5 changed files with 16 additions and 16 deletions

View File

@ -30,7 +30,7 @@ var GUI_control = function () {
// interval = time interval in miliseconds // interval = time interval in miliseconds
// first = true/false if code should be ran initially before next timer interval hits // first = true/false if code should be ran initially before next timer interval hits
GUI_control.prototype.interval_add = function (name, code, interval, first) { GUI_control.prototype.interval_add = function (name, code, interval, first) {
var data = {'name': name, 'timer': undefined, 'code': code, 'interval': interval, 'fired': 0, 'paused': false}; var data = {'name': name, 'timer': null, 'code': code, 'interval': interval, 'fired': 0, 'paused': false};
if (first == true) { if (first == true) {
code(); // execute code code(); // execute code
@ -132,7 +132,7 @@ GUI_control.prototype.interval_kill_all = function (keep_array) {
// timeout = timeout in miliseconds // timeout = timeout in miliseconds
GUI_control.prototype.timeout_add = function (name, code, timeout) { GUI_control.prototype.timeout_add = function (name, code, timeout) {
var self = this; var self = this;
var data = {'name': name, 'timer': undefined, 'timeout': timeout}; var data = {'name': name, 'timer': null, 'timeout': timeout};
// start timer with "cleaning" callback // start timer with "cleaning" callback
data.timer = setTimeout(function() { data.timer = setTimeout(function() {

View File

@ -59,8 +59,8 @@ var MSP = {
code: 0, code: 0,
message_length_expected: 0, message_length_expected: 0,
message_length_received: 0, message_length_received: 0,
message_buffer: undefined, message_buffer: null,
message_buffer_uint8_view: undefined, message_buffer_uint8_view: null,
message_checksum: 0, message_checksum: 0,
callbacks: [], callbacks: [],

View File

@ -13,7 +13,7 @@ var serial = {
var self = this; var self = this;
chrome.serial.connect(path, options, function(connectionInfo) { chrome.serial.connect(path, options, function(connectionInfo) {
if (connectionInfo !== undefined) { if (connectionInfo) {
self.connectionId = connectionInfo.connectionId; self.connectionId = connectionInfo.connectionId;
self.bitrate = connectionInfo.bitrate; self.bitrate = connectionInfo.bitrate;
self.bytes_received = 0; self.bytes_received = 0;

View File

@ -61,7 +61,7 @@ $(document).ready(function() {
// auto-connect // auto-connect
chrome.storage.local.get('auto_connect', function (result) { chrome.storage.local.get('auto_connect', function (result) {
if (typeof result.auto_connect === 'undefined' || result.auto_connect) { if (!result.auto_connect || result.auto_connect) {
// default or enabled by user // default or enabled by user
GUI.auto_connect = true; GUI.auto_connect = true;
@ -112,7 +112,7 @@ function onOpen(openInfo) {
// save selected port with chrome.storage if the port differs // save selected port with chrome.storage if the port differs
chrome.storage.local.get('last_used_port', function (result) { chrome.storage.local.get('last_used_port', function (result) {
if (typeof result.last_used_port != 'undefined') { if (result.last_used_port) {
if (result.last_used_port != GUI.connected_to) { if (result.last_used_port != GUI.connected_to) {
// last used port doesn't match the one found in local db, we will store the new one // last used port doesn't match the one found in local db, we will store the new one
chrome.storage.local.set({'last_used_port': GUI.connected_to}); chrome.storage.local.set({'last_used_port': GUI.connected_to});

View File

@ -28,7 +28,7 @@ TABS.receiver.initialize = function (callback) {
$('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2)); $('.tunings .rate input[name="expo"]').val(RC_tuning.RC_EXPO.toFixed(2));
chrome.storage.local.get('rx_refresh_rate', function (result) { chrome.storage.local.get('rx_refresh_rate', function (result) {
if (typeof result.rx_refresh_rate != 'undefined') { if (result.rx_refresh_rate) {
$('select[name="rx_refresh_rate"]').val(result.rx_refresh_rate).change(); $('select[name="rx_refresh_rate"]').val(result.rx_refresh_rate).change();
} else { } else {
$('select[name="rx_refresh_rate"]').change(); // start with default value $('select[name="rx_refresh_rate"]').change(); // start with default value