Commit graph

2973 commits

Author SHA1 Message Date
bwang a560fb814a Add fetch tests from WVUI
Bug: T288686
Change-Id: Ifeb2e355482d3d5920c2535c89193cc4f36a13c9
2022-02-15 14:00:40 -06:00
jenkins-bot 0f49a257d1 Merge "Collapse ToC by default & expand sections when clicking section headings" 2022-02-15 19:31:18 +00:00
jenkins-bot 45badb5127 Merge "Revert "Add fetch tests from WVUI"" 2022-02-15 19:16:06 +00:00
Bernard Wang 3c161cf49e Revert "Add fetch tests from WVUI"
This reverts commit 7e79ad5686.

Bug: T301810
Change-Id: Icc8ecf6b0f8b1106e0a69364da251ff52161f523
2022-02-15 18:47:37 +00:00
Translation updater bot 91ebd9da17 Localisation updates from https://translatewiki.net.
Change-Id: Ibcf44808de6fac4359b27c530cdd8023b7e962ff
2022-02-15 08:19:13 +01:00
Jan Drewniak 7d32ec80d3 Collapse ToC by default & expand sections when clicking section headings
Collapses sub-sections in the new table of contents by default
(except for non-js and reduced-motion users) and expands the
sections when the top-level section link has been clicked.

Refactors the `activateSection` TableOfContents methods into separate
`activateSection` and `deactivateSection` functions.
Adds `expandSection` and `collapseSection` methods.

Adds triangle icon as a visual expand/collapsed indicator
next to all ToC section headings and are hidden via CSS based on
whether or not the section contains subsections.

Adds test for tableOfContents.

Bug: T299361
Change-Id: I36b3ae7f9f633877683bc17a9444c970d7fa7293
2022-02-15 00:09:50 -05:00
jenkins-bot bdef6990fb Merge "Add fetch tests from WVUI" 2022-02-14 22:08:04 +00:00
bwang 7e79ad5686 Add fetch tests from WVUI
Bug: T288686
Change-Id: Ic95b620087fc14b055a3108999540769ac123ec8
2022-02-14 13:52:16 -08:00
jenkins-bot 97f231d0fb Merge "Trigger a window resize event when toggling sidebar state" 2022-02-14 21:06:39 +00:00
bwang 2a83dad477 Add back flex-grow for sticky header search bar
Change-Id: Id503163d85dfc519d4c47f95e4567dcacfa7458e
2022-02-14 13:08:07 -06:00
jenkins-bot 4557c0910b Merge "Use new ve.activationStart hook to hide header earlier when loading editor" 2022-02-14 18:33:19 +00:00
jenkins-bot a541859743 Merge "[eslint] Disable mediawiki/class-doc" 2022-02-14 16:15:34 +00:00
Translation updater bot 98c9673321 Localisation updates from https://translatewiki.net.
Change-Id: I6274a3144d0660bb72b24727099f2585bf9bd2af
2022-02-14 08:17:04 +01:00
Nicholas Ray 6b73bd2b41 Fix jsdoc comments for sectionObserver.js
Move jsdoc comment closer to the methods they are describing. This also
enables better typehint support.

I36b3ae7f9f633877683bc17a9444c970d7fa7293 will handle revising tableOfContents.js.

Change-Id: Ifcac7cfd88cd3f1c0405611c880a0d101d2aed3b
2022-02-11 12:17:38 -07:00
bwang 52c7c2ee75 [eslint] Disable mediawiki/class-doc
Given our use of constants for tracking classes this eslint rule
is more an annoyance than helpful.

Change-Id: I37570e3e851997d058f2d93777990dddb3d04089
2022-02-11 16:31:33 +00:00
Translation updater bot d4fb2960d6 Localisation updates from https://translatewiki.net.
Change-Id: I24f076cdda8875e95b8d88380f3cd9a02b7b213e
2022-02-11 08:44:49 +01:00
bwang 3e92800bd6 Move REST search client out of WVUI into Vector
Bug: T288686
Depends-on: I4afc8c38dc9c51d55b46b766a1417b1266963482
Change-Id: Iac6023bb6edca5c8dddc3bfd362db727b2534946
2022-02-10 10:17:10 -06:00
Translation updater bot 7084f9a9df Localisation updates from https://translatewiki.net.
Change-Id: I07c5527841015cf0377762fe02903dae522b0930
2022-02-10 08:44:14 +01:00
jenkins-bot 5ac2b88293 Merge "Move #mw-sidebar-button layout styles to Header.less" 2022-02-09 23:11:56 +00:00
jenkins-bot 306dc89bf8 Merge "Limit WVUI search to ES6 browsers" 2022-02-09 23:01:03 +00:00
Jon Robson 0c2981d772 Limit WVUI search to ES6 browsers
Rather than test for fetch, limit the code to ES6 browsers.

