From 649a9f133e5acb3eb18a6cea04166c19b4058eb5 Mon Sep 17 00:00:00 2001 From: Isarra Date: Thu, 29 Aug 2019 01:22:14 +0000 Subject: [PATCH] Add arrows for extension:proofreadpage pages and sort tabs appropriately Currently js-only due to the default (only) vector styles requiring js. Fixed in Ifd8be387cef671b2aaa2a482c145bccf2e6d1543, with a followup to clean up a bit after that assuming that doesn't mess up too much to be merged, but this works regardless. Bug: T231250 Change-Id: I4cadcbc3e51672fb075c884b2d2cc1d799b1b1b0 --- includes/TimelessTemplate.php | 29 ++++++++++++++++++ .../Proofreadpage.page.navigation.less | 18 +++++++++++ resources/images/arrow-large-down-grey.png | Bin 0 -> 320 bytes resources/images/arrow-large-down-grey.svg | 1 + resources/images/arrow-large-grey-ltr.png | Bin 0 -> 326 bytes resources/images/arrow-large-grey-ltr.svg | 1 + resources/images/arrow-large-grey-rtl.png | Bin 0 -> 324 bytes resources/images/arrow-large-grey-rtl.svg | 1 + resources/images/arrow-large-up-grey.png | Bin 0 -> 311 bytes resources/images/arrow-large-up-grey.svg | 1 + skin.json | 3 +- 11 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 resources/extensions/Proofreadpage.page.navigation.less create mode 100644 resources/images/arrow-large-down-grey.png create mode 100644 resources/images/arrow-large-down-grey.svg create mode 100644 resources/images/arrow-large-grey-ltr.png create mode 100644 resources/images/arrow-large-grey-ltr.svg create mode 100644 resources/images/arrow-large-grey-rtl.png create mode 100644 resources/images/arrow-large-grey-rtl.svg create mode 100644 resources/images/arrow-large-up-grey.png create mode 100644 resources/images/arrow-large-up-grey.svg diff --git a/includes/TimelessTemplate.php b/includes/TimelessTemplate.php index b9b9ce9..6fde5c6 100644 --- a/includes/TimelessTemplate.php +++ b/includes/TimelessTemplate.php @@ -800,6 +800,35 @@ class TimelessTemplate extends BaseTemplate { $sortedPileOfTools[$currentSet][$navKey] = $navBlock; } + // Extra sorting for Extension:ProofreadPage namespace items + $tabs = [ + 'proofreadPagePrevLink', + // This is the order we want them in... + 'proofreadPageScanLink', + 'proofreadPageIndexLink', + 'proofreadPageNextLink', + ]; + foreach ( $tabs as $tab ) { + if ( isset( $sortedPileOfTools['namespaces'][$tab] ) ) { + $toMove = $sortedPileOfTools['namespaces'][$tab]; + unset( $sortedPileOfTools['namespaces'][$tab] ); + + // add a hover tooltip, mostly for the icons + $toMove['title'] = $toMove['text']; + + if ( $tab === 'proofreadPagePrevLink' ) { + // prev at start + $sortedPileOfTools['namespaces'] = array_merge( + [ $tab => $toMove ], + $sortedPileOfTools['namespaces'] + ); + } else { + // move others to end + $sortedPileOfTools['namespaces'][$tab] = $toMove; + } + } + } + return $sortedPileOfTools; } diff --git a/resources/extensions/Proofreadpage.page.navigation.less b/resources/extensions/Proofreadpage.page.navigation.less new file mode 100644 index 0000000..d398e89 --- /dev/null +++ b/resources/extensions/Proofreadpage.page.navigation.less @@ -0,0 +1,18 @@ +@import '../variables.less'; + +@media screen { + #ca-proofreadPageNextLink a { + .ca-icon ( '../images/arrow-large-grey-ltr' ); + .ca-icon-only(); + } + + #ca-proofreadPagePrevLink a { + .ca-icon ( '../images/arrow-large-grey-rtl' ); + .ca-icon-only(); + } + + #ca-proofreadPageIndexLink a { + .ca-icon ( '../images/arrow-large-up-grey' ); + .ca-icon-only(); + } +} diff --git a/resources/images/arrow-large-down-grey.png b/resources/images/arrow-large-down-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..4015d8c2087a2d93191406dba3095dbf25727ea8 GIT binary patch literal 320 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VOR)S(3$d4ihn9aZtmVpnqOyq1vQVHUq4~hdikUi3H&|Bg zd7$utfA(Iz`@bS`%+mXwCb`F&i+|t7sn37^>3*qY`9C_YG1|@l(cpDy#sjIZwrAWb zqSeD$o35`gSC)Tddp-YnE zb*|rd#9VH|L$z1?EA))Cjayu2m<1dasXgQM% \ No newline at end of file diff --git a/resources/images/arrow-large-grey-ltr.png b/resources/images/arrow-large-grey-ltr.png new file mode 100644 index 0000000000000000000000000000000000000000..bc7e4827a926ddcb75b0058a4ffd529703b9a334 GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VORZaB$Lz$bCyF*lAI9D+JM<_~4P6($^V63Dp}5uw47!*X=~p{uX;AhE6*_7RiWX{q5CE2M}*>@Mg3lpP8mrJS(1k`U+~sE zu;i~gWhpJn@qA%XvMbfZ2PV=L96Dl_YCtN=a>xhUrQa-;dprc>8{;6 zbEZFB`!=E1|IOzGB8oa6Tb%_bD8=kZDci$(l&jw0pk`v@A+KM#{}Sgi22Ym^&RhDa Q3FsXLPgg&ebxsLQ07r^>7XSbN literal 0 HcmV?d00001 diff --git a/resources/images/arrow-large-grey-ltr.svg b/resources/images/arrow-large-grey-ltr.svg new file mode 100644 index 0000000..5e14908 --- /dev/null +++ b/resources/images/arrow-large-grey-ltr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/images/arrow-large-grey-rtl.png b/resources/images/arrow-large-grey-rtl.png new file mode 100644 index 0000000000000000000000000000000000000000..dbd8c571cf75488ddd03982bc17abbb05f84ff75 GIT binary patch literal 324 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VORH~7bN_O>5Ue9j?n_H>lWuDOLlbdnt&XP*uLZ9? zZwgJx=@fHUUUU3!%f+Qydn6Ozt6ueO^#8%}Rybx_!$#fD)or?c&ilWA=P$dc?<6Mt zIKJX2SNpbP0l+XkKED?IA literal 0 HcmV?d00001 diff --git a/resources/images/arrow-large-grey-rtl.svg b/resources/images/arrow-large-grey-rtl.svg new file mode 100644 index 0000000..195eb55 --- /dev/null +++ b/resources/images/arrow-large-grey-rtl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/images/arrow-large-up-grey.png b/resources/images/arrow-large-up-grey.png new file mode 100644 index 0000000000000000000000000000000000000000..88c1b0a1357370dc28cd602824bc918dc628b49d GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VORZciYT@g{YDl|pp4`vwdmT3EE#MabW zU;M49xbB*r%}@PR62~hie&XF^Uh`NsR;O@B_z$VGQWLc^+P`dHv7tvWYGU~c&ue*! zt&i6p5^8(lGA~&xa;xwowri1@^FFY~zgU{`dB%6mOxq)~-#pft|6+dTyyHxpi+S09 zXecxZbmBu{xqT#Z!-q+x@gwXXg-GY;aBY9?<;^p00i_>zopr04-l~ A$^ZZW literal 0 HcmV?d00001 diff --git a/resources/images/arrow-large-up-grey.svg b/resources/images/arrow-large-up-grey.svg new file mode 100644 index 0000000..0780b93 --- /dev/null +++ b/resources/images/arrow-large-up-grey.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/skin.json b/skin.json index 3efe5c6..1fc897e 100644 --- a/skin.json +++ b/skin.json @@ -88,7 +88,8 @@ "+ext.CodeMirror.visualEditor.init": "resources/extensions/VisualEditor.CodeMirror.less", "+ext.dismissableSiteNotice.styles": "resources/extensions/DismissableSiteNotice.less", "+ext.MWOAuth.AuthorizeForm": "resources/extensions/MWOAuth.AuthorizeForm.less", - "+ext.wikiLove.icon": "resources/extensions/WikiLove.icon.less" + "+ext.wikiLove.icon": "resources/extensions/WikiLove.icon.less", + "+ext.proofreadpage.page.navigation": "resources/extensions/Proofreadpage.page.navigation.less" } }, "AutoloadClasses": {