Commit Graph

173 Commits

Author SHA1 Message Date
jdlrobson 8cf642aa00 Drop usage of mobile.ajax.styles
From now on we'll make use of ConfirmEdit's styles.

Depends-On: Ic3a8c2cfce92659d5efc4da8799613afba544cea
Bug: T213775
Change-Id: I0a602a20178998ae997b6e5498b6548610936acd
2019-01-16 01:48:42 +00:00
jenkins-bot b06a079a81 Merge "Move HTML construction to Minerva template and simplify" 2019-01-15 15:09:01 +00:00
jdlrobson 41b59d4a2b Move HTML construction to Minerva template and simplify
Right now the HTML construction is split between MinervaTemplate
and minerva.mustache

I'd like to move all of this to mustache to make it easier to see
how to make changes.

Additional changes:
* footer-site-heading-html was previously mapped to headinghtml
The template variable has been renamed to avoid confusion.

Change-Id: I1dfe15f6f74b51b152c206e2ea63ae460d704ab6
2019-01-14 15:27:55 -08:00
zoranzoki21 5404c85e86 Fix transcuded typo
Bug: T201491
Change-Id: I705b20bc1fd8bc014c614521dc54de69fc300b26
2019-01-13 13:10:48 +00:00
jenkins-bot 19cf51602e Merge "Hygiene: Simplify Nearby menu item registration" 2019-01-04 18:00:53 +00:00
jdlrobson d8a8410a8d Hygiene: Simplify Nearby menu item registration
The Special:Nearby page is only available if wgMFNearby is
enabled so the first 2 checks are identical.

If the page is enabled, we should be able to assume the
sysop knows what they are doing and avoid all  these
unnecessary checks. It seems foolish to also check the
existence of Geodata or a NearbyEndpoint

Additional change:
* Don't use deprecated SpecialPageFactory. Use the service
instead.

Change-Id: I3a4b8fa55fc7f29c90f7173d1d973d5f4f759a6b
2019-01-04 09:13:19 -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
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
jenkins-bot 5a2cfe3623 Merge "Remove 'skins.minerva.editor' module (moved to MobileFrontend)" 2018-11-14 23:37:31 +00:00
Bjornskjald dc61408a59
Add checking if template should output <sup>β</sup>
Bug: T208185
Change-Id: I4d564d9398947ea650b935b42cf79ef4a36d1b7e
2018-11-14 21:39:26 +01: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
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
jenkins-bot 65b00b4a41 Merge "Merge remote-tracking branch 'gerrit/page-issues-cleanup'" 2018-11-09 01:11:10 +00: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
jdlrobson dabb909887 No Minerva variables should be loaded on a non-Minerva skin
Bug: T186062
Change-Id: I13c2ca804e92bc2ab839b370de48299c2ccd474f
2018-11-07 11:04:00 -08:00
jenkins-bot 69eddce6be Merge "Disable mobile editor (skins.minerva.editor) on desktop" 2018-11-05 22:11:12 +00:00
jdlrobson 6a73c395f1 Don't ship wgMFDescription if you're not using it
There are no occurances in the codebase using this description
so do not include it.

Bug: T186062
Change-Id: Icd06329af2756d3fcd143deab528e6a7c7d56d30
2018-11-01 18:58:49 +00:00
Volker E b4287378fd Provide ARIA label on main search input
Bug: T208290
Change-Id: I594ab47ffcba3596e52f02a751eaed6084db207b
2018-10-29 22:21:27 -07:00
Bartosz Dziewoński d57f8290c3 Disable mobile editor (skins.minerva.editor) on desktop
This module is no longer necessary to allow editing pages in the
Minerva skin. When it is not loaded, the normal desktop editor will
be used instead (that may be WikiEditor, VisualEditor, just the plain
textarea from MediaWiki core, or something else).

Bug: T198765
Bug: T208068
Change-Id: I1eb9d4b4bc937522e527dbdc0d6be82baf3b7413
2018-10-30 03:46:13 +01:00
jenkins-bot 6cf66a2ad8 Merge "Revert "`autocomplete` is not necessary on `search` input types"" 2018-10-30 00:15:05 +00:00
Jdlrobson b71e36313f Revert "`autocomplete` is not necessary on `search` input types"
This reverts commit 05fd384803.

Looks like it is needed.  On android i am now seeing autocomplete unexpectedly...

