From d4f6b1675644659691088eac6a150bbb2f11bc4b Mon Sep 17 00:00:00 2001 From: Greg Sarjeant <1686767+gsarjeant@users.noreply.github.com> Date: Mon, 23 Jun 2025 09:21:51 -0400 Subject: [PATCH] Enable strict accessibility toggle on navbar and homepage. --- src/Framework/Util/Util.php | 4 +++- src/View/HomeView/HomeView.php | 6 ++++-- templates/partials/home.php | 5 ++++- templates/partials/navbar.php | 24 ++++++++++++++++-------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/Framework/Util/Util.php b/src/Framework/Util/Util.php index 24bdafa..cdff28a 100644 --- a/src/Framework/Util/Util.php +++ b/src/Framework/Util/Util.php @@ -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 '' . $escaped_url . ''; + return '' . $escaped_url . ''; }, $text ); diff --git a/src/View/HomeView/HomeView.php b/src/View/HomeView/HomeView.php index 45444e7..4fe87d9 100644 --- a/src/View/HomeView/HomeView.php +++ b/src/View/HomeView/HomeView.php @@ -22,10 +22,12 @@ class HomeView {
1): ?> - « Newer + strictAccessibility): ?>tabindex="0" + href="?page=">« Newer - Older » + strictAccessibility): ?>tabindex="0" + href="?page=">Older »
diff --git a/templates/partials/home.php b/templates/partials/home.php index 2647474..120b5c7 100644 --- a/templates/partials/home.php +++ b/templates/partials/home.php @@ -12,7 +12,10 @@ mood) ?> - Change mood + strictAccessibility): ?>tabindex="0" + href="basePath) ?>mood" + class="change-mood">Change mood about)): ?> diff --git a/templates/partials/navbar.php b/templates/partials/navbar.php index 4ee40b2..3ef8cb7 100644 --- a/templates/partials/navbar.php +++ b/templates/partials/navbar.php @@ -1,25 +1,33 @@ \ No newline at end of file