From 168b412089b9e845f171859e430c0bf693181b3b Mon Sep 17 00:00:00 2001 From: Kristjan Vaga Date: Tue, 17 Nov 2015 00:53:40 +0200 Subject: [PATCH 1/7] Fix for firmware flasher checkboxes not restoring saved state issue #274. --- js/gui.js | 59 +++++++++++++++++++++------------------- tabs/firmware_flasher.js | 40 ++++++++++++++------------- 2 files changed, 52 insertions(+), 47 deletions(-) diff --git a/js/gui.js b/js/gui.js index 466b35a1..57ba8100 100644 --- a/js/gui.js +++ b/js/gui.js @@ -24,14 +24,14 @@ var GUI_control = function () { 'configuration', 'gps', 'led_strip', - 'logging', + 'logging', 'dataflash', 'modes', 'motors', 'pid_tuning', 'ports', 'receiver', - 'sensors', + 'sensors', 'servos', 'setup' ]; @@ -238,39 +238,42 @@ GUI_control.prototype.tab_switch_cleanup = function (callback) { }; GUI_control.prototype.content_ready = function (callback) { - - $('.togglesmall').each(function(index, html) { - var switchery = new Switchery(html, - { + + $('.togglesmall').each(function(index, elem) { + var switchery = new Switchery(elem, { size: 'small', - color: '#59aa29', - secondaryColor: '#c4c4c4' + color: '#59aa29', + secondaryColor: '#c4c4c4' }); - - $(html).removeClass('togglesmall'); + $(elem).on("change", function (evt) { + switchery.setPosition(); + }); + $(elem).removeClass('togglesmall'); }); - $('.toggle').each(function(index, html) { - var switchery = new Switchery(html, - { - color: '#59aa29', - secondaryColor: '#c4c4c4' + $('.toggle').each(function(index, elem) { + var switchery = new Switchery(elem, { + color: '#59aa29', + secondaryColor: '#c4c4c4' }); - - $(html).removeClass('toggle'); + $(elem).on("change", function (evt) { + switchery.setPosition(); + }); + $(elem).removeClass('toggle'); }); - $('.togglemedium').each(function(index, html) { - var switchery = new Switchery(html, - { + $('.togglemedium').each(function(index, elem) { + var switchery = new Switchery(elem, { className: 'switcherymid', - color: '#59aa29', - secondaryColor: '#c4c4c4' + color: '#59aa29', + secondaryColor: '#c4c4c4' }); - - $(html).removeClass('togglemedium'); + $(elem).on("change", function (evt) { + switchery.setPosition(); + }); + $(elem).removeClass('togglemedium'); }); - + // Build link to in-use CF version documentation var documentationButton = $('div#content #button-documentation'); documentationButton.html("Documentation for "+CONFIG.flightControllerVersion); @@ -279,12 +282,12 @@ GUI_control.prototype.content_ready = function (callback) { // loading tooltip jQuery(document).ready(function($) { $('cf_tip').each(function() { // Grab all ".cf_tip" elements, and for each... - log(this); // ...print out "this", which now refers to each ".cf_tip" DOM element + log(this); // ...print out "this", which now refers to each ".cf_tip" DOM element }); - $('.cf_tip').each(function() { + $('.cf_tip').each(function() { $(this).jBox('Tooltip', { - content: $(this).children('.cf_tooltiptext'), + content: $(this).children('.cf_tooltiptext'), delayOpen: 100, delayClose: 100, position: { diff --git a/tabs/firmware_flasher.js b/tabs/firmware_flasher.js index f46dd710..d4747a33 100755 --- a/tabs/firmware_flasher.js +++ b/tabs/firmware_flasher.js @@ -8,11 +8,11 @@ TABS.firmware_flasher.initialize = function (callback) { GUI.active_tab = 'firmware_flasher'; googleAnalytics.sendAppView('Firmware Flasher'); } - - + + var intel_hex = false, // standard intel hex in string format parsed_hex = false; // parsed raw hex in array format - + $('#content').load("./tabs/firmware_flasher.html", function () { // translate to user-selected language localize(); @@ -137,7 +137,7 @@ TABS.firmware_flasher.initialize = function (callback) { $.get('https://api.github.com/repos/cleanflight/cleanflight/releases', function (releases){ processReleases(releases); TABS.firmware_flasher.releases = releases; - + // bind events $('select[name="release"]').change(function() { if (!GUI.connect_lock) { @@ -155,7 +155,7 @@ TABS.firmware_flasher.initialize = function (callback) { } $('select[name="release"]').empty().append(''); }); - + // UI Hooks $('a.load_file').click(function () { @@ -221,7 +221,7 @@ TABS.firmware_flasher.initialize = function (callback) { $("a.load_remote_file").removeClass('disabled'); } }); - + $('a.load_remote_file').click(function (evt) { if ($('select[name="release"]').val() == "0") { @@ -249,34 +249,34 @@ TABS.firmware_flasher.initialize = function (callback) { d = new Date(data.commit.author.date), offset = d.getTimezoneOffset() / 60, date; - + date = d.getFullYear() + '.' + ('0' + (d.getMonth() + 1)).slice(-2) + '.' + ('0' + (d.getDate())).slice(-2); date += ' @ ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2); date += (offset > 0) ? ' GMT+' + offset : ' GMT' + offset; - + $('div.git_info .committer').text(data.commit.author.name); $('div.git_info .date').text(date); $('div.git_info .hash').text(data.sha.slice(0, 7)).prop('href', 'https://github.com/cleanflight/cleanflight/commit/' + data.sha); - + $('div.git_info .message').text(data.commit.message); - + $('div.git_info').slideDown(); }); } - + $('div.release_info .target').text(summary.target); - + var status_e = $('div.release_info .status'); if (summary.status == 'release-candidate') { $('div.release_info .status').html(chrome.i18n.getMessage('firmwareFlasherReleaseStatusReleaseCandidate')).show(); } else { status_e.hide(); } - + $('div.release_info .name').text(summary.name).prop('href', summary.releaseUrl); $('div.release_info .date').text(summary.date); $('div.release_info .file').text(summary.file).prop('href', summary.url); - + var formattedNotes = summary.notes.trim('\r').replace(/\r/g, '
'); $('div.release_info .notes').html(formattedNotes); @@ -303,7 +303,7 @@ TABS.firmware_flasher.initialize = function (callback) { $('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware')); } }); - + $('a.flash_firmware').click(function () { if (!$(this).hasClass('disabled')) { if (!GUI.connect_lock) { // button disabled while flashing is in progress @@ -424,6 +424,8 @@ TABS.firmware_flasher.initialize = function (callback) { chrome.storage.local.set({'no_reboot_sequence': status}); }); + + $('input.updating').change(); }); chrome.storage.local.get('flash_manual_baud', function (result) { @@ -436,22 +438,21 @@ TABS.firmware_flasher.initialize = function (callback) { // bind UI hook so the status is saved on change $('input.flash_manual_baud').change(function() { var status = $(this).is(':checked'); - chrome.storage.local.set({'flash_manual_baud': status}); }); - + $('input.flash_manual_baud').change(); }); chrome.storage.local.get('flash_manual_baud_rate', function (result) { $('#flash_manual_baud_rate').val(result.flash_manual_baud_rate); - + // bind UI hook so the status is saved on change $('#flash_manual_baud_rate').change(function() { var baud = parseInt($('#flash_manual_baud_rate').val()); chrome.storage.local.set({'flash_manual_baud_rate': baud}); }); - + $('input.flash_manual_baud_rate').change(); }); @@ -507,6 +508,7 @@ TABS.firmware_flasher.initialize = function (callback) { $('input.erase_chip').change(function () { chrome.storage.local.set({'erase_chip': $(this).is(':checked')}); }); + }); $(document).keypress(function (e) { From 126f05b9b770954e379fdeee4e0ca6291fc8b428 Mon Sep 17 00:00:00 2001 From: Kristjan Vaga Date: Tue, 17 Nov 2015 01:07:33 +0200 Subject: [PATCH 2/7] Erase chip checkbox change event. --- tabs/firmware_flasher.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tabs/firmware_flasher.js b/tabs/firmware_flasher.js index d4747a33..bcfe3557 100755 --- a/tabs/firmware_flasher.js +++ b/tabs/firmware_flasher.js @@ -509,6 +509,8 @@ TABS.firmware_flasher.initialize = function (callback) { chrome.storage.local.set({'erase_chip': $(this).is(':checked')}); }); + $('input.erase_chip').change(); + }); $(document).keypress(function (e) { From ee2560104f0fd0f0468179dfd45fa82cf7c5630a Mon Sep 17 00:00:00 2001 From: Alen Date: Wed, 18 Nov 2015 19:52:10 +0100 Subject: [PATCH 3/7] rssi_channel range is from 1-12 in firmware --- tabs/receiver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabs/receiver.js b/tabs/receiver.js index 35a7cac4..4bab6140 100644 --- a/tabs/receiver.js +++ b/tabs/receiver.js @@ -183,7 +183,7 @@ TABS.receiver.initialize = function (callback) { // rssi var rssi_channel_e = $('select[name="rssi_channel"]'); rssi_channel_e.append(''); - for (var i = 0; i < RC.active_channels; i++) { + for (var i = 1; i < RC.active_channels + 1; i++) { rssi_channel_e.append(''); } From b27b65a8972c0e427dad0487b233ed1c13ae1392 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 28 Nov 2015 11:32:41 +0000 Subject: [PATCH 4/7] Update sponsors panel. --- tabs/landing.html | 1 + 1 file changed, 1 insertion(+) diff --git a/tabs/landing.html b/tabs/landing.html index 9839e976..df1557f8 100644 --- a/tabs/landing.html +++ b/tabs/landing.html @@ -53,6 +53,7 @@
  • Scorpion Power Systems
  • MultiGP
  • +
  • MakeItBuildIt
  • From 85e4290d5aa9553f031936068ab1efd62e7ab2de Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 28 Nov 2015 15:22:42 +0000 Subject: [PATCH 5/7] Removing an unneeded console.log call --- tabs/ports.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/tabs/ports.js b/tabs/ports.js index 94345d68..5352b31d 100644 --- a/tabs/ports.js +++ b/tabs/ports.js @@ -69,8 +69,6 @@ TABS.ports.initialize = function (callback, scrollPosition) { MSP.send_message(MSP_codes.MSP_CF_SERIAL_CONFIG, false, false, on_configuration_loaded_handler); function on_configuration_loaded_handler() { - console.log(SERIAL_CONFIG.ports); - $('#content').load("./tabs/ports.html", on_tab_loaded_handler); board_definition = BOARD.find_board_definition(CONFIG.boardIdentifier); From 014990159786a8f250d12a380290b3a08ef77adc Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 28 Nov 2015 15:23:48 +0000 Subject: [PATCH 6/7] Prepare for release. --- js/data_storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/data_storage.js b/js/data_storage.js index 2d75ed18..02aa21ea 100755 --- a/js/data_storage.js +++ b/js/data_storage.js @@ -1,7 +1,7 @@ 'use strict'; var CONFIGURATOR = { - 'releaseDate': 1447275720339, // new Date().getTime() - Wed Nov 11 2015 21:02:18 GMT+0000 (GMT) + 'releaseDate': 1448724175378, // new Date().getTime() - Sat Nov 28 2015 15:22:51 GMT+0000 (GMT Standard Time) // all versions are specified and compared using semantic versioning http://semver.org/ 'apiVersionAccepted': '1.2.0', From 4867529769bb4905e8e50548c5e713874b9a7281 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 28 Nov 2015 15:24:34 +0000 Subject: [PATCH 7/7] Update changelog --- changelog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.html b/changelog.html index 9dcc83ee..84dbb40a 100644 --- a/changelog.html +++ b/changelog.html @@ -1,7 +1,7 @@ -2015.11.14 - 1.1.0 - cleanflight +2015.11.28 - 1.1.0 - cleanflight
    • Support Cleanflight API 1.14.0.
    • -
    • Minor GUI cleanups and fixes.
    • +
    • GUI cleanups and fixes.
    2015.11.11 - 1.0.0 - cleanflight