mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 16:10:55 +00:00
b9862d7d24
I want to remove the need for M.define in the Minerva repository. It's no longer necessary with packageFiles and will help tame a lot of the code we have here! Change-Id: If6a35a23e84a44adb965fd9c41265ba37eb8368e
19 lines
514 B
JavaScript
19 lines
514 B
JavaScript
( function ( track, user, config ) {
|
|
/**
|
|
* Helper function to track share button usage
|
|
*
|
|
* @param {string} action - one of "shownShareButton", "clickShareButton", "SharedToApp"
|
|
*/
|
|
function trackShare( action ) {
|
|
track( 'event.MobileWebShareButton', {
|
|
pageTitle: config.get( 'wgTitle' ),
|
|
namespaceId: config.get( 'wgNamespaceNumber' ),
|
|
isAnon: user.isAnon(),
|
|
action: action,
|
|
pageToken: user.getPageviewToken()
|
|
} );
|
|
}
|
|
|
|
module.exports = trackShare;
|
|
}( mw.track, mw.user, mw.config ) );
|