Use CtaDrawer.options.events when available instead of CtaDrawer.events.
Change-Id: I7cf5d97bef9179dfa148fa4d5ca447d128031b57
Related: I4a4129b2cac7c7c49559beef0b8780f3211edf9c
Bug: T210870
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
Instead of having one large `createBanner` function, breaks down
that responsibility into three smaller functions:
- createPageIssueBanner
- createPageIssueBannerMultiple
- createPageIssueNotice
These functions represent issues in the new treatment, the
multiple-issues template, and the old treatment.
createBanner now delegates the creation of these banner types to these
new functions.
A new property to PageSummary, $el, has also been added. This allows us
to manipulate the issues DOM via the PageSummary object, instead of using
the `$metadata` variable in createBanner.
This approach to the page-issues DOM also solves the problem of
wrong or missing icons in T202349.
Bug: T211257, T202349
Change-Id: I50a2d8e3ae94913dc060ceedaaf1fa7e1756617f
This patch removes the remaining usages of M.on/M.off/M.emit
(functionality derived from moduleLoader.js in MobileFrontend) in
Minerva and continues the work of
Id990b0e1a53221d5c1cb3e3012aed0e27d801fc2 (patch for MobileFrontend).
This patch and the patch for MobileFrontend should be merged together as
they both depend on eachother.
Depends-On: Id990b0e1a53221d5c1cb3e3012aed0e27d801fc2
Bug: T156186
Change-Id: I005d2fcdbf91c2f1ac98178dfa388aa8174e7530
You can test this against the beta cluster using
$wgMFMwApiContentProviderBaseUri = "https://en.wikipedia.beta.wmflabs.org/w/api.php";
Bug: T206177
Change-Id: Ic2e6859443ed5aa2a3f97218f4c89df2a46000f9
* 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
This replicates the behavior of the MultimediaViewer on the
desktop when using the mobile page with a desktop browser.
But we have to be careful that this change don't break
other extensions or functions of the skin.
Bug: T206348
Change-Id: Ib4b928eae136d781782dc96e82d653806587292b
Account for the fact that many wikis use `mbox-text-div` rather
than `mbox-text-span` and that the element might not be display
block/inline block
Bug: T206887
Change-Id: I6b3cee4339fc7ddb035a99fb4929b1ab67f22333
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
The extractMessage function has a lot to do with parsing - so this
and its tests are moved into the pageIssuesParser.
Change-Id: I62d79fbba166eff2c3ca573ef94ff86a269a7f9a
We have two type defs - IssueSummary and PageIssue.
I'd like to consolidate these two types by making
IssueSummary a combination of the two
Change-Id: Ic831b463fa66b0cacdd0b9b79aff741e55c0ec24
This will send an event to a non-existent schema:
ReadingDepthSchema.enable
This was mistakedly kept for backwards compatibility.
It should have been kept for trackSubscribe not track.
The damage is done, so we should just remove this to get
error rates down to a comfortable rate again.
Bug: T207423
Change-Id: Ibb5cc2dd9b486c921aab5f8830e837f813683482
Separate the page issue grouping concern so that changes to parsing
don't concern everything else and vice-versa.
Bug: T203449, T202349
Change-Id: I7bddb0c53310805ece71b8f7821b1d6ce05cfae9
These CSS classes are specific to the Minerva skin and we want to move
this file to MobileFrontend.
Now that this code is all in one place, I noticed that it seems to not
do much at all… Everything in this function looks like it could just
be done in the PHP code. If PHP does it all, then we could remove all
of it for a free performance improvement.
Bug: T198765
Change-Id: I6487c2fc520e14e0856b2e9a6f9dfa5066205817
It was limited to the main namespace since its introduction in
Ieabe8f7071696cde6afbdc6df853aacdb741a4a3. Unfortunately that
commit does not explain the reason.
It should be shown e.g. on user pages (so that sandbox pages
look like the real article) or on project pages (many policy
or help pages on Wikipedia are long and would benefit from it).
It looks like some of the CSS code already assumed that the
TOC would be shown in all namespaces (space for it was reserved
using a 'visibility: hidden;' element on all pages).
Bug: T205312
Change-Id: Id6935f5a7a3701c1c7a38fb37b48b6a3bbc80393
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
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
This event is meant to track attempts to edit the page we are on,
but also happened to catch clicks on "see talk page" links, in
case that talk page doesn't exist yet.
Bug: T204073
Change-Id: I1a471f81cc9390fc9e8665a7a336cf2dd7a063ab
The page-issues reducer function that retrieves the severityLevels
for issues was incorrectly comparing two values in the multiple-issues
scenario.
Instead of comparing the severity of the current issue with the previous
value in the accumulator, it was comparing the current issue with the
previous issue in the original array, thus ignoring the
previous `maxSeverity` value in the accumulator.
Tests added and function refactored with more explicit variable names.
Bug: T203725
Change-Id: Ia4c15cbf0c2457d68a7381e8ed04c1a6b3ae65d1
Erroneously in I6fd55c35b9e2ce35894259f36d1a50fb5dca5e43 for the old treatment
we sent sectionNumbers for all issues in the page.
This is inconsistent with the issuesSeverity field above it
Add a clarifying inline comment.
Bug: T203050
Change-Id: Ib1fcda0c49a162cd7aca8ee8b3221236f724e1d7
Rather than using err and error as variable, use error for consistency
Follow up to I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc
Bug: T202026
Change-Id: I54165ff1f1b17284d8232c491244e1a98950d5e2
createBanner was incorrectly always assigning the 'all' keyword
to the old page issues banner. Instead it should use the section
number in the function signature - as this decision of which issues
to show is made inside initPageIssues
For the old treatment, in the main namespace, we only show issues
in the lead section. When we use the 'all' keyword the visual is
the same, but it breaks the instrumentation requirement that
sectionNumbers and issuesSeverity should be the correct length
Note, for the talk and category pages treatment, we do not
log any events so the instrumentation doesn't matter here
and the 'all' keyword correctly targets all issues in the page
as before.
Bug: T203050
Change-Id: I63e45da05ca033fe282633f7fd59038a8e5d8c8d
For the page-issues modalClose event, the number of values for `sectionNumbers`
and `issuesSeverity` should be the same, since `sectionNumbers` should describe
the the section of each visible issue in the modal, not the section of the
modal itself.
Bug: T203050
Change-Id: Ic58c5940a6059e71aa3aeed26232afbe8faf1618
When handling special cases that are logically distinct from
the function's main branch, it improves code quality (through
readability and maintainability) to place those first and with
an early return.
The has the benefit of the main return statement being easy to
find at the end of the function. (Not early and/or in a block).
It also means when working on the code, there is generally a
less complexity and fewer nesting levels, given that most code
is in the main branch. This makes is easier and quicker to verify
that code does what it should, as well as making it easy to
extend in the future. When considering to add code to end of a
function's main scope, it should relate to the function's main
branch by default, not a special case. For example, a getName()
method should not end with a top-level statement 'return false'
(unless it is a stub). Rather, one would expect it to end with
`return name`.
Change-Id: I1f3088f2409c82dd3bf757fc8fa27dc97ae2767b