Depends-On: I96a03796628a74ace93579d45a582711400c09c1
Change-Id: I4ca10182491118e61e155f99c713d4cb1b4fc7f0
2022-02-09 22:10:11 +00:00
Ammarpad 5c4d917497 Update Vector SpecialVersion description
Bug: T300994
Change-Id: I3f624013ec4ce408c50d66eca7a91b55b1288ae9
2022-02-09 20:23:09 +01:00
Nicholas Ray 390155c67f Move #mw-sidebar-button layout styles to Header.less
Given that these styles deal with the layout of the sidebar button in
the main header and don't make sense in any other context (at least
currently), I think they belong in Header.less.

Change-Id: I191b9a404c82c5a1a80f97d98fa54535fdd53944
2022-02-09 09:29:47 -06:00
Translation updater bot 260c9a8c20 Localisation updates from https://translatewiki.net.
Change-Id: If1bc1d00bfa288da5a8f9b5735e58aeae4e9a102
2022-02-09 08:14:08 +01:00
jenkins-bot c621e0e91d Merge "HTMLLegacySkinVersionFieldTest: Adjust tests to closer to real situation" 2022-02-08 23:48:21 +00:00
Nicholas Ray 80a111d0e4 Fix TOC section activation on link click bug
We want the link that the user has clicked inside the TOC to be "active"
(e.g. bolded) regardless of whether the browser's scroll position
corresponds to that section. Therefore, we need to temporarily ignore
section observer until the browser has finished scrolling to the section
(if needed).

However, because the scroll event happens asyncronously after the user
clicks on a link and may not even happen at all (e.g. the user has
scrolled all the way to the bottom and clicks a section that is already
in the viewport), determining when we should resume section observer is
a bit tricky.

Because a scroll event may not even be triggered after clicking the
link, we instead allow the browser to perform a maximum number of
repaints before resuming sectionObserver. Per T297614#7687656, Firefox
wasn't consistently activating the table of contents section that the
user clicked even after waiting 2 frames. After further investigation,
it sometimes waits up to 3 frames before painting the new scroll
position so we have that as the limit.

Bug: T297614
Change-Id: If3632529f58c15348a7200258f4f5999ea0dadc4
2022-02-08 14:45:16 -07:00
jenkins-bot d94c685f02 Merge "Use bodyClasses option to register static classes on skin" 2022-02-08 16:25:02 +00:00
Func 1d67da02f8 HTMLLegacySkinVersionFieldTest: Adjust tests to closer to real situation
The behavior of data loading can differ between submitting and display,
so use FauxRequest to customize the method.
Also fix the order of parameters passing to assertSame(), the first one
should be the expected one.

Change-Id: Icfa062eada75c50cd2c8bc5db2930602d80e9ae7
2022-02-08 09:34:49 +00:00
Translation updater bot 6ec87052e9 Localisation updates from https://translatewiki.net.
Change-Id: Ieca15e7e87a50e79a3259b1f46bdacf5e2348251
2022-02-08 08:30:23 +01:00
Jon Robson 29498112ed Migration mode is now the default
- Reflect production.
- Update SkinVector migration notes.

Depends-On: Ia527e60901de59f9e094ca0f1ba62a67a2f808a2
Change-Id: I8efa56fa0644b2ceb33fdab16da5df1d44ee621f
2022-02-07 22:20:16 +00:00
jenkins-bot bcd4ee0ee1 Merge "Fixes for sticky header:" 2022-02-07 16:16:47 +00:00
Translation updater bot f322eaa6ea Localisation updates from https://translatewiki.net.
Change-Id: I4d188788b4c3be4e524302e683dbb92af58f2bbd
2022-02-07 08:24:55 +01:00
Reedy ee76b72905 SkinVector: Minor cleanup
Change-Id: I788710e17ebed933cc70b0cd88138b0a1051d72c
2022-02-06 22:48:51 +00:00
BrandonXLF 936bbc427a Only show scrollbars when needed in language menu
Bug: T301058
Change-Id: I19af6c27b7adf8a35ccbc4163c585e338240eb72
2022-02-05 21:24:47 -05:00
jenkins-bot b570e149e2 Merge "Remove getElementsByClassName usage from sectionObserver" 2022-02-04 23:47:02 +00:00
Clare Ming 19e5d2885a Fixes for sticky header:
- Make page title width fill container.
- Remove page title fadeout, replace with ellipsis.
- Prevent language button contents from wrapping.

