jenkins-bot has submitted this change and it was merged.
Change subject: Quick hack to remove now useless device modules
......................................................................
Quick hack to remove now useless device modules
Fix errors in server log caused by missing directory
Change-Id: Id96853c84a44ae87a0c9eb57218bf47963586e0d
---
M includes/MobileFrontend.hooks.php
M includes/modules/MobileDeviceDetectModule.php
2 files changed, 2 insertions(+), 41 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 0739a5d..8a621b1 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -231,19 +231,7 @@
* @return bool
*/
public static function onResourceLoaderRegisterModules( ResourceLoader
&$resourceLoader ) {
- global $wgMFMobileResourceBoilerplate, $wgMFLogEvents,
$wgResourceModules, $wgMFVaryResources;
-
- if ( !$wgMFVaryResources ) {
- $detector = DeviceDetection::factory();
- foreach ( $detector->getCssFiles() as $file ) {
- $resourceLoader->register(
"mobile.device.$file",
- $wgMFMobileResourceBoilerplate +
- array(
- 'styles' => array(
"stylesheets/devices/{$file}.css" ),
- )
- );
- }
- }
+ global $wgMFLogEvents, $wgResourceModules;
// disable event logging module on mobile
if ( !$wgMFLogEvents && isset(
$wgResourceModules['ext.eventLogging'] ) ) {
diff --git a/includes/modules/MobileDeviceDetectModule.php
b/includes/modules/MobileDeviceDetectModule.php
index 6aaf06e..b5f40c5 100644
--- a/includes/modules/MobileDeviceDetectModule.php
+++ b/includes/modules/MobileDeviceDetectModule.php
@@ -5,32 +5,5 @@
* Only added to output when $wgMFVaryResources = true
*/
class MobileDeviceDetectModule extends ResourceLoaderFileModule {
- protected $xDevice = null;
-
- protected function init( ResourceLoaderContext $context ) {
- if ( is_null( $this->xDevice ) ) {
- // @todo: Autodetection for third parties?
- $this->xDevice =
MobileContext::singleton()->getXDevice();
- if ( $this->xDevice ) {
- $response = $context->getRequest()->response();
- $response->header( 'Vary:
Accept-Encoding,X-Device' );
- $response->header( "X-Device: {$this->xDevice}"
);
- } else {
- wfDebugLog( 'mobile',
"MobileFrontendDeviceDetectModule: no X-Device header found" );
- }
- }
- }
-
- public function getStyles( ResourceLoaderContext $context ) {
- $this->init( $context );
-
- if ( $this->xDevice ) {
- $device = MobileContext::singleton()->getDevice();
- $file = "stylesheets/devices/{$device->cssFileName()}";
- if ( $file ) {
- $this->styles[] = $file;
- }
- }
- return parent::getStyles( $context );
- }
+ // dummy for now
}
--
To view, visit https://gerrit.wikimedia.org/r/72773
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id96853c84a44ae87a0c9eb57218bf47963586e0d
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits