mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-22 12:02:46 +00:00
c281bb9302
We still have 2 different mechanisms in place, maybe even 3: * We simplify the CSS selector when we know a popup type is disabled, and it's impossible an anonymous user can enable it at run-time. * We create that "initiallyEnabled" map that allows anonymous users to toggle the individual popup types at run-time. * This map is also used to check if the footer link should be shown. * There is also a wgPopupsReferencePreviews global that acts as a "kill switch". However, this is not a pure feature flag, but incorporates the user setting for registered users. This is currently partly redundant (checking `mw.user.options.get( 'popupsreferencepreviews' )` does the same) and can be removed later when the feature flag is not needed any more. The footer link currently acts odd because anonymous users are unable to enable ReferencePreviews, but get the footer link. This patch introduces a 3-state model: * `true` acts as before. * `false` means a popup type is disabled, but anonymous users can enable it (i.e. this is the opt-out behavior for anonymous users). * `null` means a popup type is not available at run-time, for nobody. Anonymous users can't do anything about this. Registered users must leave the page and change a setting. Bug: T277640 Change-Id: Id8d1396c09cf0f706034a66f9cd3c880a8b33df8 |
||
---|---|---|
.. | ||
.eslintrc.json | ||
index.js | ||
index.js.map.json |