mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-11 17:00:10 +00:00
Merge "Initialize Echo when CentralAuth autologin replaces the user toolbar"
This commit is contained in:
commit
35d89af670
|
@ -366,6 +366,15 @@
|
|||
"mobile"
|
||||
]
|
||||
},
|
||||
"ext.echo.centralauth": {
|
||||
"packageFiles": [
|
||||
"ext.echo.centralauth.js"
|
||||
],
|
||||
"targets": [
|
||||
"desktop",
|
||||
"mobile"
|
||||
]
|
||||
},
|
||||
"ext.echo.styles.badge": {
|
||||
"styles": [
|
||||
"nojs/mw.echo.badge.less"
|
||||
|
|
|
@ -929,6 +929,9 @@ class Hooks implements
|
|||
$user = $out->getUser();
|
||||
|
||||
if ( !$user->isRegistered() ) {
|
||||
if ( ExtensionRegistry::getInstance()->isLoaded( 'CentralAuth' ) ) {
|
||||
$out->addModules( [ 'ext.echo.centralauth' ] );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
11
modules/ext.echo.centralauth.js
Normal file
11
modules/ext.echo.centralauth.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Loads Echo on CentralAuth autologin
|
||||
*/
|
||||
mw.hook( 'centralauth-p-personal-reset' ).add( function () {
|
||||
mw.loader.using( [
|
||||
'ext.echo.init',
|
||||
'ext.echo.styles.badge',
|
||||
'oojs-ui.styles.icons-alerts',
|
||||
'ext.echo.styles.alert'
|
||||
] );
|
||||
} );
|
Loading…
Reference in a new issue