Merge "Add event logging for Realtime Preview enabling and disabling"

This commit is contained in:
jenkins-bot 2022-04-04 20:39:08 +00:00 committed by Gerrit Code Review
commit 8954cb96cd
2 changed files with 13 additions and 0 deletions

View file

@ -269,4 +269,16 @@
$textarea.wikiEditor( 'addModule', dialogsConfig.getDefaultConfig() );
};
// Add logging for Realtime Preview.
mw.hook( 'ext.WikiEditor.realtimepreview.enable' ).add( function () {
logEditFeature( 'preview', 'preview-realtime-on' );
} );
mw.hook( 'ext.WikiEditor.realtimepreview.inuse' ).add( function () {
logEditFeature( 'preview', 'preview-realtime-inuse' );
} );
mw.hook( 'ext.WikiEditor.realtimepreview.disable' ).add( function () {
logEditFeature( 'preview', 'preview-realtime-off' );
} );
}() );

View file

@ -15,5 +15,6 @@ mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
} );
if ( realtimePreview.getUserPref() ) {
realtimePreview.enable();
mw.hook( 'ext.WikiEditor.realtimepreview.inuse' ).fire( this );
}
} );