mediawiki-extensions-Popups/resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js
jdlrobson 4d7d55ec14 Hygiene: Rename getMassagedData to processHovercardEvent
This name is more fitting to the new purpose of this method.

Change-Id: I48f5e9a3ae737a104270699742a96923c92e12e8
2016-10-31 11:25:09 +00:00

20 lines
540 B
JavaScript

( function ( mw ) {
var previousLogData,
// Log the popup event as defined in the schema
// https://meta.wikimedia.org/wiki/Schema:Popups
schemaPopups = new mw.eventLog.Schema(
'Popups',
mw.popups.schemaPopups.getSamplingRate(),
mw.popups.schemaPopups.getDefaultValues()
);
mw.trackSubscribe( 'ext.popups.event', function ( topic, data ) {
data = mw.popups.schemaPopups.processHovercardEvent( data, previousLogData );
if ( data ) {
schemaPopups.log( data );
}
previousLogData = data;
} );
} )( mediaWiki );