+ /**
+ * Get API params for a given query
+ *
+ * @param {string} query User query
+ * @return {Object} API params
+ */
+ mw.widgets.TitleWidget.prototype.getApiParams = function ( query ) {
+ var params = {
+ action: 'query',
+ prop: [ 'info', 'pageprops' ],
+ generator: 'prefixsearch',
+ gpssearch: query,
+ gpsnamespace: this.namespace !== null ? this.namespace : undefined,
+ gpslimit: this.limit,
+ ppprop: 'disambiguation'
+ };
+ if ( this.showRedirectTargets ) {
+ params.redirects = true;
+ }
+ if ( this.showImages ) {
+ params.prop.push( 'pageimages' );
+ params.pithumbsize = 80;
+ params.pilimit = this.limit;
+ }
+ if ( this.showDescriptions ) {
+ params.prop.push( 'pageterms' );
+ params.wbptterms = 'description';
+ }
+ return params;
+ };
+