Merge pull request #1910 from cryptpad/create-account

Improve screen reader support for register/login flow
This commit is contained in:
yflory 2025-06-27 15:29:11 +02:00 committed by GitHub
commit 0cefe2ee28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View File

@ -77,6 +77,7 @@ define([
if (!ref) { return; }
var attrs = {
href: ref,
role: 'button',
};
var iconName = '';
if (!/^\//.test(ref)) {
@ -155,7 +156,7 @@ define([
return h('footer.cp-footer', [
h('div.cp-footer-left', [
h('a', {href:"https://cryptpad.org"}, [
h('a', {href:"https://cryptpad.org", role: 'button'}, [
h('div.cp-logo-foot', [
h('img', {
src: '/customize/CryptPad_logo.svg',
@ -188,7 +189,7 @@ define([
var registerLink;
if (!ApiConfig.restrictRegistration) {
registerLink = h('a.nav-item.nav-link.cp-register-btn', { href: '/register/'}, [
registerLink = h('a.nav-item.nav-link.cp-register-btn', { href: '/register/', role: 'button'}, [
h('i.fa.fa-user', {'aria-hidden':'true'}),
Msg.login_register
]);
@ -196,14 +197,14 @@ define([
if (username === null) {
rightLinks = [
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/'}, [
h('a.nav-item.nav-link.cp-login-btn', { href: '/login/', role: 'button'}, [
h('i.fa.fa-sign-in', {'aria-hidden':'true'}),
Msg.login_login
]),
registerLink,
];
} else {
rightLinks = h('a.nav-item.nav-link.cp-user-btn', { href: '/drive/' }, [
rightLinks = h('a.nav-item.nav-link.cp-user-btn', { href: '/drive/', role: 'button'}, [
h('i.fa.fa-user-circle', {'aria-hidden':'true'}),
" ",
username
@ -211,7 +212,7 @@ define([
}
var isHome = ['/', '/index.html'].includes(window.location.pathname);
var homeLink = h('a.nav-item.nav-link.cp-back-home' /* .navbar-brand */, { href: '/index.html' }, [
var homeLink = h('a.nav-item.nav-link.cp-back-home' /* .navbar-brand */, { href: '/index.html', role: 'button'}, [
h('i.fa.fa-arrow-left'),
h('img', {
src: '/customize/CryptPad_logo.svg',
@ -231,7 +232,7 @@ define([
return h('nav.navbar.navbar-expand-lg',
[
!isHome? homeLink: undefined,
h('a.nav-item.nav-link', { href: '/features.html'}, [
h('a.nav-item.nav-link', { href: '/features.html', role: 'button'}, [
h('i.fa.fa-info-circle'),
pricingName
]),

View File

@ -212,6 +212,12 @@ define([
h('div'+cls, content),
])
]);
var dialogContent = frame.querySelector('div' + cls);
dialogContent.setAttribute('aria-live', 'assertive');
dialogContent.setAttribute('role', 'alertdialog');
dialogContent.setAttribute('aria-modal', 'true');
var $frame = $(frame);
frame.closeModal = function (cb) {
frame.closeModal = function () {}; // Prevent further calls