From 230c65478f1b0c40036c5fcf4c69f98e8059fb84 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 20 Nov 2023 22:22:21 +0100 Subject: [PATCH 1/3] PageIndexWidget: restore wildcard functionality --- public/css/default.css | 3 +++ templates/PageIndexWidget.php | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/public/css/default.css b/public/css/default.css index e0815849..c13704bf 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -75,6 +75,9 @@ a:hover { .pagination .page-item { box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3); } +.pagination .wildcard { + cursor: pointer; +} @media (max-width: 767px) { .pagination { diff --git a/templates/PageIndexWidget.php b/templates/PageIndexWidget.php index 8e004907..c20baac1 100644 --- a/templates/PageIndexWidget.php +++ b/templates/PageIndexWidget.php @@ -11,6 +11,8 @@ class PageIndexWidget extends Template private $index; private string $class; + private static $unique_index_count = 0; + public function __construct(PageIndex $index) { $this->index = $index; @@ -37,14 +39,18 @@ class PageIndexWidget extends Template '', '« previous'; + $num_wildcards = 0; foreach ($page_index as $key => $page) { if (!is_numeric($key)) continue; if (!is_array($page)) + { + $num_wildcards++; echo ' -
  • ...
  • '; +
  • ...
  • '; + } else echo '
  • ', @@ -56,5 +62,17 @@ class PageIndexWidget extends Template '', 'next »
  • '; + + if ($num_wildcards) + { + echo ' + '; + } } } From 56f21a67215c3ed318ff0c48c0b74d1563c54b73 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 20 Nov 2023 22:22:55 +0100 Subject: [PATCH 2/3] PageIndexWidget: disable text wrapping --- public/css/default.css | 1 + 1 file changed, 1 insertion(+) diff --git a/public/css/default.css b/public/css/default.css index c13704bf..a0c2ccbc 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -74,6 +74,7 @@ a:hover { .pagination .page-item { box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3); + white-space: nowrap; } .pagination .wildcard { cursor: pointer; From f143b2ddcf8cddb6fb4c80c142eb6a7885ab303a Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 20 Nov 2023 22:27:57 +0100 Subject: [PATCH 3/3] PageIndexWidget: show first applicable wildcard link in responsive mode --- public/css/default.css | 5 ++++- templates/PageIndexWidget.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public/css/default.css b/public/css/default.css index a0c2ccbc..fc9988a5 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -92,13 +92,16 @@ a:hover { .pagination .page-link { border-radius: var(--bs-pagination-border-radius) !important; } - .pagination > :first-child, .pagination > :last-child { + .pagination > :first-child, .pagination > :last-child, .pagination .first-wildcard { display: inline-block; position: absolute; } .pagination > :first-child { left: 0; } + .pagination > .first-wildcard { + left: 48%; + } .pagination > :last-child { right: 0; } diff --git a/templates/PageIndexWidget.php b/templates/PageIndexWidget.php index c20baac1..70cbd654 100644 --- a/templates/PageIndexWidget.php +++ b/templates/PageIndexWidget.php @@ -47,9 +47,13 @@ class PageIndexWidget extends Template if (!is_array($page)) { + $first_wildcard = $num_wildcards === 0; $num_wildcards++; echo ' -
  • ...
  • '; +
  • ...
  • '; } else echo '