1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-19 15:43:45 +02:00
RPGnotes/static/main.ts

31 lines
764 B
TypeScript
Raw Normal View History

2022-07-30 16:24:28 +02:00
import 'vite/modulepreload-polyfill'
// import "./scss/main.scss"
import "./js/sentry"
2022-07-31 00:46:21 +02:00
// @ts-ignore
2022-07-30 16:24:28 +02:00
import {default as Dropdown} from 'bootstrap/js/src/dropdown'
2022-07-31 00:46:21 +02:00
// @ts-ignore
2022-07-30 16:24:28 +02:00
import {default as Collapse} from 'bootstrap/js/src/collapse'
2022-07-30 16:39:29 +02:00
import "./js/autocomplete"
import "./js/popover"
import "./js/gallery"
2022-07-30 16:24:28 +02:00
const bootstrapModules = [Collapse, Dropdown]
function init(): void {
2022-07-30 16:39:29 +02:00
if (document.getElementById("id_description_md")) {
2022-07-30 18:05:13 +02:00
import ("./js/codemirror").then(value => console.log("loaded"))
2022-07-30 16:39:29 +02:00
}
2022-11-25 20:20:14 +01:00
if (document.getElementById("graph")) {
import ("./js/graph").then(value => console.log("graph loaded"))
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init)
} else {
init()
}