1- 'use strict' ;
2-
3- window . googleAnalytics = analytics ;
4- window . analytics = null ;
1+ import { i18n } from './localization' ;
52
63$ ( document ) . ready ( function ( ) {
74
@@ -298,7 +295,7 @@ function startProcess() {
298295
299296 switch ( tab ) {
300297 case 'landing' :
301- TABS . landing . initialize ( content_ready ) ;
298+ import ( './tabs/ landing' ) . then ( ( { landing } ) => landing . initialize ( content_ready ) ) ;
302299 break ;
303300 case 'changelog' :
304301 TABS . staticTab . initialize ( 'changelog' , content_ready ) ;
@@ -313,7 +310,7 @@ function startProcess() {
313310 TABS . firmware_flasher . initialize ( content_ready ) ;
314311 break ;
315312 case 'help' :
316- TABS . help . initialize ( content_ready ) ;
313+ import ( './tabs/ help' ) . then ( ( { help } ) => help . initialize ( content_ready ) ) ;
317314 break ;
318315 case 'auxiliary' :
319316 TABS . auxiliary . initialize ( content_ready ) ;
@@ -545,6 +542,7 @@ function setDarkTheme(enabled) {
545542 } ) ;
546543}
547544
545+
548546function checkForConfiguratorUpdates ( ) {
549547 const releaseChecker = new ReleaseChecker ( 'configurator' , 'https://api.github.com/repos/betaflight/betaflight-configurator/releases' ) ;
550548
@@ -712,3 +710,17 @@ function showDialogDynFiltersChange() {
712710 } ) ;
713711 }
714712}
713+
714+ // TODO: all of these are used as globals in other parts.
715+ // once moved to modules extract to own module.
716+ window . showDialogDynFiltersChange = showDialogDynFiltersChange ;
717+ window . googleAnalytics = analytics ;
718+ window . analytics = null ;
719+ window . showErrorDialog = showErrorDialog ;
720+ window . generateFilename = generateFilename ;
721+ window . updateTabList = updateTabList ;
722+ window . isExpertModeEnabled = isExpertModeEnabled ;
723+ window . checkForConfiguratorUpdates = checkForConfiguratorUpdates ;
724+ window . setDarkTheme = setDarkTheme ;
725+ window . appReady = appReady ;
726+ window . checkSetupAnalytics = checkSetupAnalytics ;
0 commit comments