Commit graph

671 commits

Author SHA1 Message Date
Clare Ming
3336c6e6e9 Remove Skin::getRevisionId, Skin::isRevisionCurrent
Bug: T280613
Change-Id: I5d83ef9a62253c23cd9c047087f9939684543644
2021-07-15 13:52:30 -06:00
Clare Ming
4d4a0d67ef Remove Skin::makeNSUrl
Bug: T280612
Change-Id: I70b3bfb569d92785b719756b81e881951e892967
2021-07-14 17:02:42 -06:00
bwang
e28c5bbe04 Remove SkinTemplate::makeArticleUrlDetails
Bug: T280614
Change-Id: Id348c874a4cfdbe8a2d5580bb798458f2e383dcf
2021-07-13 17:09:21 -07:00
bwang
f3bab2f249 Remove Skin::generateDebugHTML()
Bug: T280611
Change-Id: I7f2520851fe9f4064e54f869507df4cffdd6684b
2021-07-13 21:07:38 +00:00
jenkins-bot
9fdd82c0c4 Merge "Convert Skin::relevantUser to UserIdentity" 2021-07-13 18:57:27 +00:00
jenkins-bot
9fe2383f8d Merge "links is flat array" 2021-07-13 18:23:36 +00:00
jdlrobson
120ecc6d1b links is flat array
Pass a valid key to makeLink rather than an integer (index)
which may result in an exception.

Bug: T286040
Change-Id: Ic69ec102caec982e65e264f5812ac15df5168008
2021-07-13 18:00:16 +00:00
DannyS712
b0ab985420 Fix some @stable for ... annotations to use @stable to ...
Bug: T257789
Change-Id: I3ba94a9d6b739cd57cd57afe5d397963127160a8
2021-07-08 02:54:59 +00:00
jdlrobson
14188e13f0 Allow skins to wrap menu item link labels in spans
This is going to be needed for skins that support icons as
in the new mw-ui-icon implementation, labels must be wrapped
in spans.

This is made a skin option so skins can control.
It will be used in Vector (Ia2d2c86e61341b9900f9ac337ddd763252e0515f)

Bug: T191021
Change-Id: I2bfaebf5d766240b57d7baed445001a007634839
2021-07-02 15:21:46 +00:00
jenkins-bot
660180290c Merge "Make user-menu list items produce HTML consistent with other menus" 2021-07-01 22:46:45 +00:00
Ammarpad
a03354006e Provide preference to make skins responsive
Bug: T285402
Change-Id: I4e567199a92c0492dac0561a5c7844f6c5c239e6
2021-07-01 22:18:27 +01:00
jdlrobson
05a02a39fb Make user-menu list items produce HTML consistent with other menus
The `class` property on menu items applies to the <li> tag however
in the case of the personal tools menu for historic reasons it applies
to the anchor tag. To bring these in line, a new optional parameter
is added that is utilized inside SkinMustache. Given the method is
final we do not need to worry about skins extending this behaviour.

This is needed for the mw-ui-icon change as we want to separate
the <a> tag with the mw-ui-icon class from the padding of its container
on the <li> item.

This also makes use the "new" class is added to the userpage link rather
than the list item by using the link-class property. This does not impact
existing skins as the impact is the same before and after this change.

This will temporarily break skins making use of user-menu, but this was
introduced in 1.37 which has not been released yet, so it's okay to
introduce breaking changes. It is currently only used by Vector

Bug: T285960
Change-Id: If399dfff9bbdd3b03b2ca702face3ec5164bef11
2021-07-01 12:37:51 -07:00
Petr Pchelko
5adf116196 Convert Skin::relevantUser to UserIdentity
This is a breaking change, but I've reviewed all usages
and there's nothing that requires full User object to be
returned. Maybe it's too bold, following the deprecation
process is not too hard either.

Change-Id: Id22580945f594d7e0de533226f6c374a7a97fe1e
2021-06-30 13:09:05 -07:00
jenkins-bot
c309a5dd25 Merge "Remove the fallback for create rights (covered in PM edit rights check). Remove key to i18n message, no longer being used." 2021-06-30 15:16:39 +00:00
Roman Stolar
6ebaa5caf6 Remove the fallback for create rights (covered in PM edit rights check).
Remove key to i18n message, no longer being used.

Bug: T272079
Change-Id: Id6566e5241b06ba377c2eca083221ee02556365f
2021-06-30 17:30:30 +03:00
Sam Smith
3bcf989f72 hooks: Remove deprecated SkinTemplateBuildNavUrlsNav_urlsAfterPermalink hook
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.

Bug: T284950
Change-Id: I9a4806047f8d31d59a00e02145906672b85c004c
2021-06-24 17:25:46 +01:00
Sam Smith
a11aceb214 hooks: Remove deprecated SkinTemplateTabAction hook
The SkinTemplateTabAction hook was marked as deprecated in MediaWiki
1.35.

Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].

[0] https://codesearch.wmcloud.org/search/?q=SkinTemplateTabAction

Bug: T284950
Change-Id: I998bf8ffe6be43ad3eb38b1a9388a35aa94d7685
2021-06-24 17:25:15 +01:00
Sam Smith
99786a9492 hooks: Remove deprecated SkinTemplatePreventOtherActiveTabs hook
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.

Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].

[0] https://codesearch.wmcloud.org/search/?q=SkinTemplatePreventOtherActiveTabs

Bug: T284950
Change-Id: I37c5bdcc8875a23798f641161e53be3e4d073d7d
2021-06-24 17:24:39 +01:00
Nicholas Ray
c64ba635ce Add icon to personal url menu items
Per T284594, adds an icon key/value for the following personal url menu
items so that it is easier for skins to use the appropriate icon:

* login
* logout
* mytalk
* preferences
* watchlist
* mycontris (user contributions)
* anontalk (talk page for anon user)
* anoncontribs (contributions for anon user)
* createaccount
* userpage

Bug: T284594
Change-Id: I95f2a0a01134f2c3dfc22083be66c99de26b530f
2021-06-23 10:05:02 -06:00
Thiemo Kreuz
2ba01c7ee7 Remove some more comments that literally repeat the code
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.

Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
2021-06-18 21:23:56 +00:00
bwang
085a15211f SkinMustache: Add html-before-portal default value
To mirror the html-after-portlet template variable, it will
be possible for skins to define HTML before a portlet. For now
this can only be modified by skins.

Depends-On: I32586a379cbacaad5cfb361facf79c01e982818a
Change-Id: Ia64e7d4009cf303494ff455e1596286bcca811d9
2021-06-15 21:34:12 +00:00
jenkins-bot
1129e71774 Merge "Factor out data required for creating a logout link" 2021-06-14 21:30:56 +00:00
Jan Drewniak
d638cad995 Factor out data required for creating a logout link
Factors out logic that's responsible for assembling data for the logout
link in a public SkinTemplate::buildLogoutLinkData function.

This function is required by the new version of the Vector skin to
reposition the logout button outside of the personal tools menu.

Bug: T281791
Change-Id: If82a736e37174aaadd0ff07019a1fae3759a9e51
2021-06-14 23:11:29 +02:00
bwang
0448859ab6 Hard deprecations of portlet methods and hooks
Hard deprecates BaseTemplate::getAfterPortlet
Hard deprecates BaseTemplate::renderAfterPortlet
Hard deprecates BaseTemplateAfterPortlet Hook

Bug: T280608
Depends-on: I15ed3c820823782d28f11f3724d56736db0ca3e0
Depends-on: Ie00e8c5efe9a1e736251382344a7ae8cd779bb6b
Change-Id: If3e15aa81edb4190b5a74353c089b200acf3f62b
2021-06-14 19:28:46 +00:00
Petr Pchelko
92564edc7c Use Message::page instead of Message::title
Also modified new APIs added to ApiErrorFormatter to
use PageReference instead of Title.

Change-Id: I093c89f8e1e6d383603f887358be6ece70f23a02
2021-06-09 13:18:22 +00:00
jenkins-bot
fbb29d06f5 Merge "Skin: Remove duplicated code" 2021-06-03 01:23:53 +00:00
Clare Ming
412e8f25f7 Add user-interface-preferences to personal toolbar.
- Update $content_navigation in SkinTemplate::buildContentNavigationUrls() to include a new top-level menu.
- Exclude user-interface-preferences menu from content navigation in legacy skins.
- Add method makeSkinTemplatePersonalUrls() to SkinTemplate to build personal urls.
- Rename method to injectLegacyMenusIntoPersonalTools() to add legacy menu items.
- Update unit test for renamed method injectLegacyMenusIntoPersonalTools().

