uibinder.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Initialize UI functions which depend on internal modules.
  3. * Loaded after core UI functions are initialized in uicore.js.
  4. */
  5. // Requirements
  6. const path = require('path')
  7. const ConfigManager = require('./assets/js/configmanager.js')
  8. let rscShouldLoad = false
  9. // Synchronous Listener
  10. document.addEventListener('readystatechange', function(){
  11. if (document.readyState === 'complete'){
  12. if(rscShouldLoad){
  13. if(ConfigManager.isFirstLaunch()){
  14. $('#welcomeContainer').fadeIn(500)
  15. } else {
  16. $('#landingContainer').fadeIn(500)
  17. }
  18. }
  19. }
  20. /*if (document.readyState === 'interactive'){
  21. }*/
  22. }, false)
  23. // Actions that must be performed after the distribution index is downloaded.
  24. ipcRenderer.on('distributionIndexDone', (data) => {
  25. updateSelectedServer(AssetGuard.getServerById(ConfigManager.getLauncherDirectory(), ConfigManager.getSelectedServer()).name)
  26. refreshServerStatus()
  27. if(document.readyState === 'complete'){
  28. if(ConfigManager.isFirstLaunch()){
  29. $('#welcomeContainer').fadeIn(500)
  30. } else {
  31. $('#landingContainer').fadeIn(500)
  32. }
  33. } else {
  34. rscShouldLoad = true
  35. }
  36. })