Files
tabler/screenshots/pages/modal-change-password.astro

34 lines
1.4 KiB
Plaintext

---
// The Change password modal added in 1.5 — strength meter, confirm check and
// show/hide toggles. Rendered inline (ModalInline + `show`) so a static capture
// shows the open dialog.
import ScreenshotLayout from '../layouts/ScreenshotLayout.astro'
import ModalInline from '@shared/components/modals/ModalInline.astro'
import ChangePasswordModalContent from '@shared/components/modals/ChangePasswordModalContent.astro'
---
<ScreenshotLayout title="Change password modal" columns={2}>
<ModalInline class="position-relative rounded d-block w-auto h-auto z-0" modalId="change-password" show>
<ChangePasswordModalContent />
</ModalInline>
<!-- A capture of an empty form says nothing about the strength meter, so fill the
fields in and let the modal's own `input` handler rate the password. Runs on
DOMContentLoaded — after the modal's module script has attached that handler. -->
<script is:inline>
document.addEventListener('DOMContentLoaded', () => {
const values = {
'password-current': 'sunshine1',
'password-new': 'Tabler#1.5rocks',
'password-confirm': 'Tabler#1.5rocks',
}
for (const [id, value] of Object.entries(values)) {
const input = document.getElementById(id)
if (!input) continue
input.value = value
input.dispatchEvent(new Event('input', { bubbles: true }))
}
})
</script>
</ScreenshotLayout>