Commit Graph

158 Commits

Author SHA1 Message Date
jdlrobson 2e453edd23 Only load notification icon (bell) CSS for logged in users
* The notification-count style is only needed if you are logged
in. Given a small percentage of our users are logged in, we
load a lot of render blocking css unnecessarily.
* The bell icon is not needed for anonymous users so pull that
out from skins.minerva.icons.images which is loaded for all users
into a module only used by logged in users (skins.minerva.icons.loggedin)
* Simplify the user-button rule - it is overly specific - probably for
historic reasons.

Additional changes:
* Simplify isAuthenticated helper

Change-Id: Ia72e7e45d276e8aac1ff5471bf6158705c7b5f99
2018-04-12 09:27:01 -07:00
jenkins-bot 1648c7752e Merge "multi-line, two-line and mw-ui-button-group only loaded where needed" 2018-04-12 15:57:46 +00:00
jdlrobson d228b2cbd7 multi-line, two-line and mw-ui-button-group only loaded where needed
The only usage of mw-ui-button is inside the SpecialMobileWatchList
class in MobileFrontend. Thus we needlessly load as
a render blocking CSS on all page views

multi-line and two-line are likewise only used inside
MobileSpecialPageFeed.php

mobile.special.styles is loaded on all Special pages
so let's load this instead here. This also allows us to use
the element on other special pages in future.

Change-Id: I2b363543d0356a18194a9d08922428a6cb944797
2018-04-11 21:50:53 +00:00
jdlrobson 19ceaea732 span.mw-ui-icon is defined in core
Depends-On: I3d1ed6e4a165f48244e760752342c712047a07d8
Change-Id: Ifc576bbb6ec461ed30b01ae27f02620fdf8105c1
2018-04-11 13:50:03 -07:00
Stephen Niedzielski b106ed3219 Fix: update edit button lock style state
When a user is allowed to make edits, show a normal edit button. When a
user cannot make edits, show the locked button.

This patch refactors edit button presentation logic into a new function,
updateEditPageButton(), which consistently updates the UI for both
enabled and disabled states. Additionally, in cases where the old code
only displayed the button via `$caEdit.removeClass( 'hidden' )`, the new
code now updates the state appropriately which is a functional change.
Finally, this patch sprinkles in some TODOs for future minor refactors
that were identified while creating this patch.

Bug: T190834
Change-Id: I083e91f0328cc057541ad42a27aae31b32b3d050
2018-04-09 17:40:00 +00:00
Ed Sanders f4658a4d0e Fixes for action=edit page styling
* Use box-sizing:border-box when adding textarea padding - before
the right side of the textarea did not align with the right side of
the bell icon. Now it does.
* Fix specificity of rule hiding cancel link and "editing help" which
appear at the bottom of the form.
* Fix height of noJS textarea (70vh)
* Remove some unnecessary extra margins and padding (the minor edit
and watch this page checkboxes will now show on the same line)
* Update specificity for oo-ui-fieldLayout-body so that it does not
apply to the summary form.

Change-Id: I8d3d61fdc51934a6ef0885cde94dac1e8c5e33ca
2018-04-05 23:13:49 +00:00
Jan Drewniak da7f08ad09 Use OverlayManager for SearchOverlay
Enables the SearchOverlay to be shown/hidden by the
OverlayManager, instead of managing the routing itself.

A special route is added to hide the search overlay on pageload,
so that the overlay can always be closed with history.back()

Bug: T189212, T102946
Change-Id: I1eaad36fe4ceca2d6f3e3345d987e2b32634446d
2018-04-05 15:23:36 +02:00
jdlrobson 8dad1703af Special handling for links without href attribute
The link change overrides link colors in last modified,
talk button and main menu. This approach was obviously flawed.

Rather than enter a specificity
war let's instead limit the styles to links which do not have
an href. Volker you were right...

