]> git.mxchange.org Git - friendica.git/commitdiff
Several accessibility improvements
authorMichael <heluecht@pirati.ca>
Sun, 26 Jan 2025 12:35:26 +0000 (12:35 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 26 Jan 2025 12:46:18 +0000 (12:46 +0000)
20 files changed:
src/App/Page.php
src/Content/Text/BBCode.php
src/Module/BaseProfile.php
src/Module/Calendar/Show.php
src/Module/Contact.php
src/Module/Conversation/Channel.php
src/Module/Conversation/Community.php
src/Module/Conversation/Network.php
src/Module/Moderation/BaseUsers.php
src/Object/Post.php
tests/src/Content/Text/BBCodeTest.php
view/theme/frio/css/style.css
view/theme/frio/php/default.php
view/theme/frio/php/minimal.php
view/theme/frio/php/standard.php
view/theme/frio/templates/calendar/calendar.tpl
view/theme/frio/templates/common_tabs.tpl
view/theme/frio/templates/footer.tpl
view/theme/frio/templates/search_item.tpl
view/theme/frio/templates/wall_thread.tpl

index 87493a67e4f6847dad0f15bad28e9cd1054473f7..ca831731846e2dbdcfa23abb9678aca38d0791d6 100644 (file)
@@ -356,6 +356,7 @@ class Page implements ArrayAccess
                $tpl                  = Renderer::getMarkupTemplate('footer.tpl');
                $this->page['footer'] = Renderer::replaceMacros($tpl, [
                        '$footerScripts' => array_unique($this->footerScripts),
+                       '$close'         => $l10n->t('Close'),
                ]) . $this->page['footer'];
        }
 
index f03dfa84be87162d97d3ea1acf49bfe3213449fc..2102b43a320a39f85626d682407baeedd77bb394 100644 (file)
@@ -1583,7 +1583,7 @@ class BBCode
                // Check for headers
 
                if ($simple_html == self::INTERNAL) {
-                       //Ensure to always start with <h4> if possible
+                       //Ensure to always start with <h3> if possible
                        $heading_count = 0;
                        for ($level = 6; $level > 0; $level--) {
                                if (preg_match("(\[h$level\].*?\[\/h$level\])ism", $text)) {
@@ -1591,7 +1591,7 @@ class BBCode
                                }
                        }
                        if ($heading_count > 0) {
-                               $heading = min($heading_count + 3, 6);
+                               $heading = min($heading_count + 2, 6);
                                for ($level = 6; $level > 0; $level--) {
                                        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);
index 2fab7931521640ecc025efed5fd3734ca998d670..c034287469b5a834efd881d4864ca40546635212 100644 (file)
@@ -134,6 +134,6 @@ class BaseProfile extends BaseModule
 
                $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')]);
        }
 }
index 0a55f7ada716ed0f9bb87dbb2baeab7110b64100..f808c9d50af2da061d8f502f542bcfc03a7428dd 100644 (file)
@@ -119,6 +119,8 @@ class Show extends BaseModule
                        '$week'  => $this->t('week'),
                        '$day'   => $this->t('day'),
                        '$list'  => $this->t('list'),
+                       '$prev'  => $this->t('prev'),
+                       '$next'  => $this->t('next'),
                ]);
 
                return $o;
index b352648df7da21c5568d01bed4d9553dbbc5ca56..e99816084526505ff6bc93795578aa536553c603 100644 (file)
@@ -387,7 +387,7 @@ class Contact extends BaseModule
                ];
 
                $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) {
                        case 'followers':
@@ -534,7 +534,7 @@ class Contact extends BaseModule
                }
 
                $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;
        }
index b711a58f4e909d8e0d065e0a329c0e4a493ae372..4c060b65d7643847f12c485cf3124587e7e98d9a 100644 (file)
@@ -95,7 +95,7 @@ class Channel extends Timeline
                        $tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel'));
 
                        $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');
 
index 375c86ee61dce73e2212d552c3e8564cc170209f..e3f75ddeaf9b0c315e904c8a4af03ffeec66ebf3 100644 (file)
@@ -88,7 +88,7 @@ class Community extends Timeline
                if (!$this->raw) {
                        $tabs    = $this->getTabArray($this->community->getTimelines($this->session->isAuthenticated()), 'community');
                        $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');
 
index bf8b0614a961646ab2f43f303745cc2a050bb2fa..d94aeb6cde82e49484facef21cad2ca2d777fec3 100644 (file)
@@ -292,7 +292,7 @@ class Network extends Timeline
 
                $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)
index 0123ce5bc84e53741f15c547abeee32b66ae6cd9..fcf4b4aa167e845266f61541e3e19f61fb30ba3d 100644 (file)
@@ -99,7 +99,7 @@ abstract class BaseUsers extends BaseModeration
                Hook::callAll('moderation_users_tabs', $tabs_arr);
 
                $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
index aafe1b305bd4f14f4962beefcc7149a1d66cd113..363ad5e7a945460d35031e10dec83806f309f938 100644 (file)
@@ -498,8 +498,10 @@ class Post
                }
 
                $languages = [];
