Jonas Kress (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/244704

Change subject: [WIP] Display label instead of Q id titles
......................................................................

[WIP] Display label instead of Q id titles

Display label instead of Q id titles by using page terms module and
replace displayTitle

Bug: T115014
Change-Id: I005af60091907f428a86ed75f953b0fa306b40e4
---
M resources/mobile.nearby/Nearby.js
M resources/mobile.nearby/NearbyGateway.js
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/04/244704/1

diff --git a/resources/mobile.nearby/Nearby.js 
b/resources/mobile.nearby/Nearby.js
index 5e5bbe2..9ae38e1 100644
--- a/resources/mobile.nearby/Nearby.js
+++ b/resources/mobile.nearby/Nearby.js
@@ -160,6 +160,13 @@
                                if ( pages && pages.length === 0 ) {
                                        options.errorOptions = 
self._errorOptions( 'empty' );
                                }
+                               
+                               $.each( pages, function(key, page){
+                                       if(page.options.terms.label[0]){
+                                               page.displayTitle = 
page.options.terms.label[0]
+                                       }
+                               } );
+                               //debugger;
                                self._isLoading = false;
                                result.resolve( options );
                        }
@@ -224,8 +231,8 @@
                _postRenderLinks: function () {
                        var offset,
                                hash = window.location.hash;
-
                        this.$( 'a' ).each( function ( i ) {
+                               debugger;
                                // FIXME: not unique if multiple Nearby objects 
on same page
                                $( this ).attr( 'id', 'nearby-page-list-item-' 
+ i );
                        } ).on( 'click', function () {
diff --git a/resources/mobile.nearby/NearbyGateway.js 
b/resources/mobile.nearby/NearbyGateway.js
index 99c7431..8c61fe4 100644
--- a/resources/mobile.nearby/NearbyGateway.js
+++ b/resources/mobile.nearby/NearbyGateway.js
@@ -125,7 +125,7 @@
                        requestParams = {
                                action: 'query',
                                colimit: 'max',
-                               prop: 'pageimages|coordinates',
+                               prop: 'pageimages|coordinates|pageterms',
                                pithumbsize: mw.config.get( 
'wgMFThumbnailSizes' ).small,
                                pilimit: limit,
                                generator: 'geosearch',

-- 
To view, visit https://gerrit.wikimedia.org/r/244704
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I005af60091907f428a86ed75f953b0fa306b40e4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <jonas.kr...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to