diff --git a/infrastructure/web/public/javascripts/utils.js b/infrastructure/web/public/javascripts/utils.js index 26fa540..9f629a7 100644 --- a/infrastructure/web/public/javascripts/utils.js +++ b/infrastructure/web/public/javascripts/utils.js @@ -551,8 +551,23 @@ document.addEventListener('DOMContentLoaded', () => { }); } + // Raw mail tab switcher + function initRawTabs() { + const buttons = document.querySelectorAll('.raw-tab-button'); + const panels = document.querySelectorAll('.raw-mail[data-panel]'); + if (buttons.length === 0) return; + + buttons.forEach(btn => { + btn.addEventListener('click', () => { + const target = btn.dataset.target; + buttons.forEach(b => b.classList.toggle('active', b === btn)); + panels.forEach(p => p.classList.toggle('hidden', p.dataset.panel !== target)); + }); + }); + } + // Expose utilities and run them - window.utils = { formatEmailDates, formatMailDate, initLockModals, initCopyAddress, initExpiryTimers, initQrModal, initHamburgerMenu, initThemeToggle, initRefreshCountdown, initCryptoKeysToggle, initForwardModal, initForwardAllModal, initAccountModals }; + window.utils = { formatEmailDates, formatMailDate, initLockModals, initCopyAddress, initExpiryTimers, initQrModal, initHamburgerMenu, initThemeToggle, initRefreshCountdown, initCryptoKeysToggle, initForwardModal, initForwardAllModal, initAccountModals, initRawTabs }; formatEmailDates(); formatMailDate(); initLockModals(); @@ -563,4 +578,5 @@ document.addEventListener('DOMContentLoaded', () => { initForwardModal(); initCryptoKeysToggle(); initAccountModals(); + initRawTabs(); }); diff --git a/infrastructure/web/views/layout.twig b/infrastructure/web/views/layout.twig index 5f369bb..dc29f56 100644 --- a/infrastructure/web/views/layout.twig +++ b/infrastructure/web/views/layout.twig @@ -11,25 +11,25 @@ - + - + - - + + - - + + - - + + - + {% endblock %} diff --git a/infrastructure/web/views/raw.twig b/infrastructure/web/views/raw.twig index 104d1e7..2c234ae 100644 --- a/infrastructure/web/views/raw.twig +++ b/infrastructure/web/views/raw.twig @@ -13,19 +13,6 @@
- {% endblock %} {% block footer %}{% endblock %} diff --git a/infrastructure/web/views/stats.twig b/infrastructure/web/views/stats.twig index c390b34..fd0efa7 100644 --- a/infrastructure/web/views/stats.twig +++ b/infrastructure/web/views/stats.twig @@ -6,18 +6,18 @@ - + - + - - + + - + {% endblock %} {% block header %}