2022-08-13 07:46:56 +02:00
|
|
|
/*
|
|
|
|
* Welcome to your app's main JavaScript file!
|
|
|
|
*
|
|
|
|
* We recommend including the built version of this JavaScript file
|
|
|
|
* (and its CSS file) in your base layout (base.html.twig).
|
|
|
|
*/
|
|
|
|
|
|
|
|
// any CSS you import will output into a single css file (app.css in this case)
|
|
|
|
import './styles/app.css';
|
2022-08-15 11:42:28 +02:00
|
|
|
import './styles/menu.css';
|
2022-08-13 07:46:56 +02:00
|
|
|
|
|
|
|
// start the Stimulus application
|
|
|
|
import './bootstrap';
|
2022-08-13 16:00:08 +02:00
|
|
|
|
2022-08-16 19:28:19 +02:00
|
|
|
import feather from 'feather-icons';
|
2022-08-20 05:04:29 +02:00
|
|
|
import { version } from 'core-js';
|
2022-08-16 19:28:19 +02:00
|
|
|
feather.replace();
|
2022-08-16 07:05:49 +02:00
|
|
|
|
2022-08-18 05:45:38 +02:00
|
|
|
/** Update css variables --{header, footer}-height
|
|
|
|
* by querying elements real height */
|
2022-08-20 05:04:29 +02:00
|
|
|
(function () {
|
2022-08-18 05:45:38 +02:00
|
|
|
let css_root = document.querySelector(':root');
|
|
|
|
let header = document.getElementsByTagName('header')[0];
|
|
|
|
let header_height = header.clientHeight;
|
|
|
|
css_root.style.setProperty('--header-height', header_height + 'px');
|
|
|
|
let footer = document.getElementsByTagName('footer')[0];
|
|
|
|
let footer_height = footer.clientHeight;
|
|
|
|
css_root.style.setProperty('--footer-height', footer_height + 'px');
|
2022-08-20 05:04:29 +02:00
|
|
|
|
|
|
|
})();
|
|
|
|
|
|
|
|
/** Add git version in web interface
|
|
|
|
*/
|
|
|
|
(function () {
|
|
|
|
let version_span = document.querySelector('.version-number');
|
|
|
|
version_span.textContent = `${VERSION}`;
|
|
|
|
console.debug("Version: " + VERSION);
|
2022-08-18 05:45:38 +02:00
|
|
|
})();
|
|
|
|
|
2022-08-16 19:28:19 +02:00
|
|
|
try {
|
|
|
|
document.getElementsByClassName('prevent').map(
|
|
|
|
(e) => e.addEventListener('click', (e) => e.preventDefault())
|
|
|
|
);
|
|
|
|
} catch {
|
|
|
|
console.debug('no prevent class found');
|
|
|
|
}
|