Commit graph

2373 commits

Author SHA1 Message Date
Ed Sanders e2903a5bad Reduce height of sections due to edit links
This matches the old height and the height in edit mode.

Change-Id: Ibdfd7cdabe16cec0b050a4ea706849c34beeb2ea
2020-01-29 21:35:34 -08:00
Bartosz Dziewoński 700b1c43e9 Allow passing context to MinervaPagePermissions
Previously it always used the global context RequestContext::getMain(),
which is basically equivalent to using $wgTitle or $wgUser, and will
not produce the correct results when used in other situations than
regular web requests (e.g. API requests or jobs).

MinervaPagePermissions is required to parse pages (due to the custom
section edit links in SkinMinerva::doEditSectionLink), which is often
done in API requests or jobs.

Pass the appropriate context in SkinMinerva::getPermissions(). This
fixes T234868. Note that MinervaPagePermissions is also used elsewhere
and I am not fixing those cases.

Depends-On: Iaa83e5f801c7776bf8218d8ce7484e2485b227d4
Bug: T234868
Change-Id: I2d6fd525f20a0b6beeeaa731f6b8caa471b8529d
2020-01-29 10:33:36 -08:00
jdlrobson 7340485014 Monitor render blocking css bundle sizes
Add a script that builds CSS for Minerva using lessc than measures
their bundlesize.

This will give us added protection to large increases in bundlesize
that can lead to performance regressions.

Change-Id: I2e5e55ad10fac7ecb5a8c19ccdf3cc54de59b75d
2020-01-29 11:03:59 +00:00
jenkins-bot 4c6875a793 Merge "Reorganise stylesheets" 2020-01-29 10:05:50 +00:00
jdlrobson 1f584195de Reorganise stylesheets
All stylesheet-only ResourceLoader modules now have a single entry point
rather than multiple files. This eases compilation of the content of
those modules by all toolchains, which will be useful when introducing
the bundlesize tool.

Change-Id: Ic38a3e51db2f419fe68efd23a2c48ee69218a526
2020-01-29 09:46:18 +00:00
Translation updater bot 242985f329 Localisation updates from https://translatewiki.net.
Change-Id: Ibbfdc4dce776d549c767281a0fd0e3fde88e02e4
2020-01-29 07:57:12 +01:00
jenkins-bot 974a5fb1b0 Merge "Escape HTML in toolbar menu" 2020-01-29 05:29:11 +00:00
jenkins-bot f090ffa321 Merge "Ordered lists per default receive correct numerals (finally)" 2020-01-28 20:16:24 +00:00
jenkins-bot 471fea5208 Merge "Diff styles for moving paragraphs and empty lines" 2020-01-28 17:32:41 +00:00
Ammar Abdulhamid e2c9c6cd59 Escape HTML in toolbar menu
Bug: T243502
Change-Id: Ic175e9430a3655da0ae1e4a82d423873da7eb721
2020-01-28 15:15:09 +01:00
Umherirrender 5b0a4f30b2 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
Change-Id: I529c6a67eeb5eb012031b69ef63f4338f3685178
2020-01-26 20:26:31 +01:00
jdlrobson c42f4d3450 Ordered lists per default receive correct numerals (finally)
This makes use of the ResourceLoader change in
I1c1e2b912a41d29565e45e9e536c68ac46deb0e1

Bug: T217616
Change-Id: I30632a8c12abf634fc8031ac588c36a412c7abbd
2020-01-24 12:05:26 +00:00
Translation updater bot dc69d46b4f Localisation updates from https://translatewiki.net.
Change-Id: Idbb9df32a497d0516ce234df7be121b0bb9075f9
2020-01-24 08:01:11 +01:00
Translation updater bot 63e23f5228 Localisation updates from https://translatewiki.net.
Change-Id: I5c9bf078cc2697314642efc44313f3c4cab5a02f
2020-01-21 08:01:44 +01:00
jdlrobson 2bf442db12 Diff styles for moving paragraphs and empty lines
* Fix styling of empty lines - cover full width
* Disable the pseudo element shipped in core
* Move styles from mobile.special.mobilediff.styles into mediawiki.diff.styles
since the latter is always present, the former isn't if MobileFrontend is not
available.

