Commit graph

31 commits

Author SHA1 Message Date
Fomafix 6f30044448 Replace WebRequest::getText and ::getVal by ::getRawVal or ::getCheck
The Unicode and line break normalizations are not needed here.

Change-Id: I4aebc32c938fde8e1b086325d18d72df66ca870f
2024-03-29 12:59:20 +00:00
Moh'd Khier Abualruz 5d6b866890 Rename the skin night mode classes to more readable classes
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
2024-03-19 23:12:59 +00:00
Fomafix 3fc7f0d542 Inject service Minerva.SkinOptions into Hooks and MobileFrontendHooks
Change-Id: Id343ae4cb8d1a73cfb647bfe440f2909e3835037
2024-03-12 19:44:53 +00:00
Fomafix b9eca74ff0 Use "optional_services" in skin.json
Change-Id: Idab8a934e4c8f547d018907cb427effcab1d0f3f
2024-03-12 19:44:06 +00:00
jenkins-bot 5b9fcf1260 Merge "Move Hooks::setMinervaSkinOptions to class SkinOptions" 2024-03-11 23:15:42 +00:00
Fomafix 52dd233f5e Move Hooks::setMinervaSkinOptions to class SkinOptions
This allows to inject the services.

Change-Id: If091c7c5df2d498cdb7d82db89876dab8a82c3fc
2024-03-09 22:34:28 +00:00
Fomafix fd0e6d4e4c Implement PreferencesGetLayoutHook
Change-Id: Iccf0fa1ba5b4c547a221f2d152f0f387f04848a2
2024-03-03 14:40:39 +00:00
Fomafix 0f8800ac42 Inject services in Hooks and MobileFrontendHooks
Change-Id: I8e0673689c2dbe14a385bbd1fe1725d203386bde
2024-02-27 10:15:03 +00:00
Steph Toyofuku ef46f238a7 Set up user option for night mode
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
2024-02-02 13:28:35 -08:00
Steph Toyofuku f614ce6687 Add feature flag for night mode
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
2024-01-31 00:38:51 +00:00
Umherirrender 1ad05f4a2e Use namespaced classes
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: I1eec0823b7af97ea5031ff00b111e0c88b45a155
2024-01-06 16:31:38 +01:00
Umherirrender b67f2800d3 Swap conditions in onSpecialPageBeforeExecute
Avoid use of the context when not needed as this is also called for
special page transclusion, avoid initialize of the skin in that newly
created context.

Change-Id: I56573491262a194f44bccb7fd6170eb7bf21c6ed
2023-12-06 20:18:52 +01:00
Jon Robson a3f03245fd Style the desktop diff and history page of Minerva to look like mobile pages
Depends-On: Ie8ac1aab6d2fe5f4575a6891c36efe497458e093
Bug: T305113
Bug: T240624
Change-Id: I5a4a2588da3d701be87690038c2c9b2bc1aa0365
2023-10-20 18:35:10 +00:00
Umherirrender 5062970a5b build: Remove unneeded newline from one line condition
Improve readability

Change-Id: I4493126d97668ab3b4d24a6605ab1dabe7339e2e
2023-08-22 21:46:03 +02:00
Umherirrender 7701ce2641 Use HookHandlers for MobileFrontend hooks
The use of "HookHandlers" attribute in extension.json makes it possible
to inject services into hook handler classes in a future patch.

Bug: T315823
Change-Id: I9422f0cf7d5c14db544ea67c564d34e9eca3813b
2023-08-15 17:02:31 +02:00
Umherirrender 903034de23 Create HookRunner class and the hook handler interface
Bug: T315823
Change-Id: I09c45ed939e103e6edb3a76623687574dcf0206f
2023-06-09 22:19:59 +02:00
Umherirrender 8c12e8b6dd Replace deprecated Hooks::run
Bug: T335536
Change-Id: I94280162586373a9399b3ec1b16ab9963e2d7945
2023-05-06 22:53:47 +02:00
Func a5b815903d Remove jquery.tablesorter modules form the dequeue list
Preload via Skin::getDefaultModules() should be allowed to avoid
the separate load request in a fresh environment.

