Enable strict accessibility toggle on navbar and homepage.
This commit is contained in:
parent
35033e50a6
commit
d4f6b16756
@ -17,10 +17,12 @@ class Util {
|
||||
return preg_replace_callback(
|
||||
'~(https?://[^\s<>"\'()]+)~i',
|
||||
function($matches) use ($link_attrs) {
|
||||
global $config;
|
||||
$escaped_url = rtrim($matches[1], '.,!?;:)]}>');
|
||||
$clean_url = html_entity_decode($escaped_url, ENT_QUOTES, 'UTF-8');
|
||||
$tabIndex = $config->strictAccessibility ? ' tabindex="0" ' : ' ';
|
||||
|
||||
return '<a tabindex="0" href="' . $clean_url . '"' . $link_attrs . '>' . $escaped_url . '</a>';
|
||||
return '<a' . $tabIndex . 'href="' . $clean_url . '"' . $link_attrs . '>' . $escaped_url . '</a>';
|
||||
},
|
||||
$text
|
||||
);
|
||||
|
@ -22,10 +22,12 @@ class HomeView {
|
||||
</ul>
|
||||
<div class="tick-pagination">
|
||||
<?php if ($page > 1): ?>
|
||||
<a tabindex="0" href="?page=<?php echo $page - 1 ?>">« Newer</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="?page=<?php echo $page - 1 ?>">« Newer</a>
|
||||
<?php endif; ?>
|
||||
<?php if (count($ticks) === $limit): ?>
|
||||
<a tabindex="0" href="?page=<?php echo $page + 1 ?>">Older »</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="?page=<?php echo $page + 1 ?>">Older »</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
@ -12,7 +12,10 @@
|
||||
<span class="profile-greeting-content-mood"><?php echo Util::escape_html($user->mood) ?></span>
|
||||
</span>
|
||||
<?php if (Session::isLoggedIn()): ?>
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>mood" class="change-mood">Change mood</a>
|
||||
<a
|
||||
<?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>mood"
|
||||
class="change-mood">Change mood</a>
|
||||
<?php endif ?>
|
||||
</dd>
|
||||
<?php if (!empty($user->about)): ?>
|
||||
|
@ -1,25 +1,33 @@
|
||||
<?php /** @var ConfigModel $config */ ?>
|
||||
<?php /* https://www.w3schools.com/howto/howto_css_dropdown.asp */ ?>
|
||||
<nav aria-label="Main navigation">
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>">home</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>">home</a>
|
||||
<details>
|
||||
<summary aria-haspopup="true">feeds</summary>
|
||||
<div class="dropdown-items">
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>feed/rss">rss</a>
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>feed/atom">atom</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>feed/rss">rss</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>feed/atom">atom</a>
|
||||
</div>
|
||||
</details>
|
||||
<?php if (!Session::isLoggedIn()): ?>
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>login">login</a>
|
||||
<a tabindex="0"
|
||||
href="<?= Util::escape_html($config->basePath) ?>login">login</a>
|
||||
<?php else: ?>
|
||||
<details>
|
||||
<summary aria-haspopup="true">admin</summary>
|
||||
<div class="dropdown-items">
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>admin">settings</a>
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>admin/css">css</a>
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>admin/emoji">emoji</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>admin">settings</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>admin/css">css</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>admin/emoji">emoji</a>
|
||||
</div>
|
||||
</details>
|
||||
<a tabindex="0" href="<?= Util::escape_html($config->basePath) ?>logout">logout</a>
|
||||
<a <?php if($config->strictAccessibility): ?>tabindex="0"<?php endif; ?>
|
||||
href="<?= Util::escape_html($config->basePath) ?>logout">logout</a>
|
||||
<?php endif; ?>
|
||||
</nav>
|
Loading…
x
Reference in New Issue
Block a user