Bug: T242310
Bug: T243235
Change-Id: Ic7d12fe890622e7b3ccc7bc56765f505ac0ab651
2020-01-20 22:08:53 +00:00
Translation updater bot 878a028596 Localisation updates from https://translatewiki.net.
Change-Id: Ifc4ea4fb213b5336959b494dd94ee710510cb39a
2020-01-20 08:05:48 +01:00
jenkins-bot caed4dc91d Merge "Make MobileFrontend dependency a soft one" 2020-01-17 22:30:32 +00:00
jdlrobson db29aa53bd Make MobileFrontend dependency a soft one
This extends the work in Ie29a1eb7746d56f7d8c99b74e5e3c213c30fdcf2

Bug: T171000
Change-Id: Ib125e1bdaace1893804892909c27a9f328445835
2020-01-17 14:02:23 -08:00
Translation updater bot 58c77fff02 Localisation updates from https://translatewiki.net.
Change-Id: If7d8b6dd17fb121625a1872880646e0b9a7402d1
2020-01-17 08:09:23 +01:00
Nicholas Ray f38d025b38 🐛 Make Talk Page Support Sections With Any Valid Id
Clicking on any talk page section should now open it regardless of the
characters in it. This includes ascii and non-ascii characters.

There are two changes done here:

1) When a user clicks on a section, `window.location.hash` is set to the
percent encoded version of the associated id attribute of the section.
This is important because, unfortunately, different browsers can encode
characters that do not conform to RFC 3986 (illegal URI characters) [1]
differently when calling `window.location.hash` again [2] (e.g. chrome
encodes `>` as '%3E' while safari leaves it as '>').

2) Register the encoded version with OverlayManager. OverlayManager will
simply do a strict string equality check when checking if the current
path matches. Because the browser will navigate to the percent encoded
version in step one and this version does not contain any illegal URI
characters, `window.location.hash` should give back the same percent
encoded string and the paths will match across browsers.

**Why not put this logic in OverlayManager?**

Alternatively, we could make OverlayManager decode the current route's
hash fragment and make it compare that with the unencoded version of the
id similar to the work in
I9cdaf3b01c2e5fe25512b6c18dcf6787c4422abd. However, ids with the '%'
character would then pose problems (e.g. `decodeURIComponent('100%')`
throws an error). This would require extra logic in OverlayManager to
differentiate client supplied '%' characters from browser encoded ones.

Making OverlayManager responsible for normalizing hash fragments will
make it more complicated than it already is. However, making the client
only register routes in OverlayManager that conform to RFC3986 from the
start avoids all of this logic at the expense of making the client make
one call to encodeURIComponent (if necessary).

If this patch is agreed upon, then the next step would be to change the
jsdoc `add` method  in OverlayManager to be explicit that it will only
work with URIs that conform to RFC3986 and the client should percent
encode if necessary before registering.

[1] https://tools.ietf.org/html/rfc3986
[2] https://bugs.webkit.org/show_bug.cgi?id=180396 (Thanks to TheDJ for
pointing this out)

Bug: T238364
Change-Id: Idc2cfac51c40f585c5d43713d8edf848b10424fd
2020-01-16 20:48:58 +00:00
Translation updater bot 4d67ae1044 Localisation updates from https://translatewiki.net.
Change-Id: I9f44195d07b1d058452ef02fa11b4112d1088c06
2020-01-16 09:11:55 +01:00
Translation updater bot 5e3a111181 Localisation updates from https://translatewiki.net.
Change-Id: Id2691853a4934790ecc05bd6dc8772efb12e9fdd
2020-01-15 09:35:15 +01:00
Nicholas Ray 27bc60716d Remove redundant click handling from Minerva drawers.js
MobileFrontend's Drawer component already adds a mask that covers
the whole screen intercepting any clicks to the `body` tag and as a
result handles hiding the drawer when clicked.
Therefore, this code is redundant.

Change-Id: I7cb9ee240400e5bb0f7ca8480cd5321210ed1d7d
2020-01-14 11:59:30 -08:00
Nicholas Ray fdcfcf2849 Remove amc outreach from talk page
As discussed in stand up we no longer need this feature on this page.

