CatPortal / modules /main.js
NikaMimi's picture
Upload 17 files
06163ac verified
/**
* CatOS Main Initialization Script
* Loads all modules and starts the system
*/
(function() {
'use strict';
// Wait for DOM to be ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeCatOS);
} else {
initializeCatOS();
}
function initializeCatOS() {
console.log('🐱 Initializing CatOS...');
// Create the core system
const catOS = new CatOSCore();
console.log('βœ… Core system created');
// Initialize modules
console.log('πŸ”§ Creating modules...');
const windowManager = new CatOSWindowManager(catOS);
console.log('βœ… WindowManager created');
const appManager = new CatOSAppManager(catOS);
console.log('βœ… AppManager created');
const eventHandler = new CatOSEventHandler(catOS);
console.log('βœ… EventHandler created');
// Register modules with core
catOS.registerModule('windowManager', windowManager);
catOS.registerModule('appManager', appManager);
catOS.registerModule('eventHandler', eventHandler);
// Set up global references for backward compatibility
window.CatOS = catOS;
// Now that modules are registered, set up event listeners and apps
catOS.setupEventListeners();
catOS.registerApps();
// Initialize the system
catOS.init();
console.log('πŸ±β€πŸ’» CatOS v9.0 (Whiskers Edition) loaded successfully!');
console.log('Try opening the terminal and typing "help" for cat commands!');
}
})();