Allow skins to register their own button and disable compact
Example usage: Iabd4688c6081b4de391b9655b92a16f3a414e018 We will skip loading the compact link if we don't need to compact the languages. Note special handling is known for Timeless which stops propagation of events. This will be fixed in Timeless at a later date. Bug: T264824 Change-Id: I0518ecdf402ebf5eb6bad2c430f6462322c0d8e1
This commit is contained in:
@@ -106,9 +106,10 @@ class UniversalLanguageSelectorHooks {
|
||||
// Soft dependency to Wikibase client. Don't enable CLL if links are managed manually.
|
||||
$excludedLinks = $out->getProperty( 'noexternallanglinks' );
|
||||
$override = is_array( $excludedLinks ) && in_array( '*', $excludedLinks );
|
||||
if ( !$override && self::isCompactLinksEnabled( $out->getUser() ) ) {
|
||||
$out->addModules( 'ext.uls.compactlinks' );
|
||||
}
|
||||
$config = [
|
||||
'wgULSPosition' => $wgULSPosition,
|
||||
'wgULSCompactLinksEnabled' => !$override && self::isCompactLinksEnabled( $out->getUser() ),
|
||||
];
|
||||
|
||||
if ( is_string( $wgULSGeoService ) ) {
|
||||
$out->addModules( 'ext.uls.geoclient' );
|
||||
@@ -121,7 +122,8 @@ class UniversalLanguageSelectorHooks {
|
||||
|
||||
// This is added here, and not in addConfig to allow skins and extensions to vary it
|
||||
// For example, ContentTranslation special pages depend on being able to change it.
|
||||
$out->addJsConfigVars( 'wgULSPosition', $wgULSPosition );
|
||||
$out->addJsConfigVars( $config );
|
||||
|
||||
if ( $wgULSPosition === 'personal' ) {
|
||||
$out->addModuleStyles( 'ext.uls.pt' );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user