Bug: T282196
Change-Id: If4805e5186756056afcd31d21919e907a7782ce8
2021-06-02 12:47:16 -06:00
Petr Pchelko
ee5a5f2dd7 Remove User from SkinTemplate::buildContentNavigationUrls
Change-Id: I6eec8248bde75ee90f87a49413f8de556beca5a0
2021-05-30 10:04:29 -07:00
jenkins-bot
b693065c32 Merge "Skin: Factor out functions" 2021-05-27 00:22:51 +00:00
bwang
dee771bf8b Skin: Factor out functions
Allows for the creation of create account and login urls in SkinVector

Change-Id: Ia841f92c626ca32a9ad437b3d1cff78309c83ed8
2021-05-26 17:49:13 -05:00
Isarra
6268b3a708 Skin::getCopyrightIcon: ensure it hasn't been unset in config
Sysadmins could unset the entire copyright array in FooterIcons.
Might as well make sure it exists at all before checking if it has
something usable. Also simplifies related testing.

Change-Id: I56e06d564a9d60851d10e69065fd70dd51025bd2
2021-05-23 19:09:28 +00:00
jenkins-bot
4d33cae7ce Merge "Make mw-content-body universal to all skins" 2021-05-14 01:08:19 +00:00
jdlrobson
7cda5b0bf8 Make mw-content-body universal to all skins
1) Rename content-parser-output to `content-body`

Widen the scope of this module to apply to anything that can be rendered
as the article body. Improve the documentation on what is allowed here.

For early-adopter skins already using content-parser-output,
map the feature to the new name and add tests.

2) Reclaim the `mw-body-content` class for result of
SkinTemplate::wrapHTML

The `mw-body-content` has been used in skins to wrap various elements.
Going forward we will use it to wrap any HTML content generated by
OutputPage.

See dependent patches, which we're not directly depending on to avoid
a CI gremlin:

 - I90d85c21f4a62e6697f24e3ce388445a0a53c2b0 (MonoBook)
 - I11242e243c9a529b72972089af9ac2a8c906331a (Modern)
 - I87942c60e62f6f14acdfeaa1836ace4eac9252ac (CologneBlue)
 - I4c1b15d90bacbc9b13782a1d8f52e838ce8ecd83 (Vector)

Bug: T279388
Change-Id: I3a91b294fcb3724cd46743e497dff723de0490a6
2021-05-13 16:53:52 -07:00
jenkins-bot
297d1bfb0e Merge "Remove unused default values from class properties" 2021-05-13 00:58:34 +00:00
jenkins-bot
de0ac77e45 Merge "Modern keys must be unset" 2021-05-12 23:38:48 +00:00
Isarra
44a0238f1a Remove mw-body-content class from BaseTemplate::getIndicators
Bug: T279388
Change-Id: I785bd09d01e3b004df2f0fb898d7d8f28180501c
2021-05-12 19:31:14 +00:00
jdlrobson
f311d3b8dc Modern keys must be unset
This was really badly documented. Monobook and Timeless menus are generated using
the old BaseTemplate methodology. These new keys need to be unset to keep
compatibility. This code probably needs refactoring, but for now an explanatory
comment should help avoid this happening again.

Bug: T282646
Change-Id: I050a03abd90a94138dd6591d6f92af7e1515a9c9
2021-05-12 16:57:40 +00:00
Jdlrobson
f942d65171 Revert "Revert "Create buildPersonalPage method for SkinTemplate class, add menu item to personal menu..""
This reverts commit cefb0c4b35.

Reason for revert: This creates some problems in a new mode of Vector
we're testing. The fix for the originally reported problem is simpler
and a patch will follow.

Change-Id: I78ea52ac79dd08f053c3920af4a882b8446c4ed4
2021-05-12 15:49:39 +00:00
Thiemo Kreuz
6805f39a30 Remove unused default values from class properties
In all these cases the property is unconditionally set in
the constructor. The extra initialisation is effectively
dead code and an extra source of errors and confusion.

