mediawiki-extensions-Popups/includes
Thiemo Kreuz c281bb9302 Clean up code enabling individual popup types
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
2021-04-21 19:38:25 +02:00
..
EventLogging Fix PSR12.Properties.ConstantVisibility.NotFound 2020-05-19 23:38:59 +00:00
PopupsContext.php Clean up code enabling individual popup types 2021-04-21 19:38:25 +02:00
PopupsGadgetsIntegration.php hide reference previews when reference tooltip gadget is active 2020-11-16 18:36:04 +01:00
PopupsHooks.php Merge duplicate ReferencePreviews Beta feature flag 2021-04-21 10:46:05 +02:00
ServiceWiring.php [hygiene] move ServiceWirings.php to ServiceWiring.php 2020-01-14 08:49:11 -07:00
UserPreferencesChangeHandler.php build: Updating mediawiki/mediawiki-codesniffer to 29.0.0 2020-01-26 20:22:03 +01:00