Mwalker has submitted this change and it was merged.

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(-)

Approvals:
  Mwalker: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I20808851030f0945932f022a30beb1bcf9e660cd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to