mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Allow Cite to define the reference preview module instead
This provides backwards compatibility with Cite, if Cite has register its own preview module for reference tooltips. Bug: T355194 Change-Id: Iec6f3d4d6c5f765c151ae0dbba258049530e6bc0
This commit is contained in:
parent
7172aae082
commit
e9ac5dcf47
|
@ -67,11 +67,17 @@ class PopupsHooks implements
|
|||
* @return array
|
||||
*/
|
||||
public static function getCustomPopupTypes(): array {
|
||||
$rl = MediaWikiServices::getInstance()->getService( 'ResourceLoader' );
|
||||
// FIXME: If the module ext.cite.referencePreviews does not exist register reference previews.
|
||||
// This code can be removed once T355194 is complete.
|
||||
$others = $rl->getModule( 'ext.cite.referencePreviews' ) ?
|
||||
[] : [
|
||||
'ext.popups.referencePreviews'
|
||||
];
|
||||
|
||||
return array_merge( ExtensionRegistry::getInstance()->getAttribute(
|
||||
'PopupsPluginModules'
|
||||
), [
|
||||
'ext.popups.referencePreviews'
|
||||
] );
|
||||
), $others );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue