Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/betaflight/betaflight-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ Blackman <blckmn@users.noreply.github.com>2022-11-09 02:11:07 +0300
committerGitHub <noreply@github.com>2022-11-09 02:11:07 +0300
commit2a016853739a518731736658f828598c00d0cec2 (patch)
treeda151243cf27a1e410991bdc20abc0a3a52cbd34
parentb0a2c40c22163eb9c4863613bf451a241a3f2f19 (diff)
Adding custom define input box (#3074)
-rw-r--r--locales/en/messages.json6
-rw-r--r--src/css/dark-theme.less10
-rw-r--r--src/js/tabs/firmware_flasher.js3
-rw-r--r--src/tabs/firmware_flasher.html7
4 files changed, 25 insertions, 1 deletions
diff --git a/locales/en/messages.json b/locales/en/messages.json
index 36691246..45a6b5fb 100644
--- a/locales/en/messages.json
+++ b/locales/en/messages.json
@@ -6740,5 +6740,11 @@
},
"firmwareFlasherBranchDescription": {
"message": "Especially useful for developers, you can select a merged PR, specify a commit sha, or specify a 'yet to be merged' PR by typing in: pull/{PR number}/head ."
+ },
+ "firmwareFlasherCustomDefinesDescription": {
+ "message": "For developers, you can add any defines you need, separated by a `space`, but without the `USE_` prefix, it will be added automatically for you."
+ },
+ "firmwareFlasherBuildCustomDefines": {
+ "message": "Custom Defines"
}
}
diff --git a/src/css/dark-theme.less b/src/css/dark-theme.less
index 4dd8c31d..ba2b0f57 100644
--- a/src/css/dark-theme.less
+++ b/src/css/dark-theme.less
@@ -324,9 +324,17 @@ button {
}
}
}
- select {
+ input {
background-color: #3a3a3a;
color: white;
+ border: solid 1px var(--subtleAccent);
+ border-radius: 3px;
+ min-height: 20px;
+ padding: 2px;
+ }
+ select {
+ background-color: #424242;
+ color: white;
}
}
.options {
diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js
index 03781763..a0b99da5 100644
--- a/src/js/tabs/firmware_flasher.js
+++ b/src/js/tabs/firmware_flasher.js
@@ -807,6 +807,9 @@ firmware_flasher.initialize = function (callback) {
if (summary.releaseType === "Unstable") {
request.commit = $('select[name="commits"] option:selected').val();
+ $('input[name="customDefines"]').val().split(' ').map(element => element.trim()).forEach(v => {
+ request.options.push(v);
+ });
}
self.releaseLoader.requestBuild(request, (info) => {
diff --git a/src/tabs/firmware_flasher.html b/src/tabs/firmware_flasher.html
index e15fcc53..712b0ba6 100644
--- a/src/tabs/firmware_flasher.html
+++ b/src/tabs/firmware_flasher.html
@@ -200,6 +200,13 @@
<div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherBranchDescription"></div>
</div>
</div>
+ <div style="width: 49%; float: right;">
+ <strong i18n="firmwareFlasherBuildCustomDefines"></strong>
+ <div id="customDefinesInfo">
+ <input id="customDefines" name="customDefines" style="width: 95%"></input>
+ <div class="helpicon cf_tip_wide" i18n_title="firmwareFlasherCustomDefinesDescription"></div>
+ </div>
+ </div>
</div>
</div>
</div>