mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-23 04:22:46 +00:00
c4460ba2ea
Add tests. Change-Id: I15c10f256432ab5bfa7bf7adb34764f84b17c439
20 lines
545 B
JavaScript
20 lines
545 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.getMassagedData( data, previousLogData );
|
|
|
|
if ( data ) {
|
|
schemaPopups.log( data );
|
|
}
|
|
previousLogData = data;
|
|
} );
|
|
} )( jQuery, mediaWiki );
|