feat(invites: enable dark mode

This commit is contained in:
Stefan Strigler
2026-03-01 20:09:20 +01:00
parent f210803202
commit 179c5c4cbb
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -30,6 +30,6 @@
{% block extra_scripts %}{% endblock %}
<script src="{{ static }}/jquery/jquery.min.js" integrity="sha384-fgGyf7Mo7DURSOMnOy7ed+dkq5Job205Gnzu6QIg0BOHKaqt4D76Dt8VlDCzcMHV"></script>
<script src="{{ static }}/bootstrap/js/bootstrap.min.js" integrity="sha384-G/EV+4j2dNv+tEPo3++6LCgdCROaejBqfUeNjuKAiuXbjrxilcCdDz6ZAVfHWe1Y"></script>
<script src="{{ static }}/invite.js" integrity="sha384-9UT63wKlfkiGEXmaNqAZBDtYPXYiYIbHZj16vD7NbvWF2e6WJNTt+XBev7dlVbm1"></script>
<script src="{{ static }}/invite.js" integrity="sha384-ipfEWDupA8ErMMGTLXGpx93/xQwq9rwfRUtDI5NH3GfCS+QFSYmpFS+blGWXcBBL"></script>
</body>
</html>
+6 -4
View File
@@ -1,4 +1,6 @@
(function () {
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'));
// If QR lib loaded ok, show QR button on desktop devices
if(window.QRCode) {
const qrcode_opts = {
@@ -9,6 +11,10 @@
document.getElementById('qr-button-container').classList.add("d-md-block");
}
const toggle_pw_button = document.getElementById('toggle-pw-button');
if (toggle_pw_button)
toggle_pw_button.addEventListener('click', toggle_password);
// Detect current platform and show/hide appropriate clients
if(window.platform) {
let platform_friendly = null;
@@ -95,10 +101,6 @@
}
}
}
const toggle_pw_button = document.getElementById('toggle-pw-button');
if (toggle_pw_button)
toggle_pw_button.addEventListener('click', toggle_password);
})();
function toggle_password(e) {