* Revert "Last modified links should not be progressive blue"
This reverts commit bc045b78a2.
* Revert "Do not style links without href attribute"
This reverts commit daa6ad5145.
* Apply a not selector for links

Certain links (including links inside navboxes) render
links to themselves - for example the navbox on the San
Francisco article (provided it is not removed by
wgMFRemovableClasses)

These links should be visually distinguished from normal links.
The not selector has support from IE9 onwards and given our browser
matrix and the low impact of if this fallback fails this is a perfectly
acceptable usecase.

Bug: T181472

Change-Id: I61b05e3c223f2ba5314aecdf26b8a0ee8caa6524
2018-03-29 15:58:09 -07:00
jenkins-bot 121958bea1 Merge "Block reason messages escape HTML" 2018-03-29 21:34:34 +00:00
jdlrobson ac1ffdb5f1 Restore search placeholder text
Bug: T190939
Change-Id: Ic42ed495b54f153c93ee32ac250dfe5d9233d1cb
2018-03-28 20:00:55 +00:00
jenkins-bot 75cfd47acb Merge "Last modified links should not be progressive blue" 2018-03-28 19:12:00 +00:00
jdlrobson bc045b78a2 Last modified links should not be progressive blue
This regression was due to I9f842ae09751d299716d752328f747269597fbdb
Updated specifity of selector.

Additional change:
* Update comment per feedback from TheDj

Bug: T181472
Change-Id: I9534cce5f240009c9013b75e1367776519b00d81
2018-03-28 19:00:35 +00:00
Stephen Niedzielski e8b4559f5b Fix: always show table of contents
Do not conditionally render the table of contents. Note: the underlying
condition, MFTOC, appears to still be used by MobileFormatter so it was
unchanged.

Bug: T189699
Change-Id: I7088ccad75c2a8504bf435418d7dd62238b2135d
2018-03-28 13:36:17 -05:00
David Barratt 6bea4324c6
Block reason messages escape HTML
The block reason in the block message has escaped HTML. This
HTML should be rendered to the user.

Bug: T190901
Change-Id: Icda7c5d0c76aff7c22f3a6735d880a5ee49338ff
2018-03-28 12:36:43 -04:00
jdlrobson daa6ad5145 Do not style links without href attribute
Certain links (including links inside navboxes) render
links to themselves - for example the navbox on the San
Francisco article (provided it is not removed by
wgMFRemovableClasses)

These links should not look like links as they are not
clickable so should be visually distinguished.

Support for attribute selectors goes way back to IE7
and in the case of IE6, links will still render correctly
falling back to the browser default stylesheet

Bug: T181472
Change-Id: I9f842ae09751d299716d752328f747269597fbdb
2018-03-26 10:44:52 -07:00
jdlrobson 922f4a09e4 Remove unnecessary file for gallery styles
This should have been removed back in 2015.
See I0ef5c2d5a9019355aa3a158f9e489df02975e0af
Gallery styles come from mediawiki.page.gallery.styles

Bug: T190215
Change-Id: I87713164e1c3906b341a4fb17be424307f8fa428
2018-03-20 22:12:04 +00:00
Volker E 759590873b Replace `#toc` selector by `.toc`
Replacing id CSS selector by lower specific class selector.

Bug: T187808
Depends-on: I7f3a9df7f9fd1178986112b5265b1ae7c991d5b7
Change-Id: Ib1a874b644e80a26ff415003684f6ce54fd2b7e6
2018-03-20 01:49:43 +00:00
jdlrobson cfd5fbbde8 Add icons for all the types of issues
More hackery!
This adds some tests and ensures that our own icons are mapped to the
existing template icons.

Bug: T187916
Change-Id: I49073f22995c6730369235d6039939915ba2079c
2018-03-15 15:02:05 -07:00
jdlrobson eaa2692da0 Use jsdoc for generating Minerva documentation
Given the level of documentation in this repo is extremely
low now seems a good as time as any.

