mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-03 19:56:39 +00:00
cda1ffe425
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
16 lines
388 B
JavaScript
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 );
|