27 lines
869 B
TypeScript
27 lines
869 B
TypeScript
import { AvatarModal } from './modal/avatar';
|
|
import { ModalManager } from './modal/modals';
|
|
|
|
(function () {
|
|
// This site supports disabling javascript. Some interactive elements can be hidden.
|
|
const noscriptElements = document.querySelectorAll('[data-noscript]');
|
|
const scriptElements = document.querySelectorAll('[data-script]');
|
|
|
|
noscriptElements.forEach(
|
|
(element: HTMLElement) => (element.style.display = 'none'),
|
|
);
|
|
|
|
scriptElements.forEach(
|
|
(element: HTMLElement) =>
|
|
(element.style.display = element.getAttribute('data-script') || 'block'),
|
|
);
|
|
|
|
const modals = new ModalManager();
|
|
const avatar = new AvatarModal();
|
|
modals.register(avatar);
|
|
|
|
const dateify = document.querySelectorAll('[data-locale-time]');
|
|
dateify.forEach((element: HTMLElement) => {
|
|
element.innerText = new Date(element.innerText).toString();
|
|
});
|
|
})();
|