Add betaflight firmwares to firmware flasher

10.3.x-maintenance
KiteAnton 2016-06-13 23:27:06 +02:00
parent cdd1599d7f
commit 17cdf3dcf4
1 changed files with 7 additions and 5 deletions

View File

@ -73,7 +73,7 @@ TABS.firmware_flasher.initialize = function (callback) {
var descriptor = {
"releaseUrl": release.html_url,
"name" : semver.clean(release.name),
"version" : release.tag_name,
"version" : release.name,
"url" : asset.browser_download_url,
"file" : asset.name,
"target" : target,
@ -88,7 +88,9 @@ TABS.firmware_flasher.initialize = function (callback) {
releaseDescriptors.sort(function(o1,o2){
// compare versions descending
var cmpVal = semver(o2.version).compare(semver(o1.version));
var oo1 = o1.version.replace(/[^0-9]+/g, "");
var oo2 = o2.version.replace(/[^0-9]+/g, "");
var cmpVal = (oo2<oo1?-1:(oo2>oo1?1:0));
if (cmpVal == 0){
// compare target names ascending
cmpVal = (o1.target<o2.target?-1:(o1.target>o2.target?1:0));
@ -134,7 +136,7 @@ TABS.firmware_flasher.initialize = function (callback) {
})
};
$.get('https://api.github.com/repos/cleanflight/cleanflight/releases', function (releases){
$.get('https://api.github.com/repos/betaflight/betaflight/releases', function (releases){
processReleases(releases);
TABS.firmware_flasher.releases = releases;
@ -244,7 +246,7 @@ TABS.firmware_flasher.initialize = function (callback) {
$('a.flash_firmware').removeClass('disabled');
if (summary.commit) {
$.get('https://api.github.com/repos/cleanflight/cleanflight/commits/' + summary.commit, function (data) {
$.get('https://api.github.com/repos/betaflight/betaflight/commits/' + summary.commit, function (data) {
var data = data,
d = new Date(data.commit.author.date),
offset = d.getTimezoneOffset() / 60,
@ -256,7 +258,7 @@ TABS.firmware_flasher.initialize = function (callback) {
$('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 .hash').text(data.sha.slice(0, 7)).prop('href', 'https://api.github.com/betaflight/betaflight/commit/' + data.sha);
$('div.git_info .message').text(data.commit.message);