The resulting documentation is a vast improvement on before
grouping functions to an owner and introducing module names.

We can iterate on the documentation over time.

Bug: T138401
Change-Id: I9e787d40931d3d72a7037ce07d3ab0db8e72d825
2018-03-15 15:01:41 -07:00
Volker E 19d9a6367b Replace abandoned color variables
After having aligned vast majority of color variables to WikimediaUI
color palette and/or transformed to use central variables, these
seem abandoned leftovers.

Change-Id: Ic20b445975e920259c808b7a20c6100575c99f82
2018-03-14 17:53:56 -07:00
jdlrobson 0100dc33a4 CSS tweaks to issue overlay
* Remove CSS rule updating the padding of issue-notice
(this is no longer necessary after
I1b880c46fa3debfc5b68d8b416ca642cca98ce7e which defines its own padding
for the element)
* Overlay title is updated to read "Page issues"

Bug: T187916
Change-Id: I7e41d6f03c4cf9fa7563f2f608eec5be89c04a31
2018-03-14 17:54:50 +00:00
jdlrobson 888129478b Generalise search trigger mechanism
Allow content to trigger it.

Bug: T189316
Change-Id: Ie9a66b001b3ea4f79e465747b80b181df948cd34
2018-03-12 20:49:25 +00:00
jdlrobson 71bf8604ab Move error handling inside Minerva
ReferenceDrawer
Instead of doing this inside the ReferenceDrawer component
itself, we'll do this here.

To be backwards compatible we check the value is truthy.
When I5a7b23f60722eb5017a85c68f38844dd460f8b63 is merged
this can be removed.

For NotificationBadge we pass the onError option which
is now available and allows us to clean up the NotificationBadge

Change-Id: I47db11fa945a05f3b2a9a43c3cf053ca489a38fa
2018-03-08 20:03:22 +00:00
Stephen Niedzielski 41a43c5ce1 Hygiene: remove window.location use from overlays
Bug: T173539
Depends-On: I158dd7883be2846cf0d48bbd7e89fe2cd64a57d3
Change-Id: I87741667ca06cc701e5265aff13ba0492501de26
2018-03-07 17:13:59 -06:00
Stephen Niedzielski 27bc7e7212 Chore: move window.location use to client
Move window.location manipulation from ImageOverlay view to MinervaNeue.
Also, don't leave a hanging empty URL fragment when closing the overlay.

Bug: T173539
Related: I292c0578716ff56e0e069aa8006f840025d78a88
Change-Id: I56ba9217aa9cd4e0a925c623060022392e3021c7
2018-03-06 08:35:48 -06:00
Jan Drewniak 3b83933b57 Removing tap-highlight override for iOS
Bug: T188043
Change-Id: I78558b0badc3ecdaf4eb99ab1ed2a17fac3dd9e1
2018-03-01 19:04:13 +00:00
jenkins-bot eb8b6d492f Merge "Hygiene: move CategoryAddOverlay window use to client" 2018-03-01 18:22:53 +00:00
Stephen Niedzielski 9431e9a6e3 Hygiene: move CategoryAddOverlay window use to client
MinervaNeue should be solely responsible for controlling the flow of its
own UI. This patch puts the responsibility for changing the add category
dialog state when a category has successfully been added onto
MinervaNeue.

Bug: T173539
Related: Ic61ac46e21f510e5b168d7d98b68a59429eb7044
Change-Id: I5010d5ad1a27f09c1c5b0b4188dcec445cc3229f
2018-03-01 18:17:34 +00:00
Jan Drewniak aa7e20f8c3 Passing currentPageTitle option to TalkSectionAddOverlay
Passing in a new currentPageTitle option to TalkSectionAddOverlay.
Since `title` param has spaces instead of underscores,
`pageTitle` also gets spaces by using `M.getCurrentPage().title`
instead of mw.config.get( 'wgPageName' )

