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
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
We want to remove dependencies on Minerva code from this file to move
it to MobileFrontend.
* Use 'mobile.init/skin' instead of 'skins.minerva.scripts/skin'.
* Use 'mobile.startup/OverlayManager' and #getSingleton
instead of 'skins.minerva.scripts/overlayManager'.
Both of them are just aliases for modules defined in MobileFrontend.
Bug: T198765
Change-Id: Id017dd4b6d1fe31a735613f991721c4dddafbde9
Follow up to I5fb67f4abd7aee1fce41e60fe24e8fd6b45e5146 which
incorrectly set a min-width not a max-width.
Bug: T193061
Change-Id: I385061ea47a4dbf011eec2582594f94a4749f713
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
* Enable discussion button on main page in mobile view so users
can view discussion topics related to the main page on mobile.
* Update test to make sure only 'talk' and 'switch-language' actions are
enabled on the main page and 'edit' and 'watch' are disabled on the main
page.
* Minor typo fix for doc type. Use "array" instead of "Array" and CSS
alignment fix issue with Discussion button when displayed together with
Language selector button.
* [Suggested by: @Jdlrobson] Use a generic "a" CSS selector to style the ".talk"
and ".language-selector" classes on the main page. This also avoids fixing the
CSS for future buttons if added (future proofing the code), so if any other
button is added in the future, the same css rule will be applied to it at once.
Very wise idea from @Jdlrobson, thanks!
Bug: T206406
Change-Id: Iedce84595adc357f3a707f8b94d23b2ffea3476c
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
There's no reason to have this as separate style file in content.styles
as common text styles are taken care of in 'text.less' and
'print/articles.less' for print. Moving contents rule there.
Change-Id: Ie613d95488e9b5a814b6be8f0c856e9e92ab5aed
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
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
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
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
Dynamic Type is a feature in iOS that lets users pick their reading size
so that apps can adjust their text size accordingly. This commit makes
the mobile site hook into that feature. If you go to
settings > Accessibility > Larger Text in iOS and increase or decrease
the reading size, the mobile site will now increase / decrease
its text size relative to that setting.
Notable changes:
* Moved `font-size: 100% * @fontScalingFactor` from html to body. This
rule would override Dynamic Type sizing which would effectively disable
it. Moving it to the body makes the rule be relative to Dynamic Type
instead of overriding it in iOS browsers while browsers that don't
support Dynamic Type should observe no visible changes.
* Removed intermediate variable @bodyLineHeight because it was only
being used in one place.
* Added @font-size-body-mobile and made it based on % instead of em
(which is what @font-size-body uses). @font-size-mobile-bod is used by a
media query in browsers that support Dynamic Type and by another media
query in browsers that don't support Dynamic Type.
* Added a feature query for Dynamic Type which will make Dynamic Type CSS
rules only affect browsers that support Dynamic Type. This limits the
feature to iOS 9+ feature but ensures that the css rules don't affect
browsers that don't support Dynamic Type.
* Scaled down Dynamic Type so that its default size would appear
identical to the common browser default text size of 16px. By not doing
this, the default font size in iOS browsers would be 17px (Dynamic
Type's default) and would appear 1px larger than Android browsers.
Bug: T204807
Change-Id: I8a4d621dba8dc56190bd8c974543d08dd374ba5e
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
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
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
* Page edit action (#ca-edit)
I guess it became always visible when no-JS editing was implemented?
* User page creation CTA (.edit-link)
I'm making it always visible in Ie2fc6d43ebc03626517eec21bf4738dca05152d0
(which also makes it available for no-JS editing).
* Section edit links for nested sub-sections (.in-block > .edit-page)
No idea about these, but they are clearly always shown (even in
non-article namespaces).
Depends-On: Ie2fc6d43ebc03626517eec21bf4738dca05152d0
Change-Id: I226cb1fd1e716078a4a34ed8349d5304428964cf
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
This code could never be used under normal circumstances since
a crucial bit of it was removed from MobileFrontend in 2015:
(I65e943b6dad8bfea994020f9f555bd095da1a171)
// Allow us to distinguish sign ups from the left nav to logins.
// This allows us to show them an edit tutorial when they return to the page.
if ( $query['returntoquery'] === 'welcome=yes' ) {
$query['returntoquery'] = 'campaign=leftNavSignup';
}
…and honestly, that's for good, because it fails horribly
when triggered by adding &campaign=leftNavSignup to the URL
manually: clicking "Start editing" in the callout navigates
you to an article called "Undefined/leftNavSignup".
Bug: T205325
Change-Id: I0e385488be5b2eaa7d489029b91e18b336c0d133
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
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
This exposes two broken tests:
* #setCount (Eastern Arabic numerals)
* clicking on the product of createBanner() should trigger a custom event
that were previously passing due to buggy assertions.
Change-Id: If18ad1ff9363fff65d3e347c01ce4bc0669b2a0e
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
Extensions may be using these tags and not want
these styles (especially the border).
Bug: T203474
Change-Id: I03a22cf6377002f968cabdcce9354e73354fb6b8
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
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
"multiple issues" templates as one issue.
When logging the `issuesSeverity` and `sectionNumbers` field,
any issues that are part of a "multiple issues" template only send
one value.
Adds an `isMultiple` property to IssueSummary to determine which
issues are part of a multiple-issues template.
Bug: T203050
Change-Id: I7d55dfead72439df4accadcdc8623a080e1321c2
The value of `sectionNumbers` should be the section number of each issue
Not the number of the sections that have issues.
Bug: T203050
Change-Id: I6fd55c35b9e2ce35894259f36d1a50fb5dca5e43
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
An event only needs to send this field when overriding the
default. This line is thus unnecessary.
Change-Id: Ia1dfcac5dd25f36f5f4169daf6535fd66aedf754
Previously, the main edit icon in the page actions was handled indirectly
by changing the URL and then routing the edit via detecting the hash
fragment has changed. On the other hand section edit links were hijacked
via a click handler. The latter is better as it doesn't modify the DOM,
which allows the editor to override the JavaScript behaviour. It's also
preferable as it doesn't interfere with EventLogging - this subtle difference
was supressing edits to the Edit and PageIssues schema.
Bug: T202786
Change-Id: I4175bc6f0ddda28397d185502d1839716d051c56
Previously, the image overlay would always be loaded asynchronously.
Given clicking left/right opens a new mediaviewer this left a jarring
white flash. By loading the image overlay synchronously after the first
has been loaded, we avoid this flash.
Note, the task does propose preloading and animating the images
but this is a much bigger change and deemed out of scope for this
particular task.
Additional change:
* Use a shared mw.Api instance for ImageOverlay and PageGateway
Bug: T197110
Change-Id: I28d06b34cdea4fedcd7fb754572191e904ecc81a
When unable to edit, the edit icon at the top of the page serves
as the indicator that this is the case. In case of section edits
we hide them.
Bug: T197497
Change-Id: I23f196602ad64051426baf5090f0a6d6be941de8
Setting width to auto on the ambox itself will ensure section
issues are not pushed below infoboxes, while ensuring that due
to the tbody width 100% rule that they will take up full screen
where possible.
Bug: T202512
Change-Id: I2dd82f18f80012bd95ca271b97a163de918110c5
This patch updates the various usages of $.Deferred for loading
overlays in routes to be ES6 Promise compatible
Bug: T188937
Change-Id: I3fc24bf3471a99e7671d1191bdd46cb741286ee1
Move page issue overlay specific code out of cleanuptemplates and into
PageIssueOverlay to clarify what code is specific to the page issues
modal screen and what's specific to the page itself.
Bug: T191528
Change-Id: I95821ccda84306ddd5d22b57ffbae8d13ca44408