mediawiki-extensions-Popups/resources/ext.popups.schemaPopups/ext.popups.schemaPopups.js

20 lines
545 B
JavaScript
Raw Normal View History

( 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.getMassagedData( data, previousLogData );
if ( data ) {
schemaPopups.log( data );
}
previousLogData = data;
} );
} )( jQuery, mediaWiki );