Commit graph

63 commits

Author SHA1 Message Date
C. Scott Ananian
697588af7e Rename MediaWiki\Output\Hook\OutputPageBodyAttributesHook
Depends-On: Ifdb9e6b59f126b47e4143c875c34a207643b7034
Change-Id: Idc25e5f2facef2ecc4d3207a4e520d758eb4e577
2024-02-16 00:57:13 +00:00
Umherirrender
654fe199b8 Use namespaced class OutputPage
Change-Id: Id76216db62aa4a53b227cdb71f2f48a318ce5e74
2023-12-10 00:23:54 +01:00
Reedy
ec3e5e27fe Switch to HookHandlers
Bug: T271010
Change-Id: Ie248342d4deb3520d284fac9c3ead17f7dee3de4
2022-08-22 11:43:37 +00:00
jdlrobson
abe94aa408 Monobook Mustache
Changes in HTML markup that fix various bugs and lead to consistencies
with other skins:
* firstHeading now has `dir` attribute
* `tagline` message no longer parsed - plain text only - this is consistent with
other skins
* printfooter now child of #bodyContent
* #ca-view is outputted (but hidden with CSS)
* Order of attributes on  #p-search-label changed
* Search input form elements are no longer self closing
* The #mw-searchButton element gains class mw-fallbackSearchButton
* The generated-sidebar class is no longer present on sidebar portlets,
consistent with other skins
* The print link disappears when ElectronPdf is installed so there
are not two print links.

Changes in functionality:
* Previously (in getCactions) a nomobile class would be added if
less than 2 tabs.
If not 1 tab, more would be appended. This is dropped.

Bug: T285989
Change-Id: I03d0dc1dad23894e7e64ceeb8956692316265144
2021-09-07 09:02:55 -07:00
libraryupgrader
1810f569a9
build: Updating mediawiki/mediawiki-phan-config to 0.11.0
Change-Id: I1d2975da877b82c9ac2f2437fff2055a883a4247
2021-09-04 22:30:00 +03:00
jdlrobson
c1ca90ce4b Reduce ResourceLoader modules used by Monobook
MonoBook supports two modes - one that is responsive and one that
is not. To do this it adds 3 modules. These can be reduced to 1
module by loading all the code and adding client side checks to
determine whether to use it.

The skin--responsive class is added by core for responsive skins so
can be used to make that check.

This does lead to additional download for all users (particularly
the addition of oojs-ui.styles.icons-alerts) but given the default
behaviour is to load these, and non-responsive skin requires an opt
in I don't see this as a problem.

Thanks to gzip the increase in render blocking styles is minimal:

Before:
skins.monobook.styles: 15.21KB
skins.monobook.responsive: 16.14KB

After:
skins.monobook.styles: 16.63KB

See bug for QA plan.

Bug: T285492
Change-Id: I76bb644145539c8ec0220704c8fe9a78a4819c03
2021-08-03 12:45:59 -07:00
jdlrobson
9b4186d863 Drop MonoBook responsive preference
This was moved to a core preference as part of T285402
The migration was handled by a #user-notice

Bug: T285402
Change-Id: I25fe3d32ad929924034db06b5a95bab6a3a3a727
2021-07-29 23:50:31 +00:00
Ammarpad
2f82aabd68 monobook-responsive pref: Follow core preference if set
If the general skin-responsive setting is set, let it overide
monobook-responsive preferences

