Commit Graph

200 Commits

Author SHA1 Message Date
jdlrobson 7e423c07b7 Talk tabs in AMC mode
A new feature/skin option is added that is enabled safely inside
a MobileFrontend available/unavailable hook that changes the skin
to place talk tabs at the top of the page.

These new talk tabs purposely show on the main page, user page
and standard pages and do not show on special pages.


Depends-On: Ie1a583657176acc6f7046c569c2e94fa2f72ff93
Bug: T212216
Change-Id: I57b70cd325666a287678dc897159b5bf9d089b78
2019-02-13 00:02:35 +00:00
Stephen Niedzielski f26ae2212e Hygiene: remove deprecated RL module skins.minerva.scripts.top
skins.minerva.scripts.top is no longer needed as of b356c7f. Remove the
ResourceLoader module.

Change-Id: I4db0551a7661eb5c41d7b2a27e78afb885bb9ce5
2019-02-12 23:46:07 +00:00
jdlrobson b356c7f134 Merge skins.minerva.scripts.top and skins.minerva.mainMenu into scripts
These modules can safely be merged.

Since skins.minerva.scripts.top is added via addModules to the HTML it must
be marked as deprecated and remain temporarily as a redirection to skins.minerva.scripts

All modules have been renamed to be in there new home - no deprecation notices are needed
as they are not used outside Minerva.

I leave skins.minerva.mainMenu.styles as it is used by Special:MobileMenu
and needs to continue to do so.

Change-Id: Ie919151630f4389f8e84e808bec003a6d3d07bd9
2019-02-07 18:10:15 -08:00
Stephen Niedzielski 8d67044f3d Hygiene: remove unused string
Remove mobile-frontend-language-change which does not appear to be used
by Minerva or other repos.

Change-Id: I3a6e3bff921a46575b1c3cc7d914ace35a321b35
2019-02-05 11:30:29 -07:00
jdlrobson ff83465346 skins.minerva.editor is never loaded
This is never added to any page.
Remove it.
mobile.editor inside MobileFrontend is already added
via the onBeforePageDisplay hook there.

Bug: T213340
Change-Id: Iea025ee48ee95b6d9470ad055fa717e3e3ade54a
2019-01-24 11:10:37 -08:00
jenkins-bot ffb97f5c9f Merge "Hygiene: Merge skins.minerva.base.reset into skins.minerva.base.styles" 2019-01-18 17:13:52 +00:00
jenkins-bot a816f81278 Merge "skins.minerva.tablet.styles can be merged" 2019-01-18 17:13:51 +00:00
jdlrobson 7e81cfa663 Separate ConfirmEdit styles from Login styles
ConfirmEdit styles are migrated from mediawiki.special.userlogin.common.styles
to ext.confirmEdit.fancyCaptcha.styles

The text of the reload itself mirrors the progressive blue icon by being
progressive itself

A couple of tweaks to the form (padding) are made to preserve the form to
its previous glorious status, other than that the file remains the same.

