2014-08-09 17:38:46 +00:00
'use strict' ;
$ ( document ) . ready ( function ( ) {
2014-03-28 23:59:39 +00:00
// translate to user-selected language
localize ( ) ;
2014-02-03 05:21:26 +00:00
// alternative - window.navigator.appVersion.match(/Chrome\/([0-9.]*)/)[1];
2014-03-08 05:25:15 +00:00
GUI . log ( 'Running - OS: <strong>' + GUI . operating _system + '</strong>, ' +
2014-08-09 17:38:46 +00:00
'Chrome: <strong>' + window . navigator . appVersion . replace ( /.*Chrome\/([0-9.]*).*/ , "$1" ) + '</strong>, ' +
2014-02-03 08:38:16 +00:00
'Configurator: <strong>' + chrome . runtime . getManifest ( ) . version + '</strong>' ) ;
2014-02-10 19:01:08 +00:00
2014-10-12 14:05:35 +00:00
$ ( '#status-bar .version' ) . text ( chrome . runtime . getManifest ( ) . version ) ;
2015-11-05 15:37:15 +00:00
$ ( '#logo .version' ) . text ( chrome . runtime . getManifest ( ) . version ) ;
2014-10-12 14:05:35 +00:00
2014-02-10 19:01:08 +00:00
// notification messages for various operating systems
switch ( GUI . operating _system ) {
case 'Windows' :
break ;
case 'MacOS' :
2014-02-26 05:49:38 +00:00
// var main_chromium_version = window.navigator.appVersion.replace(/.*Chrome\/([0-9.]*).*/,"$1").split('.')[0];
2014-02-10 19:01:08 +00:00
break ;
case 'ChromeOS' :
break ;
case 'Linux' :
break ;
case 'UNIX' :
break ;
}
2014-03-08 05:25:15 +00:00
2016-08-13 10:04:23 +00:00
// check for newer releases online to inform people in case they are running an old release
2016-08-23 12:34:51 +00:00
chrome . storage . local . get ( [ 'lastVersionChecked' , 'lastVersionAvailableOnline' ] , function ( result ) {
if ( typeof result . lastVersionChecked === undefined || ( $ . now ( ) - result . lastVersionChecked ) > 3600 * 1000 ) {
2016-08-13 10:04:23 +00:00
try {
var url = 'https://api.github.com/repos/betaflight/betaflight-configurator/tags' ;
$ . get ( url ) . done ( function ( data ) {
2016-08-23 12:34:51 +00:00
var versions = data . sort ( function ( v1 , v2 ) {
try {
return semver . compare ( v2 . name , v1 . name ) ;
} catch ( e ) {
return false ;
}
} ) ;
chrome . storage . local . set ( {
'lastVersionChecked' : $ . now ( ) ,
'lastVersionAvailableOnline' : versions [ 0 ] . name
} , function ( result ) {
console . log ( "Latest version available online: " + versions [ 0 ] . name ) ;
} ) ;
notifyOutdatedVersion ( versions [ 0 ] . name ) ;
2016-08-13 10:04:23 +00:00
} ) ;
} catch ( e ) {
// Just to catch and supress warnings if no internet connection is available
}
} else if ( result . lastVersionAvailableOnline ) {
notifyOutdatedVersion ( result . lastVersionAvailableOnline ) ;
}
} ) ;
2016-07-06 23:55:15 +00:00
2015-11-19 22:13:10 +00:00
chrome . storage . local . get ( 'logopen' , function ( result ) {
if ( result . logopen ) {
$ ( "#showlog" ) . trigger ( 'click' ) ;
2016-08-23 12:34:51 +00:00
}
2015-11-19 22:13:10 +00:00
} ) ;
2014-10-02 09:21:56 +00:00
// log webgl capability
// it would seem the webgl "enabling" through advanced settings will be ignored in the future
// and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one
var canvas = document . createElement ( 'canvas' ) ;
2014-09-25 10:18:47 +00:00
// log library versions in console to make version tracking easier
console . log ( 'Libraries: jQuery - ' + $ . fn . jquery + ', d3 - ' + d3 . version + ', three.js - ' + THREE . REVISION ) ;
2014-08-17 11:29:07 +00:00
2014-01-18 18:21:30 +00:00
// Tabs
2014-07-10 16:14:17 +00:00
var ui _tabs = $ ( '#tabs > ul' ) ;
2014-08-09 17:38:46 +00:00
$ ( 'a' , ui _tabs ) . click ( function ( ) {
2014-07-09 14:10:02 +00:00
if ( $ ( this ) . parent ( ) . hasClass ( 'active' ) == false && ! GUI . tab _switch _in _progress ) { // only initialize when the tab isn't already active
2014-08-09 17:38:46 +00:00
var self = this ,
2015-10-26 21:54:05 +00:00
tabClass = $ ( self ) . parent ( ) . prop ( 'class' ) ;
2014-04-21 22:30:22 +00:00
2015-01-25 16:37:47 +00:00
var tabRequiresConnection = $ ( self ) . parent ( ) . hasClass ( 'mode-connected' ) ;
2016-07-06 23:55:15 +00:00
2015-01-26 21:37:31 +00:00
var tab = tabClass . substring ( 4 ) ;
var tabName = $ ( self ) . text ( ) ;
2016-07-06 23:55:15 +00:00
2015-01-25 16:37:47 +00:00
if ( tabRequiresConnection && ! CONFIGURATOR . connectionValid ) {
2015-01-08 11:38:10 +00:00
GUI . log ( chrome . i18n . getMessage ( 'tabSwitchConnectionRequired' ) ) ;
2013-04-08 19:10:47 +00:00
return ;
}
2016-07-06 23:55:15 +00:00
2015-01-25 16:37:47 +00:00
if ( GUI . connect _lock ) { // tab switching disabled while operation is in progress
GUI . log ( chrome . i18n . getMessage ( 'tabSwitchWaitForOperation' ) ) ;
return ;
}
2016-07-06 23:55:15 +00:00
2015-01-26 21:37:31 +00:00
if ( GUI . allowedTabs . indexOf ( tab ) < 0 ) {
GUI . log ( chrome . i18n . getMessage ( 'tabSwitchUpgradeRequired' , [ tabName ] ) ) ;
2015-01-06 19:35:58 +00:00
return ;
}
2014-07-09 14:10:02 +00:00
GUI . tab _switch _in _progress = true ;
2014-08-09 17:38:46 +00:00
GUI . tab _switch _cleanup ( function ( ) {
2013-12-09 18:34:34 +00:00
// disable previously active tab highlight
2014-07-10 16:14:17 +00:00
$ ( 'li' , ui _tabs ) . removeClass ( 'active' ) ;
2014-03-08 05:25:15 +00:00
2013-12-09 18:34:34 +00:00
// Highlight selected tab
2013-11-09 05:14:21 +00:00
$ ( self ) . parent ( ) . addClass ( 'active' ) ;
2014-03-08 05:25:15 +00:00
2014-03-15 14:43:08 +00:00
// detach listeners and remove element data
2014-07-12 10:03:13 +00:00
var content = $ ( '#content' ) ;
content . empty ( ) ;
// display loading screen
$ ( '#cache .data-loading' ) . clone ( ) . appendTo ( content ) ;
2014-03-15 14:43:08 +00:00
2014-08-09 17:38:46 +00:00
function content _ready ( ) {
GUI . tab _switch _in _progress = false ;
}
2013-12-09 18:34:34 +00:00
switch ( tab ) {
2015-01-26 21:37:31 +00:00
case 'landing' :
2015-01-25 16:37:47 +00:00
TABS . landing . initialize ( content _ready ) ;
break ;
2015-01-26 21:37:31 +00:00
case 'firmware_flasher' :
2015-01-25 16:37:47 +00:00
TABS . firmware _flasher . initialize ( content _ready ) ;
break ;
2015-03-03 16:27:14 +00:00
case 'help' :
TABS . help . initialize ( content _ready ) ;
break ;
2015-01-26 21:37:31 +00:00
case 'auxiliary' :
2014-12-18 22:38:55 +00:00
TABS . auxiliary . initialize ( content _ready ) ;
break ;
2015-01-26 21:37:31 +00:00
case 'adjustments' :
2014-12-18 22:38:55 +00:00
TABS . adjustments . initialize ( content _ready ) ;
break ;
2015-01-26 21:37:31 +00:00
case 'ports' :
2015-01-02 00:05:09 +00:00
TABS . ports . initialize ( content _ready ) ;
break ;
2015-01-26 21:37:31 +00:00
case 'led_strip' :
2015-01-08 21:46:43 +00:00
TABS . led _strip . initialize ( content _ready ) ;
break ;
2015-11-20 20:42:40 +00:00
case 'failsafe' :
TABS . failsafe . initialize ( content _ready ) ;
break ;
2016-01-08 11:47:54 +00:00
case 'transponder' :
TABS . transponder . initialize ( content _ready ) ;
break ;
2016-06-29 09:22:58 +00:00
case 'osd' :
TABS . osd . initialize ( content _ready ) ;
break ;
2015-01-26 21:37:31 +00:00
case 'setup' :
2014-09-20 11:51:23 +00:00
TABS . setup . initialize ( content _ready ) ;
2014-07-12 10:03:13 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'configuration' :
2014-09-17 08:31:36 +00:00
TABS . configuration . initialize ( content _ready ) ;
2013-12-09 18:34:34 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'pid_tuning' :
2014-08-12 13:51:31 +00:00
TABS . pid _tuning . initialize ( content _ready ) ;
2013-12-09 18:34:34 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'receiver' :
2014-08-12 13:51:31 +00:00
TABS . receiver . initialize ( content _ready ) ;
2013-12-09 18:34:34 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'servos' :
2014-08-12 13:51:31 +00:00
TABS . servos . initialize ( content _ready ) ;
2013-12-09 18:34:34 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'gps' :
2014-08-12 13:51:31 +00:00
TABS . gps . initialize ( content _ready ) ;
2013-12-09 18:34:34 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'motors' :
2014-10-30 11:43:35 +00:00
TABS . motors . initialize ( content _ready ) ;
2013-12-09 18:34:34 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'sensors' :
2014-08-12 13:51:31 +00:00
TABS . sensors . initialize ( content _ready ) ;
2014-03-08 05:25:15 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'logging' :
2014-08-12 13:51:31 +00:00
TABS . logging . initialize ( content _ready ) ;
2014-05-22 10:13:16 +00:00
break ;
2015-11-30 07:36:47 +00:00
case 'onboard_logging' :
TABS . onboard _logging . initialize ( content _ready ) ;
2015-01-30 11:41:41 +00:00
break ;
2015-01-26 21:37:31 +00:00
case 'cli' :
2014-09-20 11:51:23 +00:00
TABS . cli . initialize ( content _ready ) ;
break ;
default :
2015-01-26 21:37:31 +00:00
console . log ( 'Tab not found:' + tab ) ;
2013-11-09 05:14:21 +00:00
}
} ) ;
2013-04-08 19:10:47 +00:00
}
} ) ;
2014-03-08 05:25:15 +00:00
2015-01-25 16:37:47 +00:00
$ ( '#tabs ul.mode-disconnected li a:first' ) . click ( ) ;
2014-03-08 05:25:15 +00:00
2014-04-22 14:16:22 +00:00
// options
2014-08-09 17:38:46 +00:00
$ ( 'a#options' ) . click ( function ( ) {
2014-04-22 14:16:22 +00:00
var el = $ ( this ) ;
if ( ! el . hasClass ( 'active' ) ) {
el . addClass ( 'active' ) ;
el . after ( '<div id="options-window"></div>' ) ;
2014-07-16 11:38:11 +00:00
2014-08-09 17:38:46 +00:00
$ ( 'div#options-window' ) . load ( './tabs/options.html' , function ( ) {
2014-04-22 14:16:22 +00:00
// translate to user-selected language
localize ( ) ;
// if notifications are enabled, or wasn't set, check the notifications checkbox
2014-08-09 17:38:46 +00:00
chrome . storage . local . get ( 'update_notify' , function ( result ) {
2014-11-20 18:29:43 +00:00
if ( typeof result . update _notify === 'undefined' || result . update _notify ) {
2014-04-22 14:16:22 +00:00
$ ( 'div.notifications input' ) . prop ( 'checked' , true ) ;
}
2016-08-23 12:34:51 +00:00
$ ( 'div.notifications input' ) . change ( function ( ) {
var check = $ ( this ) . is ( ':checked' ) ;
chrome . storage . local . set ( { 'update_notify' : check } ) ;
} ) ;
2014-04-22 14:16:22 +00:00
} ) ;
2016-08-23 12:34:51 +00:00
chrome . storage . local . get ( 'permanentExpertMode' , function ( result ) {
if ( result . permanentExpertMode ) {
$ ( 'div.permanentExpertMode input' ) . prop ( 'checked' , true ) ;
}
$ ( 'div.permanentExpertMode input' ) . change ( function ( ) {
var checked = $ ( this ) . is ( ':checked' ) ;
chrome . storage . local . set ( { 'permanentExpertMode' : checked } ) ;
$ ( 'input[name="expertModeCheckbox"]' ) . prop ( 'checked' , checked ) . change ( ) ;
if ( BF _CONFIG ) {
updateTabList ( BF _CONFIG . features ) ;
}
2014-04-22 14:16:22 +00:00
2016-08-23 12:34:51 +00:00
} ) . change ( ) ;
2014-04-22 14:16:22 +00:00
} ) ;
2015-10-26 21:54:05 +00:00
function close _and _cleanup ( e ) {
if ( e . type == 'click' && ! $ . contains ( $ ( 'div#options-window' ) [ 0 ] , e . target ) || e . type == 'keyup' && e . keyCode == 27 ) {
$ ( document ) . unbind ( 'click keyup' , close _and _cleanup ) ;
$ ( 'div#options-window' ) . slideUp ( 250 , function ( ) {
el . removeClass ( 'active' ) ;
$ ( this ) . empty ( ) . remove ( ) ;
} ) ;
}
}
2014-07-16 13:56:24 +00:00
$ ( document ) . bind ( 'click keyup' , close _and _cleanup ) ;
2014-04-22 14:16:22 +00:00
2014-09-04 07:33:13 +00:00
$ ( this ) . slideDown ( 250 ) ;
2014-04-22 14:16:22 +00:00
} ) ;
}
} ) ;
2014-01-15 23:55:45 +00:00
// listen to all input change events and adjust the value within limits if necessary
2014-08-09 17:38:46 +00:00
$ ( "#content" ) . on ( 'focus' , 'input[type="number"]' , function ( ) {
var element = $ ( this ) ,
val = element . val ( ) ;
2014-03-08 05:25:15 +00:00
2014-01-16 00:58:07 +00:00
if ( ! isNaN ( val ) ) {
element . data ( 'previousValue' , parseFloat ( val ) ) ;
}
} ) ;
2014-03-08 05:25:15 +00:00
2014-08-09 17:38:46 +00:00
$ ( "#content" ) . on ( 'keydown' , 'input[type="number"]' , function ( e ) {
2014-01-24 15:44:08 +00:00
// whitelist all that we need for numeric control
2014-07-16 22:28:01 +00:00
var whitelist = [
96 , 97 , 98 , 99 , 100 , 101 , 102 , 103 , 104 , 105 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , // numpad and standard number keypad
109 , 189 , // minus on numpad and in standard keyboard
8 , 46 , 9 , // backspace, delete, tab
190 , 110 , // decimal point
37 , 38 , 39 , 40 , 13 // arrows and enter
] ;
2014-08-09 17:38:46 +00:00
if ( whitelist . indexOf ( e . keyCode ) == - 1 ) {
e . preventDefault ( ) ;
}
2014-01-24 15:44:08 +00:00
} ) ;
2014-03-08 05:25:15 +00:00
2014-08-09 17:38:46 +00:00
$ ( "#content" ) . on ( 'change' , 'input[type="number"]' , function ( ) {
var element = $ ( this ) ,
min = parseFloat ( element . prop ( 'min' ) ) ,
max = parseFloat ( element . prop ( 'max' ) ) ,
step = parseFloat ( element . prop ( 'step' ) ) ,
val = parseFloat ( element . val ( ) ) ,
decimal _places ;
2014-03-08 05:25:15 +00:00
2014-01-15 23:55:45 +00:00
// only adjust minimal end if bound is set
2014-01-16 00:58:07 +00:00
if ( element . prop ( 'min' ) ) {
2014-08-09 17:38:46 +00:00
if ( val < min ) {
element . val ( min ) ;
2014-09-22 08:16:27 +00:00
val = min ;
2014-08-09 17:38:46 +00:00
}
2014-01-15 19:25:51 +00:00
}
2014-03-08 05:25:15 +00:00
2014-01-15 23:55:45 +00:00
// only adjust maximal end if bound is set
2014-01-16 00:58:07 +00:00
if ( element . prop ( 'max' ) ) {
2014-08-09 17:38:46 +00:00
if ( val > max ) {
element . val ( max ) ;
2014-09-22 08:16:27 +00:00
val = max ;
2014-08-09 17:38:46 +00:00
}
2014-01-16 00:58:07 +00:00
}
2014-03-08 05:25:15 +00:00
2014-01-16 00:58:07 +00:00
// if entered value is illegal use previous value instead
if ( isNaN ( val ) ) {
element . val ( element . data ( 'previousValue' ) ) ;
2014-09-22 08:16:27 +00:00
val = element . data ( 'previousValue' ) ;
2014-01-16 00:58:07 +00:00
}
2014-03-08 05:25:15 +00:00
2014-01-16 00:58:07 +00:00
// if step is not set or step is int and value is float use previous value instead
if ( isNaN ( step ) || step % 1 === 0 ) {
if ( val % 1 !== 0 ) {
element . val ( element . data ( 'previousValue' ) ) ;
2014-09-22 08:16:27 +00:00
val = element . data ( 'previousValue' ) ;
2014-01-16 00:58:07 +00:00
}
2014-01-15 19:25:51 +00:00
}
2014-03-08 05:25:15 +00:00
2014-01-29 19:22:14 +00:00
// if step is set and is float and value is int, convert to float, keep decimal places in float according to step *experimental*
if ( ! isNaN ( step ) && step % 1 !== 0 ) {
2014-08-09 17:38:46 +00:00
decimal _places = String ( step ) . split ( '.' ) [ 1 ] . length ;
2014-03-08 05:25:15 +00:00
2014-01-29 19:22:14 +00:00
if ( val % 1 === 0 ) {
element . val ( val . toFixed ( decimal _places ) ) ;
} else if ( String ( val ) . split ( '.' ) [ 1 ] . length != decimal _places ) {
element . val ( val . toFixed ( decimal _places ) ) ;
}
}
2014-01-15 19:25:51 +00:00
} ) ;
2016-07-06 23:55:15 +00:00
2016-08-23 12:34:51 +00:00
$ ( "#showlog" ) . on ( 'click' , function ( ) {
var state = $ ( this ) . data ( 'state' ) ;
if ( state ) {
$ ( "#log" ) . animate ( { height : 27 } , 200 , function ( ) {
var command _log = $ ( 'div#log' ) ;
command _log . scrollTop ( $ ( 'div.wrapper' , command _log ) . height ( ) ) ;
} ) ;
$ ( "#log" ) . removeClass ( 'active' ) ;
$ ( "#content" ) . removeClass ( 'logopen' ) ;
$ ( ".tab_container" ) . removeClass ( 'logopen' ) ;
$ ( "#scrollicon" ) . removeClass ( 'active' ) ;
chrome . storage . local . set ( { 'logopen' : false } ) ;
state = false ;
} else {
$ ( "#log" ) . animate ( { height : 111 } , 200 ) ;
$ ( "#log" ) . addClass ( 'active' ) ;
$ ( "#content" ) . addClass ( 'logopen' ) ;
$ ( ".tab_container" ) . addClass ( 'logopen' ) ;
$ ( "#scrollicon" ) . addClass ( 'active' ) ;
chrome . storage . local . set ( { 'logopen' : true } ) ;
state = true ;
}
$ ( this ) . text ( state ? 'Hide Log' : 'Show Log' ) ;
$ ( this ) . data ( 'state' , state ) ;
} ) ;
2016-07-06 23:55:15 +00:00
2016-08-23 12:34:51 +00:00
chrome . storage . local . get ( 'permanentExpertMode' , function ( result ) {
if ( result . permanentExpertMode ) {
$ ( 'input[name="expertModeCheckbox"]' ) . prop ( 'checked' , true ) ;
}
$ ( 'input[name="expertModeCheckbox"]' ) . change ( function ( ) {
if ( BF _CONFIG ) {
updateTabList ( BF _CONFIG . features ) ;
}
} ) . change ( ) ;
2015-11-22 21:00:01 +00:00
} ) ;
2013-11-08 17:31:19 +00:00
} ) ;
2016-08-23 12:34:51 +00:00
function notifyOutdatedVersion ( version ) {
2016-08-13 10:04:23 +00:00
if ( semver . lt ( chrome . runtime . getManifest ( ) . version , version ) ) {
GUI . log ( 'You are using an old version of ' + chrome . runtime . getManifest ( ) . name + '. Version ' + version + ' is available online with possible improvements and fixes.' ) ;
}
}
2016-08-06 13:31:10 +00:00
function update _packet _error ( caller ) {
$ ( 'span.packet-error' ) . html ( caller . packet _error ) ;
}
2013-11-13 08:49:03 +00:00
function microtime ( ) {
var now = new Date ( ) . getTime ( ) / 1000 ;
return now ;
2013-11-20 11:24:37 +00:00
}
2014-04-12 12:55:20 +00:00
function millitime ( ) {
var now = new Date ( ) . getTime ( ) ;
return now ;
}
2016-07-06 23:55:15 +00:00
var DEGREE _TO _RADIAN _RATIO = Math . PI / 180 ;
function degToRad ( degrees ) {
return degrees * DEGREE _TO _RADIAN _RATIO ;
}
2014-06-25 07:18:01 +00:00
function bytesToSize ( bytes ) {
2014-08-09 17:38:46 +00:00
if ( bytes < 1024 ) {
bytes = bytes + ' Bytes' ;
} else if ( bytes < 1048576 ) {
bytes = ( bytes / 1024 ) . toFixed ( 3 ) + ' KB' ;
} else if ( bytes < 1073741824 ) {
bytes = ( bytes / 1048576 ) . toFixed ( 3 ) + ' MB' ;
} else {
bytes = ( bytes / 1073741824 ) . toFixed ( 3 ) + ' GB' ;
}
return bytes ;
2014-11-09 00:46:12 +00:00
}
2014-10-05 17:46:27 +00:00
2016-08-23 12:34:51 +00:00
function isExpertModeEnabled ( ) {
return $ ( 'input[name="expertModeCheckbox"]' ) . is ( ':checked' ) ;
}
2016-07-24 11:09:51 +00:00
function updateTabList ( features ) {
2016-08-23 12:34:51 +00:00
if ( features . isEnabled ( 'GPS' ) && isExpertModeEnabled ( ) ) {
2016-07-23 14:46:47 +00:00
$ ( '#tabs ul.mode-connected li.tab_gps' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_gps' ) . hide ( ) ;
}
2016-08-23 12:34:51 +00:00
if ( isExpertModeEnabled ( ) ) {
2016-08-17 11:58:07 +00:00
$ ( '#tabs ul.mode-connected li.tab_failsafe' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_failsafe' ) . hide ( ) ;
}
2016-08-23 12:34:51 +00:00
if ( isExpertModeEnabled ( ) ) {
$ ( '#tabs ul.mode-connected li.tab_adjustments' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_adjustments' ) . hide ( ) ;
}
if ( isExpertModeEnabled ( ) ) {
$ ( '#tabs ul.mode-connected li.tab_servos' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_servos' ) . hide ( ) ;
}
2016-07-24 11:09:51 +00:00
if ( features . isEnabled ( 'LED_STRIP' ) ) {
2016-07-23 14:46:47 +00:00
$ ( '#tabs ul.mode-connected li.tab_led_strip' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_led_strip' ) . hide ( ) ;
}
2016-08-23 12:34:51 +00:00
if ( isExpertModeEnabled ( ) ) {
$ ( '#tabs ul.mode-connected li.tab_sensors' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_sensors' ) . hide ( ) ;
}
if ( isExpertModeEnabled ( ) ) {
$ ( '#tabs ul.mode-connected li.tab_logging' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_logging' ) . hide ( ) ;
}
2016-07-24 11:09:51 +00:00
if ( features . isEnabled ( 'BLACKBOX' ) ) {
2016-07-23 14:46:47 +00:00
$ ( '#tabs ul.mode-connected li.tab_onboard_logging' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_onboard_logging' ) . hide ( ) ;
}
2016-07-24 11:09:51 +00:00
if ( features . isEnabled ( 'TRANSPONDER' ) ) {
2016-07-23 14:46:47 +00:00
$ ( '#tabs ul.mode-connected li.tab_transponder' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_transponder' ) . hide ( ) ;
}
2016-07-24 11:09:51 +00:00
if ( features . isEnabled ( 'OSD' ) ) {
2016-07-23 14:46:47 +00:00
$ ( '#tabs ul.mode-connected li.tab_osd' ) . show ( ) ;
} else {
$ ( '#tabs ul.mode-connected li.tab_osd' ) . hide ( ) ;
}
}