2016-11-30 13:40:08 +00:00
|
|
|
( 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}
|
|
|
|
*/
|
2017-02-02 02:24:12 +00:00
|
|
|
module.exports = function ( config, window ) {
|
2017-01-15 18:50:04 +00:00
|
|
|
var samplingRate = config.get( 'wgPopupsSchemaSamplingRate', 0 );
|
2016-11-30 13:40:08 +00:00
|
|
|
|
|
|
|
if (
|
|
|
|
!window.navigator ||
|
|
|
|
!$.isFunction( window.navigator.sendBeacon ) ||
|
|
|
|
window.QUnit
|
|
|
|
) {
|
|
|
|
samplingRate = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new mw.eventLog.Schema( 'Popups', samplingRate );
|
|
|
|
};
|
|
|
|
|
|
|
|
}( mediaWiki, jQuery ) );
|