Bug: T184273
Change-Id: I68a46e512fde0c6c15e888bd3b57da21417b1085
2018-02-28 21:08:00 +00:00
jdlrobson 3bfc4c7f48 Remove unused userpage icon from repo
This was removed in Ia3fb34250714fe4ccb10c32a7027fda167e06a16
It is no longer referenced anywhere.

Bug: T187222
Change-Id: I14d486d962cfd1e4277a82d78084a785093d679d
2018-02-15 08:36:44 -08:00
jdlrobson 196fb20836 Restore Minerva specific userpage styles for all user pages
In T182162 these were removed incorrectly. They should only have
been partially removed.

Bug: T187222
Change-Id: Ia3fb34250714fe4ccb10c32a7027fda167e06a16
2018-02-13 16:14:54 -08:00
jenkins-bot 45e3f024e0 Merge "Remove main page toggle check" 2018-02-12 19:22:54 +00:00
jdlrobson 6ab5944b09 Pages that do not exist cannot have issues
Bug: T185359
Change-Id: I4d2adcd31d31761c178cbb8df8db696f654a795d
2018-02-08 22:09:49 +00:00
jdlrobson b0970a4a7e Remove main page toggle check
This is redundant.
page.getLeadSectionElement() will return null if the main page
is special casing and sections have not been wrapped.

Removing this check also allows toggling to work on pages where
users want to treat main pages like any other page.

Bug: T177337
Change-Id: Ic52fd1c9f6cc4f727ca52c871f29c76997e47f1d
2018-02-07 09:10:47 -08:00
jdlrobson 4389b67989 Explicitly use LESS variable for breakpoint defined in mediawiki ui
$wgResourceLoaderLESSVars is deprecated. Let's not use it anymore.

Change-Id: If28ab6884668700bc46533c8e2c377f17e6be696
Depends-On: Ib9f843147db4473ce5590741e0fb490384b0007e
Bug: T171365
2018-02-06 22:23:32 +00:00
jdlrobson 3047f3e0fa Merge remote-tracking branch 'gerrit/master' into specialpages
Change-Id: I1bc48ac546865f515df65e9d7f0c75e7f5c6d684
2018-02-01 11:35:11 -08:00
jdlrobson 326ec90cd5 Disable download button on Chrome like browsers
Add Dolphin, Opera and Maxthon to whitelist

Bug: T182059
Change-Id: I39bf9d016aba189016b2ce5b42a2e95b58cb33ce
2018-02-01 10:59:18 -08:00
jdlrobson 6b801b8c5c Console recruit message has been moved to MobileFrontend
Change-Id: I48eb8ac7471f7e17ed10ac326230cf2ffed467d1
Depends-On: I3ee0c34139ec658566e8d324a3c8c28a80e930fd
2018-02-01 00:48:13 +00:00
jenkins-bot af9db025df Merge "Remove horizontal line from popups preview in MinervaNeue skin" 2018-01-30 19:18:58 +00:00
Alangi Derick 3c81e0c717 Remove horizontal line from popups preview in MinervaNeue skin
A horizontal line shows in popup previews in the MinervaNeue skin
just above the setting icon due to a css rule that affect all footer
elements. Removing this effect to apply only for the MN skin.

Bug: T184560
Change-Id: Idb0c40c3fc24e4ec2d32cb2de9520952448da77a
2018-01-30 20:06:42 +01:00
jenkins-bot fcc759ee19 Merge "Fix editing of non-mobile-formatted pages" 2018-01-29 21:05:31 +00:00
jdlrobson 6cdcc8ddfa Fix editing of non-mobile-formatted pages
Template pages do not run the MobileFormatter
(see MFMobileFormatterNamespaceBlacklist).

As a result page.getLeadSectionElement() will
return null

When this happens do not change the edit icon to point
to section 1. Instead give them the non-JS editor.

After this patch, the feature remains as:

