mediawiki-extensions-Tabber.../includes/Hooks.php
H. C. Kruse 7f75899995
feat: add support for nested tabbers in Codex (#95)
* refactor: Apply some code cleanup

* feat: WIP dynamic nested tabber in codex

* feat: Make deeply nested tabbers work

* doc: fix comment position

---------

Co-authored-by: alistair3149 <alistair3149@users.noreply.github.com>
2023-07-11 22:06:57 -04:00

33 lines
832 B
PHP

<?php
declare( strict_types=1 );
namespace MediaWiki\Extension\TabberNeue;
use MediaWiki\Hook\ParserFirstCallInitHook;
use OutputPage;
use Parser;
use Skin;
class Hooks implements ParserFirstCallInitHook {
/**
* @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' ] );
}
/**
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ParserFirstCallInit
*
* @param Parser $parser
*/
public function onParserFirstCallInit( $parser ): void {
$parser->setHook( 'tabber', Tabber::class . '::parserHook' );
$parser->setHook( 'tabbertransclude', TabberTransclude::class . '::parserHook' );
}
}