Prevents dark-mode styles from affecting print media
by adding `@media screen` to dark-mode related styles.
Bug: T371331
Change-Id: Ide900a3e24a03d83f8e4ce51f89655cf5bb7e9b8
Most of page previews is private, and developers should rely
on text editors to explore the codebase.
For public documentation we only surface what is a stable API
for page previews.
Change-Id: I8536de1de3038de43e5108f7d877df2ba3a2175b
Remove the ext.popups.images module, replacing it with
references to the SVG image.
- The footer image is the same in dark and light mode so use
background image
- Use mask image for sad face to make it work correctly in dark mode.
- Rely on CSS Janus for the ltr to rtl swap out
Change-Id: Idf041730549b834126d9631ac95611526ae5daa3
Changes drop-shadow color for Page Previews from
`rgba( 0, 0, 0, 0.05 )` to `@background-color-neutral`.
This is a slight visual change that maintains the tone of the
gray border, but removes it's opacity.
Bug: T365428
Change-Id: I065324e35eb28027d98e88d35b99b1d5266690d5
Currently, the gradient is fading into #000 when what we want is #101418
(represented by @background-color-base). Correct this and remove the
hardcoded rgba values as we don't need them and this gives us one less
place to update if the value changes in the future
Visual change (bug fix)
Bug: T360877
Change-Id: If330dd251dffb07f371c0c9222c6ef5f52120e25
It currently doesn't trigger because the links lack a
title attribute, but if one were to be added the tool
would trigger as, although timestamp links are just hash
fragment links, we also include the canonical path
before the hash.
Change-Id: I156b1401f5173ba1727861adf1efa136b96d330f
offsetTop includes the scroll offset, so when using it to
calculate clientTop (position relative to the viewport),
we need to substract that offset.
clientY comes from mouse events and is already relative
to the viewport so needs no adjustment.
Bug: T270215
Change-Id: I545b14059f416678fc0d35413a76334e57bfc495
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
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
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
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
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
This allows preview types to override the default behaviour
which prohibits previews from rendering when the API finds no
extract. In the case of disambiguation pages the summary is not
required to render a preview.
Bug: T346686
Change-Id: Ifb8bbef943b02dfa971e2af96511ac708733bdd1
Also restructure eslint config so that
* root files are linted with server rules
* src and tests share config
Change-Id: Ie4d0731ba9670af7f3e60cdfe3c4e331386b17c6
This reverts commit af90386c67.
Reason for revert: The codex-styles module is now only loaded when
the settings cog is clicked.
Bug: T348069
Change-Id: I1d3c3a7b5c74c3e2d64765274468e48c014a4047
This reverts commit 85d9a7b0ed.
Reason for revert: Unexpected visual change flagged by Pixel.
We're now loading BOTH codex search and Codex
styles on page load (the latter via JavaScript). This results in
a visual regression in the sidebar as the message box for
languages switches from MediaWiki UI to Codex. I am not 100% sure
what the right approach is here, but we should pause to assess
given this new learning.
Possible options
1) Add checkbox styles to codex-search bundle
2) Load codex-styles on page load instead of codex-search
3) Delay the loading of the codex-styles until the overlay is
rendering
4) Wait until Codex has code splitting.
Change-Id: I633364fea54b048492c6bde10b4c4cc8ab99b9ae
This reverts commit 6924a89b07.
Reason for revert: Breaks persistence of setting
for anonymous users.
Change-Id: I3efc20f44281c1c68c4162584388e33bb38c4848
OO.ui.ButtonedElement has been renamed to OO.ui.ButtonElement 9 years
ago in I1abecd8aaf694799e4e46acb07afbdfb458a4882 together with its
classes. This change updates the class name in the list of selectors
that don't trigger a popup (EXCLUDED_LINK_SELECTORS) to its current
name.
Bug: T348893
Change-Id: I9b93ce62e0664ba06a14d71477afc0be4fae2fd4
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: Ie11057052fb9035944f2b79a17fb486f97102994
When the user sets a different language than the projects content
language, ReferencePreviews were rendered LTR. By using the bdi
tag this behavior is fixed.
Note that PagePreviews gets language and direction from the
TextExtracts response and use them to achive the same. The latter
is not straight forward available for ReferencePreviews so I'm
using bdi to achieve the same.
Bug: T345833
Change-Id: I6554e6e1db3aac06c04c9185500e05de238adde2
The rate is unexpected: over 5 million in the last 7 days
I don't time to investigate this further so suggest disabling this
for now.
Change-Id: Ie55d1da1652239ad4f6ea94743d6efdd12de9974
The graphic shown when disabling page previews is not an icon
so it's unhelpful to refer to the deprecated mw-ui-icon library.
Bug: T345653#9168342
Change-Id: I083b3d05fd9629c4c2a773a4805e330cfc2a6a53
Apparently caused by a mistake in I8697232, and the QA for T340256 not
covering the full functionality of what was changed in the patch.
Bug: T345829
Change-Id: I482d32183ef7f2226c7ad114be0fbaf97bc7b898
- Removes .mw-ui-icon and .mw-ui-icon-element
- Aligns markup/styles between generic and disambiguation previews
- Update padding for generic and disambiguation previews to be the same as other popups, results in minor visual changes
Bug: T341899
Change-Id: I9a58fc6a93160d07452ea6f903e1797dd9421d92
This rule is clashing with some special behaviour in Minerva
relating to labels being shown to desktop users
Follow up to I86972322ae34f1d1df8d79c66daa9e34091f9dd3
Bug: T319260
Bug: T340262
Change-Id: If6f8ee2793726306675a7e6c7de0495065644394
Dwell delay varies between popup type so should be part of the
definition. Since this is needed by reference tooltips we should
make this part of the Page preview model. This will allow us to
separate concerns of the architecture and reference tooltips
for better maintenance between WMDE and web team.
Bug: T326692
Change-Id: Ia021c8b90fd69d70c4b33744520bb963a65db036