Merge "Rough logging of metadata panel scrolling"

This commit is contained in:
jenkins-bot 2014-12-09 09:53:50 +00:00 committed by Gerrit Code Review
commit 5c869aa9ec
3 changed files with 8 additions and 1 deletions

View file

@ -1062,7 +1062,7 @@ $wgResourceModules += array(
$wgHooks['EventLoggingRegisterSchemas'][] = function( array &$schemas ) { $wgHooks['EventLoggingRegisterSchemas'][] = function( array &$schemas ) {
$schemas += array( $schemas += array(
'MediaViewer' => 10536413, 'MediaViewer' => 10606177,
'MultimediaViewerNetworkPerformance' => 10596581, 'MultimediaViewerNetworkPerformance' => 10596581,
'MultimediaViewerDuration' => 10427980, 'MultimediaViewerDuration' => 10427980,
'MultimediaViewerAttribution' => 9758179, 'MultimediaViewerAttribution' => 9758179,

View file

@ -70,6 +70,8 @@
'image-view': 'User viewed an image.', 'image-view': 'User viewed an image.',
'metadata-open': 'User opened the metadata panel.', 'metadata-open': 'User opened the metadata panel.',
'metadata-close': 'User closed the metadata panel.', 'metadata-close': 'User closed the metadata panel.',
'metadata-scroll-open': 'User opened the metadata panel by scrolling.',
'metadata-scroll-close': 'User closed the metadata panel by scrolling.',
'next-image': 'User viewed the next image.', 'next-image': 'User viewed the next image.',
'prev-image': 'User viewed the previous image.', 'prev-image': 'User viewed the previous image.',
'terms-open': 'User opened the usage terms.', 'terms-open': 'User opened the usage terms.',

View file

@ -222,8 +222,13 @@
if ( panelIsOpen && !this.panelWasOpen ) { // just opened if ( panelIsOpen && !this.panelWasOpen ) { // just opened
this.$container.trigger( 'mmv-metadata-open' ); this.$container.trigger( 'mmv-metadata-open' );
// This will include keyboard- and mouseclick-initiated open events as well,
// since the panel is anomated, which counts as scrolling.
// Filtering these seems too much trouble to be worth it.
mw.mmv.actionLogger.log( 'metadata-scroll-open' );
} else if ( !panelIsOpen && this.panelWasOpen ) { // just closed } else if ( !panelIsOpen && this.panelWasOpen ) { // just closed
this.$container.trigger( 'mmv-metadata-close' ); this.$container.trigger( 'mmv-metadata-close' );
mw.mmv.actionLogger.log( 'metadata-scroll-close' );
} }
this.panelWasOpen = panelIsOpen; this.panelWasOpen = panelIsOpen;
}; };