mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
c7b60735fe
This seems to play well with Popups with and without Ie8fa1672b9fd . However, it's not clear to me why this still works and even gives priority to the Popups implementation when present, regardless of the order the extensions are loaded in. Happily, this is the desired behavior. Bug: T363162 Change-Id: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
28 lines
852 B
PHP
28 lines
852 B
PHP
<?php
|
|
|
|
use Cite\ReferencePreviews\ReferencePreviewsContext;
|
|
use Cite\ReferencePreviews\ReferencePreviewsGadgetsIntegration;
|
|
use MediaWiki\MediaWikiServices;
|
|
use MediaWiki\Registration\ExtensionRegistry;
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
return [
|
|
'Cite.GadgetsIntegration' => static function ( MediaWikiServices $services ): ReferencePreviewsGadgetsIntegration {
|
|
return new ReferencePreviewsGadgetsIntegration(
|
|
$services->getMainConfig(),
|
|
ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ?
|
|
$services->getService( 'GadgetsRepo' ) :
|
|
null
|
|
);
|
|
},
|
|
'Cite.ReferencePreviewsContext' => static function ( MediaWikiServices $services ): ReferencePreviewsContext {
|
|
return new ReferencePreviewsContext(
|
|
$services->getMainConfig(),
|
|
$services->getService( 'Cite.GadgetsIntegration' ),
|
|
$services->getUserOptionsLookup()
|
|
);
|
|
},
|
|
];
|