Replacing deprecated mediawiki.ui `@borderRadius` variable with successor
@border-radius-base.
Former got deprecated in MW 1.35 about 2 years ago. Latter is in alignment
with mediawiki.skin.variables.less standardization. It's also in
accordance to Codex design tokens.
Bug: T322478
Change-Id: I6f9fe0a7d98713a66e1b7e78f105817f428c636f
For now it is limited to a single file RelatedPagesGateway.js
For now @types/jquery is requirement due to use of
wikimedia/mw-node-qunit and usage of MediaWiki core methods
and OOUI that use jQuery.
Change-Id: I370826bb3f521dcb5a68491990571ee1c87117ae
We currently require support for IntersectionObserver.
which is supported on Edge >= 15 (15 has partial support),
Firefox >55, Chrome >58, Safari 12.1, Opera >=38,
iOS Safari >=12.2, Android 100
Full ES6 is supported in Edge >=15, Firefox >=54, Chrome >=51,
Safari >=10, Opera >=38, iOS Safari >=10, so such a change
would only drop support for Edge 15 and Firefox 54.
CSS.escape is guaranteed in all these browsers according to
caniuse, with the only discrepancy being the Edge browser (versions
16-18) so it is also suggested we remove support for those browsers.
Firefox 54 accounts for 0.0026% of page views
Edge 15-18 accounts for 0.069% of page views
Bug: T306355
Change-Id: Id2987e3456607b610c38da9ee157a026d1d00ada
useful for testing real world data
Suggested test config:
```
$wgRelatedArticlesUseCirrusSearchApiUrl = "https://en.wikipedia.org/w/api.php";
$wgRelatedArticlesUseCirrusSearch = true;
$wgRelatedArticlesDescriptionSource = 'wikidata';
```
This will allow us to enable on patchdemo with production content.
Change-Id: I73c0d73d3369f27ed2fd74b37ae71bfc12b6ee57
The RelatedPagesGateway is an OO class.
There is no reason for it to be, we don't use any
of it's features e.g. the event emitter
Change-Id: I8f807d35b0ce36ea5764508a66f88d74577e3653
1) Merge ext.relatedArticles.readMore and ext.relatedArticles.cards modules
These are always loaded together. No need to have them in separate modules.
In process switch to packagefiles
2) Merge ext.relatedArticles.readMore.bootstrap and ext.relatedArticles.readMore.gateway
Always loaded together.
Bug: T306228
Change-Id: I9442b0336e22ca795cc06f76068215266fe81271
Previously RelatedArticles required the Cards extension
This code refers to that old state and is cleaned up.
ext.relatedArticles.cards is added a dependency of
ext.relatedArticles.readMore since it now belongs to the same
extension
Change-Id: I4a89ed4256a4ae9fd22b0191748bd47ac3ffc593
For IntersectionObserver to work the element we listen on needs to
have a non-zero height.
Bug: T223844
Change-Id: I308f646670b112e42b0aaa11c438dbc5cdc5edd8
Use normal `background-image` properties with SVGs now
that IE 8 and Android 2.1 are removed from Grade C.
Also removing PNG fallback image.
Bug: T248062
Change-Id: Ia2a102dfe8865aa0bca93453d01f11ab3ab57149
Currently, the extension queries the prop=description api to fetch the
description, but this api is only available if Wikibaseclient is installed.
Let's support other sources to fetch the page description from, too, or
disable it (by default) to sabe 85 bytes from each response by avoiding the
warning returned from the api when prop=description is not recognized.
A new configuration setting has been added: RelatedArticlesDescriptionSource.
It defaults to false (no description is fetched), but can be set to one of
those string values:
- wikidata: What's being used right now on WMF wikis
- textextracts: Extension:TextExtracts provides the prop=extracts api.
- pagedescription: Extension:Description2 provides a description page property, that can be queried by prop=pageprops&ppprop=description
Bug: T230947
Change-Id: I34410334ba9d6db1f686c7efb5722e2a51957145
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
Equivalent to latest 'article' icon in Design Style Guide and OOUI.
Also updating `.list-thumb-none` class to align icon and simplify
maintenance.
Bug: T222717
Change-Id: I49a89afa3d370abc4cf282a0bf8d44ee2751aa78
* 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
pass a collection of jQuery objects to `.append` instead of
and array.
Use `.css` instead of `.attr` to set thumbnail background image.
Change a unit to reflect the escaping pattern of the `.css` method
Bug: T219846
Change-Id: I6359be2db6c7c7a8e4b52296e0801d4ded921b46
Removing obsolete vendor property specifically for old subversion
of Opera < 12.1, desktop and mobile.
Change-Id: Id9a8a9fffb594f3973486f7be243329abdc9a5fa
Removes the muhogan module along with the templates and replacing
them with jQuery DOM construction.
Bug: T219846
Change-Id: I246f9c46ea2cc5721ddd57efcf58fae9fd947c58
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
Replace
* $.each( array, function ( index, value ) { ... } ) by
array.forEach( function ( value ) { ... } )
* $.map( array, function ( value ) { ... } ) by
array.map( function ( value ) { ... } )
* $.isArray( var ) by
Array.isArray( var )
* $.isFunction( var ) by
typeof var === 'function'
Change-Id: I450f5a75eb9c3fe20517da02986b0a491ebca67a
Per Timo's recommendation on Ife362f43d061d32fb0441dd1136fb11b46b475ae
use then instead of done for callback handling
Change-Id: I18dbfff59cb90a5076aa6f3b077ba9c264f7c139
$( '.read-more-container' ).get( 0 ) returns a DOMElement not a
jQuery object so there is no remove method. This will throw a
JavaScript exception.
It seems JavaScript exceptions can impact the loading of Wikidata
Page banners.
Bug: T152185
Change-Id: Ife362f43d061d32fb0441dd1136fb11b46b475ae
Wait until the Document is ready before appending related articles to
avoid the "last edited" link appended in afterwards.
This fix is untested as I've been unable to repro the issue reported.
Bug: T187479
Change-Id: Ieefaf644040ea057a65649a3ce14de3531ec2e72
Align SVG markup across Foundation products by
- unifying XML declaration,
- removing `enable-background` as it's deprecated and
- unifying whitespace.
Bug: T178867
Change-Id: I32972de815484fa89bd7cdacbbcd65f4663a4161
Aligning 'noimage' to overhauled color palette, background-color
equaling footer color and icon color going to closest,
minimally higher contrast color `#72777d`.
Bug: T172850
Change-Id: I949db4983910ef6609124adbfcd3c0d31a7f7eb4
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