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-02-24 10:38:08 +01:00
|
|
|
import Events from './_events';
|
2021-08-04 00:55:06 +02:00
|
|
|
import MetaWindow from './_window';
|
2021-02-24 10:38:08 +01:00
|
|
|
|
2021-08-04 00:55:06 +02:00
|
|
|
const ui = new MetaWindow();
|
|
|
|
const container = document.getElementById('MetaLightboxApp');
|
|
|
|
if (!container) {
|
|
|
|
console.log(`MetaWindow: missing container`);
|
|
|
|
}
|
2021-01-25 12:15:33 +01:00
|
|
|
|
2021-08-04 00:55:06 +02:00
|
|
|
const init = () => {
|
|
|
|
ui.init(container);
|
|
|
|
};
|
2021-02-24 10:38:08 +01:00
|
|
|
|
2021-08-04 00:55:06 +02:00
|
|
|
window.addEventListener(`${Events.LOADED}`, init);
|
|
|
|
window.addEventListener(`${Events.AJAX}`, init);
|
|
|
|
window.addEventListener(`MetaWindow.initLinks`, init);
|
2021-02-24 10:38:08 +01:00
|
|
|
|
2021-08-04 00:55:06 +02:00
|
|
|
function importAll(r) {
|
|
|
|
return r.keys().map(r);
|
|
|
|
}
|
2021-02-24 10:38:08 +01:00
|
|
|
|
2021-08-04 00:55:06 +02:00
|
|
|
const images = importAll(
|
|
|
|
require.context('../img/', false, /\.(png|jpe?g|svg)$/),
|
|
|
|
);
|
2021-02-24 10:38:08 +01:00
|
|
|
|
2021-08-04 00:55:06 +02:00
|
|
|
export default ui;
|