removing my backup files

10.3.x-maintenance
skaman82 2015-11-01 14:24:56 +01:00
parent 0fe989c2b3
commit 3b3ad55917
6 changed files with 0 additions and 1422 deletions

View File

@ -1,181 +0,0 @@
.tab-configuration .help {
padding: 10px;
background-color: #ffcb18;
margin-bottom: 10px;
}
.tab-configuration table {
margin-bottom: 10px;
border-collapse: collapse;
}
.tab-configuration table,
.tab-configuration table th,
.tab-configuration table td {
padding: 4px;
border: 1px solid #8b8b8b;
}
.tab-configuration table tr td:first-child {
text-align: center;
}
.tab-configuration table td {
padding: 2px 10px;
}
.tab-configuration table thead tr:first-child,
.tab-configuration table tr:nth-child(even) {
background-color: #ececec;
}
.tab-configuration {
position: relative;
}
.tab-configuration .groupTitle {
padding: 0 0 5px 0;
margin: 0 0 10px 0;
font-size: 16px;
border-bottom: 1px solid #dddddd;
}
.tab-configuration .leftWrapper {
float: left;
width: 50%;
margin: 0 0 10px 0;
}
.tab-configuration .rightWrapper {
float: left;
width: calc(50% - 10px);
margin: 0 0 10px 10px;
}
.tab-configuration .mixerPreview {
width: 180px;
height: 180px;
}
.tab-configuration .mixerPreview img {
display: block;
width: 100%;
height: 100%;
}
.tab-configuration select.mixerList {
width: 180px;
height: 20px;
margin-top: 10px;
font-weight: bold;
border: 1px solid silver;
}
.tab-configuration dl.features dt {
float: left;
width: 10px;
height: 18px;
line-height: 18px;
}
.tab-configuration dl.features dt input {
margin-top: 2px;
}
.tab-configuration dl.features dd {
margin: 0 0 0 20px;
height: 18px;
line-height: 18px;
}
.tab-configuration .number {
margin-bottom: 5px;
clear: left;
}
.tab-configuration .number input {
width: 60px;
height: 20px;
line-height: 20px;
text-align: right;
border: 1px solid silver;
}
.tab-configuration .number input.disabled {
width: 50px;
padding: 0px 5px;
background-color: #ececec;
}
.tab-configuration .number span {
margin-left: 10px;
line-height: 20px;
}
.tab-configuration .gps .line {
clear: left;
}
.tab-configuration .gps select {
float: left;
width: 100px;
height: 20px;
margin: 0 10px 5px 0;
border: 1px solid silver;
}
.tab-configuration .gps span {
line-height: 20px;
}
.tab-configuration .serialRX {
width: 160px;
border: 1px solid silver;
margin-bottom: 5px;
}
.tab-configuration .current .checkbox {
margin-top: 2px;
}
.tab-configuration .current .checkbox div {
float: left;
width: 60px;
}
.tab-configuration .current .checkbox div input {
display: block;
margin: 2px auto 0 auto;
}
.tab-configuration .current .checkbox span {
margin-left: 15px;
}
.tab-configuration .disarm .checkbox {
margin-top: 2px;
}
.tab-configuration .disarm .checkbox div {
float: left;
width: 60px;
margin-bottom: 5px;
}
.tab-configuration .disarm .checkbox div input {
display: block;
margin: 2px auto 0 auto;
}
.tab-configuration .disarm .checkbox span {
margin-left: 15px;
}
.tab-configuration .save {
display: block;
float: right;
height: 28px;
line-height: 28px;
padding: 0 15px 0 15px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
.tab-configuration .save:hover {
background-color: #dedcdc;
}

View File

@ -1,327 +0,0 @@
<div class="tab-configuration">
<div class="help">
<p i18n="configurationFeaturesHelp"></p>
</div>
<div class="leftWrapper">
<div class="groupTitle" i18n="configurationMixer"></div>
<div class="mixerPreview">
<img src="./resources/motor_order/custom.svg" />
</div>
<select class="mixerList">
<!-- list generated here -->
</select>
</div>
<div class="rightWrapper">
<div class="groupTitle" i18n="configurationEscFeatures"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features esc">
<!-- table generated here -->
</tbody>
</table>
<!-- -->
<div class="disarm">
<div class="number disarmdelay" style="display: none;">
<label>
<input type="number" name="autodisarmdelay" min="0" max="60" />
<span i18n="configurationAutoDisarmDelay"></span>
</label>
</div>
<div class="checkbox">
<label>
<div>
<input type="checkbox" name="disarmkillswitch" />
</div>
<span i18n="configurationDisarmKillSwitch"></span>
</label>
</div>
</div>
<!-- -->
<div class="number">
<label>
<input type="number" name="minthrottle" min="0" max="2000" />
<span i18n="configurationThrottleMinimum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="midthrottle" min="0" max="2000" />
<span i18n="configurationThrottleMid"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="maxthrottle" min="0" max="2000" />
<span i18n="configurationThrottleMaximum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="mincommand" min="0" max="2000" />
<span i18n="configurationThrottleMinimumCommand"></span>
</label>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="groupTitle" i18n="configurationBoardAlignment"></div>
<div class="number">
<label>
<input type="number" name="board_align_roll" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentRoll"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="board_align_pitch" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentPitch"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="board_align_yaw" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentYaw"></span>
</label>
</div>
</div>
<div class="rightWrapper">
<div class="groupTitle" i18n="configurationAccelTrims"></div>
<div class="number">
<label>
<input type="number" name="roll" min="-300" max="300" />
<span i18n="configurationAccelTrimRoll"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="pitch" min="-300" max="300" />
<span i18n="configurationAccelTrimPitch"></span>
</label>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="groupTitle" i18n="configurationReceiver"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features rxMode">
<!-- table generated here -->
</tbody>
</table>
<div class="groupTitle" i18n="configurationSerialRX"></div>
<select class="serialRX" size="4">
<!-- list generated here -->
</select>
<div class="help">
<p i18n="configurationSerialRXHelp"></p>
</div>
<div class="groupTitle" i18n="configurationFailsafe"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features rxFailsafe">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="failsafe_throttle" min="0" max="2000" />
<span i18n="configurationThrottleFailsafe"></span>
</label>
</div>
</div>
<div class="rightWrapper current voltage">
<div class="groupTitle" i18n="configurationBatteryVoltage"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features batteryVoltage">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="mincellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryMinimum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="maxcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryMaximum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="warningcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryWarning"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="voltagescale" step="1" min="10" max="255" />
<span i18n="configurationBatteryScale"></span>
</label>
</div>
<div class="groupTitle" i18n="configurationCurrent"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features batteryCurrent">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="currentscale" step="1" min="-1000" max="1000" />
<span i18n="configurationCurrentScale"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="currentoffset" step="1" min="0" max="3300" />
<span i18n="configurationCurrentOffset"></span>
</label>
</div>
<div class="checkbox">
<label>
<div>
<input type="checkbox" name="multiwiicurrentoutput" />
</div>
<span i18n="configurationBatteryMultiwiiCurrent"></span>
</label>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper rssi">
<div class="groupTitle" i18n="configurationRSSI"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features rssi">
<!-- table generated here -->
</tbody>
</table>
</div>
<div class="rightWrapper system">
<div class="groupTitle" i18n="configurationSystem"></div>
<div class="number">
<label>
<input type="number" name="looptime" step="100" min="0" max="9000"/>
<span i18n="configurationLoopTime"></span>
</label>
</div>
<div class="number">
<label>
<input type="text" name="looptimehz" readonly="readonly" class="disabled"/>
<span i18n="configurationCalculatedCyclesSec"></span>
</label>
</div>
<p class="help" i18n="configurationLoopTimeHelp"></p>
</div>
<div class="clear-both"></div>
<div class="leftWrapper gps">
<div class="groupTitle" i18n="configurationGPS"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features gps">
<!-- table generated here -->
</tbody>
</table>
<div class="line">
<select class="gps_protocol">
<!-- list generated here -->
</select>
<span i18n="configurationGPSProtocol"></span>
</div>
<div class="line">
<select class="gps_baudrate">
<!-- list generated here -->
</select>
<span i18n="configurationGPSBaudrate"></span>
</div>
<div class="line">
<select class="gps_ubx_sbas">
<!-- list generated here -->
</select>
<span i18n="configurationGPSubxSbas"></span>
</div>
<div class="number">
<label>
<input type="number" name="mag_declination" step="0.1" min="-180" max="180" />
<span i18n="configurationMagDeclination"></span>
</label>
</div>
<div class="help">
<p i18n="configurationGPSHelp"></p>
</div>
</div>
<div class="rightWrapper">
<div class="groupTitle" i18n="configurationFeatures"></div>
<table>
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureName"></th>
<th i18n="configurationFeatureDescription"></th>
</tr>
</thead>
<tbody class="features other">
<!-- table generated here -->
</tbody>
</table>
</div>
<div class="clear-both"></div>
<div class="buttons">
<a class="save" href="#" i18n="configurationButtonSave"></a>
</div>
</div>

View File

@ -1,220 +0,0 @@
.tab-firmware_flasher .info {
margin: 10px 0 10px 0;
position: relative;
}
.tab-firmware_flasher .info .progressLabel {
position: absolute;
width: 100%;
height: 26px;
top: 0;
left: 0;
text-align: center;
line-height: 24px;
color: white;
font-weight: bold;
/* text-shadow: 1px 0px 2px rgba(0, 0, 0, 0.9);*/
}
.tab-firmware_flasher .info .progressLabel a {
color: white;
}
.tab-firmware_flasher .info .progressLabel a:hover {
text-decoration: underline;
}
.tab-firmware_flasher .info .progress {
width: 100%;
height: 26px;
border: 1px solid silver;
}
.tab-firmware_flasher .info .progress {
-webkit-appearance: none;
}
.tab-firmware_flasher .info .progress::-webkit-progress-bar {
background-color: #343434;
}
.tab-firmware_flasher .info .progress::-webkit-progress-value {
background-color: #F86008;
}
.tab-firmware_flasher .info .progress.valid::-webkit-progress-bar {
background-color: #73BE45;
}
.tab-firmware_flasher .info .progress.valid::-webkit-progress-value {
background-color: #73BE45;
}
.tab-firmware_flasher .info .progress.invalid::-webkit-progress-bar {
background-color: #A62E32;
}
.tab-firmware_flasher .info .progress.invalid::-webkit-progress-value {
background-color: #A62E32;
}
.tab-firmware_flasher .options {
position: relative;
margin-bottom: 10px;
padding: 5px;
line-height: 18px;
border: 1px dotted silver;
}
.tab-firmware_flasher .options label input {
float: left;
margin-top: 2px;
}
.tab-firmware_flasher .options label span {
font-weight: bold;
margin-left: 6px;
}
.tab-firmware_flasher .options select {
height: 20px;
border: 1px solid silver;
}
.tab-firmware_flasher .options .releases select {
width: 280px;
}
.tab-firmware_flasher .option.releases {
margin: 0 0 2px 0;
line-height: 20px;
}
.tab-firmware_flasher .options .description {
position: absolute;
left: 300px;
font-style: italic;
color: #818181;
}
.tab-firmware_flasher .options .flash_on_connect_wrapper {
display: none;
}
.tab-firmware_flasher .options .manual_baud_rate select {
width: 70px;
}
.tab-firmware_flasher .release_info {
display: none;
margin-bottom: 10px;
border: 1px solid silver;
}
.tab-firmware_flasher .release_info .title {
line-height: 20px;
text-align: center;
font-weight: bold;
color: white;
border-bottom: 1px solid silver;
background-color: #3f4241;
}
.tab-firmware_flasher .release_info .target {
color: blue;
}
.tab-firmware_flasher .release_info p {
padding: 5px;
}
.tab-firmware_flasher .release_info p a {
font-weight: bold;
}
.tab-firmware_flasher .release_info p a:hover {
text-decoration: underline;
}
.tab-firmware_flasher .release_info .notes {
padding: 5px;
}
.tab-firmware_flasher .git_info {
display: none;
margin-bottom: 10px;
border: 1px solid silver;
}
.tab-firmware_flasher .git_info .title {
line-height: 20px;
text-align: center;
font-weight: bold;
color: white;
border-bottom: 1px solid silver;
background-color: #3f4241;
}
.tab-firmware_flasher .git_info p {
padding: 5px;
}
.tab-firmware_flasher .git_info p a {
font-weight: bold;
}
.tab-firmware_flasher .git_info p a:hover {
text-decoration: underline;
}
.warning {
border: 1px solid silver;
}
.warning .title {
line-height: 20px;
text-align: center;
font-weight: bold;
color: white;
border-bottom: 1px solid silver;
background-color: #cd4c4c;
}
.warning p {
padding: 5px;
}
.tab-firmware_flasher .buttons {
width: calc(100% - 20px);
margin-top: 10px;
bottom: 10px;
}
.tab-firmware_flasher .buttons a {
display: block;
float: left;
margin: 0 10px 0 0;
padding: 0 15px 0 15px;
height: 28px;
line-height: 28px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
.tab-firmware_flasher .buttons a:hover {
background-color: #dedcdc;
}
.tab-firmware_flasher .buttons a.flash_firmware.locked {
background-color: #b8b8b8;
}
.tab-firmware_flasher .buttons a.flash_firmware.locked:hover {
cursor: default;
background-color: #b8b8b8;
}
.tab-firmware_flasher .buttons a.load_remote_file.locked {
background-color: #b8b8b8;
}
.tab-firmware_flasher .buttons a.load_remote_file.locked:hover {
cursor: default;
background-color: #b8b8b8;
}
.tab-firmware_flasher .buttons a.back {
float: right;
margin: 0;
}

View File

@ -1,96 +0,0 @@
<div class="tab-firmware_flasher">
<div class="options">
<div class="option releases">
<select name="release">
<option value="0">Loading ...</option>
</select>
<span class="description" i18n="firmwareFlasherOnlineReleasesDescription"></span>
</div>
<div class="option">
<label>
<input class="updating" type="checkbox" />
<span i18n="firmwareFlasherNoReboot"></span>
</label>
<span class="description" i18n="firmwareFlasherNoRebootDescription"></span>
</div>
<div class="option flash_on_connect_wrapper">
<label>
<input class="flash_on_connect" type="checkbox" />
<span i18n="firmwareFlasherFlashOnConnect"></span>
</label>
<span class="description" i18n="firmwareFlasherFlashOnConnectDescription"></span>
</div>
<div class="option">
<label>
<input class="erase_chip" type="checkbox" />
<span i18n="firmwareFlasherFullChipErase"></span>
</label>
<span class="description" i18n="firmwareFlasherFullChipEraseDescription"></span>
</div>
<div class="option manual_baud_rate">
<label>
<input class="flash_manual_baud" type="checkbox" />
<span i18n="firmwareFlasherManualBaud"></span>
<select id="flash_manual_baud_rate" title="Baud Rate">
<option value="921600">921600</option>
<option value="460800">460800</option>
<option value="256000" selected="selected">256000</option>
<option value="230400">230400</option>
<option value="115200">115200</option>
<option value="57600">57600</option>
<option value="38400">38400</option>
<option value="28800">28800</option>
<option value="19200">19200</option>
</select>
</label>
<span class="description" i18n="firmwareFlasherManualBaudDescription"></span>
</div>
<div class="option">
<label>
<input class="show_development_releases" type="checkbox" />
<span i18n="firmwareFlasherShowDevelopmentReleases"></span>
</label>
<span class="description" i18n="firmwareFlasherShowDevelopmentReleasesDescription"></span>
</div>
</div>
<div class="clear-both"></div>
<div class="git_info">
<div class="title" i18n="firmwareFlasherGithubInfoHead"></div>
<p>
<strong i18n="firmwareFlasherHash"></strong> <a i18n_title="firmwareFlasherUrl" class="hash" href="#" target="_blank"></a><br />
<strong i18n="firmwareFlasherCommiter"></strong> <span class="committer"></span><br />
<strong i18n="firmwareFlasherDate"></strong> <span class="date"></span><br />
<strong i18n="firmwareFlasherMessage"></strong> <span class="message"></span>
</p>
</div>
<div class="release_info">
<div class="title" i18n="firmwareFlasherReleaseSummaryHead"></div>
<p>
<strong i18n="firmwareFlasherReleaseTarget"></strong> <span class="target"></span><br />
<strong i18n="firmwareFlasherReleaseName"></strong> <a i18n_title="firmwareFlasherReleaseUrl" class="name" href="#" target="_blank"></a><br />
<strong i18n="firmwareFlasherReleaseFile"></strong> <a i18n_title="firmwareFlasherReleaseFileUrl" class="file" href="#" target="_blank"></a><br />
<strong i18n="firmwareFlasherReleaseDate"></strong> <span class="date"></span><br />
<strong i18n="firmwareFlasherReleaseStatus"></strong> <span class="status"></span><br />
<strong i18n="firmwareFlasherReleaseNotes"></strong> <br />
<div class=notes></div>
</p>
</div>
<div class="warning">
<div class="title" i18n="firmwareFlasherWarninghead"></div>
<p i18n="firmwareFlasherWarningText">
<p i18n="firmwareFlasherTargetWarning">
</p>
</div>
<div class="info">
<progress class="progress" value="0" min="0" max="100"></progress>
<span class="progressLabel" i18n="firmwareFlasherLoadFirmwareFile"></span>
</div>
<div class="buttons">
<a class="load_file" href="#" i18n="firmwareFlasherButtonLoadLocal"></a>
<a class="load_remote_file locked" href="#" i18n="firmwareFlasherButtonLoadOnline"></a>
<a class="flash_firmware locked" href="#" i18n="firmwareFlasherFlashFirmware"></a>
</div>
</div>

View File

@ -1,529 +0,0 @@
'use strict';
TABS.firmware_flasher = {};
TABS.firmware_flasher.initialize = function (callback) {
var self = this;
if (GUI.active_tab != 'firmware_flasher') {
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();
function parse_hex(str, callback) {
// parsing hex in different thread
var worker = new Worker('./js/workers/hex_parser.js');
// "callback"
worker.onmessage = function (event) {
callback(event.data);
};
// send data/string over for processing
worker.postMessage(str);
}
$('input.show_development_releases').click(function(){
buildFirmwareOptions();
});
var buildFirmwareOptions = function(){
var releases_e = $('select[name="release"]').empty();
var showDevReleases = ($('input.show_development_releases').is(':checked'));
releases_e.append($("<option value='0'>{0}</option>".format(chrome.i18n.getMessage('firmwareFlasherOptionLabelSelectFirmware'))));
var releaseDescriptors = [];
TABS.firmware_flasher.releases.forEach(function(release){
release.assets.forEach(function(asset){
var targetFromFilenameExpression = /.*_(.*)\.(.*)/;
var match = targetFromFilenameExpression.exec(asset.name);
if (!showDevReleases && release.prerelease) {
return;
}
if (!match) {
return;
}
var target = match[1];
var format = match[2];
if (format != 'hex') {
return;
}
var date = new Date(release.published_at);
var formattedDate = "{0}-{1}-{2} {3}:{4}".format(
date.getFullYear(),
date.getMonth() + 1,
date.getDate(),
date.getUTCHours(),
date.getMinutes()
);
var descriptor = {
"releaseUrl": release.html_url,
"name" : semver.clean(release.name),
"version" : release.tag_name,
"url" : asset.browser_download_url,
"file" : asset.name,
"target" : target,
"date" : formattedDate,
"notes" : release.body,
"status" : release.prerelease ? "release-candidate" : "stable"
};
releaseDescriptors.push(descriptor);
});
});
releaseDescriptors.sort(function(o1,o2){
// compare versions descending
var cmpVal = semver(o2.version).compare(semver(o1.version));
if (cmpVal == 0){
// compare target names ascending
cmpVal = (o1.target<o2.target?-1:(o1.target>o2.target?1:0));
}
return cmpVal;
});
var optionIndex = 1;
releaseDescriptors.forEach(function(descriptor){
var select_e =
$("<option value='{0}'>{1} {2} {3} ({4})</option>".format(
optionIndex++,
descriptor.name,
descriptor.target,
descriptor.date,
descriptor.status
)).data('summary', descriptor);
releases_e.append(select_e);
});
};
var processReleases = function (releases){
var promises = [];
releases.forEach(function(release){
var promise = Q.defer();
promises.push(promise);
$.get(release.assets_url).
done(function(assets){
release.assets = assets;
promise.resolve(assets);
}
).
fail(function(reason){
promise.reject(reason);
}
);
});
Q.all(promises).then(function(){
buildFirmwareOptions();
})
};
$.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) {
$('.progress').val(0).removeClass('valid invalid');
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherLoadFirmwareFile'));
$('div.git_info').slideUp();
$('div.release_info').slideUp();
$('a.flash_firmware').addClass('locked');
}
});
}).fail(function (data){
if (data["responseJSON"]){
GUI.log("<b>GITHUB Query Failed: <code>{0}</code></b>".format(data["responseJSON"].message));
}
$('select[name="release"]').empty().append('<option value="0">Offline</option>');
});
// UI Hooks
$('a.load_file').click(function () {
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: [{extensions: ['hex']}]}, function (fileEntry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
// hide github info (if it exists)
$('div.git_info').slideUp();
chrome.fileSystem.getDisplayPath(fileEntry, function (path) {
console.log('Loading file from: ' + path);
fileEntry.file(function (file) {
var reader = new FileReader();
reader.onprogress = function (e) {
if (e.total > 1048576) { // 1 MB
// dont allow reading files bigger then 1 MB
console.log('File limit (1 MB) exceeded, aborting');
reader.abort();
}
};
reader.onloadend = function(e) {
if (e.total != 0 && e.total == e.loaded) {
console.log('File loaded');
intel_hex = e.target.result;
parse_hex(intel_hex, function (data) {
parsed_hex = data;
if (parsed_hex) {
googleAnalytics.sendEvent('Flashing', 'Firmware', 'local');
$('a.flash_firmware').removeClass('locked');
$('span.progressLabel').text('Loaded Local Firmware: (' + parsed_hex.bytes_total + ' bytes)');
} else {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
}
});
}
};
reader.readAsText(file);
});
});
});
});
/**
* Lock / Unlock the firmware download button according to the firmware selection dropdown.
*/
$('select[name="release"]').change(function(evt){
if (evt.target.value=="0") {
$("a.load_remote_file").addClass('locked');
}
else {
$("a.load_remote_file").removeClass('locked');
}
});
$('a.load_remote_file').click(function (evt) {
if ($('select[name="release"]').val() == "0") {
GUI.log("<b>No firmware selected to load</b>");
return;
}
function process_hex(data, summary) {
intel_hex = data;
parse_hex(intel_hex, function (data) {
parsed_hex = data;
if (parsed_hex) {
var url;
googleAnalytics.sendEvent('Flashing', 'Firmware', 'online');
$('span.progressLabel').html('<a class="save_firmware" href="#" title="Save Firmware">Loaded Online Firmware: (' + parsed_hex.bytes_total + ' bytes)</a>');
$('a.flash_firmware').removeClass('locked');
if (summary.commit) {
$.get('https://api.github.com/repos/cleanflight/cleanflight/commits/' + summary.commit, function (data) {
var data = data,
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, '<br />');
$('div.release_info .notes').html(formattedNotes);
$('div.release_info').slideDown();
} else {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherHexCorrupted'));
}
});
}
function failed_to_load() {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));
$('a.flash_firmware').addClass('locked');
}
var summary = $('select[name="release"] option:selected').data('summary');
if (summary) { // undefined while list is loading or while running offline
$.get(summary.url, function (data) {
process_hex(data, summary);
}).fail(failed_to_load);
} else {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));
}
});
$('a.flash_firmware').click(function () {
if (!$(this).hasClass('locked')) {
if (!GUI.connect_lock) { // button disabled while flashing is in progress
if (parsed_hex != false) {
if (String($('div#port-picker #port').val()) != 'DFU') {
if (String($('div#port-picker #port').val()) != '0') {
var options = {},
port = String($('div#port-picker #port').val()),
baud;
switch (GUI.operating_system) {
case 'Windows':
case 'MacOS':
case 'ChromeOS':
case 'Linux':
case 'UNIX':
baud = 921600;
break;
default:
baud = 115200;
}
if ($('input.updating').is(':checked')) {
options.no_reboot = true;
} else {
options.reboot_baud = parseInt($('div#port-picker #baud').val());
}
if ($('input.erase_chip').is(':checked')) {
options.erase_chip = true;
}
if ($('input.flash_manual_baud').is(':checked')) {
baud = parseInt($('#flash_manual_baud_rate').val());
}
STM32.connect(port, baud, parsed_hex, options);
} else {
console.log('Please select valid serial port');
GUI.log('<span style="color: red">Please select valid serial port</span>');
}
} else {
STM32DFU.connect(usbDevices.STM32DFU, parsed_hex);
}
} else {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFirmwareNotLoaded'));
}
}
}
});
$(document).on('click', 'span.progressLabel a.save_firmware', function () {
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [{extensions: ['hex']}]}, function (fileEntry) {
if (chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
return;
}
chrome.fileSystem.getDisplayPath(fileEntry, function (path) {
console.log('Saving firmware to: ' + path);
// check if file is writable
chrome.fileSystem.isWritableEntry(fileEntry, function (isWritable) {
if (isWritable) {
var blob = new Blob([intel_hex], {type: 'text/plain'});
fileEntry.createWriter(function (writer) {
var truncated = false;
writer.onerror = function (e) {
console.error(e);
};
writer.onwriteend = function() {
if (!truncated) {
// onwriteend will be fired again when truncation is finished
truncated = true;
writer.truncate(blob.size);
return;
}
};
writer.write(blob);
}, function (e) {
console.error(e);
});
} else {
console.log('You don\'t have write permissions for this file, sorry.');
GUI.log('You don\'t have <span style="color: red">write permissions</span> for this file');
}
});
});
});
});
chrome.storage.local.get('no_reboot_sequence', function (result) {
if (result.no_reboot_sequence) {
$('input.updating').prop('checked', true);
$('.flash_on_connect_wrapper').show();
} else {
$('input.updating').prop('checked', false);
}
// bind UI hook so the status is saved on change
$('input.updating').change(function() {
var status = $(this).is(':checked');
if (status) {
$('.flash_on_connect_wrapper').show();
} else {
$('input.flash_on_connect').prop('checked', false).change();
$('.flash_on_connect_wrapper').hide();
}
chrome.storage.local.set({'no_reboot_sequence': status});
});
});
chrome.storage.local.get('flash_manual_baud', function (result) {
if (result.flash_manual_baud) {
$('input.flash_manual_baud').prop('checked', true);
} else {
$('input.flash_manual_baud').prop('checked', false);
}
// 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();
});
chrome.storage.local.get('flash_on_connect', function (result) {
if (result.flash_on_connect) {
$('input.flash_on_connect').prop('checked', true);
} else {
$('input.flash_on_connect').prop('checked', false);
}
$('input.flash_on_connect').change(function () {
var status = $(this).is(':checked');
if (status) {
var catch_new_port = function () {
PortHandler.port_detected('flash_detected_device', function (result) {
var port = result[0];
if (!GUI.connect_lock) {
GUI.log('Detected: <strong>' + port + '</strong> - triggering flash on connect');
console.log('Detected: ' + port + ' - triggering flash on connect');
// Trigger regular Flashing sequence
GUI.timeout_add('initialization_timeout', function () {
$('a.flash_firmware').click();
}, 100); // timeout so bus have time to initialize after being detected by the system
} else {
GUI.log('Detected <strong>' + port + '</strong> - previous device still flashing, please replug to try again');
}
// Since current port_detected request was consumed, create new one
catch_new_port();
}, false, true);
};
catch_new_port();
} else {
PortHandler.flush_callbacks();
}
chrome.storage.local.set({'flash_on_connect': status});
}).change();
});
chrome.storage.local.get('erase_chip', function (result) {
if (result.erase_chip) {
$('input.erase_chip').prop('checked', true);
} else {
$('input.erase_chip').prop('checked', false);
}
// bind UI hook so the status is saved on change
$('input.erase_chip').change(function () {
chrome.storage.local.set({'erase_chip': $(this).is(':checked')});
});
});
$(document).keypress(function (e) {
if (e.which == 13) { // enter
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
if (callback) callback();
});
};
TABS.firmware_flasher.cleanup = function (callback) {
PortHandler.flush_callbacks();
// unbind "global" events
$(document).unbind('keypress');
$(document).off('click', 'span.progressLabel a');
if (callback) callback();
};

