* @license The MIT License (MIT); see LICENSE.txt
*/
( function ( $, mw ) {
+ var hasOwn = Object.prototype.hasOwnProperty;
/**
* Mixin for title widgets
params.pilimit = this.limit;
}
if ( this.showDescriptions ) {
- params.prop.push( 'pageterms' );
- params.wbptterms = 'description';
+ params.prop.push( 'description' );
}
return params;
};
redirect: suggestionPage.redirect !== undefined,
disambiguation: OO.getProp( suggestionPage, 'pageprops', 'disambiguation' ) !== undefined,
imageUrl: OO.getProp( suggestionPage, 'thumbnail', 'source' ),
- description: OO.getProp( suggestionPage, 'terms', 'description' ),
+ description: suggestionPage.description,
// Sort index
index: suggestionPage.index,
originalData: suggestionPage
titles.push( suggestionPage.title );
}
- redirects = redirectsTo[ suggestionPage.title ] || [];
+ redirects = hasOwn.call( redirectsTo, suggestionPage.title ) ? redirectsTo[ suggestionPage.title ] : [];
for ( i = 0, len = redirects.length; i < len; i++ ) {
pageData[ redirects[ i ] ] = {
missing: false,
// mismatch where normalisation would make them matching (T50476)
pageExistsExact = (
- Object.prototype.hasOwnProperty.call( pageData, this.getQueryValue() ) &&
+ hasOwn.call( pageData, this.getQueryValue() ) &&
(
!pageData[ this.getQueryValue() ].missing ||
pageData[ this.getQueryValue() ].known
);
pageExists = pageExistsExact || (
titleObj &&
- Object.prototype.hasOwnProperty.call( pageData, titleObj.getPrefixedText() ) &&
+ hasOwn.call( pageData, titleObj.getPrefixedText() ) &&
(
!pageData[ titleObj.getPrefixedText() ].missing ||
pageData[ titleObj.getPrefixedText() ].known
}
for ( i = 0, len = titles.length; i < len; i++ ) {
- page = pageData[ titles[ i ] ] || {};
+ page = hasOwn.call( pageData, titles[ i ] ) ? pageData[ titles[ i ] ] : {};
items.push( this.createOptionWidget( this.getOptionWidgetData( titles[ i ], page ) ) );
}