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