mediawiki-extensions-Visual.../modules/ve-mw/ve.track.js
Bartosz Dziewoński 766bdedf70 Centralize EditAttemptStep logging code in WikimediaEvents
* Use the new mw.track() handlers from WikimediaEvents
* Ensure that 'integration' and 'mode' are set on init
  events, since they're not guessed in the handler any more
* Remove the setting of 'editingStatsId' tracking parameter,
  now happens in WikimediaEvents by setting an API AJAX option
* Replace ve.track with mw.track in VE-MW, so that we don't have
  to copy the events manually here and in other extensions

This must be merged together with WikimediaEvents change
Iace4d53a972396ca5b8713000570cc47c9986034 (but we can't use
Depends-On, because CI requires code here to be removed first).

Bug: T332438
Change-Id: I0ef0a96aafdf89a4ebe32131a85b18c25744bb2c
2023-03-24 21:48:45 +01:00

10 lines
307 B
JavaScript

// In VE-MW, track events using MediaWiki's system instead of VisualEditor's
ve.track = mw.track;
ve.trackSubscribe = mw.trackSubscribe;
ve.trackSubscribe( 'activity.', function ( topic, data ) {
mw.track( 'visualEditorFeatureUse', ve.extendObject( data, {
feature: topic.split( '.' )[ 1 ]
} ) );
} );