Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sponsor tile to firmware flashing tab #3468

Merged
merged 3 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/css/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,12 @@ dialog {
font-weight: 300;
margin-bottom: 15px;
}
.tab_sponsor {
display: none;
height: 50px;
max-height: 50px;
margin: 0 auto 10px auto
}
.note {
background-color: #fff7cd;
border: 1px solid #ffe55f;
Expand Down
857 changes: 857 additions & 0 deletions src/images/sponsors/dogcom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/images/sponsors/hqprop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions src/images/sponsors/radiomaster.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/js/BuildApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,9 @@ export default class BuildApi {
const url = `${this._url}/api/configurator/releases/${type}`;
this.load(url, onSuccess, onFailure);
}

loadSponsorTile(onSuccess, onFailure) {
const url = `${this._url}/api/configurator/sponsors`;
this.load(url, onSuccess, onFailure);
}
}
19 changes: 19 additions & 0 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ firmware_flasher.initialize = function (callback) {

function onDocumentLoad() {

function loadSponsor() {
if (!navigator.onLine) {
return;
}

self.releaseLoader.loadSponsorTile(
(content) => {
if (content) {
$('div.tab_sponsor').html(content);
$('div.tab_sponsor').show();
} else {
$('div.tab_sponsor').hide();
}
},
);
}

function parseHex(str, callback) {
// parsing hex in different thread
const worker = new Worker('./js/workers/hex_parser.js');
Expand Down Expand Up @@ -254,6 +271,8 @@ firmware_flasher.initialize = function (callback) {
// translate to user-selected language
i18n.localizePage();

loadSponsor();
blckmn marked this conversation as resolved.
Show resolved Hide resolved

buildType_e.change(function() {
tracking.setFirmwareData(tracking.DATA.FIRMWARE_CHANNEL, $('option:selected', this).text());

Expand Down
2 changes: 2 additions & 0 deletions src/tabs/firmware_flasher.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<div class="cf_doc_version_bt">
<a id="button-documentation" href="" target="_blank" rel="noopener noreferrer"></a>
</div>
<div class="tab_sponsor">
</div>
<div class="options gui_box" style="float: left; width: 460px; ">
<div class="spacer" style="margin-bottom: 10px;">
<div class="margin-bottom">
Expand Down