Bug: T213775
Change-Id: I2322194481e4d6b7662c0f075768d5941afa98b8
2019-01-17 23:48:54 +00:00
jdlrobson 24b1e7d54d Hygiene: Merge skins.minerva.base.reset into skins.minerva.base.styles
No need for 2 modules that are both loaded on every page load
Provided consumers are loading skins.minerva.base.styles they will
continue to get the same CSS. If any consumers exist that load
skins.minerva.base.reset but not skins.minerva.base.styles they will
need to use their own css reset file
(e.g. https://meyerweb.com/eric/tools/css/reset/)

Change-Id: I599e6d5a84b311cb3bb2da197da1b688e0e6b9d4
2019-01-15 12:30:32 -08:00
jdlrobson 1166009c00 skins.minerva.tablet.styles can be merged
This module is unnecessary - it's loaded unconditionally on a page.
Instead bundle the related CSS inside skins.minerva.content.styles

Change-Id: Ieb37d63332ff5b0cf39835b64cc9f0dcaf62c34f
2019-01-15 12:30:30 -08:00
jdlrobson 76be18c788 Tablet code no longer needs to be conditional
The TableOfContents component is now inside mobile.startup
so is readily available.
Thus skins.minerva.tablet.scripts is removed and its code
moved inside skins.minerva.scripts

The check to whether the user is in tablet mode
now happens inside toc.js

The resize handler is dropped on the basis that this is an edge
case that is not worth supporting at the cost of an eventBus.

Depends-On: I353d6d7a6884dae03b55364150c6bb95cd4cc57f
Change-Id: Id16a64573e020b4606fc9b11456163a4cd290e0b
2019-01-14 15:43:50 -08:00
jenkins-bot d3557a738d Merge "Generate a shareIcon via composition" 2019-01-04 18:57:13 +00:00
jdlrobson e3bdad20bb Generate a shareIcon via composition
Bug: T205592
Change-Id: Ia107b13d4f658ce7cc077ca7337530f3e448c522
2019-01-04 09:19:59 -08:00
jenkins-bot 9258806a0f Merge "pageIssuesOverlay is a factory function that returns an Overlay" 2019-01-04 15:39:48 +00:00
jdlrobson d29eca2bc8 pageIssuesOverlay is a factory function that returns an Overlay
This experiments with making PageIssuesOverlay an Overlay with
various options.

The appending of children is a little messy and points at a need
to standardise this some way
(see https://phabricator.wikimedia.org/T209647)

TODO:
* Remove the iconString property on PageIssueSummary which is no longer
needed

Bug: T209647
Change-Id: Iadd798a820dca6bbb31edc9a8570b6db7aac237a
2019-01-03 08:31:39 -08:00
jdlrobson c73ff1f7a5 Composition: DownloadIcon
The DownloadIcon is reduced to a factory function that
returns an instance of Icon

Depends-On: I4d703eef68d51bbe0b03579c5cca0845e17b8c9d
Depends-On: I4a4129b2cac7c7c49559beef0b8780f3211edf9c
Bug: T205592
Change-Id: Ib87390d17bef6f50842f52cd84c9ce2b162aaff0
2019-01-02 13:16:09 -08:00
Stephen Niedzielski 37333c7189 Hygiene: collapse mobile.search* into mobile.startup
MinervaNeue depends on mobile.search and mobile.search.api. These
ResourceLoader modules existed in MobileFrontend but now have been
collapsed into mobile.startup.

This patch updates Minerva's ResourceLoader module and JavaScript
references.

Bug: T210207
Depends-On: I1eae36f2927a4e0f9d1e91d604d656beb8cc33ae
Change-Id: Ied6f4873bf2550564673296e9ef4fa009ca45e5b
2018-12-17 22:03:41 +00:00
Stephen Niedzielski 0cb19335fa Hygiene: collapse mobile.search LESS into mobile.startup
MinervaNeue depends on mobile.search. mobile.search's LESS has been
collapsed into mobile.startup. This patch updates Minerva's references
and revises the SearchOverlay's CSS selector to increase specificity to
account for the new order of CSS files. Previously:

- ...
- MobileFrontend Overlay.less
- MobileFrontend SearchOverlay.less
- ...
- Minerva Overlay.less
- Minerva SearchOverlay.less
- ...

Now:

- ...
- MobileFrontend Overlay.less
- Minerva Overlay.less
- ...
- MobileFrontend SearchOverlay.less
- Minerva SearchOverlay.less
- ...

Since SearchOverlay's selector are intended to override Overlay's, it
seems appropriate to specify that a SearchOverlay is also an Overlay and
increase specificity.

Bug: T210207
Related: Ib0316020ed10eb0c921a3300501df7634a889977
Change-Id: I5c06b13f22f530fb52f37f373e081ed55f332a07
2018-12-17 22:02:58 +00:00
Jan Drewniak 1589a15862 Remove references to "mobile.toggle" module.
mobile.toggle was folded into mobile.startup in
mobileFrontend, so moving references to that instead.
- Changing require statements
- moving skinStyles/mobile.toggle/minerva.less to
   skinStyles/mobile.startup/toggle.less
- Replacing references to mobile.toggle in skin.json

Depends-On: Iecc1870f08532e8c7893861afdd54f069da54be2
Bug: T210208
Change-Id: Ie67cd50a2d042fbbaaef348b9b62d64193900d78
2018-12-14 00:45:34 +01:00
jdlrobson 87942c34f9 mobile.watchstar is a deprecated module
Referencing it triggers deprecation warnings so should be updated

Bug: T208921
Change-Id: I7266a067a14bfa38a998f426e18f096515b7bfa7
2018-11-30 15:28:03 -08:00
Ed Sanders d63de2eb01 Set editfont size to 16px (100%)
Change-Id: I9bff880de792da756f14726042df0a0df4139d1b
2018-11-27 22:56:01 +00:00
jdlrobson 5c40ddc477 Zero is a sensible default for this feature flag
Bug: T205008
Depends-On: I3640b28c6a930f6e934d22c3375bffcd539902aa
Change-Id: Ie5d63e265469219063e36d6e398fd0a0b1e864db
2018-11-27 12:26:37 +00:00
jenkins-bot 58cfdbff89 Merge "page issues is feature flagged" 2018-11-20 22:44:40 +00:00
jdlrobson 97fd861a63 page issues is feature flagged
* New feature/skin option is added and value is read inside
the pageIssues setup code
* issues-group-a class is added to page on server side to remove
the flash of unstyled content
* issues-group-A class is dropped (it's not doing anything!)
* The minerva-issues flag will now accept any value to avoid confusion.
It is used to override the default setting of wgMinervaPageIssuesNewTreatment
A note has been added that this can be removed in future.

Bug: T206179
Change-Id: I3d98fd8f8e1adc818ea03589d2c8f68fe991e861
2018-11-20 12:41:41 -08:00
jdlrobson 2e3528ea62 Drop unnecessary `prefix` config
These values are never read.
In includes/MinervaHooks.php when registering the features in
onMobileFrontendFeaturesRegistration we pass the group name `skin-minerva`

Change-Id: I7e2af47daa4369d3124686de64fc197881bd3c5f
2018-11-16 20:40:33 +00:00
jenkins-bot 4f2695907f Merge "Update references to deprecated modules" 2018-11-16 18:15:47 +00:00
Bartosz Dziewoński b17d3f70da Remove 'skins.minerva.editor' module (moved to MobileFrontend)
Added in MobileFrontend in Iaaed72c32b9c4f4e15c320b79e29e9af3609069a.

(The module's name is included in cached page HTML, so to avoid
breaking them, 'skins.minerva.editor' must temporarily remain as an
alias for 'mobile.editor'. It is otherwise unused and can be removed
after caches expire on Wikimedia wikis.)

Depends-On: Iaaed72c32b9c4f4e15c320b79e29e9af3609069a
Bug: T198765
Change-Id: I52c4e0941dcf8f176e3ac32d8a1f72a0f8e1d6a6
2018-11-13 23:27:29 +01:00
jdlrobson 846b37c708 Update references to deprecated modules
Change-Id: Id5ec727eb32c7b5207bb1175ebcdb0c1c4a4911a
Depends-On: I7b0090c3e4268ea147f1d8707ee62f90e7d48724
Bug: T207805
2018-11-08 13:34:50 -08:00
Bartosz Dziewoński 3a0e46907b skins.minerva.editor: Remove unused dependencies
We were not using some of the code this was depending on. No idea when
it stopped being required.

'skins.minerva.scripts' was used until recently (d27a9481, 72cd31f2),
but now its only purpose was to load other dependencies. Add them
separately instead.

Removed dependencies:
* mediawiki.ui.input
* skins.minerva.icons.images.scripts
* skins.minerva.scripts
* skins.minerva.toggling

Added dependencies:
* mediawiki.api
* mediawiki.storage
* mediawiki.user
* mobile.init

Bug: T198765
Change-Id: Ic80ba016adca377cb539adf672793fa103deb150
2018-11-08 17:42:53 +01:00
Bartosz Dziewoński 7b5928d795 Merge remote-tracking branch 'gerrit/page-issues-cleanup'
Bug: T198765
Bug: T208514
Change-Id: I9467101c9b01cbd7682de859e43e04966760eea6
2018-11-08 16:00:39 +01:00
Bjornskjald 10978e5022
Add drawer when user is not logged in and anonymous edits are disabled
Bug: T206823
Change-Id: Ibd77ff0966f2d4b86e61f66caaafb94e85b02235
2018-11-02 23:01:22 +01:00
Volker E fd67163292 Remove obsolete Special:Preferences styles after its transformation to OOUI
The styles in this stylesheet match no elements in the
Special:Preferences page since the OOUI transformation.

Bug: T208340
Change-Id: I9c87f6a676186928787c130e61d3c312214e1853
2018-10-30 22:04:40 +00:00
jenkins-bot 885092114b Merge "Watchstar is accessible to non-js users" 2018-10-23 20:09:40 +00:00
jdlrobson 72cd31f221 Remove page issues instrumentation
Note, since the page issues code is not feature flagged,
the new treatment will only be accessible via query
string until T206179 is taken care of.

Bug: T206178
Change-Id: I5ab2f3396e642f7b973263e2bb3963e0e82721b3
2018-10-23 12:19:25 -07:00
jdlrobson aa6a2dda4c Watchstar is accessible to non-js users
Bug: T196893
Change-Id: I5dbd164ba68e6c74e80f8bcf90819a526cda5a5e
2018-10-19 11:00:19 -07:00
Piotr Miazga 43aed4a31a Disable share button
The share button should go though proper testing before it hits
production. First, it should be enabled only for beta cluster,
and then when everything works properly we can enable it as a
beta feature on production.

Bug: T181195
Change-Id: I1c5330edd8b5dfe00179bf7d9c6660887208a2e6
2018-10-15 19:42:58 +02:00
Piotr Miazga 51b6e8209b Add share icon as mobile web beta feature
Add a new beta feature - share icon. When user opts into beta
the share icon will be visible on supported devices (Android OS
and Chrome browser).

Bug: T181195
Change-Id: Ie4b9dd05eea9b63422bd174048d8b1251cb02bf4
2018-10-12 22:08:28 +02:00
jdlrobson cbad0bd363 Merge skin option modules into a single ResourceLoader module and move enabled logic to client
It's presumed that skin options will eventually become the default or be removed from the skin.
While they are not the default, it would be helpful to package them in one single module - as ResourceLoader
modules are costly bloating the dependency graph in the MediaWiki startup module.

In T167713 we talked about grouping our entry points by page rather than feature, which this seems consistent
with. A page with special options enabled is different from a page without.

Change-Id: Id948f913d4743532ba3442d2059a03c122419ff2
2018-10-12 10:18:21 -07:00
Bartosz Dziewoński cada514ded Remove code related to no-anonymous-editing mode of MobileFrontend
All of this would only be used with the configuration setting
`$wgMFEditorOptions['anonymousEditing'] = false;`.

Removed features:
* Call-to-action popup in skins.minerva.editor (note that anonymous
  editors still get a CTA from MobileFrontend's EditorOverlay code)
* Pointer towards the edit button shown after registering via the CTA
  (entire skins.minerva.newusers module)

Bug: T205382
Change-Id: I66c7035f7a23581811dda87c911dea41d4a8e5da
2018-10-10 19:03:53 +00:00
jdlrobson 07a3b81c91 Errors can be counted in statsv
Bug: T205582
Change-Id: I8f67b8356ac271872cac39a416ffefce47959177
2018-10-08 15:05:56 -07:00
jenkins-bot 57cb5f8e41 Merge "Make Minerva section editing more like other skins" 2018-10-04 21:26:03 +00:00
Bartosz Dziewoński 6b0ce86410 Make Minerva section editing more like other skins
Goal: Make skins.minerva.editor not rely on Minerva-specific markup.

SkinMinerva.php:
* Add `class="mw-editsection"` to section edit links in SkinMinerva.
  This is the default behavior in SkinTemplate.
* Tweak the page "Edit" link generated in PHP to be the same as the
  link we were generating in JS: add class="edit-page" and change the
  message for the text.
* (Fix an unrelated code comment that was incorrect.)

skins.minerva.content.styles/hacks.less:
* Remove a hack that was hiding .mw-editsection, since we now use it.

skins.minerva.editor/init.js:
* Stop using the `data-section` attribute on links to decide which
  page section to open in the editor. Instead, use the `href`
  attribute and extract the `section` URL parameter from it.
* Stop using the `edit-page` class to find section edit links.
  Instead, use the `mw-editsection` class.
* Remove super weird code that removed the original "Edit" link from
  the page and generated an identical one to replace it, instead of
  just adding event handlers to the existing one.
* Centralize event handling for all types of edit links.

Bug: T198765
Change-Id: I79639c738ff1c3ec4b48ee2e462d23060151a21b
2018-10-04 14:07:27 -07:00
jdlrobson 33a7484676 Move MainMenu click tracking schema from MobileFrontend to Minerva
Additional changes:
* Rename hook prefix from 'mf.' to 'minerva.'
* Remove now unnecessary RL call

Bug: T204584
Change-Id: I50619e71c5a98e95c8aed3c3f346d4cb8a70abbe
2018-10-02 15:03:17 -07:00
Bartosz Dziewoński 1a89047d3b Move redlink CTA out of skins.minerva.editor
It is not part of the editor. Redlinks are part of page content.

Bug: T198765
Change-Id: Iee77a228b6f2db1c5f2e85226d6cc1c6a73a89be
2018-09-27 20:13:16 +00:00
Bartosz Dziewoński 1b61a14535 When browser doesn't support mobile editor, use fallback editor rather than none
Change-Id: I41bd554c3e979061dd8b1846a6412efb3284e7e9
2018-09-27 20:12:49 +00:00
jenkins-bot ba827d4b3c Merge "Revert "Minerva is responsible for turning on WikimediaEvents itself"" 2018-09-26 20:42:38 +00:00
Bartosz Dziewoński b6672a4f9f Less harsh failure mode when attempting to undo in mobile editor
The fancy mobile editor doesn't support undo, but we can just use the
fallback (no-JS) editor. The experience is not very friendly (e.g. due
to two-column diff), but it works.

Previously we showed an old-school alert() message and then loaded the
fancy editor as if it was a normal edit, ignoring the undo parameters.

The whole thing is rather hypothetical, since there are no links to undo
in the mobile interface. See T191706.

Bug: T191706
Change-Id: I5147ada9e85d9188f19ae898fdd411985d19182f
2018-09-25 22:01:36 +00:00
Jdlrobson abf445ec9b Revert "Minerva is responsible for turning on WikimediaEvents itself"
While harmless, this patch is not needed if we take a
different approach as discussed in
https://phabricator.wikimedia.org/T204144#4612790

This reverts commit 01dc9de92e.

Change-Id: Id2fdd8677042121142ab2663edfa0ee400b8bf22
2018-09-24 22:52:12 +00:00
jenkins-bot ee5959a6fb Merge "Get rid of ICustomizableSkin" 2018-09-21 16:03:47 +00:00
jdlrobson 01dc9de92e Minerva is responsible for turning on WikimediaEvents itself
Unlike other skins, Minerva wants to be in charge of when WikimediaEvents
is loaded, so that it can guarantee load order happens at a time that
suits it.

WikimediaEvents will be loaded after initialisation of the interface.
This allows Minerva to enable schemas such as ReadingDepth conditionally.

Upon merging this patch, Ibb45f40ea301727c0c6480043760bd9426106845 can
be merged which will revoke WikimediaEvent's ownership.
Merging in this order will ensure that ReadingDepth  is never
removed from production.

Bug: T204144
Change-Id: If8395033f31485aca0ca3b38fda1be985369b481
2018-09-19 22:09:26 +00:00
jdlrobson 03bc2518d4 Red links are linked separately
In I1a471f81cc9390fc9e8665a7a336cf2dd7a063ab we excluded
edit events that led to the creation of a new page.

This restores them by providing a dedicated home for this data
in the schema.

Additional changes:
* Address some line length warnings

Bug: T204073
Change-Id: Ie7eb95f15737e94b7926d38ed6411bc0e5df2404
2018-09-18 13:43:56 -06:00
Bartosz Dziewoński c6960ce8a7 Remove 'mobile.editor.ve' styles (move to MobileFrontend)
They no longer depend on Minerva's variables and can be moved there.
See I964b23bf9363233e5fc927cfaf1e8bdbc3435de1.

Bug: T202978
Change-Id: I6ce2156c29dcf8a95015ffdf59d02ecc5a03b74f
2018-09-17 21:55:39 +00:00
Bartosz Dziewoński 5e7b3994fd Move Parsoid output overrides to 'mediawiki.skinning.content.parsoid' skinStyles
We need to load these only when VisualEditor is loaded. This is
the best way to ensure that. They have been haphazardly placed
in different files.

The goal of this change is to move content styling for Minerva out of
mobile.editor.ve/minerva.less, and thus to be able to move this file
to mediawiki/extensions/MobileFrontend (T202978). But I spotted the
other places while working on that.

Moved as-is:
* skins.minerva.content.styles/links.less
* mobile.editor.ve/minerva.less

No longer needed:
* skins.minerva.content.styles/text.less
  Parsoid now uses <sup> tags for references rather than <span>,
  so the existing rules for <sup> tags are enough. See T45094,
  <https://www.mediawiki.org/wiki/Specs/HTML/1.6.0/Extensions/Cite>.

Was never needed:
* skins.minerva.content.styles/thumbnails.less
  The styles from the core module 'mediawiki.skinning.content.parsoid'
  are never loaded, so we don't need to override them.

Bug: T202978
Change-Id: I45e1cb89b65a41a29d2b1a361a79199745ccec14
2018-09-17 21:55:32 +00:00
jdlrobson 0dd4f1cb4d Hygiene: Load errorLogger earlier in stack
Follow up to I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc

Bug: T202026
Change-Id: I190417e90fd27b21844a20f96ec1237416c57079
2018-09-06 21:05:00 +00:00
jdlrobson cd528e120b Client side error reporting for Minerva+MobileFrontend
This adds a client side error logger that will store errors
in EventLogging. We will use it to get a sense of the number
of errors inside mobile.

To enable make use of the new configuration variable
wgMinervaErrorLogSamplingRate = 1

Notes:
* the optional `meta` field will not be utilised by the generic
error handler.
* URI length is not trimmed for title. We will consider whether we need
to make any adjustments to the schema values during roll out.
** For stack trace, we limit the length by removing errorUrl (which is logged
separately)

Testing:
Add throw new Error('asasasa'); anywhere in your code and make
sure the code executes. It should trigger an Error event provided
that configuration has been updated.

Bug: T202026
Change-Id: I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc
2018-08-30 14:35:27 -07:00
Jan Drewniak ae19031f8e Log sectionNumbers in PageIssues schema
Adds logging for the sectionNumbers field in the PageIssues schema.

Additional changes:
* createBanner now requires section number to be a string - this ensures
consistency with how these are used.
* fix a bug which meant createBanner was being called with undefined
section number (due to table of contents)
* Fix some indents in some JSDoc blocks
* Change parameter in function signature from mixed type (int or string)
to explicit string
* update schema number

Depends-On: Ia2696b86c6855d7b46a3f668585377d106d7af23
Bug: T202098
Change-Id: I20511a77258ea245f3d6fe93ade238e5df397a71
2018-08-27 18:02:51 +00:00
jdlrobson 40eca4e3f3 Hygiene: IssuesOverlay moved from MobileFrontend to Minerva
The CleanupOverlay is moved to Minerva and renamed the
IssuesOverlay to be consistent with current terminology

The new IssuesOverlay is defined inside the module
skins.minerva.scripts to which it now belongs.

Additional changes:
* various file renames
* overlay-cleanup renames overlay-issues
* cleanuptemplates renamed issues.js
* Add a test stub file to avoid the need to load templates inside
the test environment

After this change, I75f47622d94e504688e04dfb2892540473817053
should be merged to avoid confusion.

Change-Id: I08945a324a6b878abe56efed1e988466085b3018
2018-08-16 14:06:12 -07:00
jdlrobson 6718bc4351 Drop issues on editor
T196150 disabled the fallback editor when JavaScript is available.
As a result the code for page issues on the editor screen is redundant.
This simplifies our code.

The css rules relating to editor
issues are retained, given they simplify the editor screen for mobile
devices.

Bug: T196150
Change-Id: I76d586414cdd8de533bb891b87d1e0b7efc20a68
2018-08-16 11:43:28 -07:00
Jan Drewniak a0071643d3 Disable edit icon in read-only mode
When a wiki is in read-only mode, the edit icon on articles should
not open an editor. Instead, it should be in a "disabled" state and
inform the user that the wiki is in read-only mode
( i.e. show the "apierror-readonly" message).

Bug: T197497
Change-Id: Iee1414c20bea3ca936fb807820e58e5ed566d008
2018-08-15 19:40:09 +00:00
Stephen Niedzielski 22b2f0fd7c Hygiene: move page issues A/B test logging to file
Refactor the page issues A/B test logging implementation to a distinct
new file that only has the responsibility of tracking.

T191528 is referenced in this commit as I was having difficulty
answering the feedback and bugs reported in the current implementation
without working through and restructuring the flow as I understood it.
This refactor is merely a byproduct artifact of that effort to focus on
the parsing and presentation responsibilities.

Bug: T191528
Change-Id: If547a0a67fbc9a532f834fe374abf668309e73df
2018-08-14 20:49:06 +00:00
Jan Drewniak f67c410859 Page Issues AB test event-logging instrumentation
Uses `mw.trackSubscribe` to create an intermediary data handler
named `wikimedia.PageIssuesAB` which extends event-logging data
before passing it to the eventLogging through `wikimedia.event.PageIssues`.

Event hooks are placed where appropriate and the `CleanupOverlay`
class is extended to capture events from within the page issues
modal.

Additional changes:
* Merge two identical on click event handlers for
.edit-page, .edit-link elements
* change pageIssueParser.maxSeverity to accept an array of severity levels
instead of an array of pageIssues objects

Depends-On: Ic84e4a3286220407863167e0f57cef1b13a72964
Bug: T191532
Change-Id: I67fb6e448f6ecc97c89c1187e491ee05f7a312ef
2018-08-09 20:30:12 +00:00
jdlrobson 0ca42ee64e Hygiene: Separate cleanups library from initialisation
In order to write tests, we'd like to separate code without side
effects from code that executes it as part of setup.

This shuffles dependencies and makes page and overlayManager
parameters to the init function (injected dependencies)

Change-Id: I96808541d48be7869fed3bc30babb80866e139ec
2018-07-31 11:42:04 +00:00
Nicholas Ray 17749f6cc4 Add mediawiki.Uri as dependency for skins.minerva.editor
mw.Uri is being used in resources/skins.minerva.editor/init.js but was
not listed as a dependency for this module. Adding this as a dependency
will ensure mw.Uri is loaded before this script is executed and tries to
use mw.Uri.

Change-Id: Ib34ca9eb9ba91d4b446a164fde42eec7f8e92000
2018-07-27 09:44:11 -06:00
Bartosz Dziewoński f114f81d42 Remove fancy block info popups (move to MobileFrontend)
We only used them for registered users, but MobileFrontend's
EditorOverlay code can use them for anonymous users as well.

Remove code for looking up block details in wgMinervaUserBlockInfo,
now we only care whether the user is blocked at all to display a
different icon. MobileFrontend looks up the same information via API
already.

Remove unused message 'mobile-frontend-editor-blocked-info-loggedin',
it was only used by non-fancy popups, which were removed in favor of
the new ones in f51cf7db7b.

Bug: T193754
Bug: T198765
Depends-On: I80564c3e6e2d0f4d7eae754f206780fb4054f254
Change-Id: I64be24845b4fee76d6b4a8e481a218f2160fced6
2018-07-26 23:44:28 +02:00
jdlrobson a3efca1582 Remove unnecessary skins.minerva.base.styles
* truncated-text is only used in MainMenu, last modified bar,
 a few special pages
Making this a mixin and limiting it to mobile.startup skinStyles
and mobile.special.styles thus makes sense
* cloaked-element is only ever added by Skin.js in mobile.startup
* position-fixed is only ever added by Skin.js

Change-Id: Iaf7061e9dda87eb25c963f8a281175af08f358e5
2018-07-26 01:18:00 +00:00
Stephen Niedzielski 9a7ee86fc1 Update: remove the internal link icons
Bug: T190549
Change-Id: I87c55d26d36eead60c0137e244bdcc09f4239a76
2018-07-25 10:55:39 +08:00
jenkins-bot e6f5d0e754 Merge "Set some authors inside Minerva" 2018-07-24 20:12:11 +00:00
jenkins-bot 65728feb27 Merge "Don't ship 2 magnifying glass icons" 2018-07-24 18:14:19 +00:00
jdlrobson 775af007f0 Don't ship 2 magnifying glass icons
We already make use of the images 'name' key inside
skins.minerva.content.styles.images to define the full
CSS selector. We can use this approach to ship a single version of
the magnifying glass icon, rather than having 2 defined in both
skins.minerva.base.styles and skins.minerva.icons.images

Change-Id: Ie5ec06152c418c4aa1b620b3d0a904cc9517e5d0
2018-07-24 11:55:41 -06:00
jdlrobson 1046d23f5e Set some authors inside Minerva
Apologies in advance if any unintentional hurt feelings!
This is based on a git blame of the skins directory in
I985c4e3a88b59461d471945ccf74cd291db45a61 before the Minerva move
and consulting the extension.json of MobileFrontend.

I've listed anyone with over 100 commits to the MobileFrontend resources/
skins folder as an author.

The Readers Web Team as the current maintainers are listed first.

If you feel you should be listed as an author of this skin
as someone who has contributed more than 100 commits to the skin code
(not MobileFrontend code), apologies and please add yourself.

Change-Id: Ifffb07d1decb47a5e08b9c45c88ccf106f0797a1
2018-07-24 19:35:20 +08:00
Stephen Niedzielski d2f6c38fe7 Update: page issue icons
- Fix a bug where the all issues endpoint would incorrectly collect
  issues from all sections.

- Update the page issue iconography. This increases the size of the
  delivered code and images by 1743 B minified uncompressed according to
  mw.inspect() (from 16.4 KiB to 18.1 KiB).

- Add support for identifying page issue severity based on template CSS
  classes.

- For multiple issues templates, show the highest priority icon.

Bug: T191528
Change-Id: Ie0a4c83ec7cfb856ec581d058797109746e3cb99
2018-07-17 15:54:17 -05:00
jdlrobson dfc29032b5 Section issues overlay has different heading
Per https://phabricator.wikimedia.org/T197932#4417319
Note that given talk/category overlay does not use or
display section issues, to simplify things any section other
than 0 or all will use this heading.

Bug: T197932
Change-Id: I737fb07aaadcea7772d0b08f8b0652dcf2f4623d
2018-07-12 15:07:22 -07:00
jdlrobson 3d0587c63d Reduce render blocking styles by deferring loading of icons
Change-Id: I8fb3b03833a49ade1d62fe4ded1a0c723cbe8f28
Depends-On: Iee77655d4868a7d921be8cc23776a7859d9acf0c
Bug: T198930
2018-07-11 09:07:10 -07:00
Bartosz Dziewoński 10fa5f0c55 Remove unnecessary MinervaResourceLoaderParsedMessageModule
All of the uses are unnecessary or harmful:

* 'skins.minerva.toggling'
  This module has no messages, parsed or otherwise.

* 'skins.minerva.editor'
  * 'mobile-frontend-editor-redlink-explain'
    This message has no formatting to be parsed. In the past, it
    included the '{{SITENAME}}' magic word, which is still present
    in some translations, but it is supported by the client-side
    jqueryMsg parser anyway.

  * 'mobile-frontend-editor-blocked-info-loggedin'
    This message only uses '{{GENDER}}', which is supported by
    the client-side jqueryMsg parser. More importantly, it uses
    a parameter for it, which is actually not supported by
    MinervaResourceLoaderParsedMessageModule. The message would
    always use the default gender, regardless of the parameter.

Change-Id: I0c597febf9051670228dd144b53521a121f3a220
2018-07-10 02:29:33 +02:00
jdlrobson 9164b9154f External link icons should use defaultColor
Depends-On: I0745e112d11026ed59d8daca990b313305cd094a
Bug: T197909
Change-Id: Ic00b77e789b487d626f497d99197649c04bd6427
2018-06-27 21:21:19 +00:00
jenkins-bot 6037e61bc9 Merge "Revert "Suppress display of wikitext editor on action=edit"" 2018-06-22 19:23:37 +00:00
Bartosz Dziewoński 645ffa46f8 Revert "Suppress display of wikitext editor on action=edit"
This reverts commit b8c0e4ff30.

Bug: T196915
Bug: T197834
Change-Id: I875854ab65f8b76929285938d2dbaa996caf3546
2018-06-22 19:11:13 +00:00
jenkins-bot f75590a85b Merge "Update: link icons for standard density displays and CSS" 2018-06-21 22:42:47 +00:00
Stephen Niedzielski 5d938aa9e8 Update: link icons for standard density displays and CSS
The previous lot of link icons look great on high DPI displays but not
as nice as they could on standard resolution displays. According to
Volker, this is because the SVG paths must appear on integer coordinates
and scale up instead of down. The new assets have been designed with
this consideration in mind.

Also, workaround redundant CSS by adding commenting out the "unvaried"
black SVG background-image selector, selectorWithoutVariant.

Bug: T190549
Bug: T197909
Change-Id: Id341d383018a436401541e82cc75d826688eaaae
2018-06-21 17:11:46 -05:00
jenkins-bot d5cd6950b0 Merge "Suppress display of wikitext editor on action=edit" 2018-06-20 09:45:57 +00:00
jenkins-bot 041eaadcb5 Merge "Mobile page issues - visual styling changes" 2018-06-19 22:13:31 +00:00
jdlrobson a231525112 Mobile page issues - visual styling changes
Changes:
* Introduce Jan's beautifully documented $wgMinervaABSamplingRate
Set to 1 to A/B test 50% of the population
* Split out ambox template styles into a separate file referenced
by hacks.less
* Update cleanuptemplates setup script to consider two buckets

Test pages:
* Shqiponja_Partizane
* World_War_II_in_Albania
* Liberation_of_Tirana
* French_Consulate
* Abd_ar-Rahman_IV
* M109_howitzer
* Aimoin
* Transport_in_Brazil
* Transport_in_Cape_Verde

Bug: T191303
Change-Id: I8d11e655ccb847b7999e64dda57b225ad8b1c23a
2018-06-19 14:11:19 -07:00
jenkins-bot 927b1bddd2 Merge "Force type Language for $lang of doEditSectionLink" 2018-06-18 01:14:35 +00:00
Stephen Niedzielski 3485269be1 Update: add internal and revise external link icons
Bug: T190549
Change-Id: Iad7fdc2f2a730fa8874487c0d83355f21a0bf7ea
2018-06-15 12:31:42 -05:00
Fomafix 152f48b846 Force type Language for $lang of doEditSectionLink
wfGetLangObj() is not necessary anymore.

This change increases the requirement to MediaWiki 1.32 or higher.

Depends-On: Id49201957e716ef8a2ea930b3616ca4fe6e35633
Change-Id: I18adeebe476b321546ceda43eb12b6cf7e8081b3
2018-06-14 23:36:39 +00:00
David Lynch b8c0e4ff30 Suppress display of wikitext editor on action=edit
As I6c7e3443756fd72749964d1eda37e3d123b201b3 gives full-page editing on
action=edit, suppress the display of the original wikitext editor so there's
not a flash of a different editor before the overlay appears. Provide a
fallback so that in cases of no-JS the wikitext editor can still be reached.

Bug: T196915
Change-Id: I7dd3de984ead4d70e977e5607bb07606d341db54
2018-06-14 11:57:18 -05:00
Jan Drewniak 7617174d40 A/B test bucketing wrapper for page issues AB.
Provides a class that initiates AB-test bucketing and registers
as a MF module. Activates the reading depth test for users who are bucketed
in either buckets "A" or "B".

Does not add event-logging or visual style changes for page issues AB test.

Bug: T193584
Change-Id: If8504a35059c6d1b056cef063a595b1c2ffd351a
2018-06-13 15:43:08 -07:00
Timo Tijhof 64134bd8a6 Remove minerva.less from global import path
Use local imports instead given all relevant files are within the
same repository, and don't vary by configuraion.

Bug: T140807
Depends-On: If3edac9a35b346af0320c12f70c0d978a6346201
Change-Id: Ife3cc345a63aff452e93accbe0a593fbaa358732
2018-05-29 12:19:00 +00:00
Timo Tijhof 91a3adacb7 Move remaining Minerva skinStyles from MobileFrontend
To be removed in MobileFrontend by If3edac9a35b346a.

Bug: T140807
Change-Id: Ifb073d1e67602b80e0e9b45f338806f5b9cb675b
2018-05-29 09:30:48 +00:00
jdlrobson f7e8df65b2 Merge profile icon with user-avatar icon
Both are the same but different variants - so use the variants
ResourceLoader module to keep this modules consistent in color
and form.

Change-Id: Ib75e1ff741fa46ad9698e89c4433b6edbad4d376
2018-05-08 23:35:44 +00:00
David Barratt f51cf7db7b
Use a Drawer for Block Notices
When a user is blocked, the toast message provides insufficent information to
the user. To provide more information, as well as a better design, the block
message will be moved into a drawer.

Bug: T165535
Change-Id: Ib025db3a8a4d1fd7bd05b69f9b5326943288372f
Depends-On: I926918d0bd7f2176f188a2154dc5e99f6a8a7ad1
2018-05-08 13:20:00 -04:00
Kunal Mehta e07e5103a4 Move skin metadata keys to top of skin.json
The keys that form the credits (name/description/url/etc.) are usually
on top, and manifest_version is typically on the bottom.

Change-Id: I1767b1e176c9cf892c1f627db4f5891fa6aade18
2018-05-07 18:19:40 -07:00
jenkins-bot f11c4e44f5 Merge "Restrict gallery styles to only pages which need it" 2018-04-20 21:19:57 +00:00
Kunal Mehta 9fc58af509 Get rid of ICustomizableSkin
As far as I can tell this interface is entirely unused.

Change-Id: I9f2ff27ab0e7f9f1e842d5e073eed5d9428f3cda
2018-04-20 00:22:48 +00:00
Kunal Mehta 90ed6468e2 Split MenuEntry to its own file
Change-Id: I2114141bf8f6d67671e063fae8c44044184688bd
2018-04-19 23:16:55 +00:00
Kunal Mehta 1b1c56c862 Fix some file names to match their class names
Change-Id: Ib1a12f8073a2d737c40c0b4d1dd64f9e55738019
2018-04-15 16:12:45 -07:00
jdlrobson 1f7de003ef Restrict gallery styles to only pages which need it
The mediawiki.page.gallery.styles module is only loaded
when needed, yet inside hacks.less we load gallery
styles unconditionally.

The hacks.less file is also only meant for css that overrides
template styles, so it didn't belong there anyway.

Change-Id: I4afc91ad7f67ae66544708d25541b3e8dd247873
2018-04-13 17:26:46 -07:00
jdlrobson 86238c64c2 Restore last modified active link color
In I7abdbac4d2d16b931e2b110fcebf0dfc82146753 I accidentally
removed the active link color (I meant to /move/ it from the
critical path since it requires JavaScript)

Change-Id: Ie86c3c9d03a0ed130a86c50bb548c9b47db6def6
2018-04-13 10:19:31 -07:00
jdlrobson 5036c91e04 Hygiene: No need for un-prefixed icons any more
These were added in I93264024f4915fc910c792b1905b89cdc6b8b546
for cached HTML but are no longer needed.

Change-Id: I008856c0c5e26270ed82d02a5413576495920bac
2018-04-12 12:01:04 -05:00
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