Bug: T298885
Bug: T300036
Bug: T298887
Change-Id: I6b09f89ed89a9da7406cdf8b3a00698a9dd66d10
2022-02-04 15:36:35 -07:00
Jon Robson 6f7a6bb24b Use bodyClasses option to register static classes on skin
Bug: T298734
Change-Id: Ia2ae8e1c655aff8783c2602da992632cd5877bf8
2022-02-04 18:44:43 +00:00
Translation updater bot 985299ef9a Localisation updates from https://translatewiki.net.
Change-Id: Ie1f9e4e1ea4f9bf4b93d39202c107082a24ae628
2022-02-04 08:23:51 +01:00
Nicholas Ray 4d2ad52374 Remove getElementsByClassName usage from sectionObserver
Based on prior discussion [1], using getElementsByClassName probably
isn't worth it.

[1] https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/756675/8..13/resources/skins.vector.es6/main.js#104

Change-Id: Id7f8aff73a1d2082ebfeaa9488a815d96317c156
2022-02-03 17:33:42 -07:00
jenkins-bot 99294ce088 Merge "Hide sticky header below 1000px port width" 2022-02-03 22:20:53 +00:00
jenkins-bot 3ea4800c40 Merge "Add recursive template for toc" 2022-02-03 20:55:15 +00:00
Clare Ming 4d8b548f5f Hide sticky header below 1000px port width
Bug: T298836
Change-Id: Ie524f997d2f9847252afc215d3ac589e511ace07
2022-02-03 13:54:16 -07:00
Jon Robson ddcf51a9ec Drop skin override
This is often used by gadgets/scripts to request
information from the API. Given `vector` means old Vector
now that leads to styling issues.

The unfortunate side effect of this is that any code
checking mw.config('skin') === 'vector' will no longer work
and we'll likely need to patch various gadgets accordingly.

Bug: T300814
Change-Id: Ic920e91960cf81790096395256b75f8ed0dc4173
2022-02-03 19:00:24 +00:00
David Lynch 19edeeabe0 Trigger a window resize event when toggling sidebar state
Other page elements outside of Vector should be notified that the
content area is changing size, in case they need to adjust the size of
fixed elements. Triggering window.resize should allow them to adapt
without needing to write Vector-specific code.

A specific case of this: the floating edit toolbar when VisualEditor is
open would be incorrectly sized / aligned if you toggled the sidebar in
edit mode.

Bug: T300826
Change-Id: I79e0fc67b5e35c2fb975a0a3048184de0d63813e
2022-02-03 12:18:42 -06:00
jenkins-bot 59c89b2db7 Merge "Overriding getPortletData will soon be deprecated" 2022-02-03 16:28:27 +00:00
Translation updater bot b9d9167d9d Localisation updates from https://translatewiki.net.
Change-Id: I532d663d0b93cb3108fd5b0717028877445b0721
2022-02-03 08:47:00 +01:00
jenkins-bot c03a5974cb Merge "Pass skin name to Hooks::isSkinLegacy" 2022-02-02 22:52:54 +00:00
Jon Robson 9b8d1b64cb Overriding getPortletData will soon be deprecated
See Ib8fc4cd183df3ed059a2d7000c56ab0a11d34f47

Bug: T299456
Change-Id: I743088e2665f8b304fb6273e912f9a6e5ff92e66
2022-02-02 14:37:36 -08:00
Jon Robson 2a2ee9b4d4 Pass skin name to Hooks::isSkinLegacy
Hooks::isSkinLegacy is only checking the skin version
but not the skin name. This is likely why we are seeing
errors due a mismatch between the result of Hooks::isSkinLegacy
and SkinVector::isLegacy

The parameter is made optional as it is not
always needed. For example in the onGetPreferences
method the skin hasn't been set at this point so all
we need to do is check the skin version.

Bug: T299971
Change-Id: I98465d5f6429f0a57dd0a95efcda71f380f3e842
2022-02-02 13:55:16 -08:00
Jon Robson c59a3b756f Fix the opt in URl
Hash fragment is wrong

Bug: T300097
Change-Id: I9e63606b66195a3b3db95e519514019dbd7d1bdb
2022-02-02 18:54:13 +00:00