This provides backwards compatibility with Cite, if Cite has register
its own preview module for reference tooltips.
Bug: T355194
Change-Id: Iec6f3d4d6c5f765c151ae0dbba258049530e6bc0
As a precursor to moving this code to the Cite extension move it off
of webpack and switch to using require rather than import
Bug: T355194
Change-Id: Ib6486ad38b79a3b67a9744b716b1a2f5d3779795
The findNearestEligibleTarget method is now being called with an
empty array and thus an empty string as a selector
Follow up to
I5f293a134521f086c9f62babb9d06cd9c51d7d47
Bug: T355933
Bug: T356186
Bug: T356193
Change-Id: I3af44ae65d5097fc44744838a4edb07552568b17
Extensions may want to log metrics relating to settings being enabled
or disabled. This is currently the case with reference previews.
This is a follow up to
I1c434f0098ae23bd62256686a658e3d5ef7f70b9
Additional change: Add FIXME clarifying migrateOldPreferences is temporary
and setting a date it can be removed.
Bug: T353798
Change-Id: If9bac123d731e7da7429ba3a0ea92e80263df6a6
It seems to me, that at this point 3rd parties might not have been
loaded that want to add custom preview types. So the list of
selectors is empty.
We still might want to initialze though for 3rd parties that load
later.
Bug: T355933
Change-Id: I5f293a134521f086c9f62babb9d06cd9c51d7d47
Used for tracking baseline stats in the Cite extension.
Also fixed the wireing of the Reference Preview type constant so
that the settings can be tracked. Not sure where this should go
best in the new code.
Bug: T353798
Change-Id: I1c434f0098ae23bd62256686a658e3d5ef7f70b9
More of a random thing done to increase the coverage a bit because
there are upcomming features that seem to be hard to test.
- Found one test case in reference previews that was configured
wrongly
- Adding some sanity checks to the settingsDialogRender test
Change-Id: I95d3c6f30388b2dcc76b018d5dc0f958d06aad91
This is a precursor to moving the code out to the Cite extension.
This can be squashed into parent commit or merged at same time.
I've kept the two patches separate to make them easier to review.
Bug: T326692
Change-Id: I50dbf28a1078df6c73fd0fbf77480488dd82c7b3
* 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
The latest update of 'svgo' dependency includes three optimizations on
converting path commands, which
- improves closing paths and how we determine if to use absolute or
relative commands.
- round arc or convert to lines based on the geometric sagitta
- convert cubic Bézier curves to quadratic Bézier curves where possible
Bug: T354875
Change-Id: Ibd611396c48ff6f971ee251b59f13e350e0f812f
Mainly auto fixes but also getting rid of some straight forward lint
warnings to reduce the wall of issues a bit when running the tests.
Also removing some rule exceptions that seem to got more relaxed
upstream.
Change-Id: Icb4d73374583675be74517e6df6508314d61e8c2
* Babel upgraded to a version that works with new Node's OpenSSL.
* Various loaders upgraded to match
* Babel config changed as plugin-proposal-private-property-in-object is now official
* Webpack config updated as noEmitOnErrors was renamed to not be a negation
* Webpack config updated as namedModules was renamed to the wider moduleIds
* Ignore the built Webpack output from eslint
Bug: T354943
Change-Id: I449f601b8218925d96bfb423fc0f349214d08385
This reverts commit a6a65204c6.
to restore custom preview types.
-- Changes since revert
The previous patch accidentally removed the syncUserSettings
changeListener. This has now been restored with several modifications:
* We have a migrate script which rewrites existing localStorage settings
to the new system
* The existing save functions are generalized.
The changes since this patch are captured in
Ia73467799a9b535f7a3cf7268727c9fab7af0d7e
-- More information
A new REGISTER_SETTING action replaces the BOOT action for
registering settings. This allows custom preview types to be
associated with a setting. They do this by adding the enabled
property to the module they provide to mw.popups.register
Every time the new action is called, we refresh the settings
dialog UI with the new settings.
Previously the settings dialog was hardcoded, but now it is generated
from the registered preview types by deriving associated messages
and checking they exist, so by default custom types will not show
up in the settings.
Benefits:
* This change empowers us to add a setting for Math previews to allow
them to be enabled or disabled.
* Allows us to separate references as its own module
Additional notes:
* The syncUserSettings.js changeListener is no longer needed as the logic
for this is handled inside the "userSettings" change listener in response to
the "settings" reducer which is responding to
SETTINGS_CHANGE and REGISTER_SETTING actions.
Upon merging:
* https://www.mediawiki.org/wiki/Extension:Popups#Extensibility will be
updated to detail how a setting can be registered.
Bug: T334261
Bug: T326692
Change-Id: Ie17d622870511ac9730fc9fa525698fc3aa0d5b6
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