Commit Graph

367 Commits

Author SHA1 Message Date
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
jenkins-bot 90629a0578 Merge "Move canEdit checks to server from client" 2018-11-09 22:07:47 +00:00
arcayn c64a4cf811 Move canEdit checks to server from client
Bug: T206262
Change-Id: I08bfc56998f4fb42c8ce76cc2ad9fba83106d476
2018-11-09 21:26:49 +00:00
Bartosz Dziewoński d27a9481bc skins.minerva.editor: Remove remaining uses of 'skins.minerva.scripts'
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
2018-11-08 16:17:21 +01:00
Bartosz Dziewoński 7bbba14ee1 skins.minerva.scripts/init: Use singleton OverlayManager from MF
Bug: T198765
Depends-On: Ie83846e7dfabe302006d0979f2f21913839e1795
Change-Id: I9c07863ab9c68886d6c5b5f09756e034a4d96477
2018-11-08 16:14:40 +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 bc303e50cc Fix invalid HTML produced by DownloadIcon
Depends-On: I549e15f8a3352761e4960abdaaef6cd4bfb133e6
Bug: T205359
Change-Id: Id67b8a6591a8dec92d1c577851661c65973d593f
2018-11-06 12:42:58 -08:00
Bjornskjald 8f1cfa4b81
Add showing toast/drawer when visiting protected article with editor link
Bug: T205630
Change-Id: I0c25f491c894d12775d236ecc9250bfdad17a13b
2018-11-03 18:39:11 +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
jdlrobson 5ad1a0ff5a Article width should not be full screen
Follow up to I5fb67f4abd7aee1fce41e60fe24e8fd6b45e5146 which
incorrectly set a min-width not a max-width.

Bug: T193061
Change-Id: I385061ea47a4dbf011eec2582594f94a4749f713
2018-10-31 11:20:53 -07:00
Goomel e300213128 Ensure there are page margins for 1000px viewports
Bug: T193061
Change-Id: I5fb67f4abd7aee1fce41e60fe24e8fd6b45e5146
2018-10-26 15:37:06 +00:00
jenkins-bot a79a0276bd Merge "Add "Discussion" button to Main page on Mobile View" 2018-10-23 20:18:50 +00:00
jenkins-bot 5a4d8daa32 Merge "Cleanup unused page actions CSS" 2018-10-23 20:09:41 +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 cb2ad9374e extract moved to parser
The extractMessage function has a lot to do with parsing - so this
and its tests are moved into the pageIssuesParser.

Change-Id: I62d79fbba166eff2c3ca573ef94ff86a269a7f9a
2018-10-23 12:17:45 -07:00
jdlrobson 878989bd85 Merge PageIssue and IssueSummary type defs
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
2018-10-23 12:10:22 -07:00
Alangi Derick a2fd0b3c1f Add "Discussion" button to Main page on Mobile View
* 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
2018-10-23 19:59:22 +01:00
jdlrobson 1fd84e123f Remove wikimedia.event.ReadingDepthSchema.enable track call
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
2018-10-23 11:10:53 -07:00
jdlrobson 13aeb1e8f5 Merge remote-tracking branch 'origin/master' into HEAD
Change-Id: I2b15e07932e4fe8b2a49fa87bb6136a3b50b7786
2018-10-22 16:20:33 -07:00
jdlrobson 1326f7be69 Cleanup unused page actions CSS
Depends-On: I06ef42cb1461fde7ca0aa903f174c3b1f39ab154
Bug: T196893
Change-Id: Iccde86c7acc0bd66bbad9a9fdc0fdf172576f872
2018-10-22 17:39:25 +00:00
jdlrobson 088faeaf08 WikimediaEvents hook was renamed
Depends-On: I1af710c1211131b3936bfa8582ead8f9c0dab77b
Bug: T207423
Change-Id: Ib267a0b944c68f00e21cd733a68abf12667339cd
2018-10-22 17:39:08 +00:00
jdlrobson aa6a2dda4c Watchstar is accessible to non-js users
Bug: T196893
Change-Id: I5dbd164ba68e6c74e80f8bcf90819a526cda5a5e
2018-10-19 11:00:19 -07:00
jenkins-bot 11d6b26093 Merge "Update 'edit' icon to standard" 2018-10-17 22:31:04 +00:00
Volker E 576c7b38a7 Update 'edit' icon to standard
Bug: T207190
Change-Id: Iffaff60f213ad037f826c960da1d876fb923916a
2018-10-17 13:11:53 -07:00
Volker E 4496292268 Hygiene: Remove 'blockquotes.less' in print and screen
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
2018-10-17 08:25:30 -07:00
Stephen Niedzielski f07985c6de Hygiene: move page issue group parsing to parser
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
2018-10-16 18:20:38 +00: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
jenkins-bot e2b4c024c7 Merge "Update user avatar to latest, slightly overhauled iteration" 2018-10-11 22:21:12 +00:00
jenkins-bot 5d4ad087c1 Merge "Remove code related to no-anonymous-editing mode of MobileFrontend" 2018-10-11 20:27:33 +00:00
Ed Sanders 59c45c2b6d Reduce specificity of wikitable overrides
Bug: T205945
Change-Id: I88d5b9699661005144f3eebc804438afaae373aa
2018-10-11 14:38:07 +01:00
Volker E 8793739b23 Update user avatar to latest, slightly overhauled iteration
Bug: T123810
Change-Id: Ia9c9db52c71135b75125af1cde7e21985df7af64
2018-10-10 17:34:09 -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
jenkins-bot e56b91f9b6 Merge "Enable Dynamic Type in iOS 9+ browsers" 2018-10-09 19:33:30 +00:00
jdlrobson 07a3b81c91 Errors can be counted in statsv
Bug: T205582
Change-Id: I8f67b8356ac271872cac39a416ffefce47959177
2018-10-08 15:05:56 -07:00
Nicholas Ray c1485615bb Enable Dynamic Type in iOS 9+ browsers
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
2018-10-08 20:20:44 +00:00
jdlrobson 5afe8abdce Remove unused categories property
This is not used by the CategoryOverlay

Bug: T206337
Change-Id: Icc19fe24fbb30db8b76d462bfba8879ff112226a
2018-10-08 08:45:35 -06:00
jenkins-bot 57cb5f8e41 Merge "Make Minerva section editing more like other skins" 2018-10-04 21:26:03 +00:00
jenkins-bot 5d4e3e01aa Merge "Move edit link enabling/disabling out of skins.minerva.editor" 2018-10-04 21:22:56 +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
Bartosz Dziewoński 53a80e1bcc Move edit link enabling/disabling out of skins.minerva.editor
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
2018-10-04 14:03:19 -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
Stephen Niedzielski 77646a40c3 Hygiene: inline util.noop
Replace mobile.startup/util.noop with inlined implementation,
`function() {}`, to reduce indirect dependencies on jQuery (.noop).

Change-Id: I48368ef6cf03fd67e117c9bf8612bbddb7d250c5
2018-10-01 12:54:52 -06: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
Bartosz Dziewoński ffa4d0e848 Remove some useless code trying to show things that are always visible
* 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
2018-09-25 22:01:24 +00:00
Bartosz Dziewoński a773c0eed2 Allow mobile TOC on pages in all namespaces
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
2018-09-25 11:49:25 +02:00