Merge branch 'automated-accessibility-fixes' into 2024.6-test

This commit is contained in:
yflory 2024-06-21 17:22:16 +02:00
commit 3e446a4578
8 changed files with 15 additions and 5 deletions

View File

@ -88,6 +88,9 @@ define(req, function(AppConfig, Default, Language) {
});
}
let html = typeof(document) !== "undefined" && document.documentElement;
if (html) { html.setAttribute('lang', language); }
var extend = function (a, b) {
for (var k in b) {
if (Array.isArray(b[k])) {

View File

@ -790,7 +790,7 @@ define([
var currentContainer = blocks.block([], 'cp-admin-customize-logo');
let redraw = () => {
var current = h('img', {src: '/api/logo?'+(+new Date())});
var current = h('img', {src: '/api/logo?'+(+new Date()),alt:'Custom logo'}); // XXX
$(currentContainer).empty().append(current);
};
redraw();

View File

@ -925,7 +925,8 @@ define([
title: text,
href: href,
target: "_blank",
'data-tippy-placement': "right"
'data-tippy-placement': "right",
'aria-label': Messages.help_genericMore //TBC XXX
});
return q;
};
@ -1205,14 +1206,14 @@ define([
if (labelOpts.class) { labelOpts.class += ' cp-checkmark'; }
// Mark properties
var markOpts = { tabindex: 0 };
var markOpts = { tabindex: 0, role: 'checkbox', 'aria-checked': checked, 'aria-labelledby': inputOpts.id + '-label' };
$.extend(markOpts, opts.mark || {});
var input = h('input', inputOpts);
var $input = $(input);
var mark = h('span.cp-checkmark-mark', markOpts);
var $mark = $(mark);
var label = h('span.cp-checkmark-label', labelTxt);
var label = h('span.cp-checkmark-label', {id: inputOpts.id + '-label'}, labelTxt);
$mark.keydown(function (e) {
if ($input.is(':disabled')) { return; }
@ -1228,8 +1229,10 @@ define([
if (!opts.labelAlt) { return; }
if ($input.is(':checked') !== checked) {
$(label).text(opts.labelAlt);
$mark.attr('aria-checked', 'true');
} else {
$(label).text(labelTxt);
$mark.attr('aria-checked', 'false');
}
});

View File

@ -2645,7 +2645,7 @@ define([
var urlArgs = (Config.requireConf && Config.requireConf.urlArgs) || '';
var logo = h('img', { src: '/customize/CryptPad_logo.svg?' + urlArgs });
var fill1 = h('div.cp-creation-fill.cp-creation-logo', logo);
var fill1 = h('div.cp-creation-fill.cp-creation-logo',{ role: 'presentation' }, logo);
var fill2 = h('div.cp-creation-fill');
var $creation = $('<div>', { id: 'cp-creation', tabindex:1 });
$creationContainer.append([fill1, $creation, fill2]);

View File

@ -2247,6 +2247,7 @@ define([
$element.prepend(img);
$(img).addClass('cp-app-drive-element-grid cp-app-drive-element-thumbnail');
$(img).attr("draggable", false);
$(img).attr("role", "presentation");
addTitleIcon(element, $name);
} else {
common.displayThumbnail(href || data.roHref, data.channel, data.password, $element, function ($thumb) {

View File

@ -78,6 +78,7 @@ define([
requireConfig.urlArgs + '#' + encodeURIComponent(JSON.stringify(req)));
$i.attr('allowfullscreen', 'true');
$i.attr('allow', 'clipboard-write');
$i.attr('title', 'iframe');
$('iframe-placeholder').after($i).remove();
// This is a cheap trick to avoid loading sframe-channel in parallel with the

View File

@ -1195,6 +1195,7 @@ MessengerUI, Messages, Pages, PadTypes) {
if (![13,32,46].includes(e.which)) { return; }
e.stopPropagation();
if (e.which === 46) {
$('body').find('.cp-dropdown-content li').first().focus();
return $(el).find('.cp-notification-dismiss').click();
}
$(el).find('.cp-notification-content').click();

View File

@ -1049,6 +1049,7 @@ define([
var $pubLabel = $('<span>', {'class': 'cp-default-label'})
.text(Messages.settings_publicSigningKey);
$key.append($pubLabel).append(UI.dialog.selectable(userHref));
$key.find('input').attr('aria-label', Messages.settings_publicSigningKey);
}
var content = [container];
cb(content);