Merge "Move ext.echo.logger module registration to extension.json"

This commit is contained in:
jenkins-bot 2018-08-08 23:56:38 +00:00 committed by Gerrit Code Review
commit 536d632d14
2 changed files with 12 additions and 16 deletions

View file

@ -53,6 +53,18 @@
"EchoAliases": "Echo.alias.php" "EchoAliases": "Echo.alias.php"
}, },
"ResourceModules": { "ResourceModules": {
"ext.echo.logger": {
"scripts": [
"logger/mw.echo.Logger.js"
],
"dependencies": [
"oojs"
],
"targets": [
"desktop",
"mobile"
]
},
"ext.echo.ui.desktop": { "ext.echo.ui.desktop": {
"scripts": [ "scripts": [
"ui/mw.echo.ui.BadgeLinkWidget.js", "ui/mw.echo.ui.BadgeLinkWidget.js",

View file

@ -143,22 +143,6 @@ class EchoHooks {
* @param ResourceLoader &$resourceLoader * @param ResourceLoader &$resourceLoader
*/ */
public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) {
// ext.echo.logger is used by mobile notifications as well, so be sure not to add any
// dependencies that do not target mobile.
$definition = [
'scripts' => [
'logger/mw.echo.Logger.js',
],
'dependencies' => [
'oojs'
],
'localBasePath' => dirname( __DIR__ ) . '/modules',
'remoteExtPath' => 'Echo/modules',
'targets' => [ 'desktop', 'mobile' ],
];
$resourceLoader->register( 'ext.echo.logger', $definition );
global $wgExtensionDirectory, $wgEchoNotificationIcons, $wgEchoSecondaryIcons; global $wgExtensionDirectory, $wgEchoNotificationIcons, $wgEchoSecondaryIcons;
$resourceLoader->register( 'ext.echo.emailicons', [ $resourceLoader->register( 'ext.echo.emailicons', [
'class' => 'ResourceLoaderEchoImageModule', 'class' => 'ResourceLoaderEchoImageModule',