This simplifies the codebase by avoiding some unnecesary custom hooks,
and also improves Parsoid compatibility.
We look for old extensiondata coming from cached pages for
compatibility, but that code can be removed once the ParserCache expires
(T371421) for further simplification.
Bug: T263772
Change-Id: I843a920a0476290a8b0efd5eba4d8d44777d27d0
This requires 1.42 for some new names
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I738fa5cd78d9b662326afc268bc2a90cb1540948
empty() should only be used to suppress errors
When the type of the variable is array,
a falsy check is the same (checks for null, false and empty array)
Found by a new phan plugin (T234237)
Change-Id: Iafd6d3bae30038bac2fad967924a9461aa57761b
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.
Remove optional return from hook handlers
Bug: T346560
Change-Id: I4e42f7cf361e41c3ee687abcf41409a4704b7bf6
- Skin is a IContextSource, same as OutputPage, use the skin directly
- Use WebRequest::getRawVal/getCheck
- Move isDisambiguationPage() down a bit, it needs database queries
- Remove unused argument from ::isReadMoreAllowedOnSkin
Bug: T347123
Change-Id: I1b7cdc8bd330624f0a099284f6eabbb3ad62675a
For IntersectionObserver to work the element we listen on needs to
have a non-zero height.
Bug: T223844
Change-Id: I308f646670b112e42b0aaa11c438dbc5cdc5edd8
composer:
* mediawiki/mediawiki-codesniffer: 28.0.0 → 29.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamTag
npm:
* eslint-config-wikimedia: 0.11.0 → 0.15.0
The following rules are failing and were disabled:
* no-jquery/no-parse-html-literal
* grunt-eslint: 21.0.0 → 22.0.0
* grunt-stylelint: 0.10.1 → 0.13.0
* stylelint-config-wikimedia: 0.6.0 → 0.8.0
Additional changes:
* Also sorted "composer fix" command to run phpcbf last.
* Removing manual reportUnusedDisableDirectives for eslint.
Change-Id: Iab538420d73bbbebfd05cf815ab06773f16da8da
This allows skins to determine where the cards appear in a consistent
fashion with other extensions, and require minimal special handling from
the extension itself.
Also change default settings as to when RelatedArticle cards will appear
- keep the whitelist to allow projects to configure their usage such as
in the case of only wanting it on mobile, etc, but now that it should
just work in any given skin, default it to on for all so that it's easier
for the average third party to install for whatever use.
Note that this default setting change will not affect WMF wikis, as
wmgRelatedArticlesFooterWhitelistedSkins is explicitly set in the
wmf-config regardless.
Bug: T181242
Depends-On: I5b0ad889e633fde88c392577ce5373c81fc5486a
Change-Id: Iebd759c0d1a536768d18953f372664df762d9e04
* The extension already uses 'null' as placeholder in RelatedArticles
instead of empty array. Update the doc comment in RelatedPagesGateway
to reflect this (its code was already using the default operator
to fallback to empty array, given empty arrays are not falsey in JS,
but null is).
* Omit the key from the mw.config output in <head> on page views,
when the value is null, given this is redundant information and consumes
additional space.
Bug: T219342
Change-Id: I367f9d9423d66611d73d56f8a769d86d14d3de8b
Bundle these with the module that needs it instead, this means
1. It is naturally only downloaded on pages where it is needed.
2. It doesn't block download/parse/render of the article HTML.
3. It doesn't delay time to mw.loader.load() for interactive
functionality.
Bug: T219342
Change-Id: I5c6809392b0621bd0d58049597f6c0306e572607
With RelatedArticlesEnabledBucketSize now removed, installation of this
extension will turn it on for 100% users without any mechanism to turn
it off.
Additional changes:
* Bump version
* Add Readers team to contributors
Bug: T202306
Change-Id: I7dc270a06dd3afd4e894c8298165d6d6d4fda8d6
Updates QUnit test files from starting with "test_" to ending with
"test.js" in accordance with the Readers Wed coding conventions.
https://www.mediawiki.org/wiki/Reading/Web/Coding_conventions
Bug: T197884
Change-Id: I3c15385d22d308b8b465985ca55e8b802d72dae4
This is the last remaining use of the module name "ext.eventLogging.Schema"
in Wikimedia Git. It is an alias for "ext.eventLogging.subscriber".
Change-Id: Idf295ef9c550ad7f1a19ac0b84e856d606ab8eb3
RelatedArticles will now only render related articles in the footer of
skins.
Bump version to 3.0.0
Bug: T165991
Change-Id: Ia4e28c0ed76b3aff37c0aea8eb713923312ba23c
Using MakeGlobalVariablesScript hook will add config variables to
the HTML meaning cached HTML will not be able to access it leaving
it as undefined. This will mess up any existing caching.
Additional changes:
Because I'm paranoid, make sure that value is never undefined.
Bug: T170648
Change-Id: Icb8e34104c57b1e69b7e035ef89d5b4c3371132f
Wikivoyage pages have more than 3 related articles as they make use
of the {{#related:}} magic word.
After speaking with Nirzar we should allow this project to show more than 3.
This change allows this while keeping the existing behaviour on other wikis and
will pave the way for removing a bunch of code from this extension.
Additional changes:
* Cleanup skinStyles definitions
* Limit cards to 30% maximum width and give margin top to account for
situations where the number of cards are multiple of 3
** In Minerva hardcode the max-width to pixels.
* Margins are switched from hardcoded 10px to percentage based. Yes
this changes the right margin slightly but is more maintable and visually
the same.
Bug: T164765
Change-Id: I41119de3228c2df799f740d4bd00082101c21b97
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.FunctionComment.Missing.Public
Change-Id: I591fd0cd60147b9f5ddd3d1b9e74f79a0bb3f595
In order to avoid further confusion, clarify that we're bucketing users
for experiments.
Bug: T167236
Depends-On: I752cdf068ca25bffb38229380785e7da1a208049
Change-Id: I6508ab8fa3d436ae295eb047e170fdc5417d25fc
* Move across all files
* Rename ext-card- prefix to ext-related-articles- prefix
** Since all code using these prefixes is JS
we do not have to worry about cached HTML
Bug: T137021
Change-Id: I784fd132c36329fa0dcc49fe2804460061940347
This change removes RelatedArticles from beta features.
It repurposes the BlacklistSkins config to be a whitelist that describes
when related pages should be shown in the footer.
To avoid enabling related pages on desktop, this depends on a config
change that makes use of the new configuration option.
Simplify browser tests to reflect the new status quo.
Bug: T146436
Bug: T160076
Depends-On: I522e0182d1c3d9261bd0561c3ec0c789b6431c7a
Change-Id: I84da1fb33a901a6365375d00d192af35422ff0b0
Log the `feature-enabled` event for users who are eligible to see the
ReadMore feature. Otherwise log the 'feature-disabled' event.
Suporting changes:
* Register the latest version of the RelatedArticles schema.
Bug: T157375
Change-Id: I1557de88c7602aa066833bd55b83e6ee51d27178