Changes:
- moved all menu elements definitions from SkinMinerva into
a separate Definitions.php file
- moved menu building from SkinMinerva into includes/menu/Main
folder
- introduced Builder pattern for easy menu building
Minerva/Menu/Main/Director takes an Minerva/Menu/Main/IBuilder
and builds the menu. The IBuilders use definitions from
Minerva/Menu/Definitions file, so all definitions can be shared
across different menus
- used ServiceWiring file to register MainMenu Director as Service
- left class_alias for old MenuBuilder as some extensions still use it
- The hooks system have to stay like that as some extensions
are using it (BlueSpiceMultiUpload and GrowthExperiments).
- introduced AdvancedMenu builder for the AMC mode
Bug: T216152
Change-Id: I210c3f1fa36bbd2f9108d728b12cbb21ee210354
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
SkinMinerva cached the ContentHandler object for better performance.
In the future the ContentHandler will be also used in the Menu,
for better readability, store ContentHandler as Service.
MediaWikiServices will initialize service on first access and cache
it for future needs. Same applies to SkinUserPageHelper,
Bug: T216152
Change-Id: Ia98dc860862360a68556272714669f0c3a13eb1e
To help us test special pages prior to moving them on mobile it
would be useful to make AMC the default on desktop
where the special page override does not exist
This is also probably what editors on desktop using the Minerva
skin want out of the skin.
On top of this, add an amc class to the body tag so we can
target styles at AMC and/or non-AMC users
Change-Id: I7f3141bae71181131ae4878fd21fb6ff4322c8ca
- Reduce MinervaTemplate.getPageActions() visibility from public to
protected. No one seems to use it.
- Use camelCase instead of lowercase for the pageActionMenu.mustache
template's pageActions variable. writingwithcaseindifference is
difficult to read and the templates seem to support casing.
Change-Id: I6d283c7b97eeef6902cb010904748bd8c72b660c
The conditional and comment here were probably copied from
MonoBook or Vector. There, they were used to decide whether
to output an H1 or not.
The way the conditional was placed here, though, was a no-op.
When this condition was false ($pageTitle == '') the implicit
behaviour was to leave $heading unchanged, which is '', hence
it is using the very value it pretends to reject.
Remove this indirection as it behaves the same either way.
Change-Id: Id3056b199172bbd21b350f920dd0640241b0dd95
The page actions bar should not show on the following
pages:
?action=history
?action=edit
?action=unwatch
?action=watch
Change-Id: Ib54c332a221d4a1b64064807e693c8882ef97938
This module produces 6 icons:
["clock", "profile"] * ["black", "gray", "white"]
of which only 3 are needed: clock-gray, clock-white, profile-gray.
This patch removes the module and moves the "clock" and "profile"
icons into `skins.minerva.icons.images`. Since that module
does not inline SVG's, the additional cost of adding these icons,
which are loaded at startup, is minimal.
The editLocked.svg icon has also been edited to correct its color.
Bug: T218807
Change-Id: Ib54960eb556dfe0c1ae06d2f73d4f350e519e20f
These code cleanups involves the following;
- Consistency in using single quotes as already been
used in the code base for loading resource loader
test modules.
- Remove irrelevant else cases when there is a return
statement in the if cases.
- Remove passing objects as references as they're already
by default passed by references so no need for &.
- Proper call to getLocalURL() instead of getLocalUrl()
though PHP doesn't really care much about the case but
let's use the function names as they are.
- Fix PHPDoc params, remove useless $skin wrongly placed
in the comment.
The changes in this patch doesn't affect the behavior of
the current system in any way.
Change-Id: I9c886c058592486b7190b9567f79c496855f4ae3
Suppress the redlink drawer for User namespace pages. The redlink drawer
prompts the user to create a missing page but this hinders the usual
workflow for User page visits specifically. A User page is connection to
an account's contributions, age, and other activities and encouraging
the creation of a missing User page when trying to view these
connections is a hindrance, especially if the missing User page is not
associated with the current user.
Bug: T201339
Change-Id: I784493a8ecf28176b5a393cb52d7bfa9fa9b1309
This patch refactors the markup and JS associated with the page actions
menu in order to achieve greater flexibility in its presentation.
The menu items are now positioned via flexbox and rendered using a mustache
template in PHP.
The goal of this refactor is to accommodate both AMC mode and default
mode with the same markup. No changes should be visible for non-AMC
users with this refactor. No changes to AMC mode have been made in this
patch either.
This patch includes temporary workarounds to avoid problems caused by HTML caching.
Changes include:
- Changing the data structure of the page_actions property in SkinMinerva.php
- Passing that modified data structure into a new mustache template, PageActionMenu.mustache
- Adding new CSS for the new page actions menu HTML
- changing the query selectors in JS to match the new markup
- Making the JS-modified page-actions compatible with the new markup
- Keeping existing CSS and JS to avoid breaking cached HTML
Bug: T213352
Depends-On: I95cf726c4b6d8c3895a26aa6e07f4b1747ee30fe
Change-Id: I5a7d73b20617cb3c6d6379084ac4bea23ec3bc74
In T214724 the talk tabs were removed from the main page in
AMC mode, however this also removed the talk button
altogether in AMC mode. This updates the logic.
Talk tabs are also
removed from the talk page for the main page
as the tabs come as a pair.
Bug: T214724
Bug: T216514
Change-Id: Ic7d54e323d9428fa222e27a86ec2f9d61ae1e5f5
Even though on most pages the tagline is empty, it still
has a bottom margin associated with it. This patch moves
that bottom margin into a container element that wraps
both the h1 and tagline.
This approach allows us to remove the bottom-margin from the tagline
as well as the top-margin from the AMC tabs in favour of just
one bottom margin on the .page-heading element.
Bug: T214195
Change-Id: I67d3938ab4a75f994acc28a8eefdf19e531c1f3d
I have decided not to worry about cached HTML.
Some pages will display the links inconsistently, but that's
okay.
Bug: T214697
Change-Id: I16f0f999f915aed8316d8a9b4fbbed9a2971d59e
This is no longer needed when Varnish cache has cleared (About a
week from I7e989a3d4553eb3357598a5cad3ccebf51dc9fae being deployed
Bug: T212216
Change-Id: I1afb68f68cc90d89c442907426bd046ddc68f488
- Move page issue view components that do not modify the DOM during
during construction to PageIssueLearnMoreLink.js and PageIssueLink.js.
PascalCase is used optimistically for filenaming in the hopes that
these functions can become something like a JSX component. A "new"
function prefix is used in the meantime.
- Move page issue view logic that munges the existing DOM to
pageIssueFormatter.js. Substitute "create" prefixes for insert so that
clients won't forget that calling the function is a modify operation.
Alternative naming welcome but it shouldn't be confused with more
idealistic components that do not depend on DOM state for
construction.
- Consolidate createPageIssueBanner() and
createPageIssueBannerMultiple() into insertPageIssueBanner() as the
code was quite similar and were it a true component, it would probably
be a single component.
All new files appear under page/ to keep their distinction from the
overlay code clear.
Some view logic remains in pageIssues.js but it shall be difficult to
isolate.
Bug: T212376
Change-Id: Iccce709c34fa8de5a28a5a00098add5775e3dc9a
A new feature/skin option is added that is enabled safely inside
a MobileFrontend available/unavailable hook that changes the skin
to place talk tabs at the top of the page.
These new talk tabs purposely show on the main page, user page
and standard pages and do not show on special pages.
Depends-On: Ie1a583657176acc6f7046c569c2e94fa2f72ff93
Bug: T212216
Change-Id: I57b70cd325666a287678dc897159b5bf9d089b78
These modules can safely be merged.
Since skins.minerva.scripts.top is added via addModules to the HTML it must
be marked as deprecated and remain temporarily as a redirection to skins.minerva.scripts
All modules have been renamed to be in there new home - no deprecation notices are needed
as they are not used outside Minerva.
I leave skins.minerva.mainMenu.styles as it is used by Special:MobileMenu
and needs to continue to do so.
Change-Id: Ie919151630f4389f8e84e808bec003a6d3d07bd9
This was causing lots of problems with the AMC design and seems
unnecessary. It dates back to tablet support added in
I14c8182473c9508ffc38a8d5baf114bcb016a35f in 2014. This no longer
appears to be needed for tablet.
Changing the HTML means we need to be careful about Varnish cached
HTML with new styles. To avoid UI regressions we use a new temporary
class heading-holding--new which will be removed as soon as possible.
The no-page-actions modifier is no longer needed given the new heading
holder doesn't care what's inside it.
Bug: T212216
Change-Id: I7e989a3d4553eb3357598a5cad3ccebf51dc9fae
Main pages do not have page actions, yet the header always adds
bottom padding to compensate for the fact that page actions are
absolutely positioned.
a new class is added adopting BEM notation that informs the client
that no page actions are going to be visible. In conjuction to this
we strip the relevant HTML from the DOM.
Bug: T212216
Change-Id: Ib69991e91160ba7e2ca3beca4475c2a06c4b9cd3
Restore prebodyhtml which was removed in
41b59d4a2b
by mistake in the process wiping out all Wikivoyage banners
on mobile
Change-Id: I6c31363d682ea4a714942fc9f94a9c85e1a8b9d9
From now on we'll make use of ConfirmEdit's styles.
Depends-On: Ic3a8c2cfce92659d5efc4da8799613afba544cea
Bug: T213775
Change-Id: I0a602a20178998ae997b6e5498b6548610936acd
No need for 2 modules that are both loaded on every page load
Provided consumers are loading skins.minerva.base.styles they will
continue to get the same CSS. If any consumers exist that load
skins.minerva.base.reset but not skins.minerva.base.styles they will
need to use their own css reset file
(e.g. https://meyerweb.com/eric/tools/css/reset/)
Change-Id: I599e6d5a84b311cb3bb2da197da1b688e0e6b9d4
This module is unnecessary - it's loaded unconditionally on a page.
Instead bundle the related CSS inside skins.minerva.content.styles
Change-Id: Ieb37d63332ff5b0cf39835b64cc9f0dcaf62c34f
Right now the HTML construction is split between MinervaTemplate
and minerva.mustache
I'd like to move all of this to mustache to make it easier to see
how to make changes.
Additional changes:
* footer-site-heading-html was previously mapped to headinghtml
The template variable has been renamed to avoid confusion.
Change-Id: I1dfe15f6f74b51b152c206e2ea63ae460d704ab6