Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/199640
Change subject: Hygiene: Don't add Echo modules, if Echo isn't installed ...................................................................... Hygiene: Don't add Echo modules, if Echo isn't installed Same as VisualEditor and friends. Change-Id: I927831e3586915b3d58c0c003039c3386d545f78 --- M includes/MobileFrontend.hooks.php M includes/Resources.php 2 files changed, 34 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/40/199640/1 diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 5fc3e59..eaf2266 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -857,14 +857,18 @@ */ public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) { self::registerMobileLoggingSchemasModule(); + $config = MobileContext::singleton()->getMFConfig(); // add VisualEditor related modules only, if VisualEditor seems to be installed - T85007 if ( class_exists( 'VisualEditorHooks' ) ) { - $mobileVisualEditorRLmodule = - MobileContext::singleton()->getMFConfig()->get( 'MobileVEModules' ); - $resourceLoader->register( $mobileVisualEditorRLmodule ); + $resourceLoader->register( $config->get( 'MobileVEModules' ) ); } + // add Echo, if it's installed + if ( class_exists( 'MWEchoNotifUser' ) ) { + $resourceLoader->register( $config->get( 'MobileEchoModules' ) ); + }; + return true; } diff --git a/includes/Resources.php b/includes/Resources.php index 792e2ba..aad4dc4 100644 --- a/includes/Resources.php +++ b/includes/Resources.php @@ -1170,29 +1170,6 @@ 'group' => 'user', ), - 'mobile.notifications.overlay' => $wgMFResourceFileModuleBoilerplate + array( - 'dependencies' => array( - 'mobile.stable', - 'ext.echo.base', - ), - 'scripts' => array( - 'javascripts/modules/notifications/NotificationsOverlay.js', - ), - 'styles' => array( - 'less/modules/NotificationsOverlay.less', - ), - 'templates' => array( - 'content.hogan' => 'templates/modules/notifications/NotificationsOverlayContent.hogan', - ), - 'messages' => array( - // defined in Echo - 'echo-none', - 'notifications', - 'echo-overlay-link', - 'echo-notification-count', - ), - ), - 'mobile.gallery' => $wgMFResourceFileModuleBoilerplate + array( 'dependencies' => array( 'mobile.toast', @@ -1364,6 +1341,33 @@ ) ); /** + * Extension:Echo related modules + */ +$wgMobileEchoModules = array( + 'mobile.notifications.overlay' => $wgMFResourceFileModuleBoilerplate + array( + 'dependencies' => array( + 'mobile.stable', + 'ext.echo.base', + ), + 'scripts' => array( + 'javascripts/modules/notifications/NotificationsOverlay.js', + ), + 'styles' => array( + 'less/modules/NotificationsOverlay.less', + ), + 'templates' => array( + 'content.hogan' => 'templates/modules/notifications/NotificationsOverlayContent.hogan', + ), + 'messages' => array( + // defined in Echo + 'echo-none', + 'notifications', + 'echo-overlay-link', + 'echo-notification-count', + ), + ), +); +/** * Mobile VisualEditor related modules */ $wgMobileVEModules = array( -- To view, visit https://gerrit.wikimedia.org/r/199640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I927831e3586915b3d58c0c003039c3386d545f78 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits