1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Merge branch 'new_stuff' of

https://github.com/skaman82/cleanflight-configurator into
skaman82-new_stuff

Fix up messages.json formatting.

Conflicts:
	_locales/en/messages.json
This commit is contained in:
Dominic Clifton 2015-12-15 00:29:11 +01:00
commit bd98aca67f
22 changed files with 724 additions and 130 deletions

77
main.js
View file

@ -42,6 +42,13 @@ $(document).ready(function () {
console.log('Application version expired');
GUI.log('You are using an old version of ' + chrome.runtime.getManifest().name + '. There may be a more recent version with improvements and fixes.');
}
chrome.storage.local.get('logopen', function (result) {
if (result.logopen) {
$("#showlog").trigger('click');
}
});
// log webgl capability
// it would seem the webgl "enabling" through advanced settings will be ignored in the future
@ -306,6 +313,45 @@ $(document).ready(function () {
}
}
});
$("#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);
});
var profile_e = $('select[name="profilechange"]');
profile_e.change(function () {
var profile = parseInt($(this).val());
MSP.send_message(MSP_codes.MSP_SELECT_SETTING, [profile], false, function () {
GUI.log(chrome.i18n.getMessage('pidTuningLoadedProfile', [profile + 1]));
updateActivatedTab();
});
});
});
function catch_startup_time(startTime) {
@ -361,31 +407,10 @@ String.prototype.format = function () {
});
};
/** log trigger **/
$(document).ready(function () {
$("#showlog").on('click', function() {
var state = $(this).data('state');
if ( state ) {
$("#log").animate({height: 27}, 200);
$("#log").removeClass('active');
$("#content").removeClass('logopen');
$(".tab_container").removeClass('logopen');
$("#scrollicon").removeClass('active');
state = false;
}else{
$("#log").animate({height: 111}, 200);
$("#log").addClass('active');
$("#content").addClass('logopen');
$(".tab_container").addClass('logopen');
$("#scrollicon").addClass('active');
state = true;
}
$(this).text(state ? 'Hide Log' : 'Show Log');
$(this).data('state', state);
});
});
function updateActivatedTab() {
var activeTab = $('#tabs > ul li.active');
activeTab.removeClass('active');
$('a', activeTab).trigger('click');
}