Change-Id: I9c4476346c183d6dcc9e25965530f3e2478ed88f
2018-10-27 06:03:00 +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 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
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 aa6a2dda4c Watchstar is accessible to non-js users
Bug: T196893
Change-Id: I5dbd164ba68e6c74e80f8bcf90819a526cda5a5e
2018-10-19 11:00:19 -07:00
Fomafix 133e806865 Force type Language for $lang of doEditSectionLink
Also make the parameter $tooltip mandatory to ensure that a mandatory
parameter does follow an optional parameter. ParserOutput always fill
all parameters of doEditSectionLink.

Bug: T207413
Depends-On: Ic49d76c7d9357f99b462471696f7e1eb86e70e3d
Change-Id: I49c1e3fb7bf72002c7f498d4afe14a06caf411f8
2018-10-18 22:13:29 +02:00
jenkins-bot 26e29baf8d Merge "Show watchlist to non-JS users of Minerva" 2018-10-15 09:16:01 +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 5d4ad087c1 Merge "Remove code related to no-anonymous-editing mode of MobileFrontend" 2018-10-11 20:27:33 +00:00
jdlrobson 3f674008a3 Show watchlist to non-JS users of Minerva
Bug: T196893
Change-Id: Ibd52079d3862854c9c88dae87501b0d42ae99716
2018-10-10 14:08:59 -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
Volker E 05fd384803 `autocomplete` is not necessary on `search` input types
Attribute doesn't provide any functionality on `type="search"`.

Change-Id: Ibf571b100155defa7188354f85586ea6d31dc720
2018-10-09 03:45:31 +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
jdlrobson 87924e7e25 Add `theme-color` meta tag to Minerva
For non-web-apps we can still control the color of the address and
status bar. Currently this is defined in MobileFrontend)
but is configurable if we ever want to change it. If not defined
(e.g. no MobileFrontend/no config) it is not added.

Bug: T204691
Depends-On: I39c0905f86edc4f52235b905850c31257e7f792e
Change-Id: I3ab0f538fb6ae3332574fd212eea1a7ec6a397bd
2018-10-01 14:25:25 +00:00
Piotr Miazga 71cbed60fb Create $returntoquery variable properly
The $returntoquery variable is created only when request wasn't
posted, but the variable can be accessed on POSTed request.
To fix that issue we need to always define $returntoquery as
an empty array. This is done in order to prevent leak of
any sensitive data sent by POST request.

The sample error from fatalmonitor:
Undefined variable: returntoquery in
skins/MinervaNeue/includes/skins/SkinMinerva.php on line 701

Bug: T205449
Change-Id: I20e5955ddcb99c110a3dc03fb3b56c1904601453
2018-09-26 15:36:44 +02:00
Piotr Miazga 8c587c58c9 Fix broken config name for MinervaABSamplingRate
Bug: T205355
Change-Id: I983866f177c4ea994954f5236b2820a7f0b8b661
2018-09-25 14:45:51 +02:00
jenkins-bot 5596488f9d Merge "Minerva A/B tests are not subject to HTML caching time" 2018-09-25 09:32:35 +00:00
jdlrobson 58c0b8131f Minerva A/B tests are not subject to HTML caching time
Config added inside SkinMinerva is subject to the rules of HTML
caching and can take several days [1]

Adding it via the onResourceLoaderGetConfigVars hook reduces the
cache time to minutes [2], giving us more control over the experiment's
enabled state.
[1] T124954
[2] https://www.mediawiki.org/wiki/ResourceLoader

Bug: T205355
Change-Id: I18cb40afe405e2f6a89a7ce5a924eb855aed5430
2018-09-24 22:49:34 +00:00
Bartosz Dziewoński 992630c705 Remove broken remains of &campaign=leftNavSignup handling
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
2018-09-24 19:30:03 +00:00
Bartosz Dziewoński 786ec45c30 SkinMinerva: Remove incorrect comment
'returnto' is, in fact, set a few lines above this comment,
since 2013 (I1553ee71f4f9ffec8462e3f9b85de9f39d921204).

Change-Id: I20ab084b3ddf59d338268f00a7f2306c9e2bd2b3
2018-09-21 19:57:15 +00:00
jenkins-bot ee5959a6fb Merge "Get rid of ICustomizableSkin" 2018-09-21 16:03:47 +00:00
Jan Drewniak 2163d5f965 Rename QUnit test files from "test_" to "test.js"
Updates QUnit test files from starting with "test_" to ending with
"test.js" in accordance with the Readers Wed coding conventions.

https://www.mediawiki.org/wiki/Reading/Web/Coding_conventions

Bug: T197884
Change-Id: I98877e3fc432b6edd0c53d834ef23b3ef8fb7d6a
2018-09-19 08:01:31 -06:00