/
Gabryelf
/
Icons-Customize-Gen
Обзор
Документация
Войти
/
Gabryelf
/
Icons-Customize-Gen
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
js/core/Application.js
40 строк
1 KB
Valeev Serj
update_version_0.0.1
15 июл 2026, 23:25
15 июл 2026, 23:25
ae94135
Код
Авторство
О чём код?
// основной модуль запуска программы // core/Application.js import { EventBus } from './EventBus.js'; import { Storage } from './Storage.js'; import { Project } from '../models/Project.js'; import { Router } from './Router.js'; import { DashboardView } from '../views/DashboardView.js'; import { EditorView } from '../views/EditorView.js'; import { SettingsView } from '../views/SettingsView.js'; export class Application { constructor() { this.events = new EventBus(); this.profile = Storage.loadProfile(); // Применяем сохраненную тему if (this.profile.theme) { document.documentElement.setAttribute('data-theme', this.profile.theme); } this.container = document.getElementById('appContainer'); // Если контейнера нет - создаем if (!this.container) { this.container = document.createElement('div'); this.container.id = 'appContainer'; document.body.appendChild(this.container); } // Инициализация роутера this.router = new Router([ { path: 'dashboard', component: DashboardView }, { path: 'editor', component: EditorView }, { path: 'settings', component: SettingsView } ], this.events); // Загрузка начальной страницы this.router.navigate('dashboard'); } }