rename translation shortcuts, drop configuration files in
parent
4fd36df425
commit
945b86f9b2
|
@ -39,34 +39,37 @@
|
|||
},
|
||||
|
||||
|
||||
"tab1": {
|
||||
"message": "Initial Setup"
|
||||
"tabSetup": {
|
||||
"message": "Setup"
|
||||
},
|
||||
"tab2": {
|
||||
"tabConfiguration": {
|
||||
"message": "Configuration"
|
||||
},
|
||||
"tabPidTuning": {
|
||||
"message": "PID Tuning"
|
||||
},
|
||||
"tab3": {
|
||||
"tabReceiver": {
|
||||
"message": "Receiver"
|
||||
},
|
||||
"tab4": {
|
||||
"tabModeSelection": {
|
||||
"message": "Mode Selection"
|
||||
},
|
||||
"tab5": {
|
||||
"tabServos": {
|
||||
"message": "Servos"
|
||||
},
|
||||
"tab6": {
|
||||
"tabGPS": {
|
||||
"message": "GPS"
|
||||
},
|
||||
"tab7": {
|
||||
"tabMotorTesting": {
|
||||
"message": "Motor Testing"
|
||||
},
|
||||
"tab8": {
|
||||
"tabRawSensorData": {
|
||||
"message": "Raw Sensor Data"
|
||||
},
|
||||
"tab9": {
|
||||
"tabCLI": {
|
||||
"message": "CLI"
|
||||
},
|
||||
"tab10": {
|
||||
"tabLogging": {
|
||||
"message": "Logging"
|
||||
},
|
||||
|
||||
|
|
23
main.html
23
main.html
|
@ -8,6 +8,7 @@
|
|||
|
||||
<link type="text/css" rel="stylesheet" href="./tabs/default.css" media="all" />
|
||||
<link type="text/css" rel="stylesheet" href="./tabs/initial_setup.css" media="all" />
|
||||
<link type="text/css" rel="stylesheet" href="./tabs/configuration.css" media="all" />
|
||||
<link type="text/css" rel="stylesheet" href="./tabs/pid_tuning.css" media="all" />
|
||||
<link type="text/css" rel="stylesheet" href="./tabs/receiver.css" media="all" />
|
||||
<link type="text/css" rel="stylesheet" href="./tabs/auxiliary_configuration.css" media="all" />
|
||||
|
@ -41,6 +42,7 @@
|
|||
|
||||
<script type="text/javascript" src="./tabs/default.js"></script>
|
||||
<script type="text/javascript" src="./tabs/initial_setup.js"></script>
|
||||
<script type="text/javascript" src="./tabs/configuration.js"></script>
|
||||
<script type="text/javascript" src="./tabs/pid_tuning.js"></script>
|
||||
<script type="text/javascript" src="./tabs/receiver.js"></script>
|
||||
<script type="text/javascript" src="./tabs/auxiliary_configuration.js"></script>
|
||||
|
@ -102,16 +104,17 @@
|
|||
</div>
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li class="tab_initial_setup"><a href="#" i18n="tab1"></a></li>
|
||||
<li class="tab_pid_tuning"><a href="#" i18n="tab2"></a></li>
|
||||
<li class="tab_receiver"><a href="#" i18n="tab3"></a></li>
|
||||
<li class="tab_auxiliary_configuration"><a href="#" i18n="tab4"></a></li>
|
||||
<li class="tab_servos"><a href="#" i18n="tab5"></a></li>
|
||||
<li class="tab_gps"><a href="#" i18n="tab6"></a></li>
|
||||
<li class="tab_motor_outputs"><a href="#" i18n="tab7"></a></li>
|
||||
<li class="tab_sensors"><a href="#" i18n="tab8"></a></li>
|
||||
<li class="tab_cli"><a href="#" i18n="tab9"></a></li>
|
||||
<li class="tab_logging"><a href="#" i18n="tab10"></a></li>
|
||||
<li class="tab_initial_setup"><a href="#" i18n="tabSetup"></a></li>
|
||||
<li class="tab_configuration"><a href="#" i18n="tabConfiguration"></a></li>
|
||||
<li class="tab_pid_tuning"><a href="#" i18n="tabPidTuning"></a></li>
|
||||
<li class="tab_receiver"><a href="#" i18n="tabReceiver"></a></li>
|
||||
<li class="tab_auxiliary_configuration"><a href="#" i18n="tabModeSelection"></a></li>
|
||||
<li class="tab_servos"><a href="#" i18n="tabServos"></a></li>
|
||||
<li class="tab_gps"><a href="#" i18n="tabGPS"></a></li>
|
||||
<li class="tab_motor_outputs"><a href="#" i18n="tabMotorTesting"></a></li>
|
||||
<li class="tab_sensors"><a href="#" i18n="tabRawSensorData"></a></li>
|
||||
<li class="tab_cli"><a href="#" i18n="tabCLI"></a></li>
|
||||
<li class="tab_logging"><a href="#" i18n="tabLogging"></a></li>
|
||||
</ul>
|
||||
<div class="clear-both"></div>
|
||||
</div>
|
||||
|
|
3
main.js
3
main.js
|
@ -88,6 +88,9 @@ $(document).ready(function () {
|
|||
case 'tab_initial_setup':
|
||||
TABS.initial_setup.initialize(content_ready);
|
||||
break;
|
||||
case 'tab_configuration':
|
||||
TABS.configuration.initialize(content_ready);
|
||||
break;
|
||||
case 'tab_pid_tuning':
|
||||
TABS.pid_tuning.initialize(content_ready);
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
.tab-configuration {
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
<div class="tab-configuration">
|
||||
</div>
|
|
@ -0,0 +1,59 @@
|
|||
'use strict';
|
||||
|
||||
TABS.configuration = {};
|
||||
|
||||
TABS.configuration.initialize = function (callback) {
|
||||
var self = this;
|
||||
GUI.active_tab_ref = this;
|
||||
GUI.active_tab = 'configuration';
|
||||
googleAnalytics.sendAppView('Configuration');
|
||||
|
||||
|
||||
function check_compatibility() {
|
||||
if (bit_check(CONFIG.capability, 30)) {
|
||||
// new stuff supported, continue fetching configuration data
|
||||
load_config();
|
||||
} else {
|
||||
// old version, deny access
|
||||
$('#content').text('We are sorry, but advanced configuration is only available for boards with latest firmware, please update');
|
||||
|
||||
if (callback) callback();
|
||||
}
|
||||
}
|
||||
|
||||
function load_config() {
|
||||
MSP.send_message(MSP_codes.MSP_CONFIG, false, false, load_rc_map);
|
||||
}
|
||||
|
||||
function load_rc_map() {
|
||||
MSP.send_message(MSP_codes.MSP_RCMAP, false, false, load_misc);
|
||||
}
|
||||
|
||||
function load_misc() {
|
||||
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_acc_trim);
|
||||
}
|
||||
|
||||
function load_acc_trim() {
|
||||
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_html);
|
||||
}
|
||||
|
||||
function load_html() {
|
||||
$('#content').load("./tabs/configuration.html", process_html);
|
||||
}
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_IDENT, false, false, check_compatibility);
|
||||
|
||||
function process_html() {
|
||||
// translate to user-selected language
|
||||
localize();
|
||||
|
||||
console.log('all ready');
|
||||
|
||||
if (callback) callback();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
TABS.configuration.cleanup = function (callback) {
|
||||
if (callback) callback();
|
||||
};
|
|
@ -8,7 +8,7 @@ TABS.initial_setup.initialize = function (callback) {
|
|||
var self = this;
|
||||
GUI.active_tab_ref = this;
|
||||
GUI.active_tab = 'initial_setup';
|
||||
googleAnalytics.sendAppView('Initial Setup');
|
||||
googleAnalytics.sendAppView('Setup');
|
||||
|
||||
function load_ident() {
|
||||
MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config);
|
||||
|
|
Loading…
Reference in New Issue