Commit graph

413 commits

Author SHA1 Message Date
Piotr Miazga (polishdeveloper) 5a2527d71d Drop smart logout handling in favor of core ready.js
MediaWiki core added support of overrideLogoutSelector skin
config variable which allows us to define the logout button
selector. Thanks to that we do not have to ship our
custom/duplicated smart logout handler as we can use the
one shipped with ready.js.

Depends-On: Id313337c85229a5e8d0aada3a67d722048709597
Bug: T259200
Change-Id: Ie0192a176dfa8be994a544221aa71de75028d502
2021-02-11 17:26:47 +00:00
yash9265 b14d4e04af Add max-width limit to empty watchlist page
On the Watchlist, when there are no results, the page uses .info and
.empty-page classes. This results in text running without max-length.

Add max-width rule to contain it.

Bug: T222872
Change-Id: I768f800a49e756da1ad2c123c842c37d18fa3310
2021-01-21 19:49:32 +00:00
DannyS712 ac6aaa1920 Bump required version of MediaWiki to 1.36
Bug: T252774
Follow-up: Ia2df978e2d0349a55620ef45f8c0827134b7c74d
Change-Id: Idd8243fbe261661e1d3cb3bce53c1c3cce3da1d3
2020-12-09 17:18:38 +00:00
Florian 557529546e Change default of showing sitenotices to true
Wikimedia-related configuration (false) now lives in mediawiki-config
which allows us to move this value to the default of true, which should
fit most other wikis better.

Change-Id: I8060ed5e67370e35f7552b3191f2864fbeb6418e
2020-12-02 16:54:57 +00:00
Volker E 32724f8183 styles: Implement mediawiki.skin.variables.less for MinervaNeue
For now, only define:

- @font-family-sans (unused in MinervaNeue, but for possible future use)
- @border-radius-base

With current implementation before this patch, MinervaNeue is relying on core's default
`@border-radius` which is set to `0` to be close to HTML default. 
MinervaNeue is currently not applying correct skin's `border-radius`.

Bug: T263270
Change-Id: I9a149eefd15efede27416ada4db07072e53628ec
2020-11-02 17:56:40 +00:00
jdlrobson ed0222b0d0 Remove client side error counting
Bug: T266359
Change-Id: I5350c801e7ecb7b8b28e54410cc57fd3b548b2ef
2020-10-23 11:09:22 -07:00
jenkins-bot c4fe18bd4b Merge "Fix style of clock icon in changes lists" 2020-10-06 17:15:02 +00:00
jenkins-bot aeaa20d88f Merge "watchstar: Add temp-watched css class when expiry is present" 2020-09-25 06:49:42 +00:00
Dayllan Maza 0fc40f71c5 watchstar: Add temp-watched css class when expiry is present
MobileFrontend extension is currently tracking watched/temp-watch
css classes and applying animations to the "watch" event.
This patch starts adding temp-watched accordingly now that the
expiry is part of the event's data.

Note: this patch does not fix the lack of animation when transitioning
from half-star to empty-star or on page-load when the page is
temporarily watched but it fixes the awkward angle the half-star
icon was left in when transitioning from a full-star to a half-star

Bug: T262862
Change-Id: I1c8cb9c33cda76b87b6a9f15e408d88edbf61d93
2020-09-24 12:21:33 -04:00
Sam Wilson df14b078c0 Fix style of clock icon in changes lists
Override core styles for the watchlist expiry clock icon in
Recent Changes and Watchlists.

Bug: T261415
Depends-On: I621b1571b57686beb9fb5802533b1e70d293bc2a
Change-Id: Iefdd271aeb6135771aae832e930fe02c73248110
2020-09-23 10:47:45 +08:00
Sam Wilson e9ad028a5b Center and align the expiry dropdown in watchstar widget
Move the watchlist expiry dropdown list to be aligned in the
centre, and its contents to be left-aligned.

Bug: T261990
Change-Id: I3073618606636c78e6afb5bf19726c7b3973292b
2020-09-21 13:24:03 +08:00
MusikAnimal 4a3e1fa9e8 Show half star for temporarily watched pages
This does not complete watchlist expiry support in MinervaNeue. It only
instructs the skin to show a half star instead of a full star on page
load if the page is being temporarily watched.

Bug: T251690
Change-Id: Ib5c479dcfe49041152ba662c56cc630c32eb220e
2020-08-27 11:57:13 -04:00
Peter Ovchyn 402aaad6ff Move css styles related to lazy-image-placeholder to skinStyles
`lazy-image-placeholder` is needed only when MobileFrontend is enabled.
So it makes sense to move those styles to mobile.init css. See more details here: T199351#6380240

Bug: T260406
Change-Id: I16ca734af33fb0f3c4c67f20bbca8631279d7778
2020-08-18 16:51:02 +00:00
Peter Ovchyn 271fb28d99 Load mediawiki.page.ready on Minerva
Disable sortable and collapsible during mediawiki.page.ready initialisation

Add onSkinPageReadyConfig hook that overrides sortable and collapsible values.

Adds 1.74kb of JS to all page loads.

Bug: T257265
Bug: T250851
Depends-On: I0dc38e74052027f26a70d58b5f520e5830e0d55d
Change-Id: I81ff55d080c8c4a40f425ca7d0fc4fda322055dd
2020-07-29 20:57:52 +00:00
Ed Sanders 13449aed52 Remove styles moved over to Echo
Bug: T258936
Depends-On: I72bedc3c3d633e8898c93d5e7d570b8ee7b6a1ff
Change-Id: Ic9b03bab0db39ccbed5b05c89577be18bb17c8de
2020-07-28 09:49:33 +00:00
jdlrobson 2e450e104e Donate link should be in a separate group in main menu
Bug: T219793
Change-Id: I7501c87eaa799e4c8a9052f5e3f650a89f376d1b
2020-06-29 14:38:34 -07:00
jdlrobson de595ccf04 Disable donate link
After checking with Alex the donate link is in the wrong place
because of a mix up on the phabricator ticket. Disabling for now
while we reposition.

Change-Id: Icd12026f9e7c617bac8b7d6b4143a634948422a8
2020-06-25 13:45:40 -07:00
Vas Jaremchuk f4e3c8f9d9 Mobile web donate link
Add the Donate link with a heart icon in Mobile menu.

Bug: T219793
Change-Id: I65d1d7408e2df7b3ae307736ac6d498b1d7f7197
2020-06-25 11:00:44 -07:00
Ammar Abdulhamid 2bb3633530 Minerva: Use OutputPageBodyAttributes hook to add body attributes
This means dropping usage of Skin::addToBodyAttributes method from
parent Skin class to pave way for its deprecation/removal.

Bug: T255698
Change-Id: Idab13c37002ac5663f292e4f4b4ff51eb7573fda
2020-06-21 09:21:07 +01:00
Jdlrobson 4f021c79f0 Revert "Drop MinervaEnableSiteNotice"
This reverts commit 33e5c1eb79.

I talked to Gergo (tgr) about this and he's convinced me
that probably I want to be more conservative 
and incremently roll the sitenotices
out first. With that in mind I'm going to revert this change
and do a config flag instead.

Bug: T254391
Change-Id: If0f214d23a012fb4ae3e1dff1728f746a22f142a
2020-06-04 22:39:36 +00:00
jdlrobson 33e5c1eb79 Drop MinervaEnableSiteNotice
This will make site notices display across the site as intended. The config
flag doesn't seem warranted - site notices should display across all skins
as they may contain important information.

This is preventing wikidata page banners from displaying in Minerva.
If this is controversial I can do a config-only change for Wikivoyages

Bug: T254391
Change-Id: I34c5e762b967ea94e33025e87f3446e8e029bc91
2020-06-04 08:38:03 -07:00
Volker E bb6827122c Naming convention using 'skin' as entrance point
Similar to Ief1c469724d4ffe238d307407c3ddb46f2e1abfa

Change-Id: Ibca2473b14ef258f92e71524489298e2f53ed873
2020-05-29 14:32:12 -07:00
jdlrobson ceb23e3738 Update Minerva's contributors
I want to reflect the contributions of the
existing members of the team that
maintain the skin.

All the added names are listed as the main contributors
on the github with consistent contributions
of at least 2 years
https://github.com/wikimedia/mediawiki-skins-MinervaNeue/graphs/contributors

Alex has overseen much of the effort in our mobile skin over the recent years
Although we don't traditionally add designers to the authors section I think
it makes sense that he should be listed.

Change-Id: Ia2a37a6988a2712151ae0c21f9e31a11310a8a53
2020-05-06 18:04:12 +00:00
Volker E c9461c9dd8 Replace skins.minerva.mainMenu.advanced.icons with OOUI icons
Additional changes:
* Address a fixme relating to the overflow icon and move some AMC styles
out of the critical path for non-AMC pages

Note about ellipsis:
The class mf-mw-ui-icon-rotate-clockwise cannot be used as it's part of
MobileFrontend and loaded via JS. Minerva must work without MobileFrontend
and this rotation is needed without JS.

Bug: T244444
Change-Id: Ifd02c50305cf036dd6df640d778678668507e5eb
2020-05-01 12:18:35 -07:00
Reedy 01f824f684 Fix namespace of SkinUserPageHelper
Allows autoloading of file

Change-Id: Ife276b5802e3cdcfd5789a7a91684317c81d5bb3
2020-05-01 02:29:54 +01:00
Volker E 73c7d817b9 Use standard palette color Base20 for icons
Bug: T240500
Change-Id: I31302acb6dded8b367cff87e35df2ccbc30b4749
2020-04-20 20:27:13 -07:00
Reedy 101a1430da Remove MediaWiki\Minerva\MenuBuilder
Move one more class to AutoloadNamespaces

Change-Id: Ib434c512bb4d85047ad7cd5f756c69802462bb48
2020-04-18 20:03:13 +01:00
Reedy d12308e38d Move some more classes to AutoloadNamespaces
Bug: T187154
Change-Id: Ia78f963a08cec1490aaff462b9787f7a826bf62c
2020-04-18 16:09:42 +00:00
Volker E 0246446196 Bump MediaWiki version requirement to v1.35.0
Change-Id: I0743756cc97bbdb31b4b533f1647211fea845063
2020-04-17 16:14:29 -07:00
jdlrobson 2e32f41fd3 Drop skins.minerva.icons.image module now cache has cleared
Bug: T244444
Change-Id: I181d41f60481efa904d5e951cf08480bbae82015
2020-04-10 17:36:46 +00:00
jdlrobson 8d1576aaaa Drop unused upload and logoWikimedia
Change-Id: Iaaa1a3455b0157475945c9721bcf71aa3c561d9c
2020-04-02 16:53:18 +00:00
jdlrobson 276ae636fe Use standardized icon classes and fix some missing icons
The icon pack wikimedia.ui was strangely using a non-standard
icon class using empty strings as a way to disable the default behaviour
of setIcon. Instead of fighting APIs - use the methods available.

The icon pack is also renamed to reflect what it's actually used for -
providing icons for overflow menus and it is no longer loaded as a dependency
by skins.minerva.scripts

Fixes issues with:
* History icon with AMC disabled and user is logged in
* Table of contents icon
* Language icon when it appears in overflow menu on user pages
when logged in where AMC is disabled
* listBullet appears in 2 modules as it is used in 2 places - the AMC
overflow menu (log icon on user overflow menu) and for table of contents
(JS only)

Bug: T232383
Change-Id: I05220ffa56195be6a594e3a8a57ae16858088444
2020-04-02 01:37:33 +00:00
Volker E 98d3225fc8 Rename several icons to WikimediaUI naming
Renaming to WikimediaUI standard naming and adding to module
skins.minerva.icons.wikimedia which is loaded via addModuleStyles
 'edit' → 'editLock'
 'edit-enabled' → 'edit'
 'toc' → 'listBullet' (already included in wikimedia.ui module)
 'mainmenu' → 'menu'
 'language-switcher' → 'language'
 'clock' → 'history'

Icon `page-actions-overflow` which is only needed on AMC is moved out of the stable icon
pack and added to skins.minerva.mainMenu.advanced.icons temporarily which is loaded on AMC pages only:
 'page-actions-overflow'

Additional changes:
* Renaming 'clockIconClass' to 'historyIconClass' to stay on name.
* Module `skins.minerva.icons.images` is deprecated and shipped for old
HTML markup. It will be removed in 2 weeks.

Bug: T232383
Change-Id: Ia3bafc74a85293c2414c0ef4ccf3bb20c75135d1
2020-03-31 11:48:57 -07:00
jenkins-bot 8a85cd2ae6 Merge "Remove unused 'talk' icon" 2020-03-28 23:28:46 +00:00
Volker E 0f5f376b64 Remove unused 'talk' icon
Bug: T244444
Change-Id: I42f60785c4693da7542a61e0ad415850175cb0f5
2020-03-27 18:06:37 -07:00
Volker E cc05fb9aca Use 'download' icon from OOUI
Bug: T244444
Change-Id: Ic65303b42c7b37c4017b98897139273f15ee1598
2020-03-27 17:01:51 -07:00
jdlrobson 6b6c6b8d6e Menu items added via addPortletLinks should look like other menu items
Requires `I4c477c88ce48484960e40609cd243e63639175bc` to function.

Bug: T236711
Change-Id: I331912a1cd6cd4293c22a1a48bb32cdec48bd37d
2020-02-29 00:11:28 +00:00
Volker E c2bed81acd Remove unused 'warning' icon
Has been introduced in I8d11e655cc and after removal of
cleanuptemplates.js left behind.

Bug: T244444
Change-Id: I47ba73bc528241d98e8f593dcaec3948273fc819
2020-02-25 11:29:40 -08:00
jenkins-bot e838fcec22 Merge "Deprecate wgMinervaCustomLogos in favor of $wgLogos" 2020-02-20 00:29:22 +00:00
jdlrobson 51a348097d Deprecate wgMinervaCustomLogos in favor of $wgLogos
Testing:
```
// Start with no Minerva config and no wgLogos defined in LocalSettings.php

// Set $wgMinervaCustomLogos
// Should trigger deprecation warning.
$wgMinervaCustomLogos = [
	'copyright' => 'https://en.m.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-fr.svg',
	'copyright-height' => 40,
	'copyright-width' => 120,
];

// Set wgLogos without wordmark
// Should trigger deprecation warning as $wgMinervaCustomLogos is still
// defined.
$wgLogos = [
	'1x' => 'https://en.wikipedia.beta.wmflabs.org/static/images/project-logos/enwiki.png'
];


// Set wgLogos['wordmark']
// No deprecation warning. $wgMinervaCustomLogos will now be ignored
// in favor of the new wordmark key.
$wgLogos = [
	'1x' => 'https://en.wikipedia.beta.wmflabs.org/static/images/project-logos/enwiki.png',
	'wordmark' => [
		'src' => 'https://en.m.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-fr.svg',
		'height' => 40,
		'width' => 120,
	],
];

// You can now safely drop $wgMinervaCustomLogos.

```
Depends-On: I66a971631c623cc94b58eb0e5e5bad804789bf1c
Bug: T232140
Change-Id: I013bd0904fe8c55efa49d14e84cf06ec1412896f
2020-02-19 23:59:28 +00:00
jdlrobson 7f47dff5e5 Use icons in skins.minerva.mainMenu.icons from OOUI
For all mainMenu icons pull from OOUI icon packs.

We make the necessary changes to Definitions.php, ToolbarBuilder
and LogoutMenuEntry to ensure to update icon glyph names.

There are caching implications for icons that show to anonymous users -
these have been fixed for grade A browsers running JS by appending the
new class to impacted elements.

Grade C browsers being served cached HTML will not benefit from this
emporary fix as available solutions are costly.
As a result these users will not see icons until the cache
expires (maximum of 4 weeks but likely 1 week) or is flushed via
action=purge.

This is acceptable given the amount of impacted users and the fact that
icons are not essential for using the main menu.

Note: The communityportal.svg icon while in the resources folder was
not referenced anywhere in the codebase so its removal is safe.
Please note the same icon in skins.minerva.mainMenu.advanced.icons which
is used for the community portal menu item.

Bug: T244444
Change-Id: I0f929f2f3b11362e02f0d02f57b90b34b5c93d24
2020-02-17 20:36:28 +00:00
jdlrobson a3179d8fff Use user sandbox icon from OOUI
It's called 'markup'. Since this icon only ever shows to logged in
users there are no caching implications.

Bug: T244444
Change-Id: I75f5365ccb5a41f1c0628532e81b5ec63804a2a8
2020-02-07 03:39:08 +00:00
jdlrobson 041091864d Remove duplicate icon loading
"login", "watchlist" and "logout" in skins.minerva.personalMenu.icons
are already defined inside skins.minerva.mainMenu.icons which is
loaded on all page views via CSS so we are loading this icon twice for
no obvious reason. This is why ResourceLoader modules should never reference
files outside their own module folder!

Change-Id: I2097802cc2d42483ef4bdd1ccfa05e0f7b1bcad4
2020-02-07 10:53:35 +08:00
Phuedx 6e4c6c99bc Revert "Reduce 'userContributions' icon code"
This reverts commit 7b4b65a30f, which
caused a regression in the user menu part of Advanced Mobile
Contributions mode.

Bug: T244436
Change-Id: Ifce627dac35b2cd05e1c5ebe658534b6b8d0de88
2020-02-06 11:05:26 -08:00
jenkins-bot b216b8187f Merge "Dev: Address some FIXMEs" 2020-02-05 00:24:25 +00:00
Volker E 7b4b65a30f Reduce 'userContributions' icon code
Also rename it to unified DSG/OOUI name and add standard XML declaration.

Change-Id: I6c908acd70c0dca5bcb1754d1b25d3da2389feb8
2020-02-04 09:54:22 +08:00
jdlrobson 1e64fc8f3d Dev: Address some FIXMEs
* Drop non-existent pointer-overlay selector
* Drop redundant icon class for arrow
* Drop unnecessary !important
* Drop transparent-shield class
* Reword an existing FIXME about a contensious decision and
add a new FIXME for moving some code to a more appropriate place.
* Move an image into a ResourceLoaderImage module (test with
`mw.notify('error', { type: 'error'} )`)

Change-Id: I6e38f07772afae6f13c4851ca17a67d52ca7d331
2020-02-03 08:43:18 +00:00
jenkins-bot 4c6875a793 Merge "Reorganise stylesheets" 2020-01-29 10:05:50 +00:00
jdlrobson 1f584195de Reorganise stylesheets
All stylesheet-only ResourceLoader modules now have a single entry point
rather than multiple files. This eases compilation of the content of
those modules by all toolchains, which will be useful when introducing
the bundlesize tool.

Change-Id: Ic38a3e51db2f419fe68efd23a2c48ee69218a526
2020-01-29 09:46:18 +00:00
jenkins-bot f090ffa321 Merge "Ordered lists per default receive correct numerals (finally)" 2020-01-28 20:16:24 +00:00
jdlrobson c42f4d3450 Ordered lists per default receive correct numerals (finally)
This makes use of the ResourceLoader change in
I1c1e2b912a41d29565e45e9e536c68ac46deb0e1

Bug: T217616
Change-Id: I30632a8c12abf634fc8031ac588c36a412c7abbd
2020-01-24 12:05:26 +00:00
jdlrobson 2bf442db12 Diff styles for moving paragraphs and empty lines
* Fix styling of empty lines - cover full width
* Disable the pseudo element shipped in core
* Move styles from mobile.special.mobilediff.styles into mediawiki.diff.styles
since the latter is always present, the former isn't if MobileFrontend is not
available.

Bug: T242310
Bug: T243235
Change-Id: Ic7d12fe890622e7b3ccc7bc56765f505ac0ab651
2020-01-20 22:08:53 +00:00
jdlrobson db29aa53bd Make MobileFrontend dependency a soft one
This extends the work in Ie29a1eb7746d56f7d8c99b74e5e3c213c30fdcf2

Bug: T171000
Change-Id: Ib125e1bdaace1893804892909c27a9f328445835
2020-01-17 14:02:23 -08:00
Ammar Abdulhamid 7728b0b743 Upgrade skin.json schema to manifest_version 2
Bug: T242505
Change-Id: Iccc217fe695270c5a04811fdca5bd65c26ae6609
2020-01-11 06:10:35 +01:00
jenkins-bot acb42e4fad Merge "Simplify menu code" 2019-12-19 22:34:52 +00:00
jenkins-bot 357c9599ab Merge "CtaDrawers no longer stay behind in DOM" 2019-12-19 20:59:01 +00:00
jdlrobson 3c5edfa5cd Simplify menu code
Now the main menu is not using JavaScript we can simplify
the menu code to apply only to the Echo navigation drawer.

Bug: T225213
Change-Id: If4831fc700c7df3a2a389b5f95b6fbaea4b7d954
2019-12-19 12:14:13 -08:00
jdlrobson 48adb2c5bf CtaDrawers no longer stay behind in DOM
A new controller is added - drawers.js with methods for controlling
display and removal of drawers. The existing code in references is
moved there and extended to support scroll to hide behaviour

Console warnings will disappear with this change.

Additional changes:
* Standardise the page issues element selector - should be the container
not a link inside it (was a red link so triggering wrong behaviour)

Bug: T214045
Change-Id: Id4719b5209dd7647775e2959e46dbae0c3dde3ac
2019-12-19 19:56:02 +00:00
Jan Drewniak f5bef2ea5c Main menu button works without JS
Converts the main menu button to work without JS using the CSS-only
"checkbox" hack, using the ToggleList module from the dropdown menus.

Bug: T225213
Change-Id: I0eff0439f7284ec74f6304324fab409e8a1b6245
2019-12-19 19:55:39 +00:00
Piotr Miazga e703f00655 Add History icon and Article/Talk tabs to default loggedin experience
Additional change:
Drop the feature file - no value in having to keep talk.js and talk.feature
in sync

Bug: T232594
Bug: T232652
Change-Id: Id8d05b1358f81845d70142ceebf193d8b192ee0a
2019-12-13 21:04:36 +00:00
jdlrobson 5fd00330d8 Dev: MinervaPageIssuesNewTreatment should reflect production value
A vanilla Minerva install should enable this. It is live for all Wikimedia
wikis.

Change-Id: I76b8e68c6674797a05cae57f78f0c8049723f255
2019-12-11 11:07:35 -08:00
Ammar Abdulhamid 898b048d1c Discontinue back-to-top feature
Bug: T237290
Change-Id: I06a6823bd3d1985a1d76384bb65c9d2ddf334a21
2019-12-11 05:12:43 +00:00
jdlrobson acfa96e8e0 Do not use data URI on main menu icons
data URIs increase CSS payload which delays render time. If we want
to render these by default in the new main menu we will need to
stop using data URIs.

Bug: T225213
Change-Id: I876317ac28837fae48f504bb8d2637e0e7b85154
2019-12-06 18:12:03 +00:00
Piotr Miazga 99f3c97c3c Logout users via API Ajax call to prevent extra step on Special:Logout
Currently the Special:Logout page will ask "do you want to logout"
even if we pass the logout token. To avoid that first let's log out
user via API Ajax call.

Bug: T232734
Change-Id: Ia4cc4253b99254d7a893a55d9e05918c5d8c87e5
2019-11-26 14:45:21 -08:00
Nicholas Ray 071aa7a0c9 Enable Simplified Talk Page only on Pages With Expandable Sections
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
2019-11-20 21:41:43 +00:00
jenkins-bot 112e95da93 Merge "Enable Categories button in AMC" 2019-11-08 21:55:20 +00:00
Ammar Abdulhamid c2592508b3 Enable Categories button in AMC
Bug: T237290
Change-Id: Icc1b44070031bab08a2dc18e19cda52ef090946f
2019-11-08 07:01:03 +01:00
Nicholas Ray 2d579183c9 Render talk page as a tab instead of an overlay
Following up on Jon's POC, this will get rid of the talk board component in
favor of linking to the server rendered talk page.

Additional Changes:

* Cleaned up talk selenium tests. Removed talk_steps.rb which doesn't appear
to be used anymore.

* Changed talk add button classes to a single class

* Moved "Add discussion" button to postheadinghtml per design mock

* Added  "...talk-explained", "...talk-explained-empty" messages to
postheadinghtml per design mock

* Due to undesirable jumps in window scroll caused by the section anchor
& Toggler.js code when opening the TalkSectionOverlay (read fixme in
code), a Promise is always returned from OverlayManager route to reset
the scroll position to the top when the section overlay is opened.

* Moved
"mobile-frontend-talk-fullpage",
"mobile-frontend-talk-reply-success",
"mobile-frontend-talk-topic-feedback",
"mobile-frontend-talk-explained"
"mobile-frontend-talk-explained-empty"
messages to minerva as minerva is
the one who initiates those messages now.

* Limited $talk selector to only `.talk` elements since amc talk tab
does not need to be targeted

* After saving a reply from TalkSectionOverlay, the DOM that is not
part of the overlay becomes out of sync since a new reply was created.
To get around this, an `onSaveComplete` callback was passed (similar to
the TalkSectionAddOverlay) to execute a full page refresh. Although this
is clunky, it is the easiest way to resync.

Bug: T230695
Depends-On: I80201394fd7015db6700446142b0b4b20829f12e
Change-Id: I243f1193bce0da9fa710fc3b5379f90b2d079680
2019-11-05 09:51:43 -07:00
jdlrobson 7f68c3d3ad MainMenu is a controller not a View and server rendered (take 2)
There should be no caching implications for this change, as the main menu
has been server side rendered on all wikis since 10th October.

As Stephen pointed out somewhere, this is a bit of a micro-optimisation
Let's simplify this code by always rendering it in the HTML. MainMenu.js
as a result becomes a controller that just decides when to show it.

The geolocation check for Nearby is removed given the fact that all
grade A browsers for mediawiki have Geolocation support.

ev.preventDefault in onSkinClick is dropped since the link to the '#'
(the default behaviour) is wanted

Additional changes
* Browser support suggests "animations" class is redundant now
* `open` event no longer filed - not being used anywhere
* Transparent shield is now managed by the MainMenu controller not
the skin (which was confusing)
* Test geolocation using a simple feature tests
rather than abstracting it away inside Browser
* The main menu button is always hidden under either a translucent shield
and/or the main menu itself when it has been opened
so so it's not possible to ever click it while the menu is open
 - the click handler is thus simplified
removing a check for the class of the button

Bug: T234650
Change-Id: If101eebbdbda1519af922745917237648722820e
2019-10-29 16:37:04 -07:00
Piotr Miazga f9c055e7f5 Remove Share feature
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
2019-10-28 12:54:14 -07:00
Umherirrender 64e7f9b04a Split line with many values in skin.json
Makes it easier to read when there one value on each line

Change-Id: Ib6e8231f718cb6bf17935e45dff696db850569b9
2019-10-25 18:30:37 +02:00
jdlrobson bf8d325388 Use core watchstar code
Apply the mediawiki core watchstar to the
Minerva skin. Note, watchstars in search and other locations will
continue to be provided by the MobileFrontend library (see
follow up patch I7b748dc87089389400b0035c62a3b9a00c2e43f9)

Bug: T234970
Change-Id: I11bbe976412b50dba76a55f37887e4c9235d0be1
2019-10-15 15:33:25 -07:00
jdlrobson ab61dbb173 Echo is removed from Minerva
Managing the transition from old implementation to new:
* A version number is exported from skins.minerva.scripts to
tell dormant code added to Echo in I09c27a084100b223662f84de6cbe01bebe1fe774
to begin running.
* A skinStyle is added for the new `ext.echo.mobile` module.
`mobile.notifications.overlay` will soon cease to exist but is kept registered for
backwards compatibility reasons
- Drop ev.preventDefault call from onSkinClick - it is no longer necessary and will ensure
notifications overlay closes when shield is clicked while it is open.

Integration:
* A server side hook SkinMinervaReplaceNotificationsBadge allows Echo to replace
the current Minerva notification badge
* A to-be-created client side hook is subscribed to to deal with the navigations drawer
like functionality using the mainMenu code
* id and class names are added to the container for the NotificationBadge for compatibility with
ext.echo.init in Minerva's desktop mode (it will work like Vector)

See I09c27a084100b223662f84de6cbe01bebe1fe774 for understanding the bigger
picture.

Depends-On:  I09c27a084100b223662f84de6cbe01bebe1fe774
Bug: T221007
Change-Id: I4c11f1b241d629e1b294ebaec17472fbf944f8c7
2019-10-08 23:21:12 +00:00
jenkins-bot 18b483b6ea Merge "Revert "MainMenu is a controller not a View and server rendered"" 2019-10-04 15:18:11 +00:00
Jdlrobson 93b16db1c5 Revert "MainMenu is a controller not a View and server rendered"
This reverts commit 111757970e.

Although I cannot replicate the performance issue, the menu doesn't seem to be rendering at all on cached HTML so this is a deal breaker. Back to the drawing board..

Bug: T234599
Change-Id: Idadc5a079340f44ec66d20a38259b6b337d2dcee
2019-10-04 15:03:19 +00:00
jenkins-bot 3c6fd24f00 Merge "MainMenu is a controller not a View and server rendered" 2019-10-03 20:30:02 +00:00
jdlrobson 111757970e MainMenu is a controller not a View and server rendered
As Stephen pointed out somewhere, this is a bit of a micro-optimisation
Let's simplify this code by always rendering it in the HTML. MainMenu.js
as a result becomes a controller that just decides when to show it.

The geolocation check for Nearby is removed given the fact that all
grade A browsers for mediawiki have Geolocation support

Additional changes
* Browser support suggests "animations" class is redundant now
* `open` event no longer filed - not being used anywhere
* Transparent shield is now managed by the MainMenu controller not
the skin (which was confusing)
* Test geolocation using a simple feature tests
rather than abstracting it away inside Browser
* The main menu button is always hidden under either a translucent shield
and/or the main menu itself when it has been opened
so so it's not possible to ever click it while the menu is open
 - the click handler is thus simplified
removing a check for the class of the button

Depends-On: I7fd243366cceae780bd46e1aef2c08dae073f647
Change-Id: I3892afb5ed3df628e2845043cf3bbc22a9928921
2019-10-03 13:13:09 -07:00
jdlrobson 8ee17cf2b0 Remove wgMinervaErrorLogSamplingRate
We are counting errors rather than sending them via EventLogging.
This code is thus being shipped unnecessarily to our users and is
not ever enabled in production

Given our work to use Sentry (T106915) let's remove this code.

Bug: T233663
Change-Id: I71ef7377e91e38f9ccc13493d52ab629d433f8f4
2019-10-03 14:57:14 +00:00
Nicholas Ray e3560b1f93 Remove mobile diff page drawer margin on mobile screens
Although alignment of things on tablet is still anyone's guess, this
commit focuses on fixing the alignment of the contents in the mobile
diff drawer on mobile screen sizes only per [1] by setting the margin to
0.

[1] https://phabricator.wikimedia.org/T233151#5537879

Bug: T233151
Change-Id: Ic3a47cf98380c501709df3f443cd43f37ce1abe8
2019-10-01 14:34:10 -06:00
jdlrobson e888b487f4 Merge skins.minerva.talk and skins.minerva.watchstar into skins.minerva.script
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
2019-09-24 14:19:18 -06:00
Timo Tijhof 30c12b3ddd Migrate from onResourceLoaderTestModules to QUnitTestModule
The hook is deprecated as of this release cycle, see:
<https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules>.

Moving away from PHP code. This can now be done from JSON, and
encourages use of a single module that is automatically named and
registered as needed.

Change-Id: I382692c70ca8e5f5ea658b07ebea6c47dd541724
2019-09-20 22:14:56 +00:00
jdlrobson 98d91a66f3 Remove watch and watched icons from repository in favor of Wikimedia UI
Note, because of the two versions of the watch icon, this will temporarily
make the watchstar not display for JavaScript users. The accompanying patch
Ic974b4d6dff14b0d72b8ca71b02c5ef73b1b1d93 will restore this.

Bug: T231613
Change-Id: I16ca70f2892d7418ff245e15f838dfc2b092f3aa
2019-09-19 10:39:27 -07:00
Jan Drewniak 6223d571bc New mw-ui-icon spec for Minerva
Redefines the mw-ui-icon module from MediaWiki-core for
better mobile support.

The new spec maintains the same interface and class names as core
(mw-ui-icon, mw-ui-icon-element, mw-ui-icon-before etc,)
but ensures that icon sizing is more consistent and
provides larger and more flexible touch-areas to the
`.mw-ui-icon-element` class, which in practice is used to
make icon buttons.

This introduces a temporary defect in which the hamburger and user
menu icons are a little too close to the edges. This will be fixed in
I5587855d0d9ecf2fac20ce16845e6749c26ab7c2

Bug: T229440
Change-Id: I929090848f3e04647a97f4979ec78682623fa070
2019-09-12 21:47:09 +00:00
jenkins-bot 7daf7ebb12 Merge "Rename UserRights to UserGroups" 2019-09-12 19:37:55 +00:00
Piotr Miazga add29651b0 Rename UserRights to UserGroups
The "User Rights" is called "User groups" on desktop. The Mobile site
should not provide it's onw naming but use the same names as desktop.

Bug: T230694
Depends-On: Ic9b7033e3f52f415ec8aec845a65a8452d0e5d8f
Change-Id: Iaf116a5cc54cc400451550d9fa958adbbccc35c5
2019-09-12 15:58:51 +02:00
jdlrobson 4e5ed825c8 Icon pseudo elements need top: 0 for RTL languages
Document why so it doesn't get removed next time.

Bug: T232260
Change-Id: I09cac0403c913e5ff10dfede9355a08f226f395d
2019-09-09 20:56:15 +00:00
jenkins-bot 53ad4bac32 Merge "New table of contents icon, prepare for arrow->expand rename" 2019-09-09 19:25:29 +00:00
Timo Tijhof 6e4afbf3bb mediawiki.RegExp (deprecated) -> mediawiki.util
Bug: T218339
Change-Id: I6913330609c03a0418af2ab54aa31f27a52dc6d0
2019-09-09 18:10:35 +00:00
jdlrobson fea60ba244 New table of contents icon, prepare for arrow->expand rename
Bug: T231613
Change-Id: I86a4bdac83e1d6caef025ad025962127d74556dd
2019-09-09 10:39:52 -07:00
Nicholas Ray f7baa81b17 Remove skins.minerva.scripts/overlayManager.js
Instead, I think we can just use:

```
M.require( 'mobile.startup').OverlayManager.getSingleton()
```

Change-Id: I3c1d5d8ffb95eea7cf076c86e8e9578aff7f95a8
2019-09-06 14:32:01 -06:00
jdlrobson 497044290a MobileFrontend is now managing the toggling code. Remove.
Depends-On: I6bdeb7198082c4b1d0a32960cc4dc679ff4c6762
Change-Id: I1815a730fc12f68c287d58f2de6f92e05db3abd2
2019-09-06 15:50:00 +02:00
jenkins-bot f095583cc8 Merge "Use avatarIcon instead of profile" 2019-09-05 21:27:17 +00:00
jdlrobson 59b2aabe24 Use avatarIcon instead of profile
Bug: T231613
Change-Id: Ie956ac82869ea5ff91d5d39d6b679a4803e46458
2019-09-05 20:58:06 +00:00
Nicholas Ray f944720ab2 🐛 Bug: Fix iOS input text zoom bug on rcfilters input
On iOS Safari, the screen zooms in when the user focused on
the text input of the rcfilters overlay. This commit adds a quickfix to
address this problem by setting the font-size to its initial value
(assumed to be 16px).

Bug: T231049
Change-Id: I98d28115e570a11d08ba2bd189c0b9151f834e7d
2019-09-04 17:45:23 -06:00
jdlrobson 15323b3d63 Use core table of contents in Minerva
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
2019-09-03 19:02:31 +00:00
Stephen Niedzielski 7af07aef20 [icon] [toolbar] update page info icon
Change the info icon from an outline ("info") to a filled or inverted
("infoFilled") representation.

Bug: T230693
Change-Id: I10f9421661c5244c6859871793bd75650cb0e1e5
2019-08-29 20:31:13 +00:00
Stephen Niedzielski 3c55b23d61 [icon] revise icons
Update the icons.

Bug: T229440
Change-Id: I4460efba7b122b2a66e65924f311bb87f84160e5
2019-08-29 13:20:35 +02:00
jdlrobson e5aeeea2a8 Restore contributions icon to non-AMC menu
Bug: T231363
Change-Id: I82b9b06a83454cf4b49d906a8358b338d30f892a
2019-08-27 11:00:52 -07:00
jdlrobson 2e4879b3b4 Fix userSandbox path
Bug: T231358
Change-Id: Id8a23d7d5adb8cce38f00dff6acac8799b6803f0
2019-08-27 10:07:48 -07:00
jdlrobson 062e067d49 Separate AMC icons from non-AMC icons
Currently a bunch of icons are loaded for all users that are only
ever used for AMC. Clean this up and add notes on the necessary steps
if these ever become the default.

Bug: T229295
Change-Id: I4e16028e7121b0b3e1a60b9404183d483db52ad8
2019-08-26 19:12:48 +00:00
jdlrobson 9150aec131 Feature flag overhaul
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
2019-08-23 10:48:14 -07:00
jdlrobson 7280d255c0 Dev: Prep for storybook
* 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
2019-08-21 12:20:26 -07:00
Stephen Niedzielski b8d8cab3db [fix] [icon] [AMC] add missing user avatar icon
userAvatar icon is used by advanced mode. Specify userAvatar as an OOUI
icon dependency.

Bug: T230162
Change-Id: I30bd90433a0f8575d1988c06a2763539a456c166
2019-08-08 14:19:27 -06:00
Stephen Niedzielski 10076c1b61 [dev] divide main menu LESS
Split apart the extensive mainmenu.less file into a few component-like
files: MainMenu, MainMenuFooter, MainMenuItem, and NotificationsOverlay.
Two variables, @duration and @easing, were moved to minerva.variables.
The separation is imperfect as some overlap still exists but is far
better than before.

This patch is focused on division without regression. Please limit any
refactor requests.

No user visible changes intended. The only selector that was cognizantly
changed was to duplicate the drawer visibility on main menu and
notifications overlay:

  // Old: mainmenu.less
  .navigation-drawer,
  .transparent-shield {
    visibility: visible;
  }

  // ---

  // New: MainMenu.less
  #mw-mf-page-left,
  .transparent-shield {
    visibility: visible;
  }

  // New: NotifcationsOverlay.less
  .navigation-enabled {
    .notifications-overlay {
      visibility: visible;
    }
  }

The is unfortunately useless. It is best to reproduce these changes
locally by renaming mainmenu.less to MainMenu.less and extract parts to
MainMenuFooter, MainMenuItem, and NotificationsOverlay LESS files until
the result matches.

Bug: T206354
Change-Id: I8d37c5346efcf39a4d76322fd6e6af3fff96ac53
2019-08-07 16:48:31 +00:00
jenkins-bot 7c869ec86a Merge "Remove all main_menu tracking related code.""" 2019-08-02 14:06:23 +00:00
jenkins-bot d8de612e0c Merge "Reset SkinOptions after logging out" 2019-08-01 22:23:12 +00:00
jdlrobson 97f0e44e19 Reset SkinOptions after logging out
Bug: T221137
Change-Id: I36ada157327b649900dbcee3917883fe8ee7687a
2019-08-01 21:57:36 +00:00
Jdlrobson 8d703b7758 Remove all main_menu tracking related code.""
This reverts commit de353c06c9.

Bug: T228681
Change-Id: Idfd964c31e09e271dca9ac39f7932df49cdcb5f6
2019-08-01 10:40:09 -07:00
Jan Drewniak 8c3fe30ea1 Enabling loading spinner for Recent Changes page
Bug: T223363
Change-Id: I29498e6247ef820f0ded8a64996a1266f1d2f4c6
2019-08-01 12:33:14 +02:00
Roan Kattouw ec17da76c1 Improve tab scrolling logic
* 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
2019-07-30 18:35:14 -07:00
jenkins-bot 2ca195c98f Merge "[UI] [AMC] add recent changes to the AMC menu" 2019-07-30 19:58:40 +00:00
jenkins-bot 0ef40e5bbb Merge "[AMC] [dev] enable page actions overflow menu in AMC by default" 2019-07-30 19:57:28 +00:00
Stephen Niedzielski 805cc92e73 [UI] [AMC] add recent changes to the AMC menu
This mostly reverts commit 692309090d and
updates the icon.

Bug: T224216
Change-Id: I7200aaef5a15479afb4bc99f5195e900351a055a
2019-07-30 11:27:34 -06:00
Jan Drewniak 5e7a35946c Adding skin styles for the changeslist module.
The changeslist module is the list of results on special
pages such as recent changes, watchlist, and parts of action history.

Adds a skin style to special.changeslist module.

Bug: T228419
Change-Id: I324b1f136f5314cb6acdba3155b07136bbde363a
2019-07-30 19:00:09 +02:00
Stephen Niedzielski ab6cbd9fef [AMC] [dev] enable page actions overflow menu in AMC by default
The AMC overflow menu is now being deployed everywhere AMC is. Default
it to true in AMC mode like all the other AMC features.

Change-Id: I671cc5d2bfc046026c83d077e78cb57b87c55246
2019-07-30 10:22:39 -06:00
jdlrobson f0503a52d0 Refresh the user, bell and search icon
* 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
2019-07-25 16:35:01 +00:00
jenkins-bot 84b950da58 Merge "[UI] [new] add user menu" 2019-07-24 18:41:46 +00:00
Stephen Niedzielski 0a4f5b6126 [UI] [new] add user menu
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
2019-07-24 18:24:07 +00:00
jdlrobson 0c5ca96031 Drop mobile.init dependency
Depends-On: If0de2d74139131be592d8edc2dbf063e9b98860c
Bug: T216537
Change-Id: I4b8011f5b73000a01d9cea032a6287b24b10f6ec
2019-07-24 15:28:49 +00:00
jdlrobson 6830ffcfea Disable the recent changes table-based layout on Minerva
See Ib68ff8fa782ac12479ef02247cdf78e405b64bad

Bug: T228280
Change-Id: I4169bcb93eb6680c0e9251873afb5637014c0e1b
2019-07-22 23:29:04 +00:00
Pmiazga de353c06c9 Revert "Remove all main_menu tracking related code."
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
2019-07-22 18:31:55 +00:00
jenkins-bot 9352a70023 Merge "Remove all main_menu tracking related code." 2019-07-19 16:24:49 +00:00
Piotr Miazga d11c84d08b Remove all main_menu tracking related code.
This code should live in WikimediaEvents extension, not in
Minerva.

Bug: T220016
Depends-On: Ic2d6d1b21b0eb72ad68b0c447bc63f7d1bb021f4
Change-Id: Iaeb12704dcd257f0783f1ebec3def01cb2848228
2019-07-19 15:30:28 +00:00
jenkins-bot 2d9be80368 Merge "Use wikimedia.ui from core directly" 2019-07-17 15:15:12 +00:00
jdlrobson e27debc1dd Use wikimedia.ui from core directly
There's no reason to copy and paste all this here. These icons
can be imported directly from core using ResourceLoaderOOUIIconPackModule

Depends-On: I7800da87a6a10399f705b43e05c8592c766bae6f
Change-Id: I1f25aaca9b7313cd95cefc7f5629b8a7e65c887f
2019-07-16 22:20:25 +00:00
jenkins-bot 6076c61772 Merge "Embrace packageFiles" 2019-07-16 21:21:42 +00:00
jenkins-bot 297a2c3aeb Merge "Extract language/variants check to a service" 2019-07-16 21:16:51 +00:00
jenkins-bot 937d2b48ea Merge "On user pages, move language icon from Toolbar to Overflow menu" 2019-07-16 20:09:04 +00:00
Piotr Miazga d7f60a26db Extract language/variants check to a service
The $hasLangauges and $hasVariants checks were used in couple places,
which lead to the same code used in many places.
Following the DRY rule, let's implement a Service that can do that
check, and use that service everywhere in code.

Bug: T224735
Change-Id: I46d58758356e870c408a74b2c087a42d6ad0ddea
2019-07-16 19:53:57 +00:00
jdlrobson 72df451bd3 Embrace packageFiles
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
2019-07-16 18:04:10 +00:00
Stephen Niedzielski 21b24830b5 [dev] match page issues LESS filename to JS naming
Bug: T212944
Change-Id: I0fa44cdb26b24fff87a7c4dfd424fe4400ceee22
2019-07-16 18:03:44 +00:00
Piotr Miazga dee1c197b9 On user pages, move language icon from Toolbar to Overflow menu
The Language icon is not useful on user pages as most probably there
are no translated user pages, thus there is no need to show all-time
disabled Language icon.

If overflow menu is available, don't show Language switcher icon in
toolbar, show it as first item in the overflow menu.

Bug: T224735
Follow-Up: I46d58758356e870c408a74b2c087a42d6ad0ddea
Change-Id: I05be9e6457257a1f2eb224ca9ec5808814bc9ed7
2019-07-16 17:51:11 +00:00
jdlrobson a82ca2fcef Restrict AMC scripts and styles to AMC mode
These have leaked into all users experience.
The CSS appears to be unused outside AMC.

Also remove a reference to skins.minerva.share
which does not exist.

See I171831469a6733c458bc5c7ba249a5096ca975b8 which introduced these
styles.

Bug: T227929
Change-Id: I6af6b026e68e11327b7c4e3edfc4f812c7309e2e
2019-07-13 01:12:34 +00:00
jdlrobson 9b4c22f31f Update page issues folder structure
Tests are untouched as these will be moved to headless
node-qunit in a follow up.

Bug: T212944
Change-Id: I3d9b43387e34fd49827e3ab62420f3555ff4b3cd
2019-07-08 23:07:28 +00:00
jdlrobson b9862d7d24 skins.minerva.options uses packageFiles
I want to remove the need for M.define in the Minerva repository.
It's no longer necessary with packageFiles and will help tame
a lot of the code we have here!

Change-Id: If6a35a23e84a44adb965fd9c41265ba37eb8368e
2019-07-08 17:22:11 +00:00
Stephen Niedzielski edb4385345 Hygiene: extract ToggleList to a reusable component
A list that toggles visibility via the checkbox hack is needed in at
least two spots: the page actions overflow menu and the user menu. This
patch makes several refactors to turn what was previously hardcoded into
page actions a reusable component:

- Start a new components directory. Components are reusable and
  composable. The subdirectories are organized by function, not
  ResourceLoader module bundling which greatly improves the ability to
  see a component's full functionality in one directory instead of
  examining the entire codebase. See updates to README.

- Extract pageactions.less into:
  - ToggleList.less: LESS for any checkbox hack list.
  - DropDownList.less: LESS for lists that open downwards.
  - MenuListItem.less: LESS for list items of menus.
  The division makes it easier to see concerns, dependencies, and change
  code.

- Move pageActionMenu.mustache to a component and extract ToggleList
  template.

- Extract ToggleList.js from Toolbar.js.

Bug: T214540
Change-Id: I171831469a6733c458bc5c7ba249a5096ca975b8
2019-07-04 13:48:13 -06:00
Piotr Miazga 6352190684 Hygiene: Extract isAllowedPageAction into MinervaPagePermissions
The isAllowedPageAction is used in multiple places (SkinMinerva
and in PageActions toolbar builder). This logic should be defined
in separate service, easy accessible for different parts of the
Minerva skin.

Changes:
 - Introduced MinervaPagePermissions as a centralized place to manage
 user permissions
 - Introduced MinervaNoTitlePermissions, an NullObject pattern to
 handle situations when we do not have Title object (like in CLI)
 - removed Minerva.ContentHandler service as it's not required any
 more
 - moved all permission names into constants
 - moved isTalkAllowed() into MinervaPermissions
 - renamed isAllowedPageAction() it `isAllowed()` to not mix it
 with PageActions. Those checks are used in many places, not only
 on PageActions menu
 - made isAllowed( watch ) more robust - now it checks that Title
 is watchable

Bug: T221792
Change-Id: I87d44a9c717b5f752b8d1fd2f146d7f5eef3c53f
2019-06-21 15:30:11 +00:00
Stephen Niedzielski 1e61706e0e Hygiene: rename "secondary button" to "user notifications"
The secondary button is not generic. Rename it to match its specific
purpose.

Bug: T214540
Change-Id: I50b7e7fa7bea91a029a8ca71199b0309dff1c518
2019-06-19 11:31:16 -06:00
Jan Drewniak 0213011285 Updating icons for AMC mode
Replaced the following icons:
- communityportal.svg
- specialpages.svg
- info.svg
- contributions.svg

Bug: T222228
Change-Id: Id7889aeb99abe39bc0efae0a1c6457826015302b
2019-06-07 00:25:21 +02:00
jenkins-bot 3d73282dc9 Merge "JSON content: Fix table margins" 2019-05-09 17:31:21 +00:00
Ed Sanders d6dc73063d JSON content: Fix table margins
Change-Id: I50a2203adb66e634f9d995225075dc29a34ab4dd
2019-05-08 11:37:57 -07:00
Jan Drewniak 4ad1b511c0 Add Minerva specific mediawiki.interface.helpers.styles.less file
This SkinStyle file adds paranthases around the (diff|hist) links
and username(talk|contrib|block) links on special pages.

Bug: T222394
Change-Id: Ic291cb795ccad556a5049d970c0282b2d4c65a11
2019-05-07 15:54:13 +02:00
Jan Drewniak 2ce755fdb2 Adds a light-blue variant to the external link icon
The light-blue variant is used in reference drawers
on a dark background.

Bug: T216961
Change-Id: Ic8fdf8f4a08ea7c8d7ae57ae8ce02a7d9a1e1dad
2019-05-04 01:12:05 +00:00
jdlrobson daef425ba1 Minerva is Hogan free
All hail Mustache!

Change-Id: Iaf83dc27addd00ffd65d003bd5d84441965124e8
Depends-On: If00010e092e3766f9812f9a69ce0dfe22298689a
Bug: T220620
2019-04-25 10:34:01 +08:00
jdlrobson 6ade2b1ec6 Reset history page styles for Minerva
This provides us with a blank canvas for styling Minerva's history
page in AMC mode.

I have also provided styles for a non-AMC mode (test by changing
the class on body tag to minerva--amc-disabled). This will allow us
to remove the SpecialMobileHistory page in mobile if we choose to
do so.

Change-Id: Ic57cb79903e90ce1bbfa6d87ab0499f09373e732
2019-04-23 10:17:50 +02:00
jenkins-bot 55ad654176 Merge "Update: add secondary page actions submenu in AMC mode" 2019-04-19 22:15:22 +00:00
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
Piotr Miazga 692309090d Remove Recent Changes from Main Menu
We decided to remove the Recent Changes menu entry from Advanced
menu for now, we might come back to it later.
For more info: https://phabricator.wikimedia.org/T216152#5123296

Bug: T216152
Change-Id: I6342e273fdc5f483692de6e1ac238c38d06f3e5f
2019-04-18 20:32:23 +02: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