* Page with lead section get the JS edit overlay for section 0
* Page without lead section but with other sections gets the JS overlay
  editor for section 1
* Pages that didn't run through MobileFormatter don't modify the edit
  link and just link to the fallback editor (useful for Template pages
  at this moment)

Bug: T172948
Change-Id: Icee96e12f62ec13a1cbd3169c687fa4b3af70754
2018-01-29 20:56:31 +00:00
jdlrobson 1e56e46724 Fix download icon spinner
Regression, introduced in
I6e474562ba5f2c704364c9d7b49f982f7bab8a18

Bug: T182162
Change-Id: I56464d42e437a94b2008338b00f49b4e0b086561
2018-01-29 20:08:04 +00:00
jdlrobson c5d09c0288 Prefix icons in Minerva
Changes:
* MinervaUI will now prefix any icons with `minerva`
* Update definitions in skin.json, retaining selectors for cached
HTML for icons that are rendered via PHP.
* In I9021c53c2c04bdd7ce395eed33d89986acbfea6d watch and watched
and arrow are moved to MobileFrontend so are removed from the RL module
skins.minerva.icons.images.scripts as they are not
used directly in this repo. user and anonymous are no longer used
so also removed.
* Presentation of userpage now belongs to MobileFrontend. Icons
are styles were moved there in depends on. They are retained in
skin.json to support cached HTML as user pages are subject to
cache. They can be removed in a week.
* In code review we noticed the anonymous icon was badly named. We
rename to login. No caching implications.
* Main menu icons are now prefixed with minerva rather than mf to
reflect where they come from.

Depends-On: I9021c53c2c04bdd7ce395eed33d89986acbfea6d
Bug: T182162
Change-Id: I93264024f4915fc910c792b1905b89cdc6b8b546
2018-01-19 15:30:03 -08:00
jdlrobson fe3ac29fe7 Merge branch 'master' into 'specialpages'
Change-Id: I167f03477fd79e5ea0c7fa5cdf5df71bb8da31c2
2018-01-19 11:00:55 -08:00
jenkins-bot 80f51c4d5d Merge "Fix infobox styles to work well with multiple column infobox rows" 2018-01-17 20:04:02 +00:00
Piotr Miazga 4ca5666c06 Show Download button only on Android >= 5 & Chrome >= 41
Changes:
 - moved DownloadButtton checks & initialization to separate function
 - introduced supportedNamespaces variable for better readability
 - reorganized huge if(){} statement to set of smaller if's with
 nice comments why this configuration is not supported
 - introduced getAndroidVersion and getChromeVersion helper functions
 - added check to not allow Android < 5 or Chrome < 41
 - added unit tests

Bug: T182059
Change-Id: Ib5064459ee56aed68179389f37b4bc3b5c2c4492
2018-01-16 22:15:07 +01:00
David Sn 5d46c576bb Fix infobox styles to work well with multiple column infobox rows
I used the fix provided by TheDJ and tested out locally
on Firefox 57 and Chrome latest, but I couldn't test out
any grade C browser as on Linux it's really hard to find
such an outdated browser like Internet Explorer on Windows.

Bug: T168716
Change-Id: I8e03610e4eb3c93b80bb757592c2fb3079a68412
2018-01-16 17:19:39 +00:00
Piotr Miazga 3c4f3a0ddd Send events when user taps download icon
To track "download" button interactions we have to notify
EventLogging that button was clicked. The easiest approach is
to use mw.track() and then in WikimediaEvents subscribe to the
`minerva.downloadAsPdf` events and track page impressions.

Bug: T181297
Change-Id: Iecbebe37c165dda3f26af47906662f6e5a81321d
2018-01-11 18:50:31 +00:00
jdlrobson 09a1f98ab3 Merge remote-tracking branch 'origin/master' into HEAD
Change-Id: Ia1a520d983be096e29cfe725f619be0423f9d110
2018-01-08 16:37:44 -08:00