* Move global state parameters to new methods setContext and setTitle.
This change solves the circular dependency error for service
'SkinUserPageHelper'. The service will used in SkinOptions in the
follow-up change I014e61c6692adbbe449f1e6aa9c6ae73dbcff925.
Change-Id: I80342e5168435c5318c378e2ac8a9a3c7a28eb4c
Services MUST NOT vary their behaviour on global state, especially not
WebRequest, RequestContext (T218555).
Change-Id: I4b73ef713166d8b254023c1eebbb45c963880a99
The classes:
- skin-night-mode-clientpref-0
- skin-night-mode-clientpref-1
- skin-night-mode-clientpref-2
is being replaced with
- skin-theme-clientpref-day
- skin-theme-clientpref-night
- skin-theme-clientpref-os
- Moved $forceNightMode to be a text parameter (dat|night|os)
- Keep adding the old classes to the html element, to give the ability of gradual deployment
The preference is renamed from minerva-night-mode to minerva-theme (a follow up to consider
migrating existing values will follow).
The query string minervanightmode continues to behave the same but now
accepts other values such as day, night and os.
Bug: T359983
Change-Id: Ia253de68f94236e7fe2219b736dd6084c64ce838
This parameter was probably intended as parameter for getTitle(), but
it is in the wrong parentheses. And even on a repair of the parentheses
the tests still fail with:
> 1) MediaWiki\Minerva\LanguagesHelperTest::testReturnsWhenOutputDoesNotHaveLangLinks
> ILanguageConverter::hasVariants() was not expected to be called more than once.
Also remove the useless ->with( $languageMock ).
Change-Id: I35a0617de2fe7dd0b58060cc8273ef756051d04f
Add a skin-night-mode-page-disabled class to the HTML element when
a page was disabled by the new MinervaNightModeOptions configuration
flag.
Bug: T356653
Change-Id: I7a6582ef8f66e78cc6f07da06bc4d2a3277cfcf0
- Add config to skin.json
- Add the function in SkinMinerva.php to check exclusion of pages and namespaces.
Bug: T355705
Change-Id: I0fa0eab3bfa57cc6864dbdd2d6aeaa5582767c3c
Whereas previously, the value of the query param would simply determine
whether or not night mode was enabled, we would like to be able to
control the actual night mode setting off of the query param
Now, it functions as an option to force the user into a particular
setting, be it automatic, night, or day. If the query param is not set
(if night mode is enabled via config), we will default to the user
option as before
Bug: T355118
Change-Id: I38ed94bfc1b80d0a827c63c6dbdd92eb6f1bf531
Add a new user option, `minerva-night-mode`, and configure it with a
default value of 2 (automatic based on OS). Rework the code in
`getHtmlElementAttributes` to set the initial class value according to
the user option, which will be set and saved inside of MobileFrontend
Bug: T355118
Change-Id: I4b0d63a186f490ba10b7655b3af4dcb8b64bd400
Adds a config flag, `MinervaNightMode`, and wires it up as a skin option
for enabling/disabling the night mode toggle (sold separately)
Additionally, allow this feature to be enabled via the
`minervanightmode` query param
For now, turning the flag on will result in the class
`skin-nightmode-clientpref-1` being added to the HTML element, but in a
later change this will be updated to switch values based on the
forthcoming client pref
Bug: T355118
Change-Id: I35848ab80ee75d324ceb35d17794e2d3e620cc19
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I1eec0823b7af97ea5031ff00b111e0c88b45a155
I recently put up a change and was informed by jenkins-bot that I had
decreased PHP test coverage :/
As I would like to be the type of person that only ✨ increases ✨ test
coverage, I wrote the corresponding tests for my change, as well as the
member functions it depends on. From what I can tell, this is the
correct method of writing unit tests, but please do let me know if there
is anything I'm missing!
Change-Id: Id5c4f76ae058d2b0d487245c28b9ccecc2deef8e
Removes a `display: inherit` that was causing issues with the alignment of these two items in the menu. In addition, correctly sets display to none for jsonly-specified list items when client js is disabled and rename the class to make it more specific to the menu items
Note: this will have a visual impact as it is fixing what is currently a visual bug. The jsonly hiding will also not work with cached content, but since it's currently broken we figured this was acceptable
Bug: T346670
Change-Id: I56d2c4fcba09d199a0fd6aad2f1621509bbfaba5
- Add "useDataURI": false to following modules:
-- skins.minerva.mainMenu.advanced.icons
-- skins.minerva.personalMenu.icons
-- Remove .mw-ui-icon-mf-next-invert old class kept for caching from edit.page.js
Bug: T346162
Change-Id: I362fdc9c68a7483c182e3540cba6501d9b12959d