meta-lightbox/src/js/app.js

37 lines
713 B
JavaScript
Raw Normal View History

2019-11-25 06:59:54 +01:00
/*
2019-11-27 06:09:35 +01:00
* MetaLightbox
2019-11-25 06:59:54 +01:00
* https://tony.twma.pro
*
*/
2021-11-12 06:54:01 +01:00
import Events from './_events';
import MetaWindow from './window';
2021-02-24 10:38:08 +01:00
2021-11-12 06:54:01 +01:00
const container = document.getElementById('MetaLightboxApp');
2021-08-04 00:55:06 +02:00
if (!container) {
2021-08-18 19:00:31 +02:00
console.log(`MetaWindow: missing container #MetaLightboxApp`);
2021-08-04 00:55:06 +02:00
}
2021-01-25 12:15:33 +01:00
2021-08-10 01:19:48 +02:00
const ui = new MetaWindow({
2021-08-11 18:57:45 +02:00
target: container,
2021-08-10 01:19:48 +02:00
});
2021-08-04 00:55:06 +02:00
const init = () => {
2021-08-11 18:57:45 +02:00
ui.init();
2021-08-04 00:55:06 +02:00
};
2021-02-24 10:38:08 +01:00
2021-11-12 06:54:01 +01:00
window.addEventListener(`${Events.LOADEDANDREADY}`, init);
2021-08-04 00:55:06 +02:00
window.addEventListener(`${Events.AJAX}`, init);
window.addEventListener(`MetaWindow.initLinks`, init);
2021-02-24 10:38:08 +01:00
2021-08-11 18:18:28 +02:00
window.MetaWindow = ui;
2021-08-04 01:22:41 +02:00
/*function importAll(r) {
2021-08-04 00:57:03 +02:00
return r.keys().map(r);
2021-08-04 00:55:06 +02:00
}
2021-02-24 10:38:08 +01:00
2021-08-04 00:55:06 +02:00
const images = importAll(
2021-08-04 00:57:03 +02:00
require.context('../img/', false, /\.(png|jpe?g|svg)$/),
2021-08-04 01:22:41 +02:00
);*/
2021-02-24 10:38:08 +01:00
2021-08-04 00:55:06 +02:00
export default ui;