Also, cleanup the code and comments, 'sortable' => true is the default,
no need to specify again.

Bug: T233340
Change-Id: Icc04d2cd2dc85efab64e5c8de68e606cfad61480
2023-03-31 17:31:27 +00:00
Bartosz Dziewoński 8c0f0c578e Remove talk page tools
Bug: T319145
Change-Id: Ib432564e1049f18334653e5eb3981f0f051582b3
2023-03-13 18:21:52 +00:00
Jon Robson 889543edcb Targets no longer needed
All match current default.

Bug: T328497
Change-Id: I9de21b59edc63bbe4b7d10891f469991dc5e80d4
2023-02-27 16:43:57 +00:00
ksarabia 973c9486d7 Remove onBeforePageDisplay for Minerva
Removes onBeforePageDisplay hook. This is no longer needed because module style is added through Skin::getDefaultModules via SkinMinerva->getSkinStyles

Bug: T281421
Change-Id: Ie0610735c96476e66629815a6611d6b34356707c
2023-02-13 13:22:35 -06:00
Umherirrender b21e4a98bc Avoid use of deprecated User::idFromName
Use a UserFactory instead of getting an id and the user objects on
second request

Also replace another deprecated User class and use the injected factory

Bug: T325687
Change-Id: Id610ee39e0ef865b97f7ae8506188eea04a86ac5
2022-12-21 22:35:49 +01:00
Jon Robson f6f2c4f1e4 Show both Echo icons in desktop Minerva
For consistency with desktop Vector, Minerva should show two
icons. This also removes the duplicate #pt-notifications-alert
element in the skin.

Bug: T313609
Change-Id: I6449f0c29b52fd2092d63fbef23205ed8f57d50f
2022-12-14 02:08:44 +00:00
suecarmol b4e78eace4 HookRunner - Change PreferencesGetLayoutHook params
Changed the PreferencesGetLayoutHook parameters so thatit no longer passes a Skin variable. Now, the hook willpass an additional string variable with the skin name  and an associative array with extra skin properties the hook might need.

Bug: T322781
Change-Id: I200aec586dbe8613e9a9c762db8d9bcbdc69a35b
2022-11-18 20:17:47 -06:00
jsn 73d9281e75 hooks: reference PreferencesGetLayout docs
Bug: T320843
Change-Id: I74f089d2e44ecfb5a0ba6a3b34db8abd0ec9a24f
2022-10-20 12:04:26 -05:00
jsn 48cdc5a33d hooks: implement PreferencesGetLayout
Use mobile layout in Special:Preferences

Bug: T320586
Depends-On: I468481b66bf96880d1779cd11a46e18745e2c894
Change-Id: Ic6aa01e6e8806d1f2be8e07ca6c83decd62bc641
2022-10-12 20:54:55 -05:00
Reedy 9dd8065d4d Switch to MW core hooks to HookHandlers
Bug: T315823
Change-Id: I0d1eb1e2ea584904ee3a130b938bd372048a47eb
2022-10-04 23:05:38 +00:00
EllenR adc53dbbfc Add sortability to sortable tables for mobile web
changed value of $config['sortable'] from false to true

Bug: T233340
Change-Id: I76a3b2e966ebe291299b7a514d86e5607db95b4e
2022-06-21 18:02:07 +00:00
Jon Robson 8c57c9c12d Enable special page tabs
For now this should be a NOOP as the existing "special" page tab
is removed, put it paves the way for using tabs on special pages.

Bug: T286466
Change-Id: Ic0b52b298d598c20987b172c81c732a31e409402
2022-05-18 21:41:00 +00:00
Reedy b6685f9c4a Namespace SkinMinerva
Change-Id: I8f6bddac9f8cd060c551651e711ee987b8bbfbe3
2022-03-04 17:50:20 +00:00
Reedy 87bb746849 Namespace two more classes
Change-Id: Id32beb98df0f37ced858c17196517f65b64a041c
2022-03-04 16:33:46 +00:00
Renamed from includes/MinervaHooks.php (Browse further)