Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6033114
isReferencePreviewsEnabled.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
824 B
Referenced Files
None
Subscribers
None
isReferencePreviewsEnabled.js
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Oct 4 2026, 18:31 (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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment