Log right-clicks on the image

Record how many users right-click on the image in MediaViewer, with the
assumption being they're intending to download the image. However, that
image has been resized and is not the original.

The event is logged even if the metadata panel is open, as the user probably
still intended to download.

Bug: T75962
Change-Id: I223ed957bcc60646adf9c9a00d2d9ca18ad128e6
This commit is contained in:
gladoscc 2015-01-01 13:24:32 +11:00
parent cf67495467
commit 7f4ce833d4
3 changed files with 8 additions and 1 deletions

View file

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

View file

@ -95,6 +95,7 @@
'download-select-menu-large': 'User selected the large size in the download dropdown menu.', 'download-select-menu-large': 'User selected the large size in the download dropdown menu.',
'download': 'User clicked on the button to download a file.', 'download': 'User clicked on the button to download a file.',
'download-view-in-browser': 'User clicked on the link to view the image in the browser in the download tab.', 'download-view-in-browser': 'User clicked on the link to view the image in the browser in the download tab.',
'right-click-image': 'User right-clicked on the image.',
'share-page': 'User opened the link to the current image.', 'share-page': 'User opened the link to the current image.',
'share-link-copied': 'User copied the share link.', 'share-link-copied': 'User copied the share link.',
'embed-html-copied': 'User copied the HTML embed code.', 'embed-html-copied': 'User copied the HTML embed code.',

View file

@ -213,6 +213,12 @@
} ); } );
} }
} ); } );
this.$image.on( 'mousedown.mmv-canvas', function ( e ) {
if ( e.which === 3 ) {
mw.mmv.actionLogger.log( 'right-click-image' );
}
} );
}; };
/** /**