Bug: T242491
Change-Id: I2f3e4b4028593c908f0e01055d6fd772734581f8
2020-01-14 11:52:54 -07:00
Translation updater bot 4a08fb5b72 Localisation updates from https://translatewiki.net.
Change-Id: I190f5e9439dcf84ab8db4bda766318148d8d3be2
2020-01-14 10:32:55 +01:00
Nicholas Ray 9c2ba25ca2 Update amc outreach code to reflect new drawer changes
The Drawer API was changed in Ib123efe6af1b167706a73c71c860c85e7f439cc5
to have clients in charge of appending drawers to the DOM.

To reflect and make AMC outreach drawer work with these changes, the
amcOutreach.js code in MF was refactored  in
I8aa3f2c1fe1f638810a20a5e77eb5f2e2f6addd1 to make the showIfEligible
method return the drawer instead of calling show on it.

This work refactors Minerva to make use of both of these changes.

Additional changes:

* Removes amcOutreach click handler for talk button. Talk button is a
tab everywhere except main page (I think) now so this code is just
confusing.

Bug: T242491
Depends-On: I8aa3f2c1fe1f638810a20a5e77eb5f2e2f6addd1
Change-Id: I01afe765cbcb5e79e419a3e42b3125f513e1f87e
2020-01-14 02:04:57 +00:00
jdlrobson 46f28730e1 Do not add the navigation-enabled class to body tag for drawers
This class is used for the main menu exclusively. Applying it
will reveal 2 transparent shields on top of each other when is
not desired

Bug: T214049
Change-Id: I8ddcc7082c3c602a78084157c2d613366a8016c7
2020-01-14 01:20:40 +00:00
jenkins-bot 2a2756bb0d Merge "Categories browser test only runs if the feature is enabled" 2020-01-13 22:29:47 +00:00
jenkins-bot 9f41c44da7 Merge "Fix: user navigation label when AMC is disabled" 2020-01-13 22:14:16 +00:00
jdlrobson ff687da5c2 Categories browser test only runs if the feature is enabled
Remove some Ruby code which was causing lots of confusion.

Bug: T237290
Change-Id: I2c0ae965e4ee094c1b4edc3817c1bf66dc3fa694
2020-01-13 22:09:07 +00:00
jenkins-bot 3230404d1f Merge "Upgrade skin.json schema to manifest_version 2" 2020-01-13 15:54:19 +00:00
Translation updater bot 42b3bfabf5 Localisation updates from https://translatewiki.net.
Change-Id: I96652099fea58529403054e0bdade85c5d0f5809
2020-01-13 08:40:14 +01:00
Ammar Abdulhamid 7728b0b743 Upgrade skin.json schema to manifest_version 2
Bug: T242505
Change-Id: Iccc217fe695270c5a04811fdca5bd65c26ae6609
2020-01-11 06:10:35 +01:00
Stephen Niedzielski 83432ba8b5 Fix: user navigation label when AMC is disabled
At some point I introduced a bad label aria ID,
minerva-user-menu-toggle, for the user navigation. This was the
incorrect text and ID to use. Further, the ID is not present in non-AMC
mode (which is what search engines use). This patches adds a new string,
minerva-user-navigation, and replaces the aria-labelledby attribute with
a direct aria-label.

Bug: T242281
Change-Id: Ic247eb77609862b62025dc5e6af550c079df26d9
2020-01-10 15:23:04 -07:00
jdlrobson 81799f71bb Fix the broken main menu
Although it's not being linked to, it can be visited from cached HTML.
Ensure on this page the menu shows.

Change-Id: Ib688e212c06d7febe82dcd3298e0627b4751dc97
2020-01-10 19:14:43 +00:00
Nicholas Ray 725ee88657 Remove 'animated', mw-notification-tag-toast classes from toast.less
* .mw-notification-tag-toast appears to not longer exist anywhere in
mediawiki

* Removed bottom 'counter translate' style. I'm not sure this is needed
now? The comment makes it seem like it was needed for older browsers
that didn't support fixed positioning but I think mobile browser support
for fixed is good now [1]

* The previous animated class was only in effect during the exit of
toasts. I refactored this logic to be easier to read with hopefully the
same animation effect.

