2024-01-12 22:30:44 +00:00
|
|
|
/**
|
|
|
|
* @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(
|
2024-04-15 08:29:38 +00:00
|
|
|
'wgCiteReferencePreviewsConflictsWithRefTooltipsGadget',
|
2024-01-12 22:30:44 +00:00
|
|
|
!!( popupsFlags & REF_TOOLTIPS_ENABLED )
|
|
|
|
);
|
|
|
|
config.set(
|
2024-04-15 08:29:38 +00:00
|
|
|
'wgCiteReferencePreviews',
|
2024-01-12 22:30:44 +00:00
|
|
|
!!( popupsFlags & REFERENCE_PREVIEWS_ENABLED )
|
|
|
|
);
|
|
|
|
/* eslint-enable no-bitwise */
|
|
|
|
};
|