mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-11-27 17:50:25 +00:00
Replace pageterms with description API
Bug: T190953 Change-Id: Ia188a7bdc4d3533d6ee0e9bb06fa62da4b759c66
This commit is contained in:
parent
ed90ee091c
commit
816bda69c5
|
@ -66,10 +66,9 @@
|
|||
var parameters = {
|
||||
action: 'query',
|
||||
formatversion: 2,
|
||||
prop: 'pageimages|pageterms',
|
||||
prop: 'pageimages|description',
|
||||
piprop: 'thumbnail',
|
||||
pithumbsize: 160, // FIXME: Revert to 80 once pithumbmode is implemented
|
||||
wbptterms: 'description'
|
||||
pithumbsize: 160 // FIXME: Revert to 80 once pithumbmode is implemented
|
||||
},
|
||||
// Enforce limit
|
||||
relatedPages = this.editorCuratedPages.slice( 0, limit );
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
var result = {
|
||||
title: page.title,
|
||||
url: mw.util.getUrl( page.title ),
|
||||
hasThumbnail: false
|
||||
hasThumbnail: false,
|
||||
extract: page.description
|
||||
};
|
||||
|
||||
if ( page.thumbnail ) {
|
||||
|
@ -26,14 +27,6 @@
|
|||
result.isThumbnailPortrait = page.thumbnail.height >= page.thumbnail.width;
|
||||
}
|
||||
|
||||
if (
|
||||
page.terms &&
|
||||
page.terms.description &&
|
||||
page.terms.description.length
|
||||
) {
|
||||
result.extract = page.terms.description[ 0 ];
|
||||
}
|
||||
|
||||
return new CardView( new CardModel( result ) );
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue