Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/58454
Change subject: Stop CentralNotice from running on mobile stable site ...................................................................... Stop CentralNotice from running on mobile stable site Reflects change in dependency: https://gerrit.wikimedia.org/r/#/c/56887/ Change-Id: I20808851030f0945932f022a30beb1bcf9e660cd --- M CentralNotice.php 1 file changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/54/58454/1 diff --git a/CentralNotice.php b/CentralNotice.php index 460551a..d1aab08 100644 --- a/CentralNotice.php +++ b/CentralNotice.php @@ -83,12 +83,22 @@ 'remoteExtPath' => 'CentralNotice/modules', 'scripts' => 'ext.centralNotice.bannerController/bannerController.js', 'position' => 'top', - 'targets' => array( 'mobile', 'desktop' ), 'dependencies' => array( 'jquery.cookie', ), - 'mobileTargets' => array( 'beta', 'alpha' ), ); +$wgResourceModules[ 'ext.centralNotice.bannerController.mobile' ] = $wgResourceModules[ 'ext.centralNotice.bannerController' ] + array( + 'targets' => 'mobile', +); + +function efEnableMobileModules( $out, $mode ) { + global $wgResourceModules; + $name = 'ext.centralNotice.bannerController.mobile'; + if ( $mode !== 'stable' ) { + $out->addModules( $name ); + } + return true; +} /* Configuration */ @@ -279,6 +289,8 @@ $wgHooks[ 'SiteNoticeAfter' ][ ] = 'efCentralNoticeDisplay'; $wgHooks[ 'ResourceLoaderGetConfigVars' ][] = 'efResourceLoaderGetConfigVars'; } + // Register mobile modules + $wgHooks['EnableMobileModules'][] = 'efEnableMobileModules'; // Register special pages $wgSpecialPages[ 'BannerLoader' ] = 'SpecialBannerLoader'; -- To view, visit https://gerrit.wikimedia.org/r/58454 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20808851030f0945932f022a30beb1bcf9e660cd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: Jdlrobson <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
