Skip to content

Commit 654dca2

Browse files
authored
Add new wiki to configurator tabs (#3237)
* Add new wiki to configurator tabs * Unify connecting characters in URL
1 parent ce2b698 commit 654dca2

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/js/gui.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,10 @@ class GuiControl {
318318
const documentationButton = $('div#content #button-documentation');
319319
documentationButton.html("Wiki");
320320

321-
if (GUI.active_tab !== 'firmware_flasher') { // hack till we have a nice solution for individual wiki URLs for each page
322-
documentationButton.attr("href", "https://github.com/betaflight/betaflight/wiki");
323-
}
321+
const tRex = GUI.active_tab.replaceAll('_', '-').toLowerCase();
322+
const url = `https://betaflight.com/docs/configurator/${tRex}-tab`;
323+
324+
fetch(url).then(res => documentationButton.attr("href", res.ok ? url : `https://betaflight.com/docs/wiki`));
324325

325326
// loading tooltip
326327
jQuery(function () {

src/js/tabs/firmware_flasher.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,9 @@ firmware_flasher.initialize = function (callback) {
7676
$('div.release_info .configFilename').text(self.isConfigLocal ? self.configFilename : "[default]");
7777

7878
// Wiki link to url found in unified target configuration or if not defined to general wiki url
79-
let targetWiki = $('#targetWikiInfoUrl');
79+
const targetWiki = $('#targetWikiInfoUrl');
8080
targetWiki.html(`   [Wiki]`);
81-
if (summary.wiki === undefined) {
82-
targetWiki.attr("href", "https://github.com/betaflight/betaflight/wiki/");
83-
} else {
84-
targetWiki.attr("href", summary.wiki);
85-
}
81+
targetWiki.attr("href", summary.wiki === undefined ? "https://betaflight.com/docs/wiki/" : summary.wiki);
8682

8783
if (summary.cloudBuild) {
8884
$('div.release_info #cloudTargetInfo').show();

0 commit comments

Comments
 (0)