Page MenuHomeWickedGov Phorge

isReferencePreviewsEnabled.js
No OneTemporary

Size
824 B
Referenced Files
None
Subscribers
None

isReferencePreviewsEnabled.js

const { TYPE_REFERENCE } = require( './constants.js' );
/**
* @module isReferencePreviewsEnabled
*/
/**
* Given the global state of the application, creates a function that gets
* whether or not the user should have Reference Previews enabled.
*
* @param {mw.user} user The `mw.user` singleton instance
* @param {Function} isPreviewTypeEnabled check whether preview has been disabled or enabled.
* @param {mw.Map} config
*
* @return {boolean|null} Null when there is no way the popup type can be enabled at run-time.
*/
function isReferencePreviewsEnabled( user, isPreviewTypeEnabled, config ) {
if ( !config.get( 'wgCiteReferencePreviewsActive' ) ) {
return null;
}
if ( user.isAnon() ) {
return isPreviewTypeEnabled( TYPE_REFERENCE );
}
return true;
}
module.exports = isReferencePreviewsEnabled;

File Metadata

Mime Type
text/plain
Expires
Oct 4 2026, 18:04 (5 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
0f/6f/c264c0eed2169e7bcbfe03eb6fe8
Default Alt Text
isReferencePreviewsEnabled.js (824 B)

Event Timeline