mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-04 19:38:16 +00:00
f0849b2b17
This updates the easy variables which are set and get within a single module, these changes should have no effect and don't need to be coordinated across extensions. Bug: T362332 Change-Id: Ibbe69c321e9e2b744ec88cebbdc3476d776f5956
30 lines
681 B
JavaScript
30 lines
681 B
JavaScript
/**
|
|
* @module setUserConfigFlags
|
|
*/
|
|
|
|
/**
|
|
* Same as in includes/PopupsContext.php
|
|
*/
|
|
const REF_TOOLTIPS_ENABLED = 2,
|
|
REFERENCE_PREVIEWS_ENABLED = 4;
|
|
|
|
/**
|
|
* Decodes the bitmask that represents preferences to the related config options.
|
|
*
|
|
* @param {mw.Map} config
|
|
*/
|
|
module.exports = function setUserConfigFlags( config ) {
|
|
const popupsFlags = parseInt( config.get( 'wgPopupsFlags' ), 10 );
|
|
|
|
/* eslint-disable no-bitwise */
|
|
config.set(
|
|
'wgCiteReferencePreviewsConflictsWithRefTooltipsGadget',
|
|
!!( popupsFlags & REF_TOOLTIPS_ENABLED )
|
|
);
|
|
config.set(
|
|
'wgCiteReferencePreviews',
|
|
!!( popupsFlags & REFERENCE_PREVIEWS_ENABLED )
|
|
);
|
|
/* eslint-enable no-bitwise */
|
|
};
|