Several accessibility improvements

This commit is contained in:
Michael 2025-01-26 12:35:26 +00:00
parent 8bf3d6694a
commit c978c8e027
20 changed files with 45 additions and 35 deletions

View file

@ -356,6 +356,7 @@ class Page implements ArrayAccess
$tpl = Renderer::getMarkupTemplate('footer.tpl'); $tpl = Renderer::getMarkupTemplate('footer.tpl');
$this->page['footer'] = Renderer::replaceMacros($tpl, [ $this->page['footer'] = Renderer::replaceMacros($tpl, [
'$footerScripts' => array_unique($this->footerScripts), '$footerScripts' => array_unique($this->footerScripts),
'$close' => $l10n->t('Close'),
]) . $this->page['footer']; ]) . $this->page['footer'];
} }

View file

@ -1583,7 +1583,7 @@ class BBCode
// Check for headers // Check for headers
if ($simple_html == self::INTERNAL) { if ($simple_html == self::INTERNAL) {
//Ensure to always start with <h4> if possible //Ensure to always start with <h3> if possible
$heading_count = 0; $heading_count = 0;
for ($level = 6; $level > 0; $level--) { for ($level = 6; $level > 0; $level--) {
if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) { if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) {
@ -1591,7 +1591,7 @@ class BBCode
} }
} }
if ($heading_count > 0) { if ($heading_count > 0) {
$heading = min($heading_count + 3, 6); $heading = min($heading_count + 2, 6);
for ($level = 6; $level > 0; $level--) { for ($level = 6; $level > 0; $level--) {
if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) { if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) {
$text = preg_replace("(\[h$level\](.*?)\[\/h$level\])ism", "</p><h$heading>$1</h$heading><p>", $text); $text = preg_replace("(\[h$level\](.*?)\[\/h$level\])ism", "</p><h$heading>$1</h$heading><p>", $text);

View file

@ -134,6 +134,6 @@ class BaseProfile extends BaseModule
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs']]); return Renderer::replaceMacros($tpl, ['$tabs' => $arr['tabs'], '$more' => DI::l10n()->t('More')]);
} }
} }

View file

@ -119,6 +119,8 @@ class Show extends BaseModule
'$week' => $this->t('week'), '$week' => $this->t('week'),
'$day' => $this->t('day'), '$day' => $this->t('day'),
'$list' => $this->t('list'), '$list' => $this->t('list'),
'$prev' => $this->t('prev'),
'$next' => $this->t('next'),
]); ]);
return $o; return $o;

View file

@ -387,7 +387,7 @@ class Contact extends BaseModule
]; ];
$tabs_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tabs_tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
$tabs_html = Renderer::replaceMacros($tabs_tpl, ['$tabs' => $tabs]); $tabs_html = Renderer::replaceMacros($tabs_tpl, ['$tabs' => $tabs, '$more' => DI::l10n()->t('More')]);
switch ($rel) { switch ($rel) {
case 'followers': case 'followers':
@ -534,7 +534,7 @@ class Contact extends BaseModule
} }
$tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
$tab_str = Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); $tab_str = Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs, '$more' => DI::l10n()->t('More')]);
return $tab_str; return $tab_str;
} }

View file

@ -95,7 +95,7 @@ class Channel extends Timeline
$tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel')); $tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel'));
$tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
$o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs, '$more' => $this->l10n->t('More')]);
Nav::setSelected('channel'); Nav::setSelected('channel');

View file

@ -88,7 +88,7 @@ class Community extends Timeline
if (!$this->raw) { if (!$this->raw) {
$tabs = $this->getTabArray($this->community->getTimelines($this->session->isAuthenticated()), 'community'); $tabs = $this->getTabArray($this->community->getTimelines($this->session->isAuthenticated()), 'community');
$tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
$o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs, '$more' => $this->l10n->t('More')]);
Nav::setSelected('community'); Nav::setSelected('community');

View file

@ -292,7 +292,7 @@ class Network extends Timeline
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
return Renderer::replaceMacros($tpl, ['$tabs' => $tabs]); return Renderer::replaceMacros($tpl, ['$tabs' => $tabs, '$more' => $this->l10n->t('More')]);
} }
protected function parseRequest(array $request) protected function parseRequest(array $request)

View file

@ -99,7 +99,7 @@ abstract class BaseUsers extends BaseModeration
Hook::callAll('moderation_users_tabs', $tabs_arr); Hook::callAll('moderation_users_tabs', $tabs_arr);
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
return Renderer::replaceMacros($tpl, ['$tabs' => $tabs_arr['tabs']]); return Renderer::replaceMacros($tpl, ['$tabs' => $tabs_arr['tabs'], '$more' => $this->t('More')]);
} }
protected function setupUserCallback(): \Closure protected function setupUserCallback(): \Closure

View file

@ -498,8 +498,10 @@ class Post
} }
$languages = []; $languages = [];
$language = '';
if (!empty($item['language'])) { if (!empty($item['language'])) {
$languages = DI::l10n()->t('Languages'); $languages = DI::l10n()->t('Languages');
$language = array_key_first(json_decode($item['language'], true));
} }
if (in_array($item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($item['network'], Protocol::FEDERATED)) { if (in_array($item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($item['network'], Protocol::FEDERATED)) {
@ -579,6 +581,7 @@ class Post
'tagger' => $tagger, 'tagger' => $tagger,
'filer' => $filer, 'filer' => $filer,
'language' => $languages, 'language' => $languages,
'lang' => $language,
'searchtext' => DI::l10n()->t('Search Text'), 'searchtext' => DI::l10n()->t('Search Text'),
'drop' => $drop, 'drop' => $drop,
'block' => $block, 'block' => $block,

View file

@ -248,11 +248,11 @@ Karl Marx - Die ursprüngliche Akkumulation
'text' => '[emoji=https://fedi.underscore.world/emoji/custom/custom/heart_nb.png]:heart_nb:[/emoji]', 'text' => '[emoji=https://fedi.underscore.world/emoji/custom/custom/heart_nb.png]:heart_nb:[/emoji]',
], ],
'task-12900-multiple-paragraphs' => [ 'task-12900-multiple-paragraphs' => [
'expectedHTML' => '<h4>Header</h4><ul><li>One</li><li>Two</li></ul><p>This is a paragraph<br>with a line feed.</p><p>Second Chapter</p>', 'expectedHTML' => '<h3>Header</h3><ul><li>One</li><li>Two</li></ul><p>This is a paragraph<br>with a line feed.</p><p>Second Chapter</p>',
'text' => "[h4]Header[/h4][ul][li]One[li]Two[/ul]\n\nThis is a paragraph\nwith a line feed.\n\nSecond Chapter", 'text' => "[h4]Header[/h4][ul][li]One[li]Two[/ul]\n\nThis is a paragraph\nwith a line feed.\n\nSecond Chapter",
], ],
'task-12900-header-with-paragraphs' => [ 'task-12900-header-with-paragraphs' => [
'expectedHTML' => '<h4>Header</h4><p>Some Chapter</p>', 'expectedHTML' => '<h3>Header</h3><p>Some Chapter</p>',
'text' => '[h4]Header[/h4]Some Chapter', 'text' => '[h4]Header[/h4]Some Chapter',
], ],
'bug-12842-ul-newlines' => [ 'bug-12842-ul-newlines' => [

View file

@ -1806,7 +1806,8 @@ blockquote.shared_content {
} }
/* wall items contact info */ /* wall items contact info */
.media .media-body h4.media-heading { .media .media-body h1.media-heading,
.media .media-body h2.media-heading {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: $font_color_darker; color: $font_color_darker;
@ -2604,7 +2605,7 @@ ul.viewcontact_wrapper > li {
.contact-entry-checkbox { .contact-entry-checkbox {
margin-top: -20px; margin-top: -20px;
} }
.contact-wrapper .media-body .contact-entry-name h4.media-heading a { .contact-wrapper .media-body .contact-entry-name h1.media-heading a {
font-weight: bold !important; font-weight: bold !important;
color: $link_color; color: $link_color;
font-size: 15px !important; font-size: 15px !important;
@ -2706,10 +2707,10 @@ ul li:hover .contact-wrapper .contact-action-link:hover {
#circle-update-wrapper .shortmode .contact-entry-desc { #circle-update-wrapper .shortmode .contact-entry-desc {
font-size: 12px !important; font-size: 12px !important;
} }
#circle-update-wrapper .shortmode .contact-entry-desc h4.media-heading { #circle-update-wrapper .shortmode .contact-entry-desc h1.media-heading {
margin: 0; margin: 0;
} }
#circle-update-wrapper .shortmode .contact-entry-desc h4.media-heading a { #circle-update-wrapper .shortmode .contact-entry-desc h1.media-heading a {
font-size: 13px !important; font-size: 13px !important;
white-space: nowrap; white-space: nowrap;
} }

View file

@ -67,7 +67,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
</head> </head>
<body id="top" class="mod-<?php echo $page['module'] . " " . $is_singleuser_class . " " . $view_mode_class;?>"> <body id="top" class="mod-<?php echo $page['module'] . " " . $is_singleuser_class . " " . $view_mode_class;?>">
<a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a> <a href="<?php echo DI::args()->getCommand(); ?>/#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
<?php <?php
if (!empty($page['nav']) && !$minimal) { if (!empty($page['nav']) && !$minimal) {
echo str_replace( echo str_replace(

View file

@ -5,6 +5,9 @@
* *
* SPDX-License-Identifier: AGPL-3.0-or-later * SPDX-License-Identifier: AGPL-3.0-or-later
*/ */
use Friendica\DI;
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -27,7 +30,7 @@
<div class="modal-dialog modal-full-screen"> <div class="modal-dialog modal-full-screen">
<div class="modal-content"> <div class="modal-content">
<div id="modal-header" class="modal-header"> <div id="modal-header" class="modal-header">
<button id="modal-close" type="button" class="close" data-dismiss="modal"> <button id="modal-close" type="button" class="close" data-dismiss="modal" title="<?php echo DI::l10n()->t('Close'); ?>">
&times; &times;
</button> </button>
<h4 id="modal-title" class="modal-title"></h4> <h4 id="modal-title" class="modal-title"></h4>

View file

@ -25,7 +25,7 @@ $frio = 'view/theme/frio';
</head> </head>
<body id="top"> <body id="top">
<?php if($_SERVER['REQUEST_URI'] == '/'){header('Location: /login');} ?> <?php if($_SERVER['REQUEST_URI'] == '/'){header('Location: /login');} ?>
<a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a> <a href="<?php echo DI::args()->getCommand(); ?>/#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
<?php <?php
if(!empty($page['nav'])) { if(!empty($page['nav'])) {
echo str_replace('~config.sitename~', DI::config()->get('config','sitename'), echo str_replace('~config.sitename~', DI::config()->get('config','sitename'),
@ -114,7 +114,7 @@ $('nav').bind('nav-update', function(e,data)
<div class="modal-dialog modal-full-screen"> <div class="modal-dialog modal-full-screen">
<div class="modal-content"> <div class="modal-content">
<div id="modal-header" class="modal-header"> <div id="modal-header" class="modal-header">
<button id="modal-close" type="button" class="close" data-dismiss="modal"> <button id="modal-close" type="button" class="close" data-dismiss="modal" title="<?php echo DI::l10n()->t('Close'); ?>">
&times; &times;
</button> </button>
<h4 id="modal-title" class="modal-title"></h4> <h4 id="modal-title" class="modal-title"></h4>

View file

@ -46,8 +46,8 @@
{{* The buttons to change the month/weeks/days *}} {{* The buttons to change the month/weeks/days *}}
<div id="fc-fc-header-left" class="btn-group"> <div id="fc-fc-header-left" class="btn-group">
<button class="btn btn-eventnav" onclick="changeView('prev', false);" title="{{$previous.1}}"><i class="fa fa-angle-up" aria-hidden="true"></i></button> <button class="btn btn-eventnav" onclick="changeView('prev', false);" title="{{$prev}}"><i class="fa fa-angle-up" aria-hidden="true"></i></button>
<button class="btn btn-eventnav btn-separator" onclick="changeView('next', false);" title="{{$next.1}}"><i class="fa fa-angle-down" aria-hidden="true"></i></button> <button class="btn btn-eventnav btn-separator" onclick="changeView('next', false);" title="{{$next}}"><i class="fa fa-angle-down" aria-hidden="true"></i></button>
<button class="btn btn-eventnav btn-separator" onclick="changeView('today', false);" title="{{$today}}"><i class="fa fa-bullseye" aria-hidden="true"></i></button> <button class="btn btn-eventnav btn-separator" onclick="changeView('today', false);" title="{{$today}}"><i class="fa fa-bullseye" aria-hidden="true"></i></button>
</div> </div>

View file

@ -27,7 +27,7 @@
<ul class="tabs tabs-extended" role="menu"> <ul class="tabs tabs-extended" role="menu">
<li role="presentation" class="dropdown flex-target"> <li role="presentation" class="dropdown flex-target">
<button type="button" class="btn-link dropdown-toggle" id="dropdownMenuTools" data-toggle="dropdown" <button type="button" class="btn-link dropdown-toggle" id="dropdownMenuTools" data-toggle="dropdown"
aria-expanded="false"> aria-expanded="false" title="{{$more}}">
<i class="fa fa-chevron-down" aria-hidden="true"></i> <i class="fa fa-chevron-down" aria-hidden="true"></i>
</button> </button>
</li> </li>
@ -59,7 +59,7 @@
<ul class="tabs tabs-extended"> <ul class="tabs tabs-extended">
<li class="dropdown"> <li class="dropdown">
<button type="button" class="btn-link dropdown-toggle" id="dropdownMenuTools-xs" <button type="button" class="btn-link dropdown-toggle" id="dropdownMenuTools-xs"
data-toggle="dropdown" aria-expanded="false"> data-toggle="dropdown" aria-expanded="false" title="{{$more}}">
<i class="fa fa-chevron-down" aria-hidden="true"></i> <i class="fa fa-chevron-down" aria-hidden="true"></i>
</button> </button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenuTools"> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenuTools">

View file

@ -9,7 +9,7 @@
<div class="modal-dialog modal-full-screen"> <div class="modal-dialog modal-full-screen">
<div class="modal-content"> <div class="modal-content">
<div id="modal-header" class="modal-header"> <div id="modal-header" class="modal-header">
<button id="modal-close" type="button" class="close" data-dismiss="modal"> <button id="modal-close" type="button" class="close" data-dismiss="modal" title="{{$close}}">
&times; &times;
</button> </button>
<h4 id="modal-title" class="modal-title"></h4> <h4 id="modal-title" class="modal-title"></h4>

View file

@ -45,7 +45,7 @@
<span class="wall-item-network" title="{{$item.app}}">{{$item.network_name}}</span> <span class="wall-item-network" title="{{$item.app}}">{{$item.network_name}}</span>
{{/if}} {{/if}}
</div> </div>
<h4 class="media-heading"> <h2 class="media-heading">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card"> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card">
<span class="wall-item-name {{$item.sparkle}}">{{$item.name}}</span> <span class="wall-item-name {{$item.sparkle}}">{{$item.name}}</span>
</a> </a>
@ -82,7 +82,7 @@
{{/if}} {{/if}}
</div> </div>
{{* @todo $item.created have to be inserted *}} {{* @todo $item.created have to be inserted *}}
</h4> </h2>
</div> </div>
{{* contact info header for smartphones *}} {{* contact info header for smartphones *}}
@ -113,7 +113,7 @@
{{* item content *}} {{* item content *}}
<div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}"> <div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}">
{{if $item.title}} {{if $item.title}}
<span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h4 class="media-heading" dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}}">{{$item.title}}</a></h4><br /></span> <span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h2 class="media-heading" dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}}">{{$item.title}}</a></h2><br /></span>
{{/if}} {{/if}}
<div class="wall-item-body" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div> <div class="wall-item-body" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div>

View file

@ -138,7 +138,7 @@ as the value of $top_child_total (this is done at the end of this file)
</div> </div>
{{if $item.thread_level==1}} {{if $item.thread_level==1}}
<div class="hidden-sm hidden-xs media-body"><!-- <= For computer --> <div class="hidden-sm hidden-xs media-body"><!-- <= For computer -->
<h4 class="media-heading"> <h1 class="media-heading">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card"> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card">
<span class="wall-item-name {{$item.sparkle}}">{{$item.name}}</span> <span class="wall-item-name {{$item.sparkle}}">{{$item.name}}</span>
</a> </a>
@ -148,7 +148,7 @@ as the value of $top_child_total (this is done at the end of this file)
<span class="wall-item-name {{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span> <span class="wall-item-name {{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span>
</a> </a>
{{/if}} {{/if}}
</h4> </h1>
<div class="additional-info text-muted"> <div class="additional-info text-muted">
<div id="wall-item-ago-{{$item.id}}" class="wall-item-ago"> <div id="wall-item-ago-{{$item.id}}" class="wall-item-ago">
@ -189,7 +189,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{* contact info header for smartphones *}} {{* contact info header for smartphones *}}
<div class="contact-info-xs hidden-lg hidden-md"><!-- <= For smartphone (responsive) --> <div class="contact-info-xs hidden-lg hidden-md"><!-- <= For smartphone (responsive) -->
<h5 class="media-heading"> <h2 class="media-heading">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card"><span>{{$item.name}}</span></a> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card"><span>{{$item.name}}</span></a>
<p class="text-muted"> <p class="text-muted">
<small> <small>
@ -214,15 +214,15 @@ as the value of $top_child_total (this is done at the end of this file)
{{/if}} {{/if}}
</small> </small>
</p> </p>
</h5> </h2>
</div> </div>
{{else}} {{* End of if $item.thread_level == 1 *}} {{else}} {{* End of if $item.thread_level == 1 *}}
{{* contact info header for comments *}} {{* contact info header for comments *}}
<div class="contact-info-comment"> <div class="contact-info-comment">
<h5 class="media-heading"> <h2 class="media-heading">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card"><span class="fakelink">{{$item.name}}</span></a> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link userinfo hover-card"><span class="fakelink">{{$item.name}}</span></a>
<span class="text-muted"> <span class="text-muted">
</h5> </h2>
<small> <small>
{{if $item.parentguid}} {{if $item.parentguid}}
<span class="hidden-xs hidden-sm"> <span class="hidden-xs hidden-sm">
@ -270,12 +270,12 @@ as the value of $top_child_total (this is done at the end of this file)
{{* item content *}} {{* item content *}}
<div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}"> <div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}">
{{if $item.title}} {{if $item.title}}
<span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h4 class="media-heading" dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name" target="_blank">{{$item.title}}</a></h4><br /></span> <span class="wall-item-title" id="wall-item-title-{{$item.id}}"><h3 class="media-heading" dir="auto"><a href="{{$item.plink.href}}" class="{{$item.sparkle}} p-name" target="_blank">{{$item.title}}</a></h3><br /></span>
{{/if}} {{/if}}
{{if $item.summary}} {{if $item.summary}}
<summary class="wall-item-summary" id="wall-item-summary-{{$item.id}}">{{$item.summary}}</summary> <summary class="wall-item-summary" id="wall-item-summary-{{$item.id}}">{{$item.summary}}</summary>
{{/if}} {{/if}}
<div class="wall-item-body e-content {{if !$item.title}}p-name{{/if}}" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div> <div class="wall-item-body e-content {{if !$item.title}}p-name{{/if}}" id="wall-item-body-{{$item.id}}" dir="auto" lang="{{$item.lang}}">{{$item.body_html nofilter}}</div>
</div> </div>
<!-- TODO --> <!-- TODO -->