View File

@ -1,69 +0,0 @@
<div id="content-watermark"></div>
<div class="tab-ports">
<div class="require-support">
<div class="help">
<p i18n="portsHelp"></p>
</div>
<table class="ports">
<thead>
<tr>
<td>Identifier</td>
<td>Data</td>
<td>Logging</td>
<td>Telemetry</td>
<td>RX</td>
<td>GPS</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div class="help">
<p i18n="portsMSPHelp"></p>
</div>
<div class="clear-both"></div>
<div class="buttons">
<a class="save" href="#" i18n="portsButtonSave"></a>
</div>
</div>
<div class="note require-upgrade" i18n="portsFirmwareUpgradeRequired">
</div>
</div>
<div id="tab-ports-templates">
<table class="ports">
<thead>
</thead>
<tbody>
<tr class="portConfiguration">
<td class="identifierCell">
<p class="identifier"></p>
</td>
<td class="functionsCell-data">
<select class="msp_baudrate">
<!-- list generated here -->
</select>
</td>
<td class="functionsCell-logging">
<select class="blackbox_baudrate">
<!-- list generated here -->
</select>
</td>
<td class="functionsCell-telemetry">
<select class="telemetry_baudrate">
<!-- list generated here -->
</select>
</td>
<td class="functionsCell-rx">
</td>
<td class="functionsCell-gps">
<select class="gps_baudrate">
<!-- list generated here -->
</select>
</td>
</tr>
</tbody>
</table>
</div>