Merge remote-tracking branch 'cleanflight/development' into GUI-rework

# Conflicts:
#	main.js
#	tabs/landing.js
10.3.x-maintenance
skaman82 2015-11-11 22:08:19 +01:00
commit 0880343488
24 changed files with 52 additions and 90 deletions

View File

@ -1,4 +1,4 @@
<span>2015.10.31 - 0.67.0 - cleanflight</span>
<span>2015.10.31 - 1.0.0 - cleanflight</span>
<ul>
<li>Major GUI rework.</li>
<li>Support flashing of boards that have USB directly connected to MCU. (Device Firmware Update/DFU support).</li>

View File

@ -1,7 +1,7 @@
'use strict';
var CONFIGURATOR = {
'releaseDate': 1446278768375, // new Date().getTime() - Fri Oct 02 2015 20:50:49 GMT+0100 (GMT Daylight Time)
'releaseDate': 1447275720339, // new Date().getTime() - Wed Nov 11 2015 21:02:18 GMT+0000 (GMT)
// all versions are specified and compared using semantic versioning http://semver.org/
'apiVersionAccepted': '1.2.0',

View File

@ -237,5 +237,35 @@ 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,
{
size: 'small',
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('togglesmall');
});
$('.toggle').each(function(index, html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('toggle');
});
// Build link to in-use CF version documentation
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
if (callback) callback();
}
// initialize object into GUI variable
var GUI = new GUI_control();

65
main.js
View File

@ -101,66 +101,6 @@ $(document).ready(function () {
function content_ready() {
GUI.tab_switch_in_progress = false;
$('.togglesmall').each(function(index, html) {
var switchery = new Switchery(html,
{
size: 'small',
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('togglesmall');
});
$('.toggle').each(function(index, html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('toggle');
});
$('.togglemedium').each(function(index, html) {
var switchery = new Switchery(html,
{
className: 'switcherymid',
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('togglemedium');
});
// 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
});
$('.cf_tip').each(function() {
$(this).jBox('Tooltip', {
content: $(this).children('.cf_tooltiptext'),
delayOpen: 100,
delayClose: 100,
position: {
x: 'right',
y: 'center'
},
outside: 'x'
});
});
});
// Build link to in-use CF version documentation
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
}
switch (tab) {
@ -449,8 +389,3 @@ $("#showlog").on('click', function() {
});
// loading tooltip PLACEHOLDER

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"minimum_chrome_version": "38",
"version": "0.67.0",
"version": "1.0.0",
"author": "Hydra",
"name": "Cleanflight - Configurator",
"short_name": "cleanflight",

View File

@ -277,7 +277,7 @@ TABS.adjustments.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -283,7 +283,7 @@ TABS.auxiliary.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -62,7 +62,7 @@ TABS.cli.initialize = function (callback) {
// give input element user focus
textarea.focus();
if (callback) callback();
GUI.content_ready(callback);
});
};

View File

@ -453,7 +453,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -113,7 +113,7 @@ TABS.dataflash.initialize = function (callback) {
}
if (callback) callback();
GUI.content_ready(callback);
}
// IO related methods

View File

@ -516,7 +516,7 @@ TABS.firmware_flasher.initialize = function (callback) {
}
});
if (callback) callback();
GUI.content_ready(callback);
});
};

View File

@ -71,7 +71,7 @@ TABS.gps.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -12,7 +12,7 @@ TABS.help.initialize = function (callback) {
$('#content').load("./tabs/help.html", function () {
localize();
if (callback) callback();
GUI.content_ready(callback);
});
};

View File

@ -37,8 +37,7 @@ TABS.landing.initialize = function (callback) {
$(this).data('state2', state);
});
if (callback) callback();
GUI.content_ready(callback);
});
};

View File

@ -288,7 +288,7 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
});
if (callback) callback();
GUI.content_ready(callback);
}
function findLed(x, y) {

View File

@ -110,7 +110,7 @@ TABS.logging.initialize = function (callback) {
}
});
if (callback) callback();
GUI.content_ready(callback);
}
function print_head() {

View File

@ -149,7 +149,7 @@ TABS.modes.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -450,7 +450,7 @@ TABS.motors.initialize = function (callback) {
// enable Status and Motor data pulling
GUI.interval_add('motor_and_status_pull', get_status, 50, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -388,9 +388,7 @@ TABS.pid_tuning.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) {
callback();
}
GUI.content_ready(callback);
}
};

View File

@ -208,7 +208,7 @@ TABS.ports.initialize = function (callback, scrollPosition) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
function on_save_handler() {

View File

@ -458,7 +458,7 @@ TABS.receiver.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -448,7 +448,7 @@ TABS.sensors.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
});
};

View File

@ -192,7 +192,7 @@ TABS.servos.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
GUI.content_ready(callback);
}
};

View File

@ -193,7 +193,7 @@ TABS.setup.initialize = function (callback) {
GUI.interval_add('setup_data_pull_fast', get_fast_data, 33, true); // 30 fps
GUI.interval_add('setup_data_pull_slow', get_slow_data, 250, true); // 4 fps
if (callback) callback();
GUI.content_ready(callback);
}
};