mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 11:59:51 +03:00
Make links to documents relevant to firmware version
This commit is contained in:
parent
d23638ca3e
commit
a47d971ade
5 changed files with 26 additions and 2 deletions
|
@ -1933,6 +1933,9 @@
|
|||
"cliReboot": {
|
||||
"message": "CLI reboot detected"
|
||||
},
|
||||
"cliDocsBtn": {
|
||||
"message": "CLI Command Docs"
|
||||
},
|
||||
"cliSaveToFileBtn": {
|
||||
"message": "Save to File"
|
||||
},
|
||||
|
|
|
@ -672,7 +672,7 @@ var Settings = (function () {
|
|||
}
|
||||
|
||||
if (typeof dataSettingName !== "undefined" && dataSettingName !== "") {
|
||||
helpIcon.wrap('<a class="helpiconLink" href="https://github.com/iNavFlight/inav/blob/master/docs/Settings.md#' + dataSettingName + '" target="_blank"></a>');
|
||||
helpIcon.wrap('<a class="helpiconLink" href="' + globalSettings.docsTreeLocation + 'Settings.md#' + dataSettingName + '" target="_blank"></a>');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
18
main.js
18
main.js
|
@ -25,11 +25,15 @@ let globalSettings = {
|
|||
unitType: null,
|
||||
// Used to convert units within the UI
|
||||
osdUnits: null,
|
||||
// Map
|
||||
mapProviderType: null,
|
||||
mapApiKey: null,
|
||||
proxyURL: null,
|
||||
proxyLayer: null,
|
||||
// Show colours for profiles
|
||||
showProfileParameters: null,
|
||||
// tree target for documents
|
||||
docsTreeLocation: 'master',
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
|
@ -673,7 +677,21 @@ function updateActivatedTab() {
|
|||
function updateFirmwareVersion() {
|
||||
if (CONFIGURATOR.connectionValid) {
|
||||
$('#logo .firmware_version').text(CONFIG.flightControllerVersion + " [" + CONFIG.target + "]");
|
||||
globalSettings.docsTreeLocation = 'https://github.com/iNavFlight/inav/blob/' + CONFIG.flightControllerVersion + '/docs/';
|
||||
|
||||
// If this is a master branch firmware, this will find a 404 as there is no tag tree. So default to master for docs.
|
||||
$.ajax({
|
||||
url : globalSettings.docsTreeLocation + 'Settings.md',
|
||||
method: "HEAD",
|
||||
statusCode: {
|
||||
404: function() {
|
||||
globalSettings.docsTreeLocation = 'https://github.com/iNavFlight/inav/blob/master/docs/';
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#logo .firmware_version').text(chrome.i18n.getMessage('fcNotConnected'));
|
||||
|
||||
globalSettings.docsTreeLocation = 'https://github.com/iNavFlight/inav/blob/master/docs/';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<a class="exit" href="#" i18n="cliExitBtn"></a>
|
||||
</div>
|
||||
<div class="btn save_btn pull-right">
|
||||
<a class="cliDocsBtn" href="#" i18n="cliDocsBtn" target="_blank"></a>
|
||||
<a class="save" href="#" i18n="cliSaveToFileBtn"></a>
|
||||
<a class="load" href="#" i18n="cliLoadFromFileBtn"></a>
|
||||
<a class="clear" href="#" i18n="cliClearOutputHistoryBtn"></a>
|
||||
|
|
|
@ -146,6 +146,8 @@ TABS.cli.initialize = function (callback) {
|
|||
// translate to user-selected language
|
||||
localize();
|
||||
|
||||
$('.cliDocsBtn').attr('href', globalSettings.docsTreeLocation + 'Settings.md');
|
||||
|
||||
CONFIGURATOR.cliActive = true;
|
||||
|
||||
var textarea = $('.tab-cli textarea[name="commands"]');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue