Commit graph

763 commits

Author SHA1 Message Date
Nicholas Ray c22eab914e Add minerva-animations-ready CSS class in Minerva
Per T234570, browser support for animations is solid now so we no longer
need to check for browser support.

However, due to some browsers firing css transitions on page load (see
https://bugs.chromium.org/p/chromium/issues/detail?id=332189), we still
need JS to add this wrapping class after CSS transitions are loaded to
prevent the transitions firing on page load for some components
(DropDownList and MainMenu). See MainMenu.less or DropDownList.less for
an example of how this is used.

MobileFrontend adds an animations class too rn, but that will be removed
in in I58f754740f7146f09c38220a7614285e57684924.

Bug: T234570
Change-Id: If0cf7113b40f7217a22b66a8669138466af2cf5d
2020-01-09 13:58:37 -07:00
jenkins-bot c5fc4d05df Merge "Use document.body and document.documentElement as jQuery selector" 2020-01-06 22:25:14 +00:00
Jan Drewniak ce687f1261 Remove unnecessary visited/active color from main-menu links
These styles are unnecessary because the visited/active color
is inherited from the styles on the `a` element.

Also causes an issue when clicking on the logout link.

Bug: T240644
Change-Id: I908121043487bb01c55e76b3e366aa3d4c624ce7
2020-01-06 21:47:00 +00:00
jenkins-bot 6f571aa4ed Merge "Remove border-radius" 2020-01-06 21:20:38 +00:00
Krzysztof Witucki 3ec0ca1e6e Remove border-radius
ToggleList.less: remove border-radius style from .toggle-list__list
userMenu.less: add border-radius to .minerva-user-menu-list
pageactions.less: add border-radius to .page-actions-overflow-list
design feedback: (see T231205#5771626)

Bug: T231205
Change-Id: Ia06e230a53ddba7931a2869209e0851b11ca8030
2020-01-06 21:47:55 +01:00
jdlrobson cd0a86045a Do not load toggle list CSS twice
Now that ToggleList is loaded in skins.minerva.mainMenu.styles
which is loaded for all users, we should not load it again in
skins.minerva.amc.styles

Change-Id: I6d33a83f20a20956427f261f1900f3cfd8e0153b
2020-01-06 20:09:30 +00:00
Fomafix f482ee198e Use document.body and document.documentElement as jQuery selector
The eslint-disable directive jquery/no-global-selector is not needed
anymore.

Change-Id: Ia520232d6ae94a726b5c0768a8245ab555c79112
2020-01-06 14:33:44 +01:00
jdlrobson 28d8c52664 Remove primary-navigation-enabled
This CSS became dead when openNavigationDrawer was removed
in If4831fc700c7df3a2a389b5f95b6fbaea4b7d954

Bug: T225213
Change-Id: I67b5d9bc596be3cff93f3da96fa04c417f741a66
2019-12-24 08:03:48 -08:00
Krzysztof Witucki 0887552619 Fix shadow on notification overlay and navigation-drawer
minerva.variables.less: added gray color variable
MainMenu.less: added shadow to navigation
NotificationOverlay.less: changed alpha color of shadow
drawers.less: replaced rgba color with the same color variable

Bug: T231205
Change-Id: Ib1e16804b941a8f3b0cc639673baf73dc749a60a
2019-12-24 12:00:15 +00:00
jenkins-bot acb42e4fad Merge "Simplify menu code" 2019-12-19 22:34:52 +00:00
jenkins-bot df0a53ffe4 Merge "🐛 Fix simplified talk page section collapsing on tablet+" 2019-12-19 21:46:42 +00:00
Nicholas Ray 963519148e 🐛 Fix simplified talk page section collapsing on tablet+
The div tag was replaced with section tag in
Id032df3a420d577e42572ab128ca89a006b67ffe. This commit updates the css
to reflect that on simplified talk pages.

Change-Id: I94641eac33d30133d69fff561fe20de606076024
2019-12-19 14:22:34 -07: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
Volker E d4c58fe6d8 Remove obsolete, deprecated cache-only selectors
Change-Id: I29141fd2eebcec409bee72d6d2ddb0311ddf67d3
2019-12-19 18:37:35 +00:00
Jan Drewniak ec56a60694 Fix typo in class definition
Change-Id: Ide0fff7f7e53dd42d322a2ab3b06f5e9a8de8daf
2019-12-18 23:46:50 +01:00
Volker E 76212152a0 Use font-weight: 500 for page action buttons
Bug: T237019
Change-Id: I55e167ce794fe5c635cd86205e38055d7deb1040
2019-12-18 00:15:14 -08:00
jdlrobson 1223772ecb Remove references from the DOM on close and manage body classes
Depends-On: I960872c4f827c2b5a72f0c0d0ee0946792fb6e3b
Bug: T214045
Change-Id: Ice72f432fe2bce1246e7aea76ea23985227fab64
2019-12-13 19:44:18 +00:00
Nicholas Ray 05a073cc5c Use .html() instead of .text() when passing talk section title into Section
Bug: T240487
Change-Id: Ida471291f1698387a26736931ab17e6899e05b51
2019-12-13 19:11:03 +00:00
Volker E 09d0feb287 Add @font-size-root var and rename @font-size-body-mobile
Following Vector and OOUI in `@font-size-root` and put it in central
file. Removing duplicated code in `html` and `body` achieving the
same thing.
Also renaming `@font-size-body-mobile` to a distinct
`@font-size-body--feature-phone` ending the confusion that it's a
variable only used at `@width-breakpoint-mobile - 1`.

Change-Id: Ie355d015d882f61c813991c3244bfcb67f161791
2019-12-12 17:34:44 -08:00
Jan Drewniak 9d19e07053 Prevent text from showing in main-menu logout button
The mw-ui-icon class sets a transparent color on icons, however
that rule is loosing a specificity battle with the rules that
color the main menu links.

Given this is the only known instance where this happens,
a transparent color is added to the logout button itself
instead of a more general solution (likely involving
adding multiple "!important"s).

Bug: T240644
Change-Id: I4675e14fa34770361bc8b30f3562b5cb72b3e42d
2019-12-13 01:39:28 +01:00
Volker E 7dc77f594a Replace id by attribute selector
`[ class|='mw-content ]'` catches `.mw-content`, but also `.mw-content-rtl`.

Change-Id: Ibbde7670cf86e36f08a4ce3dca9565bdaaec9b13
2019-12-12 14:36:09 +00:00
jenkins-bot d53cf4c3e0 Merge "Discontinue back-to-top feature" 2019-12-11 20:00:04 +00:00
Ammar Abdulhamid 898b048d1c Discontinue back-to-top feature
Bug: T237290
Change-Id: I06a6823bd3d1985a1d76384bb65c9d2ddf334a21
2019-12-11 05:12:43 +00:00
Volker E cf903b20f6 Remove duplicated line-height
It's also set in content.styles/main.less and is preceding there.
This has already been merged in reset removal branch and is now
re-deleted on master after first branch attempt failed.

Bug: T222877
Change-Id: I1e9eb28360acd57e574d37e118058abbf5bc6b3e
2019-12-10 18:29:27 -08:00
Volker E d021f2fc9e Remove LESS @fontScalingFactor variable
It dates back before MinervaNeue was its own skin in Iff1f7e63e796cc
and was probably an idea to provide a simple one-stop solution for
a typography change of font size.
It isn't very well setup for this and also provides no value as of now,
for code simplicity's sake, let's remove it.
From a design perspective, we would approach this problem differently
nowadays.

Change-Id: If43ea2590468832e135b3f654022e8b2064b06c1
2019-12-05 21:28:38 -08:00
Volker E ea00e7cb28 Align LESS typography variable naming scheme to WikimediaUI Base
Another step into unified naming scheme, here all typography
variables.

Change-Id: Ic0ee64fc924ccc2b04a6b9d040e2f00dc6c45799
2019-12-05 21:15:33 -08:00
jdlrobson 97c157b8e8 Replace .content class with .post-content on last modified bar
We use `.post-content` which has less side effects.

Change-Id: I40ce9b2c7410c4c361554b5b32d9c1178a59e234
2019-12-05 21:01:23 +00:00
jenkins-bot 2880fa63eb Merge "Replace #content selector by .mw-body" 2019-12-03 18:49:33 +00:00
jenkins-bot 1f22955461 Merge "Enable stylelint 'selector-max-id' rule and disable only on occurrence" 2019-12-03 18:48:13 +00:00
Volker E a62ca4412f Replace #content selector by .mw-body
Has been replaced in other skins, `.mw-body` is exclusively used on
`#content`.

Change-Id: I56ca92a683a2f9f4181e7708a312e691448ce230
2019-12-03 11:36:18 -07:00
jenkins-bot 2022b35a2f Merge "Remove obsolete CSS after cache has cleared" 2019-11-28 08:18:41 +00:00
Volker E 52f37a5f2a Enable stylelint 'selector-max-id' rule and disable only on occurrence
Enabling 'selector-max-id' rule, and changing in rare exceptions like
`#bodyContent` to `.mw-body > .content` where there's only one less
specific option.

Bug: T239183
Change-Id: I9d929eaae09475b2e20d96cb19081aba3aec5877
2019-11-27 17:36:59 -08:00
Volker E 1a5a80df6f Remove obsolete CSS after cache has cleared
Introduced in I27658477aaeed3290aced844caa64fc5e1c34fbd

Change-Id: I8273272fe087d83bcaade5a33bd23908228ac4b7
2019-11-27 15:58:36 -08:00
Volker E 3bd0a4cfaf Replace #toc id selector by .toc class
Replacing id CSS selector by lower specific class selector, if needed
with `.client-js` prefix.
We have already been there once in Ib1a874b644, we need to enable
`selector-max-id` stylelint rule in a follow-up in order to make
devs not introduce without clear need.

Change-Id: Id16d89280d2ef080907fca5871dca701554087fd
2019-11-26 22:56:33 +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
jenkins-bot 0a2408bb61 Merge "Talk overlays should be synchronous" 2019-11-25 23:13:58 +00:00
jdlrobson f1b9c909d7 Talk overlays should be synchronous
Talk overlays are only needed on talk pages, so we can now
unconditionally load them on talk pages and drop usage of
the ResourceLoader loading module.

When binding the section click handlers, the ids of the
associated headings are now removed to avoid ambiguity in
their behaviour.

Bug: T230695
Change-Id: I9b0ef7c5bc389209ed79761582e2f8aa3058c39d
2019-11-25 14:55:50 -08:00
Volker E 2ac6ee0309 Rename LESS variable for unified naming scheme
Change-Id: I89342b7dd01e9aba1b5761bad6cb44ab930d8ceb
2019-11-25 22:54:30 +00:00
Kosta Harlan e8e8c6cf80 Check if title can have talk page before accessing prefixed text
Loading Special:Homepage on mobile betalabs currently results in an error,
`TypeError: currentPage.titleObj.getTalkPage(...) is null`. The call to
canHaveTalkPage results in false because Special:Homepage is in a lower
namespace number than what canHaveTalkPage() checks for.

Before setting talkTitle, check to see if getTalkPage doesn't fail.
Theoretically we might want to wrap other usages of talkTitle to check if it's
undefined but it seems safe to leave them as is.

Bug: T239101
Change-Id: I913fc309458e014b84da054e25e636492e3ed12a
2019-11-25 19:27:00 +00:00
Volker E 9262b6bb09 Remove obsolete toc selector
Removing obsolete code, now that cache has definitely expired from
I720e62a578f0c7a14f4b5a698004471c85e54bc8.

Change-Id: I4f8dc279ed7eeb185e0591b64b91e68c135cf235
2019-11-25 07:31:41 -08:00
Volker E 6dac1b0bc0 Set overflow-y to scroll to avoid reflow
Setting `overflow-y: scroll` to prevent reflow as soon as content
comes in. Adding it to `body` as there might be side-effects when
it's set on both, `html` and `body` and latter seems to be the
place where volunteers or third parties would have set it already.

Bug: T204084
Change-Id: I08e8ceeaea4d8488bc9aee23d26f7791ceaa7ee0
2019-11-18 15:07:49 -08:00
Jdlrobson 10defb5aa1 Merge "Do not jump to the top of the page when the reference drawer is closed" 2019-11-05 19:57:04 +00:00
jenkins-bot 84bc822a4c Merge "Make label for the PDF button in the page-actions menu appear on desktop size" 2019-11-05 19:05:24 +00:00
Jan Drewniak 96ced4d6e3 Make label for the PDF button in the page-actions menu appear on desktop size
Bug: T226562
Change-Id: I60b0f2030b2519a36a2c5bbdc256885980de6420
2019-11-05 19:52:01 +01:00
jdlrobson b4f03d475f Do not jump to the top of the page when the reference drawer is closed
The default behaviour is only needed for the main menu and notification
drawer. In the case of a references drawer where no URL navigation has
occurred, do not reset the hash.

history.replaceState cannot be used here as that interferes with the
OverlayManager's work.

Bug: T237015
Change-Id: I51b8c755933f33a3274aa77dc4e4c0b929d872ec
2019-11-05 17:58:00 +00:00
Nicholas Ray 3a6729841b Remove eventbus usage in talk.js
Now that we have refactored TalkSectionAddOverlay to not use the
eventbus and instead exclusively use the passed in onSaveComplete
callback in I75158ff363d56d55ae385687baf64f8b9d5ca8b0, we can remove the
references in talk.js.

Bug: T230695
Depends-On: I75158ff363d56d55ae385687baf64f8b9d5ca8b0
Change-Id: Ia874fa04c125b00fd1997aa4be8b781d76a18763
2019-11-05 09:51:43 -07: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