Commit graph

787 commits

Author SHA1 Message Date
Volker E 79bb67027c Unify XML declaration in SVG files
Unifying XML declaration for markup parity and to align to SVG coding
conventions.
Also manually optimizing several others.

Change-Id: I5dc71dc3cea6dde054d3e60ca3337e20ed661568
2020-02-12 13:23:25 -08:00
Volker E ecf404db7f Drop the abandoned, replaced 'KSS' styleguide
KSS is no longer in use anywhere. The only official style guide is
at https://design.wikimedia.org/style-guide.

Depends-On: I688a78e9a71a082c499af55bd01e8fd615130486
Change-Id: I21663c7b48465b0f23f1b40520e8cee9be71c4bc
2020-02-11 14:26:19 -08:00
Volker E 871cee64ae Update '.svgo.yml' with pretty print rule and re-crush all icons
Align with Wikimedia Foundation SVG coding convention.

Bug: T179361
Bug: T244439
Change-Id: Ief272a4fc7a35ee2044046f262aec2ec454683d1
2020-02-11 13:53:36 -08:00
jenkins-bot 90f245c5d3 Merge "Remove eslint "valid-jsdoc" rules/fix linting errors" 2020-02-10 05:48:44 +00:00
jenkins-bot 84e1a223d1 Merge "Use user sandbox icon from OOUI" 2020-02-07 23:44:24 +00:00
Nicholas Ray 17a3c4bee0 Remove eslint "valid-jsdoc" rules/fix linting errors
Our eslintrc file extends "wikimedia/client" which already includes all
of the previously listed jsdoc rules [1]. Therefore, we were clobbering
this much more thorough list.

This commit removes this clobbering and enables a much more extensive
list of jsdoc rules. Additionally, downloadPageActions was made to
conform to the rules.

[1] 07320f16ae/common.json (L99-L137)

Bug: T239269
Change-Id: I19c09054ba0bf2746ac78befc1b44426352113ec
2020-02-07 13:59:24 -07:00
Umherirrender 78dc3baf5c Use single quotes on less @import
Change-Id: I370dd866e9e3836fe6de4c86a54861f055424d7d
2020-02-07 17:51:49 +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
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
Umherirrender 4ccaf6e959 Move comments out of class lists
Bypass upstream bug and allow stylelint upgrade
https://github.com/stylelint/stylelint/issues/4049

Change-Id: Ibb0a1cc714324db96cf6c7973cfd8c4616e159b8
2020-02-06 01:05:27 +00:00
jenkins-bot 9837ab99e9 Merge "Clicking the category overlays is synchronous" 2020-02-05 01:48:36 +00:00
jenkins-bot b216b8187f Merge "Dev: Address some FIXMEs" 2020-02-05 00:24:25 +00:00
jdlrobson df60088bf5 Clicking the category overlays is synchronous
This also means we can now get rid of the rlModuleLoader module
and make all OverlayManager routes synchronous form now on.

Depends-On: Iacea45ea5ac7332d61a33041bbd25ea4830e1375
Bug: T214641
Change-Id: I73cb622bbda44f4cfe51d08189419e15003b9d91
2020-02-04 16:53:16 +08:00
Volker E 6248fc6ebe Unify XML declaration and fix title
Change-Id: I5eb0b93022401112538e89df530418a0e4659994
2020-02-03 19:50:02 -08: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
Ed Sanders e2903a5bad Reduce height of sections due to edit links
This matches the old height and the height in edit mode.

Change-Id: Ibdfd7cdabe16cec0b050a4ea706849c34beeb2ea
2020-01-29 21:35:34 -08: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
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
Nicholas Ray f38d025b38 🐛 Make Talk Page Support Sections With Any Valid Id
Clicking on any talk page section should now open it regardless of the
characters in it. This includes ascii and non-ascii characters.

There are two changes done here:

1) When a user clicks on a section, `window.location.hash` is set to the
percent encoded version of the associated id attribute of the section.
This is important because, unfortunately, different browsers can encode
characters that do not conform to RFC 3986 (illegal URI characters) [1]
differently when calling `window.location.hash` again [2] (e.g. chrome
encodes `>` as '%3E' while safari leaves it as '>').

2) Register the encoded version with OverlayManager. OverlayManager will
simply do a strict string equality check when checking if the current
path matches. Because the browser will navigate to the percent encoded
version in step one and this version does not contain any illegal URI
characters, `window.location.hash` should give back the same percent
encoded string and the paths will match across browsers.

**Why not put this logic in OverlayManager?**

Alternatively, we could make OverlayManager decode the current route's
hash fragment and make it compare that with the unencoded version of the
id similar to the work in
I9cdaf3b01c2e5fe25512b6c18dcf6787c4422abd. However, ids with the '%'
character would then pose problems (e.g. `decodeURIComponent('100%')`
throws an error). This would require extra logic in OverlayManager to
differentiate client supplied '%' characters from browser encoded ones.

Making OverlayManager responsible for normalizing hash fragments will
make it more complicated than it already is. However, making the client
only register routes in OverlayManager that conform to RFC3986 from the
start avoids all of this logic at the expense of making the client make
one call to encodeURIComponent (if necessary).

If this patch is agreed upon, then the next step would be to change the
jsdoc `add` method  in OverlayManager to be explicit that it will only
work with URIs that conform to RFC3986 and the client should percent
encode if necessary before registering.

[1] https://tools.ietf.org/html/rfc3986
[2] https://bugs.webkit.org/show_bug.cgi?id=180396 (Thanks to TheDJ for
pointing this out)

Bug: T238364
Change-Id: Idc2cfac51c40f585c5d43713d8edf848b10424fd
2020-01-16 20:48:58 +00:00
Nicholas Ray 27bc60716d Remove redundant click handling from Minerva drawers.js
MobileFrontend's Drawer component already adds a mask that covers
the whole screen intercepting any clicks to the `body` tag and as a
result handles hiding the drawer when clicked.
Therefore, this code is redundant.

Change-Id: I7cb9ee240400e5bb0f7ca8480cd5321210ed1d7d
2020-01-14 11:59:30 -08:00
Nicholas Ray fdcfcf2849 Remove amc outreach from talk page
As discussed in stand up we no longer need this feature on this page.

Bug: T242491
Change-Id: I2f3e4b4028593c908f0e01055d6fd772734581f8
2020-01-14 11:52:54 -07:00
Nicholas Ray 9c2ba25ca2 Update amc outreach code to reflect new drawer changes
The Drawer API was changed in Ib123efe6af1b167706a73c71c860c85e7f439cc5
to have clients in charge of appending drawers to the DOM.

To reflect and make AMC outreach drawer work with these changes, the
amcOutreach.js code in MF was refactored  in
I8aa3f2c1fe1f638810a20a5e77eb5f2e2f6addd1 to make the showIfEligible
method return the drawer instead of calling show on it.

This work refactors Minerva to make use of both of these changes.

Additional changes:

* Removes amcOutreach click handler for talk button. Talk button is a
tab everywhere except main page (I think) now so this code is just
confusing.

Bug: T242491
Depends-On: I8aa3f2c1fe1f638810a20a5e77eb5f2e2f6addd1
Change-Id: I01afe765cbcb5e79e419a3e42b3125f513e1f87e
2020-01-14 02:04:57 +00:00
jdlrobson 46f28730e1 Do not add the navigation-enabled class to body tag for drawers
This class is used for the main menu exclusively. Applying it
will reveal 2 transparent shields on top of each other when is
not desired

Bug: T214049
Change-Id: I8ddcc7082c3c602a78084157c2d613366a8016c7
2020-01-14 01:20:40 +00:00
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