mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-15 12:25:15 +03:00
feat: migrate main to modules
This commit is contained in:
parent
085cdc4a2d
commit
6c8dd5de6d
3 changed files with 21 additions and 3 deletions
|
@ -320,7 +320,8 @@ function dist_rollup() {
|
|||
'components/init': 'src/components/init.js',
|
||||
'js/main_cordova': 'src/js/main_cordova.js',
|
||||
'js/utils/common': 'src/js/utils/common.js',
|
||||
'js/tabs/logging': 'src/js/tabs/logging.js'
|
||||
'js/tabs/logging': 'src/js/tabs/logging.js',
|
||||
'js/main': 'src/js/main.js',
|
||||
},
|
||||
plugins: [
|
||||
alias({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
'use strict';
|
||||
import { i18n } from './localization';
|
||||
|
||||
window.googleAnalytics = analytics;
|
||||
window.analytics = null;
|
||||
|
@ -40,6 +40,7 @@ function appReady() {
|
|||
});
|
||||
});
|
||||
}
|
||||
window.appReady = appReady;
|
||||
|
||||
function checkSetupAnalytics(callback) {
|
||||
if (!analytics) {
|
||||
|
@ -57,6 +58,8 @@ function checkSetupAnalytics(callback) {
|
|||
}
|
||||
}
|
||||
|
||||
window.checkSetupAnalytics = checkSetupAnalytics;
|
||||
|
||||
function getBuildType() {
|
||||
return GUI.Mode;
|
||||
}
|
||||
|
@ -545,12 +548,16 @@ function setDarkTheme(enabled) {
|
|||
});
|
||||
}
|
||||
|
||||
window.setDarkTheme = setDarkTheme;
|
||||
|
||||
function checkForConfiguratorUpdates() {
|
||||
const releaseChecker = new ReleaseChecker('configurator', 'https://api.github.com/repos/betaflight/betaflight-configurator/releases');
|
||||
|
||||
releaseChecker.loadReleaseData(notifyOutdatedVersion);
|
||||
}
|
||||
|
||||
window.checkForConfiguratorUpdates = checkForConfiguratorUpdates;
|
||||
|
||||
function notifyOutdatedVersion(releaseData) {
|
||||
ConfigStorage.get('checkForConfiguratorUnstableVersions', function (result) {
|
||||
let showUnstableReleases = false;
|
||||
|
@ -604,6 +611,8 @@ function isExpertModeEnabled() {
|
|||
return $('input[name="expertModeCheckbox"]').is(':checked');
|
||||
}
|
||||
|
||||
window.isExpertModeEnabled = isExpertModeEnabled;
|
||||
|
||||
function updateTabList(features) {
|
||||
|
||||
if (isExpertModeEnabled()) {
|
||||
|
@ -658,6 +667,8 @@ function updateTabList(features) {
|
|||
|
||||
}
|
||||
|
||||
window.updateTabList = updateTabList;
|
||||
|
||||
function zeroPad(value, width) {
|
||||
|
||||
let valuePadded = String(value);
|
||||
|
@ -689,6 +700,8 @@ function generateFilename(prefix, suffix) {
|
|||
return `${filename}.${suffix}`;
|
||||
}
|
||||
|
||||
window.generateFilename = generateFilename;
|
||||
|
||||
function showErrorDialog(message) {
|
||||
const dialog = $('.dialogError')[0];
|
||||
|
||||
|
@ -701,6 +714,8 @@ function showErrorDialog(message) {
|
|||
dialog.showModal();
|
||||
}
|
||||
|
||||
window.showErrorDialog = showErrorDialog;
|
||||
|
||||
function showDialogDynFiltersChange() {
|
||||
const dialogDynFiltersChange = $('.dialogDynFiltersChange')[0];
|
||||
|
||||
|
@ -712,3 +727,5 @@ function showDialogDynFiltersChange() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.showDialogDynFiltersChange = showDialogDynFiltersChange;
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
<script type="text/javascript" src="./js/jenkins_loader.js"></script>
|
||||
<script type="text/javascript" src="./js/Analytics.js"></script>
|
||||
<script type="text/javascript" src="./js/GitHubApi.js"></script>
|
||||
<script type="text/javascript" src="./js/main.js"></script>
|
||||
<script type="module" src="./js/main.js"></script>
|
||||
<script type="text/javascript" src="./js/Clipboard.js"></script>
|
||||
<script type="text/javascript" src="./js/tabs/static_tab.js"></script>
|
||||
<script type="text/javascript" src="./js/tabs/landing.js"></script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue