mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-27 09:41:01 +00:00
Merge "[Development] Allow us to pull RelatedArticles from production APIs"
This commit is contained in:
commit
d043e31869
|
@ -61,6 +61,7 @@
|
|||
{
|
||||
"name": "data.json",
|
||||
"config": {
|
||||
"searchUrl": "RelatedArticlesUseCirrusSearchApiUrl",
|
||||
"useCirrusSearch": "RelatedArticlesUseCirrusSearch",
|
||||
"onlyUseCirrusSearch": "RelatedArticlesOnlyUseCirrusSearch",
|
||||
"descriptionSource": "RelatedArticlesDescriptionSource"
|
||||
|
@ -121,6 +122,10 @@
|
|||
]
|
||||
},
|
||||
"config": {
|
||||
"RelatedArticlesUseCirrusSearchApiUrl": {
|
||||
"description": "During development use a different API for sourcing related articles.",
|
||||
"value": "/w/api.php"
|
||||
},
|
||||
"RelatedArticlesCardLimit": {
|
||||
"description": "Maximum number of articles that should be shown in RelatedArticles widget. This limit is derived from limits in TextExtracts and PageImages extensions. Number should be between 1 and 20.",
|
||||
"value": 3
|
||||
|
|
|
@ -63,6 +63,7 @@ RelatedPagesGateway.prototype.getForCurrentPage = function ( limit ) {
|
|||
var parameters = {
|
||||
action: 'query',
|
||||
formatversion: 2,
|
||||
origin: '*',
|
||||
prop: 'pageimages',
|
||||
piprop: 'thumbnail',
|
||||
pithumbsize: 160 // FIXME: Revert to 80 once pithumbmode is implemented
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
var data = require( './data.json' ),
|
||||
RelatedPagesGateway = require( './RelatedPagesGateway.js' ),
|
||||
relatedPages = new RelatedPagesGateway(
|
||||
new mw.Api(),
|
||||
new mw.Api( {
|
||||
ajax: {
|
||||
url: data.searchUrl
|
||||
}
|
||||
} ),
|
||||
mw.config.get( 'wgPageName' ),
|
||||
mw.config.get( 'wgRelatedArticles' ),
|
||||
data.useCirrusSearch,
|
||||
|
|
Loading…
Reference in a new issue