From 816bda69c5b1ceb9adc2a0e8885f452bcc1cdc58 Mon Sep 17 00:00:00 2001 From: Jan Drewniak Date: Thu, 12 Apr 2018 09:58:55 +0200 Subject: [PATCH] Replace pageterms with description API Bug: T190953 Change-Id: Ia188a7bdc4d3533d6ee0e9bb06fa62da4b759c66 --- .../RelatedPagesGateway.js | 5 ++--- resources/ext.relatedArticles.readMore/index.js | 11 ++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js b/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js index 737e345c..c8b2b24a 100644 --- a/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js +++ b/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js @@ -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 ); diff --git a/resources/ext.relatedArticles.readMore/index.js b/resources/ext.relatedArticles.readMore/index.js index 9a42c3cb..02d80079 100644 --- a/resources/ext.relatedArticles.readMore/index.js +++ b/resources/ext.relatedArticles.readMore/index.js @@ -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 ) ); } ); }