Retrospring/app/javascript/retrospring/initializers/stimulus.ts

29 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-01-05 23:35:02 -08:00
import { Application } from "@hotwired/stimulus";
import AnnouncementController from "retrospring/controllers/announcement_controller";
import AutofocusController from "retrospring/controllers/autofocus_controller";
import CharacterCountController from "retrospring/controllers/character_count_controller";
import CharacterCountWarningController from "retrospring/controllers/character_count_warning_controller";
import FormatPopupController from "retrospring/controllers/format_popup_controller";
import CollapseController from "retrospring/controllers/collapse_controller";
2023-01-16 22:39:14 -08:00
import ThemeController from "retrospring/controllers/theme_controller";
2023-01-16 20:45:12 -08:00
import CapabilitiesController from "retrospring/controllers/capabilities_controller";
2023-01-05 23:35:02 -08:00
/**
* This module sets up Stimulus and our controllers
*
* TODO: Temporary solution until I implement stimulus-rails and move
* controllers to app/javascript/controllers where an automated
* index can be generated
*/
export default function (): void {
window['Stimulus'] = Application.start();
window['Stimulus'].register('announcement', AnnouncementController);
window['Stimulus'].register('autofocus', AutofocusController);
2023-01-16 20:45:12 -08:00
window['Stimulus'].register('capabilities', CapabilitiesController);
2023-01-05 23:35:02 -08:00
window['Stimulus'].register('character-count', CharacterCountController);
window['Stimulus'].register('character-count-warning', CharacterCountWarningController);
window['Stimulus'].register('collapse', CollapseController);
window['Stimulus'].register('format-popup', FormatPopupController);
2023-01-16 22:39:14 -08:00
window['Stimulus'].register('theme', ThemeController);
2023-01-05 23:35:02 -08:00
}