From c3b24e200566b11e80f96f8186dbe5eab6241d72 Mon Sep 17 00:00:00 2001 From: PayBas Date: Thu, 29 May 2014 23:28:22 +0200 Subject: [PATCH 01/25] [ticket/12613] Improved pagination PHPBB3-12613 --- phpBB/language/en/common.php | 1 + phpBB/phpbb/pagination.php | 4 +- phpBB/styles/prosilver/template/forum_fn.js | 27 +++--- .../styles/prosilver/template/pagination.html | 55 +++++++++---- .../prosilver/template/viewforum_body.html | 8 +- .../prosilver/template/viewtopic_body.html | 8 +- phpBB/styles/prosilver/theme/bidi.css | 5 ++ phpBB/styles/prosilver/theme/colours.css | 4 + phpBB/styles/prosilver/theme/common.css | 77 ++++++++++++++++-- .../theme/images/icons_pagination.png | Bin 0 -> 786 bytes phpBB/styles/prosilver/theme/responsive.css | 14 +++- 11 files changed, 152 insertions(+), 51 deletions(-) create mode 100644 phpBB/styles/prosilver/theme/images/icons_pagination.png diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 2020783100..d2aa0fea54 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -341,6 +341,7 @@ $lang = array_merge($lang, array( 'JUMP_PAGE' => 'Enter the page number you wish to go to', 'JUMP_TO' => 'Jump to', 'JUMP_TO_PAGE' => 'Click to jump to page…', + 'JUMP_TO_PAGE_FORM' => 'Jump to page:', 'KB' => 'KB', 'KIB' => 'KiB', diff --git a/phpBB/phpbb/pagination.php b/phpBB/phpbb/pagination.php index 927d711f4b..1d20b7f81c 100644 --- a/phpBB/phpbb/pagination.php +++ b/phpBB/phpbb/pagination.php @@ -126,8 +126,8 @@ class pagination // determine this number. Again at most five pages? Then just display them all. More than // five and we first (min) determine whether we'd end up listing more pages than exist. // We then (max) ensure we're displaying the minimum number of pages. - $start_page = ($total_pages > 5) ? min(max(1, $on_page - 3), $total_pages - 4) : 1; - $end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 3), 5) : $total_pages; + $start_page = ($total_pages > 5) ? min(max(1, $on_page - 2), $total_pages - 4) : 1; + $end_page = ($total_pages > 5) ? max(min($total_pages, $on_page + 2), 5) : $total_pages; } if ($on_page != 1) diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index fa838fde19..5d2382c4dd 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -25,20 +25,12 @@ function popup(url, width, height, name) { /** * Jump to page */ -function jumpto(item) { - if (!item || !item.length) { - item = $('a.pagination-trigger[data-lang-jump-page]'); - if (!item.length) { - return; - } - } +function jumpto(form) { - var jump_page = item.attr('data-lang-jump-page'), - on_page = item.attr('data-on-page'), - per_page = item.attr('data-per-page'), - base_url = item.attr('data-base-url'), - start_name = item.attr('data-start-name'), - page = prompt(jump_page, on_page); + var page = $(form).find("input[name='page-number']").val(), + per_page = $(form).find("input[name='per-page']").val(), + base_url = $(form).find("input[name='base-url']").val(), + start_name = $(form).find("input[name='start-name']").val(); if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { if (base_url.indexOf('?') === -1) { @@ -363,9 +355,16 @@ function parse_document(container) /** * Pagination */ - container.find('a.pagination-trigger').click(function() { + container.find('form.page-jump-form').submit(function(event) { + event.preventDefault(); jumpto($(this)); }); + + container.find('.pagination-trigger').click(function() { + $input = $(this).parent().find("input[name='page-number']"); + + setTimeout(function() { $input.focus(); },100); + }); /** * Dropdowns diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html index e27a90900a..8b8631ce26 100644 --- a/phpBB/styles/prosilver/template/pagination.html +++ b/phpBB/styles/prosilver/template/pagination.html @@ -1,18 +1,37 @@ - - {PAGE_NUMBER} • - - {PAGE_NUMBER} • - - + diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index c747dd01f5..51aaeb937e 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -59,11 +59,11 @@ @@ -233,11 +233,11 @@ diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index fb0b9733e7..2133f9a21a 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -51,11 +51,11 @@ @@ -352,11 +352,11 @@ diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 78b95d902e..907a1dff7e 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -226,6 +226,11 @@ position: absolute; } +.pagination li.previous a { background-position: -50px 2px; } +.pagination li.next a { background-position: -30px 2px; } +.pagination li.previous a:hover { background-position: -50px -18px; } +.pagination li.next a:hover { background-position: -30px -18px; } + /* Miscellaneous styles ---------------------------------------- */ .rtl #forum-permissions { diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 72c8b5f226..a21cd1e3ec 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -188,6 +188,10 @@ dl.details dd { border-color: #B4BAC0; } +.pagination li.next a, .pagination li.previous a, .pagination li.jump-to a { + background-image: url("./images/icons_pagination.png"); +} + /* Pagination in viewforum for multipage topics */ .row .pagination { background-image: url("./images/icon_pages.gif"); diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index b9728729f9..a95ffdcfc5 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -833,21 +833,61 @@ li.pagination ul { } .pagination ul li, dl .pagination ul li, dl.icon .pagination ul li { - display: inline; + display: inline-block; padding: 0; font-size: 100%; line-height: normal; + vertical-align: middle; } .pagination li a, .pagnation li span, li .pagination li a, li .pagination li span, .pagination li.active span, .pagination li.ellipsis span { - font-weight: normal; - text-decoration: none; - padding: 0 2px; border: 1px solid transparent; + border-radius: 2px; + display: block; font-size: 0.9em; - line-height: 1.5em; + font-weight: normal; + line-height: 13px; + min-width: 10px; + padding: 3px; + text-align: center; + text-decoration: none; } +.pagination li.ellipsis span { + border: none; + padding: 0; +} + +.pagination li.jump-to { + margin: 0 5px; +} + +.pagination li.jump-to a, .pagination li.next a, .pagination li.previous a { + font-size: 0; + height: 13px; + width: 11px; +} + +.pagination li.jump-to a { + background-position: 0 2px; + background-repeat: no-repeat; + width: 24px; +} + +.pagination li.next a { + background-position: -50px 2px; + background-repeat: no-repeat; +} + +.pagination li.previous a { + background-position: -30px 2px; + background-repeat: no-repeat; +} + +.pagination li.jump-to a:hover { background-position: 0 -18px; } +.pagination li.next a:hover { background-position: -50px -18px; } +.pagination li.previous a:hover { background-position: -30px -18px; } + /* Pagination in viewforum for multipage topics */ .row .pagination { display: block; @@ -859,6 +899,11 @@ li.pagination ul { background: none 0 50% no-repeat; } +li .pagination li a, li .pagnation li span { + border-radius: 1px; + padding: 1px; +} + /* jQuery popups ---------------------------------------- */ .phpbb_alert { @@ -1155,3 +1200,25 @@ form > p.post-notice strong { .compact .icon-notification > a > strong, .compact .icon-pm > a > strong { padding-left: 2px; } + +.dropdown-jump-to .dropdown { + top: 20px; +} + +.dropdown-jump-to .dropdown-contents { + margin: 0; +} + +.dropdown-jump-to .dropdown-contents ul { + display: inherit; +} + +.dropdown-jump-to .dropdown-contents li { + display: list-item; + padding-bottom: 4px; + padding-top: 4px; +} + +.dropdown-jump-to input.tiny { + width: 50px; +} diff --git a/phpBB/styles/prosilver/theme/images/icons_pagination.png b/phpBB/styles/prosilver/theme/images/icons_pagination.png new file mode 100644 index 0000000000000000000000000000000000000000..c75f8ee1d4811b2d1c63372093813b5e21385e99 GIT binary patch literal 786 zcmV+t1MU2YP)V|gc3n4R%ifZ<#%LJRl6@jOzZNut zQcwUki9s*|eu|S`ba(vs#vE5X?;>ag<(~cms+&OrcmoE=+#VRzu5&Ry6XHOl$#js= zbx`fn37fn;1>Ni5fya~uFau`6Z)S1^WN{(Fqzc3FIBZa+ru@^3D`GB#+wAx~cnjuP z-wALF)KU8qVQdN&(}-zedXB1IP{f=DZS1%UJoT6&$~x!;^(=aF#S}js$JCfCYd-@M zA(5A1Yfdhi63HByF=s#}wZDMj5S?q_rp96(+sr0qx@;i#Si4W*M_&`ZD?S#$eDrN4 zxhBLNi85nOQN0Sj8vG;lqbdP&pfl+OGtTssrBWdoqGHOi0E0`YJ|8u$O!qPD`&v4( z0j<-H_MM{6wxs_f?SF<82NAU9#9@xTSF$&e));GyHO3lajj_g9V~%Rc(>y;zyV>Q` z&a)R$FM<2u?4fc-M2rGgz_c4&HoznHok>OQAlw)( zUV+cxp-5GeIpZn6?>ZsQ-StF8KdAPca}qoUYd%qAGQ)1n5u>FS6ftGs8#}(iA4W;a zswaBV2N)?vxEs-4lr`G^=s?`l|}- zlrVTRfthz>j2JB)S;YJT;~Fz9do}U_toZDMqC}4A!fWr9>`i2X<&OXZ074;OlQdB1 QtpET307*qoM6N<$f?GFURR910 literal 0 HcmV?d00001 diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css index b76f6b60cd..e3e4a46fa2 100644 --- a/phpBB/styles/prosilver/theme/responsive.css +++ b/phpBB/styles/prosilver/theme/responsive.css @@ -201,10 +201,12 @@ ul.topiclist li.row dt a.subforum { margin: 5px 0; } -.pagination li a, .pagination li span { - min-width: 10px; - display: inline-block; - text-align: center; +.pagination ul { + margin-top: 5px; +} + +.row .pagination ul { + margin-top: 0; } /* Responsive tables @@ -518,6 +520,10 @@ fieldset.display-actions { padding-bottom: 1px; } + .topic-actions > .pagination li.jump-to { + margin: 0 2px; + } + .topic-actions > div.search-box, p.jumpbox-return { display: none; } From 015ddc8fa8fa992646b412c69b3f3c3df0c22554 Mon Sep 17 00:00:00 2001 From: PayBas Date: Thu, 29 May 2014 23:58:25 +0200 Subject: [PATCH 02/25] [ticket/12613] Fix dropdown-up positioning PHPBB3-12613 --- phpBB/styles/prosilver/theme/common.css | 6 +++++- phpBB/styles/prosilver/theme/responsive.css | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index a95ffdcfc5..804599bf6c 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -1205,11 +1205,15 @@ form > p.post-notice strong { top: 20px; } +.dropdown-jump-to.dropdown-up .dropdown { + bottom: 20px; +} + .dropdown-jump-to .dropdown-contents { margin: 0; } -.dropdown-jump-to .dropdown-contents ul { +.dropdown-jump-to ul.dropdown-contents { display: inherit; } diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css index e3e4a46fa2..b9d3ef4432 100644 --- a/phpBB/styles/prosilver/theme/responsive.css +++ b/phpBB/styles/prosilver/theme/responsive.css @@ -515,7 +515,6 @@ fieldset.display-actions { .topic-actions > .pagination { float: none; - overflow: hidden; clear: both; padding-bottom: 1px; } From da1d24a1f0a45026f0abc781a63eff4af6f69985 Mon Sep 17 00:00:00 2001 From: PayBas Date: Fri, 30 May 2014 00:45:07 +0200 Subject: [PATCH 03/25] [ticket/12613] Fix tests PHPBB3-12613 --- tests/pagination/pagination_test.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php index e233264cc6..4846dd83f7 100644 --- a/tests/pagination/pagination_test.php +++ b/tests/pagination/pagination_test.php @@ -91,7 +91,6 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case :current:3:page.php?start=20 :else:4:page.php?start=30 :else:5:page.php?start=40 - :else:6:page.php?start=50 :ellipsis:9:page.php?start=80 :else:10:page.php?start=90 :next::page.php?start=30 @@ -142,7 +141,6 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case :current:3:test/page/3 :else:4:test/page/4 :else:5:test/page/5 - :else:6:test/page/6 :ellipsis:9:test/page/9 :else:10:test/page/10 :next::test/page/4 From 140ecf1c98175ce6984968d10c35ce80fe927526 Mon Sep 17 00:00:00 2001 From: PayBas Date: Fri, 30 May 2014 01:13:23 +0200 Subject: [PATCH 04/25] [ticket/12613] Removed all previous_page / next_page text links PHPBB3-12613 --- phpBB/styles/prosilver/template/mcp_forum.html | 2 -- phpBB/styles/prosilver/template/mcp_logs.html | 2 -- phpBB/styles/prosilver/template/mcp_notes_user.html | 2 -- phpBB/styles/prosilver/template/mcp_queue.html | 2 -- phpBB/styles/prosilver/template/mcp_reports.html | 2 -- phpBB/styles/prosilver/template/memberlist_body.html | 2 -- phpBB/styles/prosilver/template/search_results.html | 2 -- phpBB/styles/prosilver/template/ucp_attachments.html | 2 -- phpBB/styles/prosilver/template/ucp_pm_viewfolder.html | 2 -- phpBB/styles/prosilver/template/viewforum_body.html | 2 -- phpBB/styles/prosilver/template/viewonline_body.html | 6 ------ phpBB/styles/prosilver/template/viewtopic_body.html | 8 +++----- 12 files changed, 3 insertions(+), 31 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index 4a8c4c5de9..02c6edb05b 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -95,8 +95,6 @@
- {L_NEXT} - {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index b930bbbcc6..0aba36b8fd 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -54,8 +54,6 @@
- {L_NEXT} - {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index 9b6c9b2667..127cf7cb08 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -95,8 +95,6 @@
- {L_NEXT} - {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index 461d5982db..4cee8c0094 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -73,8 +73,6 @@
- {L_NEXT} - {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html index ffa82d5e0e..62edf22958 100644 --- a/phpBB/styles/prosilver/template/mcp_reports.html +++ b/phpBB/styles/prosilver/template/mcp_reports.html @@ -79,8 +79,6 @@
- {L_NEXT} - {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 7623fbe38b..9891ec71ce 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -140,8 +140,6 @@
- {L_PREVIOUS} - {L_NEXT} diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 0043da4507..9e770a2d66 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -164,8 +164,6 @@
- {L_PREVIOUS} - {L_NEXT} diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index 4731683a80..587e3eaed5 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -51,8 +51,6 @@
- {L_NEXT} - {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index b081c14498..d51676b5aa 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -123,8 +123,6 @@
- {L_PREVIOUS} - {L_NEXT} diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 51aaeb937e..1cc6f93bab 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -208,8 +208,6 @@
- {L_PREVIOUS} - {L_NEXT} diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html index 553e322f92..a8fb6424b6 100644 --- a/phpBB/styles/prosilver/template/viewonline_body.html +++ b/phpBB/styles/prosilver/template/viewonline_body.html @@ -47,12 +47,6 @@ - -
- {L_PREVIOUS}{L_PREVIOUS}{L_NEXT}{L_NEXT} -
- -

{L_LEGEND}{L_COLON} {LEGEND}

-
+