Eventually remove monobook-responsive when the affected users
have migrated to the general pref (or they're migrated, if necessary)

Bug: T285402
Depends-On: I4e567199a92c0492dac0561a5c7844f6c5c239e6
Change-Id: If6e405eaf1e4c3ac396fdcf2da31501ea3f65b53
2021-06-28 22:03:39 +01:00
jdlrobson
ee59005150 Separate hooks from SkinMonoBook, use namespace
For consistency with other skins, its easier to see how hooks are
invoked when they are separated from the skin.

The skin is also updated to use namespaces and modern skin registration
which has been available since MediaWiki v1.36.

Change-Id: I1c93d4e817b53c93eba47ee9086c86c5d75443e5
2021-06-27 22:06:39 +00:00
Jack Phoenix
57e963507c Move capitalize-all-nouns CSS class support from core to MonoBook
Bug: T97892
Change-Id: I598c4469c46d284562ea3aec79330f9a1f40d2ce
2021-06-17 20:20:55 +00:00
bwang
6ce3ce1acb Use Skin::getAfterPortlet instead of deprecated BaseTemplate:getAfterPortlet
Change-Id: Ie00e8c5efe9a1e736251382344a7ae8cd779bb6b
2021-06-11 15:08:45 -05:00
Jdlrobson
0321b399f5 Drop mw-body-content class from Monobook in preparation for glorious future
* Removes the class from site notice - this provides no styling benefits
inside MediaWiki and is inconsistent with other skins. If site styles
need to target this element they should use the siteNotice id
* Replaces mw-body-content class with monobook-body and adapts existing
styles. The mw-body-content class will soon be applied to
$this->get( 'bodytext' ) instead. The core change
I3a91b294fcb3724cd46743e497dff723de0490a6 will shift this class to the
child element. There are no styles outside Monobook that rely on this
class and only 45 Monobook specific site/user styles that could be impacted.
The new class is prefixed monobook to avoid confusion with classes that
originate in core that are prefixed `mw-`

Bug: T279388
Change-Id: I90d85c21f4a62e6697f24e3ce388445a0a53c2b0
2021-05-13 20:14:11 +00:00
jenkins-bot
29b13c8b9c Merge "Monobook should use content-links feature instead of mediawiki.skinning.content.externallinks" 2020-12-07 19:56:34 +00:00
jdlrobson
747c8e6fa8 Monobook should use content-links feature instead of mediawiki.skinning.content.externallinks
Bug: T267577
Change-Id: I94dce8f159eaf3fb533bc0c57a9bab768d376a1e
2020-12-07 18:37:14 +00:00
jdlrobson
530de7b362 BaseTemplate::getFooterIcons is deprecated
For callers calling `$this->getFooterIcons( 'icononly' );`
`$this->get( 'footericons' )` can be used instead.

Note the output HTML should be identical.
BaseTemplate::getFooterIcon
will unset any items that are not arrays, but upstream changes
have made this unsupported. Using SkinTemplate::getFooterIcon
will also ensure that all icons have width and heights if not
defined which is better for performance.

Bug: T267447
Change-Id: Ia5278884a10173a509b7ae50b8407774c5d8719b
2020-12-03 16:22:02 +00:00
Ammar Abdulhamid
4f9b64bd97 Remove ULS extension and anon placeholder hacks.
The anon placeholder is now provided by core.
The ULS extension hack is no longer needed.

Bug: T263382
Change-Id: I008511f5fc326bca10f2c2bf4e03b2df3561b56e
2020-09-23 21:32:48 +01:00
Ammar Abdulhamid
7f3581f05c Drop MonoBookAfterContent hook
Also removed is the helper deprecatedHookHack() method.

SkinAfterContentHook should be used instead.

Bug: T259400
Change-Id: I3818cf1ea26444f3736af2b48aabf8b67815008a
2020-09-14 11:08:32 +01:00
jdlrobson
3bed284b37 Refactor: Simplify responsive Monobook's optional dependencies
Having module definitions living inside SkinMonobook makes them
less discoverable. It also shouldn't be necessary - even if there
are soft dependencies on other modules.

A new file resources/optional-enhancements.js is added which will
load the two optional dependencies based on whether they have been
installed on the client.

Bug: T203023
Change-Id: If9a88db52deb0cc91d58cbb40693d4cd448eabbc
2020-09-04 15:53:28 +00:00
jdlrobson
5ca99813d0 Drop responsive Monobook IE8 support
Bug: T259316
Change-Id: I85c198601291327bb5edff6d440ce143b8887756
2020-08-04 21:55:36 +00:00
mainframe98
bce6d15d35 Specify the responsive option rather than manually specifying viewport
I6e69b482cdbc adds a viewport with the same value as MonoBook.

Bug: T258290
Depends-On: I6e69b482cdbc49c09adc6f7cee54f5e17b7c92c4
Change-Id: Iae529da5dba07a2eee91a1fa7b29e4bdc163aa40
2020-08-04 11:35:55 +02:00
Ammar Abdulhamid
058fef6bf6 MonoBook: Rename searchGoButton -> searchButton
Bug: T255791
Change-Id: I9ced97b55cf5d6fb675a925825a28458ab7278db
2020-07-25 03:18:49 +01:00
Ammar Abdulhamid
cc55b0d822 MonoBook: Remove usage of $wgUseTwoButtonsSearchForm config variable
The search form no longer changes based on this config variable.

Note that the variable has always been true since its introduction and
there's no way for users to turn it off, so probably the single button
search form has never been shown.

Bug: T256568
Change-Id: I86fde4f89cff553966614d725bbd6ba14d4ab1a4
2020-07-11 08:51:14 +01:00
jenkins-bot
3b8d36160a Merge "Drop MonoBookAfterToolbox hook" 2020-06-26 14:07:22 +00:00
jdlrobson
cd99a29f77 Languages portal should be at the bottom of the sidebar
Per discussion on T254546 the language portal is so long in most
articles that it pushes down other boxes rendering them inaccessible
for this reason make sure Monobook outputs it last.

Bug: T254546

Change-Id: Ib80fa6414e220fbc3c1b6e3527c32fb28b994376
2020-06-22 16:09:48 -07:00
Ammar Abdulhamid
e93aa477aa Drop MonoBookAfterToolbox hook
SkinAfterPortlet hook should be used instead.

Bug: T255315
Change-Id: I0c8e2f69fc3debcfcbc3b8c82796193277329a3a
2020-06-22 14:47:58 +01:00
Ammar Abdulhamid
91cb084117 Drop MonoBookTemplateToolboxEnd hook
This hook was deprecated 6 years ago and is no longer in use.

Bug: T253783
Change-Id: Iabcb77eb1a4f0667dd667fd5bfc346b8d1188dea
2020-06-12 21:44:34 +01:00
Ammar Abdulhamid
5fa6a6a339 MonoBook: Drop SkinTemplateToolboxEnd hook
This hook is not in use in any deployed code.

Bug: T253783
Change-Id: I5b636f005bdcdafabbb22ea3c5acef2a49c7c5c5
2020-06-05 20:29:18 +01:00
jdlrobson
833d93500c Show after portal links when languages is empty
Various extensions reveal the language portal when empty by appending
a link. Monobook needs to check this now itself, to avoid these links
disappearing - for example the Wikidata edit link.

Bug: T252841
Change-Id: If2cf64f6b7ba313d3e437e9da63afa886fee5d11
2020-06-02 00:43:56 +00:00
Ammar Abdulhamid
191aa61755 Monobook supports SidebarBeforeOutput hook
Bug: T253783
Change-Id: If8ed1ccd17b4eedea18c77d721ee45ed0d67b7fc
2020-06-01 01:08:34 +01:00
AronDemian
1587cdfb60 Add .mw-footer CSS class & replace #footer selector with it
`#footer` kept for backwards compatibility with user styles and gadgets.

Bug: T248137
Change-Id: Ied8e79c5895f8fe383b1ca743a31890549cc8d86
2020-04-24 02:28:15 +00:00
jdlrobson
f7e483042e Reveal Monobook "enable responsive design" option when skin selected
Currently one has to click save on "Special:Preferences" to reveal
the monobook responsive design option. As of
Iaf68b238a8ac7a4fb22b9ef5d6c5a3394ee2e377 we can reveal this conditionally
when the Monobook skin is selected.

Depends-On: Idd06bcfe7935e16732a6a95c1253dbf95c8aca2e
Bug: T246296
Change-Id: Ibd74cc03f3ccbdc0042163c18ab0f71b6aa556f6
2020-02-26 15:48:00 -08:00
jdlrobson
00234ce031 Drop mediawiki.skinning.interface in preparation for its deprecation
Since MonoBook is never cached on Wikimedia wikis, we don't need
to do anything about both modules being loaded in cached HTML.
There should be no differences before and after this change.

The change must apply to skins.monobook.styles and skins.monobook.responsive
as these modules never load at the same time (see setupSkinUserCss).

Bug: T242177
Change-Id: I5e69cd7f37f7b7a2b6325177b6688a426d92d57f
2020-02-05 18:28:27 +01:00
libraryupgrader
c21a70208c build: Updating composer dependencies
* mediawiki/minus-x: 0.3.2 → 1.0.0
* mediawiki/mediawiki-phan-config: 0.9.0 → 0.9.1

Change-Id: I0cd1840109e0cdde8bce1510e1970098edc5e868
2020-01-26 18:22:20 +00:00
libraryupgrader
9879ec956a build: Updating mediawiki/mediawiki-phan-config to 0.9.0
Change-Id: I14024466c38bd61f75ac2185ea3a5372cb91c054
2019-12-15 18:07:49 +00:00
Volker E
cdafe2a796 Remove IE 6 & 7 specific code
Bug: T234582
Change-Id: I3b51005bdc4ce49a534f8fc005f8e5a67b5c39e7
2019-10-13 09:15:38 -07:00
jenkins-bot
6a32ca83c0 Merge "Enhance the 'MonoBookAfterToolbox' hook by passing the class instance to the hook subscribers" 2019-07-21 18:11:17 +00:00
Jack Phoenix
9ade7fcbe6 Enhance the 'MonoBookAfterToolbox' hook by passing the class instance to the hook subscribers
That way hook subscribers can use RequestContext and whatnot instead of having to resort to globals.

Change-Id: I1e4be7156aaea12fef75169bd0216140b9d50388
2019-07-21 18:03:37 +00:00
James D. Forrester
147550142d build: Upgrade phan-taint-check-plugin from 1.5.x to 2.0.1
Add `@param-taint $contents escapes_htmlnoent` annotation to
MonoBookTemplate::getBox(). The method will escape the $contents
parameter if it's an array, but it will not if it's a string; Phan
can't distinguish the types, and assumes it always escapes. Use
escapes_htmlnoent to suppress warnings about double-escaped output.

Change-Id: Id8ef73f2efbe8d4d5510917d55dbac4e41b2b3a1
2019-07-10 17:12:44 +02:00
jenkins-bot
fa1deee55e Merge "Move DataAfterContent outside of main content block" 2019-07-08 21:18:35 +00:00
MarcoAurelio
dd06d6e216 Use oojs-ui.styles.icons-alerts
`ext.echo.badgeicons` got removed in was removed in I8218530e.

Bug: T226503
Change-Id: Id4d912fdaedf94dca8c42d64cc1f342f5566e642
2019-06-25 14:29:29 +00:00
Timo Tijhof
896f88e740 Use array_merge() instead of manual assignment loop
Change-Id: I0acd669658720ec95e724fd91ef41060560b4888
2019-06-20 19:22:42 +00:00
Isarra
c86558a8b4 I have no damn clue!
Change-Id: Icf173be114856897c0663b04c1a4e19aada0e74b
2019-06-20 19:06:08 +00:00
Isarra
1e0aa01470 Move DataAfterContent outside of main content block
Bug: T226199
Change-Id: I367302e528a4df7c4b53c93caa5b4ba2bfd30e33
2019-06-20 17:43:25 +00:00
James D. Forrester
f8b08d09d3 build: Upgrade mediawiki/mediawiki-phan-config from 0.5.0 to 0.6.0
Change-Id: Ic32748529c65b8e75fbb93cd88c0fd70edaeaf6d
2019-05-19 18:59:48 +00:00
Kunal Mehta
1c67fac1b4 Upgrade to newer phan
Change-Id: Idb1940b42d85afb80422c4f10a50942464c3afba
2019-03-20 19:43:14 -07:00
Isarra
1efe5cbc59 Target desktop only for ULS mobile styles, as the ULS styles themselves do
Per Jon's comments here:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/MonoBook/+/434159/1/includes/SkinMonoBook.php#99

Change-Id: Ie91ecd50726b62ce2e8261c40a6a684d879d9c87
2019-01-24 23:16:30 +00:00
jenkins-bot
c54d8b693a Merge "Use \u{00A0} instead of  " 2018-11-04 21:03:10 +00:00
Fomafix
20109df332 Use \u{00A0} instead of  
Directly use the UTF-8 encoding of the 'NO-BREAK SPACE' (U+00A0)
instead of the HTML/XML entitiy  .

Bug: T154300
Change-Id: I610c8c6a70c7561c46f80e40614f69ccedab5194
2018-11-03 00:02:35 +01:00
Umherirrender
18acebb7fc Add method scope visibility
Change-Id: I1897cff26504b38eecc45491b027b7e6f8c58fd5
2018-11-02 07:40:38 +00:00
Edward Chernenko
73ad6a7835 Missing 'class' in "newtalk" notification
MonoBookTemplate incorrectly calls getIfExists() for newtalk/undelete:
attributes of wrapper <div> must be under the 'parameters' key.

Change-Id: I5392477d493174b0b5598927bfbcec2029b0987e
2018-06-20 10:56:52 +02:00