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
This reverts commit 05fd384803.
Looks like it is needed. On android i am now seeing autocomplete unexpectedly...
Change-Id: I9c4476346c183d6dcc9e25965530f3e2478ed88f
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
* 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
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
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
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
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
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
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
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
'returnto' is, in fact, set a few lines above this comment,
since 2013 (I1553ee71f4f9ffec8462e3f9b85de9f39d921204).
Change-Id: I20ab084b3ddf59d338268f00a7f2306c9e2bd2b3
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
Not calling an explicit output format defaults to ->escaped(), which often
leads to double escaping.
Spotted by the phan-taint-check-plugin.
Change-Id: Ie527768bea670808e63cfc8cbff64015ae29d4a3
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
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
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
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
- Replace the header div with a header element and the content div with
a main element. main and header elements are already shivved:
https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/22dd581f10/resources/lib/html5shiv/html5shiv.js#234.
- Link the wiki header title / logo to the main page. Note: the link
border around images is already omitted. The link is identical to the
menu home button.
Bug: T198947
Change-Id: Id312638d86179e75bc670e72e5943f8c00232bbb
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
Remove JavaScript hack introduced in
MobileFrontend 858a66d9f.
This hack is already provided by html5shiv.
Change-Id: I09251a23f4c0dda2f971028fa0250335bfe998b4
- 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
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
The profile icon is necessary for logged in users. This is known when
parsing skin.json but was not added in MinervaHooks.php. This patch adds
the dependency unconditionally although it is only needed for the server
render of Special:MobileMenu for logged in users.
Bug: T196893
Change-Id: I2a8485299162c01d28ca1b07e7071ad0c0ef44fc
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
This reverts commit 648491015c.
Parent patch is being reverted since it didn't follow the
deprecation policy.
Change-Id: Id0e80bf23593d6fc7c986df7b42ff836cc24d867
wfGetLangObj() is not necessary anymore.
This change increases the requirement to MediaWiki 1.32 or higher.
Depends-On: Id49201957e716ef8a2ea930b3616ca4fe6e35633
Change-Id: I18adeebe476b321546ceda43eb12b6cf7e8081b3
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
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
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
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
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
Minerva purposely does not load mediawiki.legacy.shared
This should still be the same when setupSkinUserCss is
deprecated.
Change-Id: Ib2b19ba165a9d646a770702cdf1724509156b93e
The change in If9c8f0974e3a4b08e4a66d37f7f5adf67d73054e
will introduce styles that are incompatible with Minerva due
to the blanking of the content array. The styles content
array should also be blanked.
Bug: T42812
Change-Id: I3388c3c4f91cdbab11e89cdc95973b688d3f1ce7
SkinMinerva::getPersonalUrl() is supposed to link to the login page if the
user isn't logged in, building a URL that will redirect them back to the
proper special page. Except the two special pages that use this function
will already automatically redirect to the login page if you're not logged
in.
Manually handling the redirect requries additional complexity, and
duplication of things like message keys.
Change-Id: Id5bfca1049f84e52476b179b8fdda50d030d7c1c
Instead of requiring a full IContextSource object and only using the
Title, only ask for the Title in the first place.
Change-Id: I33034193140ca53919f29f847a03caf26250ce54
* 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
The merged patch hid the edit icon completely for blocked users.
It should not do this but should show. I've updated the task
description to explain this behaviour better.
This reverts commit cb6bde03dd.
Bug: T190834
Change-Id: I28b2a6bfb1d0501668752faaf4cbd2ea8bf3398a
Before showing an edit button, check that the user isn't blocked from
editing everywhere. Note: User.isBlockedFrom() internally checks whether
that includes user talk pages or not.
Bug: T190834
Change-Id: I9126dfef04333e15baa67e1d080b09f35548d58d
Avoid the 'ResourceLoaderGetLessVars' hook, which registers a
global LESS variable exposed to all modules (inc. core/extensions).
Instead, use a FileModule subclass to provide the variable only
to the modules that need it.
Using this approach, also has the benefit of being tracked by
the version hasher, so that changes to the configuration actually
result in timely invalidation of module caches.
Bug: T171367
Change-Id: I7c7d13c83004edfc852a9b7dbfc4169617ab9f64
Do not conditionally render the table of contents. Note: the underlying
condition, MFTOC, appears to still be used by MobileFormatter so it was
unchanged.
Bug: T189699
Change-Id: I7088ccad75c2a8504bf435418d7dd62238b2135d
More hackery!
This adds some tests and ensures that our own icons are mapped to the
existing template icons.
Bug: T187916
Change-Id: I49073f22995c6730369235d6039939915ba2079c
In T182162 these were removed incorrectly. They should only have
been partially removed.
Bug: T187222
Change-Id: Ia3fb34250714fe4ccb10c32a7027fda167e06a16
With the introduction of the FeaturesManager the
getConfigVariable method will disappear.
(I535b24803341dc3912aed4bef06970e2861fe3ad)
That change cannot be merged until Minerva stops using the
method.
This temporary fix ensures it resolves to false when the method
doesn't exist.
Bug: T182217
Change-Id: I619fd8fac47a98d1ff8f3646d61b8e285246a17f