jenkins-bot has submitted this change and it was merged.

Change subject: Bug 46480: Enable mobile site module
......................................................................


Bug 46480: Enable mobile site module

Makes Mobile.js and Mobile.css work again by targetting mobile
Moved into new folder to make this code more discoverable

Bug 46480
Change-Id: I4eaf51af79bdda8ec758922f8d4b8d87f4b7aa39
---
M MobileFrontend.php
M includes/MobileFrontend.body.php
A includes/modules/MobileSiteModule.php
3 files changed, 17 insertions(+), 22 deletions(-)

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



diff --git a/MobileFrontend.php b/MobileFrontend.php
index 6f871c6..b358100 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -36,7 +36,6 @@
 $autoloadClasses = array (
        'ExtMobileFrontend' => 'MobileFrontend.body',
        'MobileFrontendDeviceDetectModule' => 'MobileFrontend.body',
-       'MobileFrontendSiteModule' => 'MobileFrontend.body',
        'MobileFrontendHooks' => 'MobileFrontend.hooks',
 
        'DeviceDetection' => 'DeviceDetection',
@@ -50,6 +49,7 @@
        'ApiQueryExtracts' => 'api/ApiQueryExtracts',
 
        'MFResourceLoaderModule' => 'modules/MFResourceLoaderModule',
+       'MobileSiteModule' => 'modules/MobileSiteModule',
 
        'SpecialUploads' => 'specials/SpecialUploads',
        'SpecialMobileDiff' => 'specials/SpecialMobileDiff',
@@ -479,8 +479,7 @@
 
 $wgResourceModules['mobile.site'] = array(
        'dependencies' => array( 'mobile.startup' ),
-       'class' => 'MobileFrontendSiteModule',
-       'targets' => 'mobile',
+       'class' => 'MobileSiteModule',
        'mobileTargets' => array( 'stable', 'beta', 'alpha' ),
 );
 
@@ -794,14 +793,6 @@
  * to mix mobile and non-mobile pages in its search results, creating 
confusion.
  */
 $wgMFNoindexPages = true;
-
-/**
- * Which pages should be included in mobile.site
- */
-$wgMobileSiteResourceLoaderModule = array(
-       'MediaWiki:Mobile.css' => array( 'type' => 'style' ),
-       'MediaWiki:Mobile.js' => array( 'type' => 'script' ),
-);
 
 /**
  * Set the domain of the stopMobileRedirect cookie
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index c640cf9..132f847 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -205,17 +205,6 @@
        }
 }
 
-class MobileFrontendSiteModule extends ResourceLoaderSiteModule {
-       protected function getPages( ResourceLoaderContext $context ) {
-               global $wgMobileSiteResourceLoaderModule;
-               return $wgMobileSiteResourceLoaderModule;
-       }
-
-       public function isRaw() {
-               return true;
-       }
-}
-
 class MobileFrontendDeviceDetectModule extends ResourceLoaderFileModule {
        public function getStyles( ResourceLoaderContext $context ) {
                $response = $context->getRequest()->response();
diff --git a/includes/modules/MobileSiteModule.php 
b/includes/modules/MobileSiteModule.php
new file mode 100644
index 0000000..e2335c2
--- /dev/null
+++ b/includes/modules/MobileSiteModule.php
@@ -0,0 +1,15 @@
+<?php
+class MobileSiteModule extends ResourceLoaderSiteModule {
+       protected $targets = array( 'mobile' );
+
+       protected function getPages( ResourceLoaderContext $context ) {
+               return array(
+                       'MediaWiki:Mobile.css' => array( 'type' => 'style' ),
+                       'MediaWiki:Mobile.js' => array( 'type' => 'script' ),
+               );
+       }
+
+       public function getPosition() {
+               return 'top';
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/57216
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4eaf51af79bdda8ec758922f8d4b8d87f4b7aa39
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: awjrichards <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to