mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
dedicated options icon/button (live access)
This commit is contained in:
parent
8c4a4277f8
commit
6049cf0ec4
12 changed files with 125 additions and 67 deletions
|
@ -3,7 +3,7 @@
|
||||||
"message": "Receive desktop <strong>notification</strong> when application updates"
|
"message": "Receive desktop <strong>notification</strong> when application updates"
|
||||||
},
|
},
|
||||||
"options_improve_configurator": {
|
"options_improve_configurator": {
|
||||||
"message": "<strong>Improve</strong> Baseflight - Configurator by sending anonymous usage data to the developer team"
|
"message": "Send anonymous usage data to the developer team"
|
||||||
},
|
},
|
||||||
"options_back": {
|
"options_back": {
|
||||||
"message": "Leave Options"
|
"message": "Leave Options"
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<span>xx.xx.2014 - 0.32</span>
|
<span>xx.xx.2014 - 0.32</span>
|
||||||
<p>
|
<p>
|
||||||
- <br />
|
- Native application frame on Chrome 35+<br />
|
||||||
|
- Reworked Sensors tab (optimized graphs, new ui)<br />
|
||||||
|
- Small ui changes<br />
|
||||||
|
- Performance improvements<br />
|
||||||
</p>
|
</p>
|
||||||
<span>04.11.2014 - 0.31</span>
|
<span>04.11.2014 - 0.31</span>
|
||||||
<p>
|
<p>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 991 B |
Binary file not shown.
Before Width: | Height: | Size: 1 KiB |
BIN
images/options.png
Normal file
BIN
images/options.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
44
main.css
44
main.css
|
@ -114,6 +114,8 @@ input[type="number"]::-webkit-inner-spin-button {
|
||||||
#sensor-status {
|
#sensor-status {
|
||||||
float: right;
|
float: right;
|
||||||
|
|
||||||
|
margin-right: 10px;
|
||||||
|
|
||||||
height: 22px;
|
height: 22px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
@ -136,6 +138,48 @@ input[type="number"]::-webkit-inner-spin-button {
|
||||||
#sensor-status .on {
|
#sensor-status .on {
|
||||||
background-color: #0d8b13;
|
background-color: #0d8b13;
|
||||||
}
|
}
|
||||||
|
#options {
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
margin-top: -1px;
|
||||||
|
|
||||||
|
width: 21px;
|
||||||
|
height: 21px;
|
||||||
|
|
||||||
|
opacity: 0.6;
|
||||||
|
|
||||||
|
background-image: url('../images/options.png');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
#options:hover {
|
||||||
|
opacity: 0.70;
|
||||||
|
}
|
||||||
|
#options.active {
|
||||||
|
opacity: 0.70;
|
||||||
|
}
|
||||||
|
#options.active:hover {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
#options-window {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
|
||||||
|
right: 10px;
|
||||||
|
top: 32px;
|
||||||
|
|
||||||
|
padding: 5px;
|
||||||
|
|
||||||
|
line-height: 20px;
|
||||||
|
|
||||||
|
border: 1px solid silver;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
#options-window input {
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
#log {
|
#log {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/motor_outputs.css" media="all" />
|
<link type="text/css" rel="stylesheet" href="./tabs/motor_outputs.css" media="all" />
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/sensors.css" media="all" />
|
<link type="text/css" rel="stylesheet" href="./tabs/sensors.css" media="all" />
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/cli.css" media="all" />
|
<link type="text/css" rel="stylesheet" href="./tabs/cli.css" media="all" />
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/options.css" media="all" />
|
|
||||||
<link type="text/css" rel="stylesheet" href="./tabs/firmware_flasher.css" media="all" />
|
<link type="text/css" rel="stylesheet" href="./tabs/firmware_flasher.css" media="all" />
|
||||||
|
|
||||||
<script type="text/javascript" src="./js/libraries/google-analytics-bundle.js"></script>
|
<script type="text/javascript" src="./js/libraries/google-analytics-bundle.js"></script>
|
||||||
|
@ -45,7 +44,6 @@
|
||||||
<script type="text/javascript" src="./tabs/motor_outputs.js"></script>
|
<script type="text/javascript" src="./tabs/motor_outputs.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/sensors.js"></script>
|
<script type="text/javascript" src="./tabs/sensors.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/cli.js"></script>
|
<script type="text/javascript" src="./tabs/cli.js"></script>
|
||||||
<script type="text/javascript" src="./tabs/options.js"></script>
|
|
||||||
<script type="text/javascript" src="./tabs/firmware_flasher.js"></script>
|
<script type="text/javascript" src="./tabs/firmware_flasher.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -80,6 +78,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<a id="options" href="#" title="Options"></a>
|
||||||
<div id="sensor-status">
|
<div id="sensor-status">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="gyro" title="Gyroscope">Gyro</li>
|
<li class="gyro" title="Gyroscope">Gyro</li>
|
||||||
|
@ -106,7 +105,6 @@
|
||||||
<li class="tab_motor_outputs"><a href="#">Motor/Servo Outputs</a></li>
|
<li class="tab_motor_outputs"><a href="#">Motor/Servo Outputs</a></li>
|
||||||
<li class="tab_sensors"><a href="#">Raw Sensor Data</a></li>
|
<li class="tab_sensors"><a href="#">Raw Sensor Data</a></li>
|
||||||
<li class="tab_cli"><a href="#">CLI</a></li>
|
<li class="tab_cli"><a href="#">CLI</a></li>
|
||||||
<li class="tab_options"><a href="#">Options</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clear-both"></div>
|
<div class="clear-both"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
70
main.js
70
main.js
|
@ -111,6 +111,76 @@ $(document).ready(function() {
|
||||||
|
|
||||||
tab_initialize_default();
|
tab_initialize_default();
|
||||||
|
|
||||||
|
// options
|
||||||
|
$('a#options').click(function() {
|
||||||
|
var el = $(this);
|
||||||
|
|
||||||
|
if (!el.hasClass('active')) {
|
||||||
|
el.addClass('active');
|
||||||
|
el.after('<div id="options-window"></div>');
|
||||||
|
$('div#options-window').load('./tabs/options.html', function() {
|
||||||
|
ga_tracker.sendAppView('Options');
|
||||||
|
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
|
||||||
|
if (configuration_received) {
|
||||||
|
$('a.back').hide();
|
||||||
|
} else {
|
||||||
|
$('a.back').click(function() {
|
||||||
|
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
|
||||||
|
tab_initialize_default();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// if notifications are enabled, or wasn't set, check the notifications checkbox
|
||||||
|
chrome.storage.local.get('update_notify', function(result) {
|
||||||
|
if (typeof result.update_notify === 'undefined' || result.update_notify) {
|
||||||
|
$('div.notifications input').prop('checked', true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('div.notifications input').change(function() {
|
||||||
|
var check = $(this).is(':checked');
|
||||||
|
|
||||||
|
chrome.storage.local.set({'update_notify': check});
|
||||||
|
});
|
||||||
|
|
||||||
|
// if tracking is enabled, check the statistics checkbox
|
||||||
|
if (ga_tracking == true) {
|
||||||
|
$('div.statistics input').prop('checked', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('div.statistics input').change(function() {
|
||||||
|
var check = $(this).is(':checked');
|
||||||
|
|
||||||
|
ga_tracking = check;
|
||||||
|
|
||||||
|
ga_config.setTrackingPermitted(check);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(this).slideDown();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$('div#options-window').slideUp(function() {
|
||||||
|
el.removeClass('active');
|
||||||
|
$(this).empty().remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
chrome.app.window.create('./tabs/options.html', {
|
||||||
|
id: 'option-window',
|
||||||
|
frame: 'none',
|
||||||
|
resizable: false
|
||||||
|
}, function(createdWindow) {
|
||||||
|
// translate to user-selected language
|
||||||
|
localize();
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
|
||||||
// listen to all input change events and adjust the value within limits if necessary
|
// listen to all input change events and adjust the value within limits if necessary
|
||||||
$("#content").on('focus', 'input[type="number"]', function() {
|
$("#content").on('focus', 'input[type="number"]', function() {
|
||||||
var element = $(this);
|
var element = $(this);
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
.tab-options {
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
.tab-options input {
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
margin-top: 3px;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
|
@ -1,9 +1,6 @@
|
||||||
<div class="tab-options">
|
<div class="notifications">
|
||||||
<div class="notifications">
|
|
||||||
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label>
|
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="statistics">
|
<div class="statistics">
|
||||||
<label><input type="checkbox" /><span i18n="options_improve_configurator"></span></label>
|
<label><input type="checkbox" /><span i18n="options_improve_configurator"></span></label>
|
||||||
</div>
|
|
||||||
<a class="back" href="#" i18n="options_back"></a>
|
|
||||||
</div>
|
</div>
|
|
@ -1,45 +0,0 @@
|
||||||
function tab_initialize_options() {
|
|
||||||
ga_tracker.sendAppView('Options');
|
|
||||||
|
|
||||||
$('#content').load("./tabs/options.html", function() {
|
|
||||||
GUI.active_tab = 'options';
|
|
||||||
|
|
||||||
// translate to user-selected language
|
|
||||||
localize();
|
|
||||||
|
|
||||||
if (configuration_received) {
|
|
||||||
$('a.back').hide();
|
|
||||||
} else {
|
|
||||||
$('a.back').click(function() {
|
|
||||||
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
|
|
||||||
tab_initialize_default();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// if notifications are enabled, or wasn't set, check the notifications checkbox
|
|
||||||
chrome.storage.local.get('update_notify', function(result) {
|
|
||||||
if (typeof result.update_notify === 'undefined' || result.update_notify) {
|
|
||||||
$('div.notifications input').prop('checked', true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('div.notifications input').change(function() {
|
|
||||||
var check = $(this).is(':checked');
|
|
||||||
|
|
||||||
chrome.storage.local.set({'update_notify': check});
|
|
||||||
});
|
|
||||||
|
|
||||||
// if tracking is enabled, check the statistics checkbox
|
|
||||||
if (ga_tracking == true) {
|
|
||||||
$('div.statistics input').prop('checked', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$('div.statistics input').change(function() {
|
|
||||||
var check = $(this).is(':checked');
|
|
||||||
|
|
||||||
ga_tracking = check;
|
|
||||||
|
|
||||||
ga_config.setTrackingPermitted(check);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue