Replace pageterms with description API

Bug: T190953
Change-Id: Ia188a7bdc4d3533d6ee0e9bb06fa62da4b759c66
This commit is contained in:
Jan Drewniak 2018-04-12 09:58:55 +02:00
parent ed90ee091c
commit 816bda69c5
2 changed files with 4 additions and 12 deletions

View file

@ -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 );

View file

@ -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 ) );
} );
}