The checks are part of the Cite extension now and have no relevance
for page previews. The config is also obsolete by now due to the
copy in Cite and a mapping in mediawiki-config.
See Ie6e8bc706235724494036c7f0d873f5c996c46e6 and
Ia028c41f8aaa1c522dfc7c372e1ce51e40933a5e for reference.
Bug: T362771
Change-Id: I51311a099b21c3c1af39bbfbde1d2c2044958421
- Reference preview preferences should be defined inside Cite
- Don't use constants for seldom used strings to make the code
more readable.
- The lightweght ext.popups module is now always sent to the user
This was a micro-optimization and not necessary to do
Bug: T365538
Depends-On: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
Change-Id: Ie8fa1672b9fdbb1c6b840dde5c9060a20a625adb
This configuration is always enabled, so remaining conditions are dead
code. Removing the flag in this code base simplifies moving the
remaining Reference Previews settings in a later patch.
Bug: T363162
Change-Id: I2b952f4203b6ffa040daad2aa288eb53d2ffd3b2
Commit a75ddc41 and 33f9e9d3 effectively changed the default user
option value of popups-reference-previews for users created before
2017/08/16 without any justification.
Please see the task description for full analysis.
This partially reverts commit a75ddc41.
Bug: T366419
Change-Id: I68d6114384af6d259dbc4541522d52ae9a289e49
Implement conditional defaults for user preferences in the Popups
component.
This patch aims to simplify the preference management system by
leveraging conditional logic directly within the component rather
than relying on multiple hooks
Changes:
- Updated `extension.json` to reflect the removal of outdated hooks.
- Updated `extension.json` to reflect the conditional user defaults.
- Removed unused user option `popupsreferencepreviews` from
`extension.json`
- Modified `PopupsHooks` to streamline the preferences management,
and depend on conditional user defaults, and removing `onUserGetDefaultOptions` and `onLocalUserCreated` hooks.
- Removed unneeded test cases in `PopupsHooksTest`.
Bug: T364347
Change-Id: Iae454e4b4704a0289ca0a2b0794730562fda0dd1
This provides backwards compatibility with Cite, if Cite has register
its own preview module for reference tooltips.
Bug: T355194
Change-Id: Iec6f3d4d6c5f765c151ae0dbba258049530e6bc0
* Adds a new webpack entry point for references previews
* Reference related code in src/index.js is moved to new
file resources/ext.popups.referencePreviews/index.js
The changes:
* References previews now in its own module ext.popups.referencePreviews
* Loaded via getCustomPopupTypes
* OWNERS.md files make clear which team owns which part of the code.
Bug: T326692
Change-Id: Iea8a5b9221c0b1fd41e40bff2cbe01e42124d53f
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ib30da35841aadb558709dbbe6e30be2241048c87
User-options related classes are being moved to
the MediaWiki\User\Options namespace in MediaWiki Core;
reflect that change here.
Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: Icb39d3f73e120fd0d9dad5ae362787cd19d47bfb
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.
Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: I0c66220b0ba9501e8ef20a172d21d7e75a19d6cc
The extension is out of beta and will be enabled by default now.
Leaving some hints if we decide to also remove the feature flag.
Bug: T282999
Bug: T351708
Change-Id: I1556b2f3592294d094770ede2c276eddeef8bbe9
The …AFTER_BETA constant is the one we want to keep after we removed
all BetaFeature code. The naming scheme is just confusing.
Safe to rename. Not used anywhere else:
https://codesearch.wmcloud.org/search/?q=REFERENCE_PREVIEWS_PREFERENCE_NAME
We also decided to keep the $wgPopupsReferencePreviews feature flag.
Update the documentation accordingly.
This is split from I1556b2f to make it easier to review.
Bug: T351708
Change-Id: Ifbb41156f2a5a4d8a81e79f613754869c5c89690
Allow extensions to register new types of previews via
extension attributes.
Changes:
- The check for reference previews doesn't make sense
as $('a[ href*="#" ]' ) will match any elements with a hash
fragment, so the additional check to Title.getFragment
will not provide a different result. This was introduced in
I9ec57e0fbb0d21beaaa7b359c1c2bef64d2c14f5
- Links that point to themselves are marked with mw-selflink
in MediaWiki so this can use the not selector we already have.
- The new API is used internally and only available via extension
Attributes
- An example is provided in SkinJSON
(https://github.com/jdlrobson/mediawiki-skins-skinjson/pull/14)
Bug: T233099
Change-Id: Iefe98c1f0422dbf034e385b1a41a859d030a2cf4
User::getBoolOption() is deprecated and should be replaced with
UserOptionsLookup::getBoolOption()
Bug: T277600
Change-Id: I9a2118a6342bd5f145174428dcfb518cba4e439b
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()
Bug: T277818
Change-Id: I5698b4422755a921c9c9c01ce29084ebfe5f5385
* php-parallel-lint/php-parallel-lint: 1.0.0 → 1.3.0
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* mediawiki/minus-x: 1.1.0 → 1.1.1
Libup is broken on the build steps due to different node versions
Change-Id: I28aefe77365b9812f9cc0f9e5177f45e9f5c2cc2
For example:
* Anonymous users are a critical exception. They must always
load the module.
* Otherwise check if one preview type is active.
* Prefer isRegistered() over isAnon(), because isRegistered()
is part of the UserIdentity interface.
Change-Id: Iea7e3bb7ef01bd72ccbd1fc5e574437f6dc42aa2
The behavior for PagePreviews – implemented years ago – was
different. For old users it was disabled by default. This
behavior is wrong for ReferencePreviews.
Bug: T271206
Change-Id: I28c43ab3348ffdc27b068fc1ac1d6a6a06ee90a6
This is the smallest possible patch for a backport.
While it seems there is zero technical reason to limit user
option keys to lowercase with dashes, it's best-practice.
Same as message keys.
Bug: T281235
Change-Id: Ia4a45cf4459543c81b23b757ae9c2cfaf9676894
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