Change-Id: Icae13390d5ca5c14e2754f3be4eb956dd7f54ac4
2021-05-12 13:44:28 +02:00
jenkins-bot
675694308c Merge "Revert "Create buildPersonalPage method for SkinTemplate class, add menu item to personal menu.."" 2021-05-12 06:31:50 +00:00
Legoktm
cefb0c4b35 Revert "Create buildPersonalPage method for SkinTemplate class, add menu item to personal menu.."
This reverts commit 5c7a0f84f2.

Unannounced breaking change for skins, causes weird tab to be
added on MonoBook and Timeless skins.

Bug: T276561
Bug: T282646
Change-Id: I35a7b9ded2be5401294d74fd59269b874793ad4c
2021-05-12 05:43:59 +00:00
Ammarpad
88fb4dd871 Skin: Remove duplicated code
This check is now in Skin::getRelevantUser() method itself and
so is pointless to repeat.

It was supposed to be removed in I177cd83 but was restored
unintentionally in one of the rebases

Follow-up: I177cd83a9c4f87c27a63d8f530c40895d0f3f5dd
Change-Id: Ic1758775ecd6992e162f1e7461a9ae7afdc9bcd0
2021-05-10 16:32:52 +00:00
Isarra
489564b35d getFooterIcons should not return empty arrays, part 2, Electric Boogaloo
We filter out icons with no images, which includes empty icon arrays,
already. Let's also remove their containers if nothing winds up inside
them so we're not returning any empty container arrays, either.

Bug: T278266
Change-Id: If9bfb764b61a77e71ca7f374fa67a56ac89c799f
2021-05-09 20:12:06 +00:00
Clare Ming
5c7a0f84f2 Create buildPersonalPage method for SkinTemplate class, add menu item to personal menu..
Inside buildPersonalUrls method, replace personal_urls variable with method call to build personal page link. Add "user-page" menu to content navigation. This patch is a dependency for a corresponding patch in the Vector repo which needs the new "user-page" menu item to update the personal toolbar based on a feature flag.

Bug: T276561
Change-Id: If4e143aada711d210ae45d33b97a6be0685b6a41
2021-05-04 23:31:01 +00:00
DannyS712
40eda16b0e Remove deprecated talk page message handling in User class
Most needed for moving forward with the removal of uses
of the Revision class, and remove User::getNewtalk at
the same time to be consistent. All of this code was
already hard deprecated in 1.35.

- User::getNewtalk
- User::getNewMessageLinks (could return Revision objects)
- UserRetrieveNewTalks hook (could return Revision objects)
- User::getNewMessageRevisionId (used ::getNewMessageLinks)
- User::setNewtalk (accepted Revision object parameters)

Bug: T247143
Bug: T277511
Change-Id: Ib4fd1e4cbc5ba1497658190b6c6ea3c6a5dc97f0
2021-05-04 19:21:06 +00:00
vladshapik
9cc797695b Hard deprecate User ::isIP, ::getOptions
Bug: T275602
Change-Id: Id4be13751ca0a900e51214c1855a4624077a5a62
2021-04-26 16:10:24 +00:00
Cindy Cicalese
a384acffa7 Use WatchlistManager in several classes
Change-Id: I720629e08373736b5fc1e12563b5059311b113e1
2021-04-21 00:37:40 -04:00
jenkins-bot
f05d54738b Merge "Fix annoying E_NOTICE about undefined 'alt' index in Skin#makeFooterIcon." 2021-03-28 02:17:55 +00:00
Cormac Parle
679497c171 Allow public access to getter for default search page
Bug: T273979
Change-Id: I241a9cce679c7b42ff749c6236299d82b94db669
2021-03-24 14:20:56 +00:00
ZabeMath
e91c0ad729 Hard deprecate BaseTemplate::getFooterIcons()
BaseTemplate::getFooterIcons() is soft deprecated since 1.35 and unused.

Bug: T267447
Change-Id: Iff952cff08a5c93b93ab75743ea6f1e18067572f
2021-03-23 13:44:11 -07:00