mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-03 03:36:41 +00:00
fa2b10a2e7
This way, src contains sources, and dist contains distribution files. Also, add some documentation about the folders in the README and an adr. Change-Id: Ie0b9f6475b8423b90e927633d883bde3cd5d5e4d
26 lines
555 B
JavaScript
26 lines
555 B
JavaScript
( function ( mw, $ ) {
|
|
|
|
/**
|
|
* Creates an instance of an EventLogging schema that can be used to log
|
|
* Popups events.
|
|
*
|
|
* @param {mw.Map} config
|
|
* @param {Window} window
|
|
* @return {mw.eventLog.Schema}
|
|
*/
|
|
module.exports = function ( config, window ) {
|
|
var samplingRate = config.get( 'wgPopupsSchemaSamplingRate', 0 );
|
|
|
|
if (
|
|
!window.navigator ||
|
|
!$.isFunction( window.navigator.sendBeacon ) ||
|
|
window.QUnit
|
|
) {
|
|
samplingRate = 0;
|
|
}
|
|
|
|
return new mw.eventLog.Schema( 'Popups', samplingRate );
|
|
};
|
|
|
|
}( mediaWiki, jQuery ) );
|