Related articles are loaded when the user scrolls past
half the document height, which used to be calculated on
page load. This height, however, changes after all sections
are collapsed on small screens, thus never loading the
related articles for the page. Calculating the document height
just before showing related articles allows us to correctly
decide whether it's time to load the needed modules.
Bug: T121263
Change-Id: I1266894ab763cfb571b14f067086445fb6be1887
We only want to show it in view mode.
When a reader hits edit, wgAction is view so we add a CSS rule to
hide the widget when that transition occurs.
This means related widget does not show up post edit (you'll need to
refresh but this seems like an acceptable workaround until we can
understand this issue some more)
Bug: T120443
Bug: T120735
Change-Id: If1356906d5f55167c9d1abbed88f433f36b7f390
Only triggers RelatedArticles module load and query after user has scrolled
through half the document height.
Bug: T116838
Change-Id: If290988fb7cc187cad37dd4a8a2c4f38abed9bb9
Changes:
* Rename $wgRelatedArticlesShowReadMore to $wgRelatedArticlesShowInFooter
* Add $wgRelatedArticlesShowInSidebar, which is truthy by default, and
short circuit the SkinBuildSidebar and SkinTemplateToolboxEnd hook
handlers if it is falsy
Bug: T119926
Change-Id: Idf04bf3221ba44d7b898160764fbd6ba83561abb
There are two positions where the list of related articles is rendered:
the sidebar, and the the footer. Move the hook handlers related to
rendering the former to RelatedArticles\SidebarHooks and those related
to rendering the latter to RelatedArticles\FooterHooks.
Change-Id: Idde57905d828e63309bfdc360a3a09e64e291304
When $wgRelatedArticlesShowReadMore was false, while deciding
whether to show related articles on the sidebar,
we used to incorrectly consider whether BetaFeatures was
enabled for the user. BetaFeatures should only be used
for enabling ReadMore and not for showing related articles
on the sidebar.
We also used to show the beta features option for ReadMore
even when the ReadMore feature was disabled. Now we only
show that option if ReadMore is enabled.
Also rename isAbleToShowRelatedPages to isInSidebar to make
the function less confusing.
Bug: T119926
Change-Id: Ia5e44d94bb20660af711772cab7e3a59f98c931f
Hide the related articles from the sidebar if ReadMore is enabled.
Otherwise leave as is because it's used in WikiVoyage.
Bug: T117444
Change-Id: I3879ae1e53de301b0d3f5f2c066f8e8de7c1c223
I33936a3 didn't introduce a regression but highlighted an issue with the
fixture in the RelatedPagesGateway unit test: the fixture is in the
legacy JSON format despite the API request URL including
formatversion=2.
Change-Id: Id372d022625d88eea685267ea6b6484cf6b28cbc
RelatedArticles tries to load the 'ext.cards' module and if
it succeeds it continues with showing the related articles
on the page.
Dependency: I6661527175eb889cec4193b18fa18207f332b4fc
Bug: T117108
Change-Id: I33936a3e9cd5d1f0296e48fd1c2bba77fff4e466