Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
Hooks | |
0.00% |
0 / 5 |
|
0.00% |
0 / 2 |
20 | |
0.00% |
0 / 1 |
onBeforePageDisplay | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
onParserFirstCallInit | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\CharInsert; |
4 | |
5 | class Hooks implements |
6 | \MediaWiki\Hook\BeforePageDisplayHook, |
7 | \MediaWiki\Hook\ParserFirstCallInitHook |
8 | { |
9 | /** @inheritDoc */ |
10 | public function onBeforePageDisplay( $out, $skin ): void { |
11 | if ( $out->getTitle()->isSpecial( 'Upload' ) || |
12 | in_array( $out->getActionName(), [ 'edit', 'submit' ] ) |
13 | ) { |
14 | $out->addModules( 'ext.charinsert' ); |
15 | $out->addModuleStyles( 'ext.charinsert.styles' ); |
16 | } |
17 | } |
18 | |
19 | /** @inheritDoc */ |
20 | public function onParserFirstCallInit( $parser ) { |
21 | $parser->setHook( 'charinsert', [ CharInsert::class, 'charInsertHook' ] ); |
22 | } |
23 | } |