diff --git a/app/config.sample.yaml b/app/config.sample.yaml index dbc9c28..9fc4c90 100644 --- a/app/config.sample.yaml +++ b/app/config.sample.yaml @@ -647,4 +647,36 @@ navigation: class: fa-solid fa-scale-balanced url: https://s.veen.world/imprint iframe: true - \ No newline at end of file + - name: Settings + description: Application settings + icon: + class: fa-solid fa-cog + children: + - name: Toggle Fullscreen + description: Enter or exit fullscreen mode + icon: + class: fa-solid fa-expand-arrows-alt + onclick: "toggleFullscreen()" + - name: Toggle Full Width + description: Switch between normal and full-width layout + icon: + class: fa-solid fa-arrows-left-right + onclick: "setFullWidth(!initFullWidthFromUrl())" + - name: Open in new tab + description: Open the currently embedded iframe URL in a fresh browser tab + icon: + class: fa-solid fa-up-right-from-square + onclick: openIframeInNewTab() + - name: Print + description: Print the current view + icon: + class: fa-solid fa-print + onclick: window.print() + - name: Zoom + + icon: + class: fa-solid fa-search-plus + onclick: zoomPage(1.1) + - name: Zoom – + icon: + class: fa-solid fa-search-minus + onclick: zoomPage(0.9) diff --git a/app/static/js/fullscreen.js b/app/static/js/fullscreen.js index ecf348b..c796fe6 100644 --- a/app/static/js/fullscreen.js +++ b/app/static/js/fullscreen.js @@ -42,8 +42,11 @@ function exitFullscreen() { * Toggle between enter and exit fullscreen. */ function toggleFullscreen() { - if (document.fullscreenElement) exitFullscreen(); - else enterFullscreen(); + const params = new URLSearchParams(window.location.search); + const isFull = params.get('fullscreen') === '1'; + + if (isFull) exitFullscreen(); + else enterFullscreen(); } /** diff --git a/app/static/js/iframe.js b/app/static/js/iframe.js index c044c0b..51e847c 100644 --- a/app/static/js/iframe.js +++ b/app/static/js/iframe.js @@ -139,5 +139,20 @@ window.addEventListener('popstate', function(event) { } }); +/** + * Opens the current iframe URL in a new browser tab. + */ +function openIframeInNewTab() { + const params = new URLSearchParams(window.location.search); + const iframeUrl = params.get('iframe'); + if (iframeUrl) { + window.open(iframeUrl, '_blank'); + } else { + alert('No iframe is currently open.'); + } +} +// expose globally so your template’s onclick can find it +window.openIframeInNewTab = openIframeInNewTab; + // Adjust iframe height on window resize window.addEventListener('resize', syncIframeHeight); diff --git a/app/templates/moduls/navigation.html.j2 b/app/templates/moduls/navigation.html.j2 index 2b90ff4..257d383 100644 --- a/app/templates/moduls/navigation.html.j2 +++ b/app/templates/moduls/navigation.html.j2 @@ -8,30 +8,43 @@ {% endmacro %} {% macro render_children(children) %} - {% for children in children %} - {% if children.children %} -