diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:46:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:46:43 +0000 |
commit | 3e02d5aff85babc3ffbfcf52313f2108e313aa23 (patch) | |
tree | b01f3923360c20a6a504aff42d45670c58af3ec5 /public/js/bootstrap.js | |
parent | Initial commit. (diff) | |
download | icingaweb2-3e02d5aff85babc3ffbfcf52313f2108e313aa23.tar.xz icingaweb2-3e02d5aff85babc3ffbfcf52313f2108e313aa23.zip |
Adding upstream version 2.12.1.upstream/2.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'public/js/bootstrap.js')
-rw-r--r-- | public/js/bootstrap.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/public/js/bootstrap.js b/public/js/bootstrap.js new file mode 100644 index 0000000..425c8ab --- /dev/null +++ b/public/js/bootstrap.js @@ -0,0 +1,28 @@ +;(function () { + let html = document.documentElement; + window.name = html.dataset.icingaWindowName; + window.icinga = new Icinga({ + baseUrl: html.dataset.icingaBaseUrl, + locale: html.lang, + timezone: html.dataset.icingaTimezone + }); + + if (! ('icingaIsIframe' in document.documentElement.dataset)) { + html.classList.replace('no-js', 'js'); + } + + if (window.getComputedStyle) { + let matched; + let element = document.getElementById('layout'); + let name = window + .getComputedStyle(html)['font-family'] + .replace(/['",]/g, ''); + + if (null !== (matched = name.match(/^([a-z]+)-layout$/))) { + element.classList.replace('default-layout', name); + if ('object' === typeof window.console) { + window.console.log('Icinga Web 2: setting initial layout to ' + name); + } + } + } +})(); |