50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
|
|
// Main entry point for Calendar Plantempus
|
||
|
|
import { eventBus } from './core/EventBus.js';
|
||
|
|
import { CalendarManager } from './managers/CalendarManager.js';
|
||
|
|
import { NavigationManager } from './managers/NavigationManager.js';
|
||
|
|
import { ViewManager } from './managers/ViewManager.js';
|
||
|
|
import { EventManager } from './managers/EventManager.js';
|
||
|
|
import { EventRenderer } from './managers/EventRenderer.js';
|
||
|
|
import { CalendarConfig } from './core/CalendarConfig.js';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Initialize the calendar application
|
||
|
|
*/
|
||
|
|
function initializeCalendar(): void {
|
||
|
|
console.log('🗓️ Initializing Calendar Plantempus...');
|
||
|
|
|
||
|
|
// Create calendar configuration
|
||
|
|
const config = new CalendarConfig();
|
||
|
|
|
||
|
|
// Initialize managers
|
||
|
|
const calendarManager = new CalendarManager(eventBus, config);
|
||
|
|
const navigationManager = new NavigationManager(eventBus);
|
||
|
|
const viewManager = new ViewManager(eventBus);
|
||
|
|
const eventManager = new EventManager(eventBus);
|
||
|
|
const eventRenderer = new EventRenderer(eventBus);
|
||
|
|
|
||
|
|
// Enable debug mode for development
|
||
|
|
eventBus.setDebug(true);
|
||
|
|
|
||
|
|
// Initialize all managers
|
||
|
|
calendarManager.initialize();
|
||
|
|
|
||
|
|
console.log('✅ Calendar Plantempus initialized successfully with all core managers');
|
||
|
|
|
||
|
|
// Expose to window for debugging
|
||
|
|
(window as any).calendarDebug = {
|
||
|
|
eventBus,
|
||
|
|
calendarManager,
|
||
|
|
navigationManager,
|
||
|
|
viewManager,
|
||
|
|
eventManager,
|
||
|
|
eventRenderer
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
// Initialize when DOM is ready
|
||
|
|
if (document.readyState === 'loading') {
|
||
|
|
document.addEventListener('DOMContentLoaded', initializeCalendar);
|
||
|
|
} else {
|
||
|
|
initializeCalendar();
|
||
|
|
}
|