mediawiki-extensions-Popups/resources/ext.popups.schemaPopups.js
Baha cda1ffe425 Use mw.eventLog.Schema to log EventLogging events
This change is an intermediate step in our transition
to logging a variety of events easily.

Also:
  * Some events may need sendBeacon support and may not be
    logged if the navigator does not support sendBeacon.
  * Do not load schema code if EventLogging is not available.

Bug: T131315
Change-Id: Iff939577f65f1c6c71701dd6967939445385fb70
2016-05-16 17:29:48 -04:00

16 lines
388 B
JavaScript

( function ( $, mw ) {
/**
* Log the popup event as defined in the schema
*
* https://meta.wikimedia.org/wiki/Schema:Popups
*/
var schemaPopups = new mw.eventLog.Schema(
'Popups',
mw.config.get( 'wgPopupsSchemaPopupsSamplingRate', 0 )
);
mw.trackSubscribe( 'ext.popups.schemaPopups', function ( topic, data ) {
schemaPopups.log( data );
} );
} )( jQuery, mediaWiki );