dedicated options icon/button (live access)
parent
8c4a4277f8
commit
6049cf0ec4
|
@ -3,7 +3,7 @@
|
|||
"message": "Receive desktop <strong>notification</strong> when application updates"
|
||||
},
|
||||
"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": {
|
||||
"message": "Leave Options"
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<span>xx.xx.2014 - 0.32</span>
|
||||
<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>
|
||||
<span>04.11.2014 - 0.31</span>
|
||||
<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.0 KiB |
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 {
|
||||
float: right;
|
||||
|
||||
margin-right: 10px;
|
||||
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
@ -136,6 +138,48 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
#sensor-status .on {
|
||||
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 {
|
||||
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/sensors.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" />
|
||||
|
||||
<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/sensors.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>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -80,6 +78,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<a id="options" href="#" title="Options"></a>
|
||||
<div id="sensor-status">
|
||||
<ul>
|
||||
<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_sensors"><a href="#">Raw Sensor Data</a></li>
|
||||
<li class="tab_cli"><a href="#">CLI</a></li>
|
||||
<li class="tab_options"><a href="#">Options</a></li>
|
||||
</ul>
|
||||
<div class="clear-both"></div>
|
||||
</div>
|
||||
|
|
70
main.js
70
main.js
|
@ -111,6 +111,76 @@ $(document).ready(function() {
|
|||
|
||||
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
|
||||
$("#content").on('focus', 'input[type="number"]', function() {
|
||||
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">
|
||||
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label>
|
||||
</div>
|
||||
<div class="statistics">
|
||||
<label><input type="checkbox" /><span i18n="options_improve_configurator"></span></label>
|
||||
</div>
|
||||
<a class="back" href="#" i18n="options_back"></a>
|
||||
<div class="notifications">
|
||||
<label><input type="checkbox" /><span i18n="options_receive_app_notifications"></span></label>
|
||||
</div>
|
||||
<div class="statistics">
|
||||
<label><input type="checkbox" /><span i18n="options_improve_configurator"></span></label>
|
||||
</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…
Reference in New Issue