Commit Graph

528 Commits

Author SHA1 Message Date
Stephen Niedzielski 815f3386e3 Update: add secondary page actions submenu in AMC mode
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
2019-04-19 14:51:17 +00:00
jenkins-bot 8767b8ad18 Merge "Add basic `hr` element styles" 2019-04-17 20:16:01 +00:00
Piotr Miazga 2cf4ed8981 Add Community Portal link to Mobile Main Menu
Changes:
 - introduced new icon for Community Portal
 - added new menu entry in Advanced Builder that links to
 MediaWiki:Portal-url

Bug: T216152
Change-Id: Id38836d8f1a62d4e15181ab10e219d5c5b769ec3
2019-04-16 11:21:43 +00:00
Piotr Miazga 1f4582cc09 Provide a code structure for menus handling and add Advanced menu
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
2019-04-16 13:19:51 +02:00
Volker E 5f6f75e487 Add basic `hr` element styles
Bug: T221020
Change-Id: I90cef54b48d5934dac4adac6be6ffe7145a726f4
2019-04-15 17:43:09 -07:00
Stephen Niedzielski cbea4fabd5 Hygiene: remove unused downloadPageAction argument
Remove unused Skin parameter from downloadPageAction.

Change-Id: I27cd85b1e4f2328d3d4fd0ece5580c4432181757
2019-04-10 15:21:27 -06:00
Jan Drewniak 7821b1499c Removing code related to old page-action menu markup
Bug: T218653
Change-Id: Ifafe86f36be59fc22bb02c42b3ff12509c67b53d
2019-04-10 22:31:14 +02:00
jenkins-bot f9ac8d40e5 Merge "Increase `margin-top` for `h3` following `p` elements" 2019-04-04 18:15:34 +00:00
Volker E 6a078ddb65 Increase `margin-top` for `h3` following `p` elements
With Id00fbe7ca90a in, this inharmonious, too close distance has
become more obvious.

Bug: T219572
Change-Id: Ie9689d29b6553aadf8ec4781369ec966b4a34abe
2019-04-04 18:01:55 +00:00
James D. Forrester 75a751f1c6 build: Upgrade eslint-config-wikimedia from 0.10.1 to 0.11.0
Change-Id: I36a88cbf8b468646c21d47c3b58433895e8ff31a
2019-04-04 18:01:40 +00:00
jenkins-bot 381170d00e Merge "Provide focus styles only in overlay" 2019-04-04 10:17:46 +00:00
Volker E 1c2a354a78 Provide focus styles only in overlay
Preventing double transition in search input focus by limiting styles
only to non-JS or when JavaScript enabled to the overlay.
Also introducing standard transition to smoothen it further.

Bug: T218154
Change-Id: I2344bfc7c4edc1941119565d7b113788e8713624
2019-04-03 19:46:53 -07:00
Volker E 681a752f29 Remove `.background-size()` mixin usage
Removing deprecated LESS `.background-size()` mixin calls.
Also
- simplifying code, where second (height) value is automatically set
  to `auto` when only one value is set and
- removing stylelint rule.

Bug: T219956
Change-Id: I643c66b3067ba77726d76cbebf7550781e18aa5d
2019-04-03 18:02:48 -07:00
jenkins-bot 541ee9b3eb Merge "Reduce `li` selector specificity for general li treatment" 2019-04-02 00:25:22 +00:00
Nicholas Ray 517e4f537a Add amc boolean to MobileWebMainMenuClickTracking sampling
Now that we can determine client side whether or not a user is in AMC
mode from Ie000fc8f938a76d10c2566f17f933cef40aa1665, let's add this data
to MobileWebMainMenuClickTracking sampling. Per T218627, if the user has
amc enabled, the sampling rate will be 100%. If not, the sampling rate
will follow wgMinervaSchemaMainMenuClickTrackingSampleRate.

Additional changes:

* Removes an outdated comment at top of schema.js (this has already been
moved)

* Corrects jsdoc comment for defaults.mode

* Updates EventLoggingSchemas entry for MobileWebMainMenuClickTracking
in skin.json to accommodate new amc field.

Depends-On: Ie000fc8f938a76d10c2566f17f933cef40aa1665
Bug: T218627
Change-Id: I950a6efd1040c3a270d09bff298ee1781a010328
2019-04-01 17:39:16 -06:00
Volker E 8398bda8fd Reduce `li` selector specificity for general li treatment
Same margin is used for both `ol li` and `ul li`. And `li` shouldn't
be used anywhere else then as child of those two parent elements or
`menu` anyways, which doesn't seem in use on mobile, therefore reducing
the specificity.
Side-effects would only be visible in invalid code.

Change-Id: Idddc3115b08c9937a1d2141b23f33008d6776f60
2019-03-29 22:56:16 -07:00
jenkins-bot a03ced4677 Merge "Add default focus treatment to search" 2019-03-29 16:27:07 +00:00
jenkins-bot 3ace1a7615 Merge "Images should have borders in Android app / parsoid generated content" 2019-03-29 14:57:02 +00:00
Volker E e75b3dfa37 Add default focus treatment to search
Bug: T218154
Depends-on: I73505c1d180f157939493883d50a4440a66ae995
Change-Id: I187f20d9ec7847b17a19be59e87a574d813a3a10
2019-03-28 15:09:54 -07:00
Volker E 1f418a20b8 Remove unnecessary double assignment of `font-family`
Headings inherit from body, therefore removing unnecessary double
assignment of sans serif font family value.

Change-Id: Iebea830399703b5f95ff87f2e0b91660df8c79cc
2019-03-27 20:24:58 +00:00
jenkins-bot 875b22d5a5 Merge "Use system font stack as sans-serif choice" 2019-03-27 18:11:05 +00:00
Volker E a738f25c05 Use system font stack as sans-serif choice
Using system font stack provides better reading experience on wider
range of operating systems and languages combinations.

Adding `fontFamilyBase` variable to easier update and clarify usage.

Bug: T175877
Change-Id: Id00fbe7ca90a3b31524c618de4441c413fe4afbe
2019-03-27 10:01:01 -07:00
Jan Drewniak e42a655e9a Fix alignment of "learn-more" link on page-issues
Fixes the extra padding below the page-issues boxes as well
as the alignment of the "learn-more" link relative to the rest of
the text in the issues box.

Bug: T214549
Change-Id: I691254af76c65a3d620ec28bce6bb16b8977607d
2019-03-26 13:11:16 +01:00
Nicholas Ray 799f426f5b Make minerva use updated mediaViewerOverlay factory function
Additional changes:

* rlModuleLoader is no longer needed now that the mediaViewerOverlay is
part of mobile.startup so that was removed in addition to the calls to
it.

* Removed the EVENT_SLIDE/EVENT_EXIT logic as the mediaViewerOverlay
now handles its own slide/exit behavior

Bug: T216198
Depends-On: I36e3c0645c931492fbef0b7c0a49f6a418dbd3a1
Change-Id: I04656c4adb7edc9a111447de3d63044044a8d6dd
2019-03-25 14:18:16 -06:00
jdlrobson 05e6069ab6 Images should have borders in Android app / parsoid generated content
To test check out  I5c1fdfc87a48764cbb53b7a751fbffc1a4e36fc5
``
$wgMFContentProviderClass = 'MobileFrontend\ContentProviders\McsContentProvider';
$wgMFMcsContentProviderBaseUri = "https://he.wikipedia.org/api/rest_v1";
```
Navigate to http://localhost:8888/w/index.php/%D7%93%D7%92%D7%9C_%D7%99%D7%A4%D7%9F

Bug: T198534
Change-Id: I19e9456895789abc413679105da46cbd4f9f0ce9
2019-03-23 00:15:04 +00:00
jenkins-bot e7c497bda7 Merge "Cleanup NotificationBadge and notification overlay creation" 2019-03-22 20:53:35 +00:00
jdlrobson ee97d1acd3 Cleanup NotificationBadge and notification overlay creation
Load notification overlay instantly.
Filter overlay will be taken care of in a follow up patch

Depends-On: Id595b1158b86db9dc7725c8e3c0fb9cc35f49134
Change-Id: I1e1de678b98f225c3a0534e5e649602eb856dbe4
Bug: T217296
2019-03-22 13:34:34 -07:00
Jan Drewniak 6d34e401ff Remove skins.minerva.icons.images.variants module
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
2019-03-22 09:46:14 -07:00
jdlrobson 4cb7852284 Drop unused parameter in NotificationBadge
The onError option is never passed to an overlay. It seems to have historically
intended to be sent to the NotificationsOverlay, but that is not
needed and will no longer be supported.

Bug: T217296
Change-Id: Ia9f436060062ccf52005582ff49e0e13b0cfbb8d
2019-03-19 13:56:20 -07:00
Stephen Niedzielski 88dd2530e7 Update: don't prompt to create User pages
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
2019-03-19 18:07:32 +00:00
jenkins-bot 4c10e0524d Merge "Track share button usage" 2019-03-18 16:34:59 +00:00
Piotr Miazga 6c2450a5f2 Track share button usage
Use MobileWebShareButton schema to track interactions with

Additional changes: Fix how button is injected into page actions
bar as last AMC changes broke it.

Bug: T207280
Change-Id: Ie7d7ab6bc66df5ab30aaec77e2ee8583c69b8f48
2019-03-18 09:03:42 -07:00
jenkins-bot ee82a568cb Merge "Track links shared by Share feature" 2019-03-18 15:58:44 +00:00
jenkins-bot dddb34dfdc Merge "Remove Nokia60 override and use a CSS property order" 2019-03-16 00:35:06 +00:00
Piotr Miazga 8a844a9699 Track links shared by Share feature
Apply provenance parameter to all shared links via Share api.

Bug: T207280
Change-Id: I175dcd45bd25f6ed21f06eeecfc22d97bd5a210a
2019-03-15 22:46:54 +01:00
Ammar 9038122c6f Fix position of back-to-top arrow in rtl wikis
Bug: T211078
Change-Id: I8ee25b2d904814fc8dc8a78a4ccdaf545df907ee
2019-03-14 17:38:43 -07:00
Jan Drewniak d153d78f46 Ensure page-actions icons are `display:block`
The technique used to hide the text in the .wm-ui-icon-element
(i.e. negative text-indent) depends on the icon container being
display block. This ensures that it is.

Bug: T218182
Change-Id: If68099c63023f878128dcedda38963f617a5c717
2019-03-13 22:09:39 +00:00
Volker E d119da1835 Remove Nokia60 override and use a CSS property order
Additionally grouping CSS properties properly for better
readability.

Bug: T218154
Change-Id: Ib174605d123b61180848506b750520822fb7f6fb
2019-03-12 14:11:15 -07:00
jenkins-bot add1ca4174 Merge "Add padding and center text in infobox `caption`" 2019-03-12 19:57:04 +00:00
Volker E 644cc45f6f Add padding and center text in infobox `caption`
Bug: T168861
Change-Id: Ibdbd25ce6e93a8cb363e24887bde09bc81880e40
2019-03-12 13:17:29 +01:00
jenkins-bot 0152ee1c31 Merge "Add history icon to page actions menu for AMC mode" 2019-03-07 20:47:22 +00:00
Jan Drewniak 38178c608a Passing page parameter to TOC toggler
The `page` parameter for the table of contents widget was null,
causing an exception to be thrown when the Toggler checks for
page.title.

Bug: T217820
Change-Id: Ifb78496c8b42f9500ab03655a496e9aae6d1c04b
2019-03-07 11:03:28 +01:00
Jan Drewniak 69511f16b6 Add history icon to page actions menu for AMC mode
Bug: T213352
Change-Id: I6ba11c5969e03bf71fb891558fde68215e978083
2019-03-07 00:45:53 +00:00
jenkins-bot 566178d8ba Merge "Move `html` and `body` styles to 'ui.less'" 2019-03-06 23:20:33 +00:00
jdlrobson 4b4e9d6399 Minerva should use the MobileFrontend eventBusSingleton
The talk overlay is created inside MobileFrontend, but the
overlay for creating a new talk overlay is here.

The two need to speak to either other - in particularly, the create
talk overlay must invalidate the current talk page before returning
the user to the former.

In preparation for the refactoring changes in MobileFrontend, the
same object is shared and the cache invalidation is moved here since
Minerva creates and manages the PageGateway instance that is given
to the talk overlay.

Additional change:
* Update a selector broken by changes in
I8c34646b7ba13a26facbb69684e65109870d27a1

Bug: T217102
Change-Id: I212ff044c4c608c6ea60a5fda043166cd434ec1f
2019-03-06 12:33:36 -08:00
Volker E 4a7bd78d8b Move `html` and `body` styles to 'ui.less'
Moving reset properties
- `font-family` and
- `font-size`

and opinionated
- `margin`
to ui.less.

All other properties from 'reset.less' don't apply to those elements.

Also
- consolidating body `background-color` and `color` in 'ui.less' and
- moving `html` affecting property there as well.

Bug: T205341
Bug: T217621
Change-Id: I4c545da76e6fdebced41e6e7e6eb89e4d97a8b24
2019-03-05 16:38:20 -08:00
Volker E 454eb6dcf4 Move `main` normalization to explicit selector
Change-Id: I8904bd531e14ee0bfcd7c057637fbea89c75d446
2019-03-04 19:51:15 -08:00
Jan Drewniak 864a1766a7 Refactor pageActions menu to accommodate AMC mode
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
2019-02-28 12:31:57 +01:00
Jan Drewniak 99aa7a28a4 HYGIENE: Remove element `nav` selector from mainmenu.less
The top level `nav` CSS selector (combined with the nested element
selectors, i.e. `nav ul li a`) represent a general DOM structure
which is not limited to the navigation menu and can interfere with
other styles.

This replaces the `nav` selectors (which have only been used to select
the main navigation) with a `#mw-mf-page-left` selector instead, since
that represents the main navigation as well.

Change-Id: I047108974fd295f196d9f7150c3721c05ac40c6d
2019-02-27 15:01:08 -08:00
jenkins-bot 4f42e4949d Merge "Allow us to distinguish errors for logged in users" 2019-02-26 22:05:28 +00:00