mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Add attributes for Minerva click tracking
Bug: T295490 Change-Id: I05fa96280c8dacc801b071d22086568ee0f11d86
This commit is contained in:
parent
f083d129e2
commit
28124e7f1e
|
@ -350,13 +350,15 @@ class PageHooks implements
|
|||
// talk page feature is enabled, but we shouldn't depend on code from there.
|
||||
$output->enableOOUI();
|
||||
$output->addHTML(
|
||||
new ButtonWidget( [
|
||||
( new ButtonWidget( [
|
||||
'href' => $title->getLinkURL( [ 'action' => 'edit', 'section' => 'new' ] ),
|
||||
// TODO: Make this a local message if the Minerva feature goes away
|
||||
'label' => $context->msg( 'minerva-talk-add-topic' )->text(),
|
||||
'flags' => [ 'progressive', 'primary' ],
|
||||
'classes' => [ 'ext-discussiontools-init-new-topic' ]
|
||||
] )
|
||||
] ) )
|
||||
// For compatibility with Minerva click tracking (T295490)
|
||||
->setAttributes( [ 'data-event-name' => 'talkpage.add-topic' ] )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,6 +244,11 @@ function init( $container, state ) {
|
|||
// Lazy-load postEdit module, may be required later (on desktop)
|
||||
mw.loader.using( 'mediawiki.action.view.postEdit' );
|
||||
|
||||
if ( OO.ui.isMobile() && mw.config.get( 'skin' ) === 'minerva' ) {
|
||||
// For compatibility with Minerva click tracking (T295490)
|
||||
$container.find( '.section-heading' ).attr( 'data-event-name', 'talkpage.section' );
|
||||
}
|
||||
|
||||
$pageContainer = $container;
|
||||
linksController = new ReplyLinksController( $pageContainer );
|
||||
var parser = new Parser( require( './parser/data.json' ) );
|
||||
|
|
Loading…
Reference in a new issue