Merge "Add additional tracking information to mediawiki.searchSuggest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 4 Mar 2016 20:10:17 +0000 (20:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 4 Mar 2016 20:10:17 +0000 (20:10 +0000)
1  2 
docs/hooks.txt
resources/src/mediawiki/mediawiki.searchSuggest.js

diff --cc docs/hooks.txt
Simple merge
                        // linkParams object is modified and reused
                        formData.linkParams[ formData.textParam ] = text;
  
+                       // Allow trackers to attach tracking information, such
+                       // as wprov, to clicked links.
+                       mw.track( 'mediawiki.searchSuggest', {
+                               action: 'render-one',
+                               formData: formData,
+                               index: context.config.suggestions.indexOf( text ) + 1
+                       } );
                        // this is the container <div>, jQueryfied
 -                      this.text( text )
 -                              .wrap(
 +                      this.text( text );
 +
 +                      // wrap only as link, if the config doesn't disallow it
 +                      if ( textboxConfig.wrapAsLink !== false ) {
 +                              this.wrap(
                                        $( '<a>' )
                                                .attr( 'href', formData.baseHref + $.param( formData.linkParams ) )
                                                .attr( 'title', text )