[1] https://caniuse.com/#feat=css-fixed

Bug: T234570
Change-Id: I757122758cb0758f9ede5ccb81d9cc82bb92e79b
2020-01-09 13:58:39 -07:00
Nicholas Ray c22eab914e Add minerva-animations-ready CSS class in Minerva
Per T234570, browser support for animations is solid now so we no longer
need to check for browser support.

However, due to some browsers firing css transitions on page load (see
https://bugs.chromium.org/p/chromium/issues/detail?id=332189), we still
need JS to add this wrapping class after CSS transitions are loaded to
prevent the transitions firing on page load for some components
(DropDownList and MainMenu). See MainMenu.less or DropDownList.less for
an example of how this is used.

MobileFrontend adds an animations class too rn, but that will be removed
in in I58f754740f7146f09c38220a7614285e57684924.

Bug: T234570
Change-Id: If0cf7113b40f7217a22b66a8669138466af2cf5d
2020-01-09 13:58:37 -07:00
jenkins-bot e69b0c708b Merge "Settings link is hidden to non-JS users when beta and AMC unavailable" 2020-01-08 23:15:15 +00:00
jdlrobson da5798ef22 Settings link is hidden to non-JS users when beta and AMC unavailable
Bug: T198265
Change-Id: I6340da6dbbd031d8c91ae99801065bafe9245920
2020-01-08 22:57:04 +00:00
Translation updater bot 76bb331e55 Localisation updates from https://translatewiki.net.
Change-Id: If75ea7c5f535648e4656eac952ddeb6d4b181cb9
2020-01-08 08:13:48 +01:00
jenkins-bot c5fc4d05df Merge "Use document.body and document.documentElement as jQuery selector" 2020-01-06 22:25:14 +00:00
Jan Drewniak ce687f1261 Remove unnecessary visited/active color from main-menu links
These styles are unnecessary because the visited/active color
is inherited from the styles on the `a` element.

Also causes an issue when clicking on the logout link.

Bug: T240644
Change-Id: I908121043487bb01c55e76b3e366aa3d4c624ce7
2020-01-06 21:47:00 +00:00
jenkins-bot 6f571aa4ed Merge "Remove border-radius" 2020-01-06 21:20:38 +00:00
jenkins-bot 482c65bb6a Merge "username & userlinks should appear on a separate line on RecentChanges and Watchlist" 2020-01-06 21:04:08 +00:00
Krzysztof Witucki 3ec0ca1e6e Remove border-radius
ToggleList.less: remove border-radius style from .toggle-list__list
userMenu.less: add border-radius to .minerva-user-menu-list
pageactions.less: add border-radius to .page-actions-overflow-list
design feedback: (see T231205#5771626)

Bug: T231205
Change-Id: Ia06e230a53ddba7931a2869209e0851b11ca8030
2020-01-06 21:47:55 +01:00
jdlrobson cd0a86045a Do not load toggle list CSS twice
Now that ToggleList is loaded in skins.minerva.mainMenu.styles
which is loaded for all users, we should not load it again in
skins.minerva.amc.styles

Change-Id: I6d33a83f20a20956427f261f1900f3cfd8e0153b
2020-01-06 20:09:30 +00:00
Jan Drewniak 08b82c025e username & userlinks should appear on a separate line on RecentChanges and Watchlist
Followup to I30aba29 fixes an issue where the user links (talk|contribs)
were pushed on a new line.

Bug: T236328
Change-Id: I52871ffc643b0484b62f8a2049101027d0de7d50
2020-01-06 15:18:00 +01:00
Fomafix f482ee198e Use document.body and document.documentElement as jQuery selector
The eslint-disable directive jquery/no-global-selector is not needed
anymore.

Change-Id: Ia520232d6ae94a726b5c0768a8245ab555c79112
2020-01-06 14:33:44 +01:00
jenkins-bot 52bc6f6989 Merge "build: Updating composer dependencies" 2020-01-06 09:21:26 +00:00
Translation updater bot 50aefa59cc Localisation updates from https://translatewiki.net.
Change-Id: Ifd4ef0d0be1e302ea5f7a1f8f53a1e957a434767
2020-01-06 08:21:13 +01:00