+               $language  = '';
                if (!empty($item['language'])) {
                        $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)) {
@@ -579,6 +581,7 @@ class Post
                        'tagger'                 => $tagger,
                        'filer'                  => $filer,
                        'language'               => $languages,
+                       'lang'                   => $language,
                        'searchtext'             => DI::l10n()->t('Search Text'),
                        'drop'                   => $drop,
                        'block'                  => $block,
index 6d6c6107623d75c91c83f67fcea2250aaae03fb0..4757200000fe3ffee98fe63f44099e62e025f13f 100644 (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]',
                        ],
                        '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",
                        ],
                        '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',
                        ],
                        'bug-12842-ul-newlines' => [
index ddcb9abef600d12b04720a8e173775f409587c7a..811f9afc4f1cacce38e78cba25bb56ba41bc3005 100644 (file)
@@ -1806,7 +1806,8 @@ blockquote.shared_content {
 }
 
 /* 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-weight: 500;
        color: $font_color_darker;
@@ -2604,7 +2605,7 @@ ul.viewcontact_wrapper > li {
 .contact-entry-checkbox {
        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;
        color: $link_color;
        font-size: 15px !important;
@@ -2706,10 +2707,10 @@ ul li:hover .contact-wrapper .contact-action-link:hover {
 #circle-update-wrapper .shortmode .contact-entry-desc {
        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;
 }
-#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;
        white-space: nowrap;
 }
index 0f79ca718e13b3a7921f6a31681910c9857efc34..a0d67b474f719a013fff2299f421d661f69ad846 100644 (file)
@@ -67,7 +67,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
        </head>
 
        <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
        if (!empty($page['nav']) && !$minimal) {
                echo str_replace(
index 06be79c7446963be24bc6721887a3279deebf9da..98d5a69b85fb90fda08002daa0ae42b2ebca9120 100644 (file)
@@ -5,6 +5,9 @@
  *
  * SPDX-License-Identifier: AGPL-3.0-or-later
  */
+
+use Friendica\DI;
+
 ?>
 <!DOCTYPE html>
 <html>
@@ -27,7 +30,7 @@
                <div class="modal-dialog modal-full-screen">
                        <div class="modal-content">
                                <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;
                                        </button>
                                        <h4 id="modal-title" class="modal-title"></h4>
index e7bfa184787299ab8650ed7b8847b48e339bf519..1799f7f8367d8acd0b2f4e608462e100afc7997a 100644 (file)
@@ -25,7 +25,7 @@ $frio = 'view/theme/frio';
 </head>
 <body id="top">
 <?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
        if(!empty($page['nav'])) {
        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-content">
                        <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;
                                </button>
                                <h4 id="modal-title" class="modal-title"></h4>
index 4b7775857a49e6ab76e6c7066094758b4ed33052..c6578bcf5c299f6d610c3ff9d8336a83ef9932da 100644 (file)
@@ -46,8 +46,8 @@
 
                {{* The buttons to change the month/weeks/days *}}
                <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 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" 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}}"><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>
                </div>
 
index d1f3d1d4a62c3e3d4f588ff1b2e8a0f947066e3d..fa28c938ecc15ab356b2afa445a353ab0c21233e 100644 (file)
@@ -27,7 +27,7 @@
                        <ul class="tabs tabs-extended" role="menu">
                                <li role="presentation" class="dropdown flex-target">
                                        <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>
                                        </button>
                                </li>
@@ -59,7 +59,7 @@
                        <ul class="tabs tabs-extended">
                                <li class="dropdown">
                                        <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>
                                        </button>
                                        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenuTools">
index 0e662d19dc18d5c0194aced4c327e275bf42964d..305c73ba84e94fa80f529be38ef89a2e4107694d 100644 (file)
@@ -9,7 +9,7 @@
                                <div class="modal-dialog modal-full-screen">
                                        <div class="modal-content">
                                                <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;
                                                        </button>
                                                        <h4 id="modal-title" class="modal-title"></h4>
index 85d40cd6dd4c7942ac012d8295f9013a35eb94f5..caa43f58361c206acb1b05e6399a7072bf8dbb20 100644 (file)
@@ -45,7 +45,7 @@
                                                <span class="wall-item-network" title="{{$item.app}}">{{$item.network_name}}</span>
                                        {{/if}}
                                </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">
                                                <span class="wall-item-name {{$item.sparkle}}">{{$item.name}}</span>
                                        </a>
@@ -82,7 +82,7 @@
                                                {{/if}}
                                        </div>
                                {{* @todo $item.created have to be inserted *}}
-                               </h4>
+                               </h2>
                        </div>
 
                        {{* contact info header for smartphones *}}
                        {{* item content *}}
                        <div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}">
                                {{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}}
 
                                <div class="wall-item-body" id="wall-item-body-{{$item.id}}" dir="auto">{{$item.body_html nofilter}}</div>
index c945105eef7c5f517b04d1ad5c0d2ec016b02e92..db17771deda72c37463d4679c0c62634c23f77c0 100644 (file)
@@ -138,7 +138,7 @@ as the value of $top_child_total (this is done at the end of this file)
                        </div>
                {{if $item.thread_level==1}}
                        <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">
                                                <span class="wall-item-name {{$item.sparkle}}">{{$item.name}}</span>
                                        </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>
                                        </a>
                                {{/if}}
-                               </h4>
+                               </h1>
 
                                <div class="additional-info text-muted">
                                        <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 *}}
                        <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>
                                        <p class="text-muted">
                                                <small>
@@ -214,15 +214,15 @@ as the value of $top_child_total (this is done at the end of this file)
                                                        {{/if}}
                                                </small>
                                        </p>
-                               </h5>
+                               </h2>
                        </div>
                {{else}} {{* End of if $item.thread_level == 1 *}}
                        {{* contact info header for comments *}}
                        <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>
                                        <span class="text-muted">
-                               </h5>
+                               </h2>
                                <small>
                                        {{if $item.parentguid}}
                                                <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 *}}
                <div class="wall-item-content {{$item.type}}" id="wall-item-content-{{$item.id}}">
                        {{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 $item.summary}}
                        <summary class="wall-item-summary" id="wall-item-summary-{{$item.id}}">{{$item.summary}}</summary>
                        {{/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>
 
                <!-- TODO -->