Brings the last-modified toolbar (links to history page at the bottom
of articles) in line with recent icon changes. Removes the icon
class from the toolbar itself and by employing a flexbox layout,
reducing the amount of CSS required for this toolbar.
Bug: T233172
Change-Id: I27658477aaeed3290aced844caa64fc5e1c34fbd
Logic is moved from server to client. Config is added via getSkinConfigVariables (e.g.
passed to mw.config ) and a JavaScript if statement.
The IIFE in watchstar and talk files is replaced with a module.exports function to avoid
refactoring at this point and added risk. The file contents remain the same.
skins.minerva.options is left as is, given the code is more experimental and used in
the beta mode - should not be sent to all clients.
Additional change:
* Remove skins.minerva.toggling (that module has been empty for a week now and functionality
moved to mobile.init module)
Depends-On: Ie71adbe18e8dbeb661ddb9d7d3d1d0897891d515
Bug: T233048
Change-Id: Ife777e76d9d77894fb5d09e7c8f0238b00596a7a
uses the CSS :last-child selector to align the last item in the header
with the edge of the container.
This is usually the notification icon in "normal" mode and
the user menu icon in AMC mode.
Bug: T229440
Change-Id: I4430f5659093f76896e2b86e076526a0b51d9630
To accommodate for cached HTML a new class last-modified-bar__text
replaces last-modifier-tagline to help us distinguish between old
out dated HTML and the new HTML.
Bug: T232792
Bug: T232800
Change-Id: I53fa45058dbc81c91089840073e03113ff1a4b9c
Includes icon fixes and removal of some CSS overrides.
This causes the following temporary defects to the skin:
* Last modified bar will temporarily be squashed
* clear search icon will be misaligned vertically
Depends-On: Ie811d25595d041c35e6c214190101821f3a5d466
Bug: T229440
Change-Id: I0a3a73421791ad353bbcebaeb8241ad062f67ae4
Note: this agitates T230232 again - when merging this please
make sure a merge for I929090848f3e04647a97f4979ec78682623fa070
is pending.
In various places we try to override the default mw-ui-icon behaviours
The hacks need to be removed as part of addressing the core problem.
Changes:
* Wherever we use mw-ui-icon-before in PHP - wrap the label with a span
so that label font-size is altered where needed - not the icon
* Where a small icon is needed us isSmall parameter for the Icon component
* Apply font-size to labels of mw-ui-icon-before elements
* The browser tests need a slight update to access the span element inside
a menu item - in the case of the logout button the label is always hidden,
so we need to check the visibility of the parent element (secondary_action)
Bug: T229440
Depends-On: I3f803ec4c9068b30aa93b803391aa4d65d8310ff
Change-Id: I07e4ae233979636b739f1117dd7703571e0a9366
Instead, I think we can just use:
```
M.require( 'mobile.startup').OverlayManager.getSingleton()
```
Change-Id: I3c1d5d8ffb95eea7cf076c86e8e9578aff7f95a8
Make use of mediawiki.mixins' `.transform()` mixin for widest available
browser support.
Follow-up to I720e62a578f0c7a14f4b5a698004471c85e54bc8
Change-Id: I771a5a6e2020e323bf4cefdb944c26bdcce26ee2
No more using the TableOfContents component in MobileFrontend. It's
just creating more work for us. The end result is exactly the same - we can make
a table of contents using the checkbox hack rule and CSS that looks identical to
the current table of contents.
For now, this change can only be tested on Minerva desktop.
I2ea1c23bc86871e2a095c4c6674a08ff2f04b160
is the patch that goes for the jugular and applies this to mobile Minerva. It's
important we merge the two together to avoid disruption to this feature, as
currently MobileFrontend strips the table of contents from core from the HTML
using the MobileFormatter.
Change-Id: I720e62a578f0c7a14f4b5a698004471c85e54bc8
Hamburger menu item - stopPropagation and associated comment seem
unnecessary. Clicking page center is supposed to hide open menus!
Notification item - also unnecessary and outdated comment. Works as
expected without
Talk links - no reason to stopProgation (which happens when you return
false) - only event.preventDefault is needed.
Edit icon - see depends on
Depends-On: Ie23ae7d8dba31b5f524693e60580032e2ccd714f
Bug: T220016
Change-Id: Ica95076f4399d173d49087e5c866f55fe6aec597
* Remove ambiguity in imports - say the file extension
'less' for all instances of variables and mixins.
* Separate toast styles from drawer styles so they can be
imported separately
* associate header-action selector with its parent
(.overlay-header) not parent's parent (.overlay) so it can be imported
and rendered without the Overlay.
Change-Id: Ib7e19a440ba095d6424d35305fb41d643ca9764c
Color progressive/destructive (blue and red) do not make
sense on a black background, so we use white and underlined
for both of these. Note these don't seem to be used currently
so this is not a breaking change.
Bug: T150189
Change-Id: I78a92b5b6c76638633b99fe32670911d355ce6f3
This reverts commit 354de09fa7.
When tapping notifications, both main and notification
menus are shown.
Change-Id: Iaa3ca4d2c7eadb1c9888b514d08895c658336d10
The responsibilities of managing the classes on the body tag are
pulled upwards from the Menu code.
Due to the absence of global state/Redux like thing, the open and close
navigation drawer methods remain for the time being.
Bug: T206354
Change-Id: I77cd8ff75b0d4487ad19c1506a2911791542d70f
Additional: Pass in a page rather than a skin - skin is not
used anywhere other than to get the page
Bug: T211775
Change-Id: Ia7c56158773ac16992fb1ebf002131e9c24dda14
Remove the page action overflow and user menu height sizing. Previously,
a maximum menu height was set so that the menu itself would scroll. A
minimum height was also used so that the menu couldn't be shrunk down to
a silly size. Both the minimum height LESS and maximum height JS are now
removed.
Bug: T225959
Change-Id: I201374ab8b249272ee5dbb1401b844ffe034ea66
* If the leftmost tab is selected, scroll all the way to the left
* If the rightmost tab is selected, scroll all the way to the right
* If a tab in the middle is selected, scroll to center it
* If the selected tab is wider than the tab container, make sure its
start (left edge in LTR, right edge in RTL) is always made visible.
As Bartosz reminded me, .scrollLeft in RTL is a cross-browser nightmare
(see https://github.com/othree/jquery.rtl-scroll-type), so add a bunch
of code working around this. Some of this logic is in OOUI already, but
what's there is not enough for what we need here, and we also don't want
to load OOUI for this.
Bug: T223142
Change-Id: Ica298954b42f9daa4819043ec24bc0266290a927
menu/schema is never imported so it never executed.
Move it into initLogging which seems to the be the logic place
for this code to execute
Change-Id: Iec85548cf96fcc7ea96977d0aa89f601dbd8599f
* Remove event and add class .hide so that it uses event defined in
Drawer class
* Use actionAnchor - it achieves the same purpose
Change-Id: I2570de1e692a22c9383a850460eabb75b3d8eaf5
Changes in the MultimediaViewer extension mean Minerva's onClick event
is preventing the default of the click handler in MultimediaViewer.
Explicitly do not setup our multimedia viewer version when the desktop
MMV is present!
Bug: T227034
Change-Id: I94e22d045346d53bb2c50035281398799fb6c7ac
This temporarily and quietly breaks references display in beta
on the assumption
that I2dcf9b0cbfe2f46eb6763e0add4ed892d1fbecd9 will be merged swiftly
afterwards.
Bug: T123328
Change-Id: I2dcf9b0cbfe2f46eb6763e0add4ed892d1fbecd9
* New module skins.minerva.icons.wikimedia provides icons
from Wikimedia UI in Minerva
* search selector in skins.minerva.content.styles.images is
retained for cached HTML
* skins.minerva.icons.loggedin now a
ResourceLoaderOOUIIconPackModule and bell removed from repo.
* userAvatar replaced with userAvatarOutline
Bug: T224070
Change-Id: Ibed609371060acc4b69e5cd4cd4f20edc871b3ba
Add new user menu. The changes required include:
- Break up AuthMenuEntry into reusable components. They're now simple,
independent, static functions in AuthUtil that are easy to reason
about and compose.
There's lots of verbose code because of the builder and director
patterns. That is, most of the code is for building the thing we
actually want to build instead of just building it. It's easy to write
but no fun to read--even simple configurations are extremely verbose
expressions that must be threaded through the system.
These builders are also single purpose and unlikely to be reusable
unlike a URI builder, for example. As objects, they're not especially
composable either.
- Similarly, break up Menu/DefaultBuilder into BuilderUtil and ban
inheritance. Inheritance has not worked well on the frontend of
MobileFrontend. I don't think it's going to work well here. E.g., I
could have made changes to the base class' getPersonalTools() method
such that the client passes a parameter for the advanced config or
maybe I just override it in the subclass. In either case, I think it
makes the whole hierarchy nuanced and harder to reason about for
something that should be simple.
- Add ProfileMenuEntry and LogOutMenuEntry for the user menu.
- Rename insertLogInOutMenuItem() to insertAuthMenuItem() which matches
the entry name, AuthMenuEntry.
- Extension:SandboxLink is needed to display the sandbox link in the
user menu.
- Performance note: the toolbar is now processed in MinervaTemplate,
which corresponds to removing the buildPersonalUrls() override.
- To mimic the design of main menu, the following steps would be
necessary:
1. Create a user/Default and user/Advanced user menu builder and also
a user/IBuilder interface.
2. Create a user/Director.
3. Create a service entry for Minerva.Menu.UserDirector in
ServiceWiring. The Director is actually powerless and doesn't get
to make any decisions--the appropriate builder is passed in from
ServiceWiring which checks the mode.
4. Access the service in SkinMinerva to set a userMenuHTML data member
on the Minerva QuickTemplate.
5. In MinervaTemplate, access the userMenuHTML QuickTemplate member
and do the usual song and dance of inflating a Mustache template.
This patch does everything except add a service, which was agreed to
be unnecessary, so that logic is now in SkinMinerva.
- Wrap the existing echo user notifications button and new user menu
button in a nav element. This seems like a semantic improvement.
- The existing styling and logic for the search bar and search overlay
are pretty messy and delicate. Changes made to that LESS endeavored to
be surgical. There's lots of room for improvement in the toolbar but
it's out of scope.
- Rename logout icon to logOut.
Bug: T214540
Change-Id: Ib517864fcf4e4d611e05525a6358ee6662fe4e05
This reverts commit d11c84d08b.
We decided to track both old MobileWebMainMenuClickTracking and new MobileWebUIActionsTracking for some time. Then once everything goes stable and it's proven to work correctly we will merge d11c84d08b.
Bug: T220016
Change-Id: Ib4d52e8b8c870774041284e575564a9933af6136
This code should live in WikimediaEvents extension, not in
Minerva.
Bug: T220016
Depends-On: Ic2d6d1b21b0eb72ad68b0c447bc63f7d1bb021f4
Change-Id: Iaeb12704dcd257f0783f1ebec3def01cb2848228
The navigate method does not accept a second parameter for
replacing state. navigateTo was what was wanted.
Mark navigate as deprecated (to match ooui router) to make
sure this doesn't happen again.
Bug: T226106
Change-Id: Ie86fa632b2175727417b166c222c29bdf12bfea4
When moving to packageFiles, the modules errorLogging and toc
were not imported by init.js meaning they were not run.
ResourceLoader should probably error in this situation, but until
then we should fix this problem.
This is a follow up to I44790dd3fc6fe42bb502d79c39c4081c223bf2b1
Bug: T212944
Change-Id: I86efb7be1c39b03f63c8f1e0b107216cd30ff6de
Help with readability by using module.exports and require rather than the MobileFrontend
provided mw.mobileFrontend module manager (and avoid adopting webpack at this time)
Replace usages of mw.mobileFrontend.require with local require and module.exports
(compatible with RL or Node implementation)
Changes:
* Notifications modules are merged into skins.minerva.scripts and initialised
via a client side check.
* new file overlayManager for exporting an overlayManager singleton
rather than being hidden inside resources/skins.minerva.scripts/init.js
* All M.define/M.requires swapped out for require where possible
The `define` method is now forbidden in the repo.
Bug: T212944
Change-Id: I44790dd3fc6fe42bb502d79c39c4081c223bf2b1
In I02f8645aac1d7b081eaba8f2ac92a2ef51f78182, Page.js was made into a
model and its html parsing responsibilities were moved to
PageHTMLParser. Additionally, a singleton for the current page
(currentPage.js) and a singleton for the curent page html parser
(currentPageHTMLParser.js) were introduced to replace the usage of
M.getCurrentPage().
This commit refactors Minerva to make use of these changes.
Notable changes:
* 🐛 The event bus singleton was added to references.js since it
previously relied on an instance of Skin to listen for the
`references-loaded` event. However, this event is emitted on the event
bus singleton.
* Additionally, I didn't see a reason why the `references-loaded` event
needed to also pass the current page instance when the only file
listening to it is references.js (which already has the current page
instance) so I removed that and the convoluted passing of page.js within
the file. I assumed this logic was unecessary.
* The call to drawer.showReferences in references.js now was made to
pass the currentPage instance as well as the currentPageHTMLParser. This
is to prepare for I6e858bbe73f83166476b5b2c0fdac1cca7404246 where the
getReferences() interface for ReferencesMobileViewGateway.js and
ReferencesHtmlScraperGateway.js is refactored to accept both of these
instances. Additionally, references.js was refactored to support event
delegation which gets rid of some parsing/setup logic.
Bug: T193077
Depends-On: I02f8645aac1d7b081eaba8f2ac92a2ef51f78182
Change-Id: I2f32dbcc4ebaa4bebb297cda1ecce3457922b343