The Page-Previews extension currently manages a JS global wgPopupsFlags [1] that mainly holds data about settings related to the Reference Previews feature. The code now moved to the Cite extension and so most of these settings should be set there.
Implementation plan:
- Add gadget detection [2] for ReferenceTooltips and NavigationPopups to Cite's codebase and disable the preview in these cases. ( Use the existing wgPopupsConflictingRefTooltipsGadgetName and wgPopupsConflictingNavPopupsGadgetName settings )
- Move the code for detecting the user setting wgPopupsReferencePreviews to the Cite codebase. [3]
- Create Cite specific copies for the relevant gadget and feature switch setting globals
- Cleanup the settings and flag code in the Popups extension. Note, that the detection for NavigationPopups is still relevant for popups
- Rename the wgPopupsConflictingRefTooltipsGadgetName config setting and move it to Cite [4]. It's only relevant for Reference Previews .
- Remove irrelevant global config copies when changes are deployed on production.
Note:
- We can use the onMakeGlobalVariablesScript hook to set JS vars where we need the user object like done in the Popups extension.
[1] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/includes/PopupsHooks.php#246
[2] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/includes/PopupsGadgetsIntegration.php
[3] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/includes/PopupsContext.php#152
[4] https://gerrit.wikimedia.org/g/mediawiki/extensions/Popups/+/03449d1af07d25561d2abfeeff5763d5d3fad55e/extension.json#74