mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "DesktopArticleTarget.init: Pass platform to ve.track directly"
This commit is contained in:
commit
df253967e1
|
@ -282,6 +282,10 @@
|
|||
|
||||
function trackActivateStart( initData ) {
|
||||
ve.track( 'trace.activate.enter', { mode: initData.mode } );
|
||||
// ve.track normally tries to guess the current platform based on
|
||||
// ve.init.target. We're in a pre-target-loaded state, so have it
|
||||
// hardcode desktop here.
|
||||
initData.platform = 'desktop';
|
||||
ve.track( 'mwedit.init', initData );
|
||||
mw.libs.ve.activationStart = ve.now();
|
||||
}
|
||||
|
|
|
@ -95,11 +95,20 @@
|
|||
delete data.mode;
|
||||
}
|
||||
|
||||
if ( !data.platform ) {
|
||||
if ( ve.init && ve.init.target && ve.init.target.constructor.static.platformType ) {
|
||||
data.platform = ve.init.target.constructor.static.platformType;
|
||||
} else {
|
||||
data.platform = 'other';
|
||||
// TODO: outright abort in this case, once we think we've caught everything
|
||||
mw.log.warn( 've.init.mw.trackSubscriber: no target available and no platform specified', action );
|
||||
}
|
||||
}
|
||||
|
||||
event = $.extend( {
|
||||
version: 1,
|
||||
action: action,
|
||||
editor: 'visualeditor',
|
||||
platform: ve.init && ve.init.target && ve.init.target.constructor.static.platformType || 'other',
|
||||
integration: ve.init && ve.init.target && ve.init.target.constructor.static.integrationType || 'page',
|
||||
'page.id': mw.config.get( 'wgArticleId' ),
|
||||
'page.title': mw.config.get( 'wgPageName' ),
|
||||
|
|
Loading…
Reference in a new issue