* Add type hints where possible.
* Add initialization values to properties where needed.
* Remove @var block if redundant to type declaration.
* Use single line /** @var type $var */ instead of multi line.
* Add improvements to avoid Phan warnings.
Change-Id: I8e391700dcbfbbcc88cceb589dc3a36fb8e3b357
* Declare class names from other namespaces in the `use` block.
* Use Foo::class instead of 'Foo' to reference a class name.
Change-Id: I5a1aba6b0cc8842d71b6b6df0a0b67e16e5b6453
Note: This will not show on main page for now, that will be
handled in a follow up as it is a little more complicated.
Bug: T361526
Change-Id: Ib2eb38f93f5f03304a6164e313b2298b425af01e
* Move global state parameters to new methods setContext and setTitle.
This change solves the circular dependency error for service
'SkinUserPageHelper'. The service will used in SkinOptions in the
follow-up change I014e61c6692adbbe449f1e6aa9c6ae73dbcff925.
Change-Id: I80342e5168435c5318c378e2ac8a9a3c7a28eb4c
Adds a config flag, `MinervaNightMode`, and wires it up as a skin option
for enabling/disabling the night mode toggle (sold separately)
Additionally, allow this feature to be enabled via the
`minervanightmode` query param
For now, turning the flag on will result in the class
`skin-nightmode-clientpref-1` being added to the HTML element, but in a
later change this will be updated to switch values based on the
forthcoming client pref
Bug: T355118
Change-Id: I35848ab80ee75d324ceb35d17794e2d3e620cc19
For consistency with desktop Vector, Minerva should show two
icons. This also removes the duplicate #pt-notifications-alert
element in the skin.
Bug: T313609
Change-Id: I6449f0c29b52fd2092d63fbef23205ed8f57d50f
For now this should be a NOOP as the existing "special" page tab
is removed, put it paves the way for using tabs on special pages.
Bug: T286466
Change-Id: Ic0b52b298d598c20987b172c81c732a31e409402
This patch should knock out two bugs we were seeing with the simplified
talk page:
1) Removes the "Add discussion" button and "There are no discussions"
message from appearing on Flow enabled talk pages.
2) Removes the "Read as wiki page" and "Active Discussions"/"There
are no discussions" message we were seeing on Minerva desktop talk
pages.
To address when the "There are no dicussions"/"Active Discussions"
message and "Read as wikipage" button are displayed, Minerva now listens
to MobileFrontend's `MobileFrontendBeforeDOM` hook and turns on the
simplified talk page (via a skin option) when this hook runs.
To address when the "Add discussion" button is added, a check was added
to SkinMinerva which only adds it to a talk page if the content model is
wikipage. Unfortunately, we can't just check the skin option because we
also want to display the button on desktop minerva.
Other changes:
* Moves around the logic in `getTalkPagePostHeadingHTML` for improved
readability
Bug: T237589
Bug: T237597
Change-Id: I83fd5cab174d90b24a5335f2b30c912c3b68040a
The feature got into Beta in over a year ago and never made into
the beta mode. For most of the time it was disabled for all users.
There is no need to keep this code as it is dead code now.
Change-Id: I9037f58b97373195e9d1b9f57789a6c531f42831
Two new feature flags:
1) MinervaPersonalMenu
2) MinervaAdvancedMainMenu
Changes:
* AMC defaults to false on desktop - desktop doesn't have AMC mode it just
enables several skin options.
* WHen inserting a link at the bottom of the page check whether the talk at top
of the page (tabs) is enabled.. not AMC
* Update ServiceWiring to construct menu based on MinervaAdvancedMainMenu
and MinervaPersonalMenu - note when former is enabled but not latter there is
no way to logout. Noted in README.
* Use one entry point for skins.minerva.amc.styles/index.less
* Document files inside skins.minerva.amc.styles to make it clear which features
they are associated with
* Drop history page styles when AMC is disabled - it's not possible to ever get to
these as the history page redirects in non-AMC mode
* Rename the class .minerva--amc-enabled to minerva--history-page-action-enabled
to reflect its real purpose and move styles from skins.minerva.base.styles to skins.minerva.amc.styles
No need to worry about cached HTML as AMC runs without cache...
* Remove isAnyAMCOptionEnabled - it's an antipattern and should be discouraged as it discourages the
art of feature flagging. Nothing is using it after these changes.
* The AMC_MODE flag is disabled. There is no need for this - AMC is not a feature and therefore not a
skin option. It is a mechanism for turning on other skin options. Tests are updated.
Testing:
It should now be possible to enable any feature in `beta` and see it in the beta of the
site.
Bug: T229295
Change-Id: I48959905f5c09721b14a27aa1a5ad82849ac6263
Do not hardcode special handling of Options in other places
than SkinOptions. SkinOptions should be only one place that
knows all interpedences.
Change-Id: I9ad8c1560332665dbcd88ccc7105fb253a2f41b9
It is expected that in mobile mode, onRequestContextCreateSkinMobile
hook will explicitly set skin options based on the user configuration.
The desktop should however reflect everything with AMC enabled.
Bug: T229295
Change-Id: Ib3bf09c25d9bcf9b31d994b92a1d016cca8a6224
If the option is not default, system will throw OutOfBoundsException
when trying to access OPTION_TABS_ON_SPECIALS value.
Bug: T225279
Change-Id: I01ff016caea0bfd961c71e15388d670cd93acc7f
When advanced mobile contributions mode is enabled and
`$wgMinervaOverflowInPageActions` is set, show a secondary overflow menu
on main namespace articles and user namespace pages. The menu content
varies for each namespace. The new submenu is *disabled* by default,
even when AMC is active. This feature should not be deployed until
instrumentation is available.
The secondary menu is rendered in PHP using the existing menu system
with some changes to the template. The checkbox hack is needed for no-
JavaScript keyboard navigation until :focus-within is supported. CSS
additions are documented in the source.
All client side toolbar execution occurs in Toolbar.js. Enhancements are
documented in the source.
Minor changes to the existing download button:
- Move download and edit button initialization to Toolbar.
- Update copy (not visible) from "Download" to "Download PDF".
- When the overflow menu is present, use the "hasText" / label style.
Wikimedia UI icons are copied from OOUI at d00a0ac and seem useful to
expose as HTTP URIs (not data URIs).
The overflow menu does not show for pages provided by the content proxy
since its entries depend on $tpl->data['nav_urls'] being populated.
Bug: T216418
Depends-On: I0781151a8232b6a7b52f79a34298afcecb8e4271
Change-Id: I4b50a0e519024a7ab91dae6ab40b23cf14a03861
SkinOptions array was used to determine which options are available
for current session. Once we started extracting things from
SkinMinerva class, we found out that lots of things depend on
SkinOptions.
For example MainMenu/PageActionsMenu depend on skinsOptions var.
We could pass $skin object as dependency to a menu builder, but
this would cause a circural dependency (Skin depends on menu builder,
menu builder depends on skin) which is an anti-pattern.
In order to avoid such situations lets prepare first, and extract
the SkinOptions to a separate class, register it as a service
so different parts of Skin Minerva can freely use a single instance
of SkinOptions object.
Bug: T216152
Bug: T221012
Change-Id: Icd5da546e1bfaf8d9bfe86dab3b659a88eae19e4