2022-04-20 17:11:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare( strict_types=1 );
|
|
|
|
|
2022-06-29 21:22:14 +00:00
|
|
|
namespace MediaWiki\Extension\TabberNeue;
|
2022-04-20 17:11:10 +00:00
|
|
|
|
2022-04-20 18:00:28 +00:00
|
|
|
use MediaWiki\Hook\ParserFirstCallInitHook;
|
2022-06-29 21:01:57 +00:00
|
|
|
use OutputPage;
|
2022-04-20 17:11:10 +00:00
|
|
|
use Parser;
|
2022-06-29 21:01:57 +00:00
|
|
|
use Skin;
|
2022-04-20 17:11:10 +00:00
|
|
|
|
2022-04-23 22:41:14 +00:00
|
|
|
class Hooks implements ParserFirstCallInitHook {
|
2022-06-29 21:01:57 +00:00
|
|
|
/**
|
|
|
|
* @see https://www.mediawiki.org/wiki/Extension:MobileFrontend/BeforePageDisplayMobile
|
|
|
|
*
|
|
|
|
* @param OutputPage $out
|
|
|
|
* @param Skin $sk
|
|
|
|
*/
|
|
|
|
public static function onBeforePageDisplayMobile( OutputPage $out, Skin $sk ) {
|
|
|
|
$out->addModuleStyles( [ 'ext.tabberNeue.mobile.styles' ] );
|
|
|
|
}
|
|
|
|
|
2022-04-20 17:11:10 +00:00
|
|
|
/**
|
2022-04-20 18:00:28 +00:00
|
|
|
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ParserFirstCallInit
|
2022-04-20 17:11:10 +00:00
|
|
|
*
|
2022-04-20 18:00:28 +00:00
|
|
|
* @param Parser $parser
|
2022-04-20 17:11:10 +00:00
|
|
|
*/
|
2023-07-12 02:06:57 +00:00
|
|
|
public function onParserFirstCallInit( $parser ): void {
|
2022-04-20 19:23:45 +00:00
|
|
|
$parser->setHook( 'tabber', Tabber::class . '::parserHook' );
|
|
|
|
$parser->setHook( 'tabbertransclude', TabberTransclude::class . '::parserHook' );
|
2022-04-20 17:11:10 +00:00
|
|
|
}
|
2022-04-20 17:51:17 +00:00
|
|
|
}
|