Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71731
Change subject: Remove device specific stylesheets
......................................................................
Remove device specific stylesheets
Create a happy Max.
Change-Id: I9e45dc82690ee2e73f5d022b9a96efabc314f21f
---
M MobileFrontend.php
M includes/DeviceDetection.php
M includes/MobileFrontend.hooks.php
M includes/Resources.php
D includes/modules/MobileDeviceDetectModule.php
M includes/skins/SkinMobile.php
M less/common/mf-typography.less
M less/common/ui.less
M stylesheets/common/mf-typography.css
D stylesheets/devices/android.css
D stylesheets/devices/blackberry.css
D stylesheets/devices/ie.css
D stylesheets/devices/iphone.css
D stylesheets/devices/kindle.css
D stylesheets/devices/nokia.css
D stylesheets/devices/operamini.css
D stylesheets/devices/operamobile.css
D stylesheets/devices/palm_pre.css
D stylesheets/devices/psp.css
D stylesheets/devices/simple.css
D stylesheets/devices/webkit.css
D stylesheets/devices/wii.css
22 files changed, 6 insertions(+), 338 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/31/71731/1
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 003bc26..28a2918 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -52,7 +52,6 @@
'MFResourceLoaderModule' => 'modules/MFResourceLoaderModule',
'MobileSiteModule' => 'modules/MobileSiteModule',
- 'MobileDeviceDetectModule' => 'modules/MobileDeviceDetectModule',
'SpecialUploads' => 'specials/SpecialUploads',
'SpecialMobileUserlogin' => 'specials/SpecialMobileUserlogin',
diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php
index f1adc84..8044835 100644
--- a/includes/DeviceDetection.php
+++ b/includes/DeviceDetection.php
@@ -37,15 +37,6 @@
*/
function isMobileDevice();
- /**
- * @return string
- */
- function moduleName();
-
- /**
- * @return string
- */
- function cssFileName();
}
interface IDeviceDetector {
@@ -64,10 +55,6 @@
*/
function getDeviceProperties( $deviceName, $userAgent );
- /**
- * @return array
- */
- function getCssFiles();
}
/**
@@ -168,30 +155,6 @@
wfProfileOut( __METHOD__ );
return $isMobile;
}
-
- /**
- * @return string
- */
- public function moduleName() {
- if ( isset( $this->device['css_file_name'] ) &&
- $this->device['css_file_name'] ) {
- return "mobile.device.{$this->device['css_file_name']}";
- } else {
- return '';
- }
- }
-
- /**
- * @return string
- */
- public function cssFileName() {
- if ( isset( $this->device['css_file_name'] ) &&
- $this->device['css_file_name'] ) {
- return "{$this->device['css_file_name']}.css";
- } else {
- return '';
- }
- }
}
/**
@@ -211,35 +174,27 @@
),
'blackberry' => array (
'view_format' => 'html',
- 'css_file_name' => 'blackberry',
),
'ie' => array (
'view_format' => 'html',
- 'css_file_name' => 'ie',
),
'iphone' => array (
'view_format' => 'html',
- 'css_file_name' => 'iphone',
),
'kindle' => array (
'view_format' => 'html',
- 'css_file_name' => 'kindle',
),
'netfront' => array (
'view_format' => 'html',
- 'css_file_name' => 'simple',
),
'nokia' => array (
'view_format' => 'html',
- 'css_file_name' => 'nokia',
),
'operamini' => array (
'view_format' => 'html',
- 'css_file_name' => 'operamini',
),
'operamobile' => array (
'view_format' => 'html',
- 'css_file_name' => 'operamobile',
),
'palm_pre' => array (
'view_format' => 'html',
@@ -349,19 +304,5 @@
}
wfProfileOut( __METHOD__ );
return $deviceName;
- }
-
- /**
- * @return array: List of all device-specific stylesheets
- */
- public function getCssFiles() {
- $files = array();
-
- foreach ( self::$formats as $dev ) {
- if ( isset( $dev['css_file_name'] ) ) {
- $files[] = $dev['css_file_name'];
- }
- }
- return array_unique( $files );
}
}
diff --git a/includes/MobileFrontend.hooks.php
b/includes/MobileFrontend.hooks.php
index 0739a5d..f65a263 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 $wgMFMobileResourceBoilerplate, $wgMFLogEvents,
$wgResourceModules;
// disable event logging module on mobile
if ( !$wgMFLogEvents && isset(
$wgResourceModules['ext.eventLogging'] ) ) {
diff --git a/includes/Resources.php b/includes/Resources.php
index 29959c7..04b7c5d 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -771,9 +771,4 @@
),
'position' => 'top',
),
-
- //@hack: xdevice instead of device to force this module to be last in a
link
- 'mobile.xdevice.detect' => $wgMFMobileResourceBoilerplate + array(
- 'class' => 'MobileDeviceDetectModule',
- ),
) );
diff --git a/includes/modules/MobileDeviceDetectModule.php
b/includes/modules/MobileDeviceDetectModule.php
deleted file mode 100644
index 6aaf06e..0000000
--- a/includes/modules/MobileDeviceDetectModule.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
- * Provides device-specific CSS
- * 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 );
- }
-}
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 77ae426..2504014 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -116,21 +116,8 @@
return $vars;
}
- // FIXME: move addModuleStyles calls to initPage get should not have
side effects
public function getDefaultModules() {
- global $wgMFVaryResources;
-
- $ctx = MobileContext::singleton();
$out = $this->getOutput();
- $device = $ctx->getDevice();
-
- // add device specific css file - add separately to avoid cache
fragmentation
- if ( $wgMFVaryResources ) {
- $out->addModuleStyles( 'mobile.xdevice.detect' );
- } elseif ( $device->moduleName() ) {
- $out->addModuleStyles( $device->moduleName() );
- }
-
$modules = parent::getDefaultModules();
// main page special casing
diff --git a/less/common/mf-typography.less b/less/common/mf-typography.less
index adacf81..1009d85 100644
--- a/less/common/mf-typography.less
+++ b/less/common/mf-typography.less
@@ -1,6 +1,8 @@
@import "../mf-variables.less";
html {
+ // prevent font scaling in landscape in Safari
+ -webkit-text-size-adjust: none;
font-size: 100% * @fontScalingFactor; /* default browser size is 16px
(12pt - our @baseFontSize) */
}
diff --git a/less/common/ui.less b/less/common/ui.less
index 258a0f7..e3b8e78 100644
--- a/less/common/ui.less
+++ b/less/common/ui.less
@@ -62,6 +62,8 @@
/* Search */
input.search {
+ // see bug 36490
+ background-color: white;
-webkit-appearance: none;
.border-radius( 3px );
border: @headerElementBorderHeight solid #c9c9c9;
diff --git a/stylesheets/common/mf-typography.css
b/stylesheets/common/mf-typography.css
index 38300ed..6506355 100644
--- a/stylesheets/common/mf-typography.css
+++ b/stylesheets/common/mf-typography.css
@@ -1,4 +1,5 @@
html {
+ -webkit-text-size-adjust: none;
font-size: 90%;
/* default browser size is 16px (12pt - our @baseFontSize) */
diff --git a/stylesheets/devices/android.css b/stylesheets/devices/android.css
deleted file mode 100644
index 3a2916c..0000000
--- a/stylesheets/devices/android.css
+++ /dev/null
@@ -1 +0,0 @@
-/* empty until further notice */
diff --git a/stylesheets/devices/blackberry.css
b/stylesheets/devices/blackberry.css
deleted file mode 100644
index 90964ed..0000000
--- a/stylesheets/devices/blackberry.css
+++ /dev/null
@@ -1,4 +0,0 @@
-input.searchSubmit {
- padding-top: 0;
- padding-bottom: 0;
-}
diff --git a/stylesheets/devices/ie.css b/stylesheets/devices/ie.css
deleted file mode 100644
index a8ef09b..0000000
--- a/stylesheets/devices/ie.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/* TD cannot be turned into display block on Windows Phone 7.5
-This hack hides the TD with the icon in it so that the more important
-text is readable */
-.mbox-image {
- display: none !important;
-}
diff --git a/stylesheets/devices/iphone.css b/stylesheets/devices/iphone.css
deleted file mode 100644
index 222d395..0000000
--- a/stylesheets/devices/iphone.css
+++ /dev/null
@@ -1,8 +0,0 @@
-html {
- /* prevent font scaling in landscape in Safari */
- -webkit-text-size-adjust: none;
-}
-
-#searchInput {
- line-height: normal; /* placeholder displays incorrectly on iphones */
-}
diff --git a/stylesheets/devices/kindle.css b/stylesheets/devices/kindle.css
deleted file mode 100644
index 9fc9840..0000000
--- a/stylesheets/devices/kindle.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body {
- line-height: 120%;
-}
diff --git a/stylesheets/devices/nokia.css b/stylesheets/devices/nokia.css
deleted file mode 100644
index 90ac38d..0000000
--- a/stylesheets/devices/nokia.css
+++ /dev/null
@@ -1,4 +0,0 @@
-/* empty */
-#searchInput {
- background-color: white !important; /* see bug 36490 */
-}
diff --git a/stylesheets/devices/operamini.css
b/stylesheets/devices/operamini.css
deleted file mode 100644
index a031b6a..0000000
--- a/stylesheets/devices/operamini.css
+++ /dev/null
@@ -1,27 +0,0 @@
-.header {
- padding-top: 9px !important;
-}
-
-table { /* table[style] not supported */
- float: none !important;
- margin-left: 0 !important;
- width: 100% !important;
- overflow: auto;
-}
-
-.mwm-notice {
- text-align: left;
-}
-
-.mwm-message.mwm-notice {
- display: none;
-}
-
-a.arrow {
- float: right;
- margin-right: 5px;
-}
-
-span.idx {
- display: none;
-}
diff --git a/stylesheets/devices/operamobile.css
b/stylesheets/devices/operamobile.css
deleted file mode 100644
index 0fe711c..0000000
--- a/stylesheets/devices/operamobile.css
+++ /dev/null
@@ -1,7 +0,0 @@
-table {
- overflow-y: scroll;
-}
-
-tbody {
- height: 200px;
-}
diff --git a/stylesheets/devices/palm_pre.css b/stylesheets/devices/palm_pre.css
deleted file mode 100644
index 40a8c17..0000000
--- a/stylesheets/devices/palm_pre.css
+++ /dev/null
@@ -1 +0,0 @@
-/* empty */
diff --git a/stylesheets/devices/psp.css b/stylesheets/devices/psp.css
deleted file mode 100644
index f1218f7..0000000
--- a/stylesheets/devices/psp.css
+++ /dev/null
@@ -1,66 +0,0 @@
-.header,
-#footer,
-#content_wrapper {
- margin: 0 2px;
-}
-
-/* TODO: review duplicate definition in operamini, psp, simple
-Are they even necessary? could/should they be in common.css ?
-*/
-.nav {
- border: 0;
- border-bottom: 2px solid #6d84b4;
- border-top: 2px solid #6d84b4;
- height: auto;
- clear: both;
- padding: 5px 0 5px 0;
- margin: 0;
-}
-
-.mwm-notice {
- text-align: left;
-}
-
-.mwm-message.mwm-notice {
- display: none;
-}
-
-a.arrow {
- float: right;
- margin-right: 5px;
-}
-
-.thumb {
- margin: 0.5em 0;
-}
-
-.thumb.tright {
- float: right;
- clear: right;
- margin-left: 0.5em;
-}
-
-.thumb .thumbcaption {
- text-align: left;
- margin: 0;
- font-size: 90%;
- padding-top: 0.5em;
-}
-
-.thumb.tleft {
- float: left;
- clear: left;
- margin-right: 0.5em;
-}
-
-.thumb .thumbinner,
-.thumb .thumbinner[style] {
- padding: 5px;
- margin: 0;
-}
-
-span.idx {
- display: none;
-}
-
-
diff --git a/stylesheets/devices/simple.css b/stylesheets/devices/simple.css
deleted file mode 100644
index 138180d..0000000
--- a/stylesheets/devices/simple.css
+++ /dev/null
@@ -1,30 +0,0 @@
-.header,
-#footer,
-#content_wrapper {
- margin: 0 2px;
-}
-
-/* TODO: duplicate see psp.css */
-.nav {
- border: 0;
- border-bottom: 2px solid #6d84b4;
- border-top: 2px solid #6d84b4;
- height: auto;
- clear: both;
- padding: 5px 0 5px 0;
- margin: 0;
-}
-
-.mwm-notice {
- text-align: left;
-}
-
-.mwm-message.mwm-notice {
- display: none;
-}
-
-a.arrow {
- float: right;
- margin-right: 5px;
-}
-
diff --git a/stylesheets/devices/webkit.css b/stylesheets/devices/webkit.css
deleted file mode 100644
index 3a2916c..0000000
--- a/stylesheets/devices/webkit.css
+++ /dev/null
@@ -1 +0,0 @@
-/* empty until further notice */
diff --git a/stylesheets/devices/wii.css b/stylesheets/devices/wii.css
deleted file mode 100644
index 8897210..0000000
--- a/stylesheets/devices/wii.css
+++ /dev/null
@@ -1,53 +0,0 @@
-.thumb {
- margin: 0.5em 0;
-}
-
-.thumb.tright {
- float: right;
- clear: right;
- margin-left: 0.5em;
-}
-
-.thumb .thumbcaption {
- text-align: left;
- margin: 0;
- font-size: 90%;
- padding-top: 0.5em;
-}
-
-.thumb.tleft {
- float: left;
- clear: left;
- margin-right: 0.5em;
-}
-
-.thumb .thumbinner,
-.thumb .thumbinner[style] {
- padding: 5px;
- margin: 0;
-}
-
-#content_wrapper {
- background: white;
- clear: both;
- padding: 8px;
-}
-
-#footer {
- background: white;
- padding: 0 8px;
-}
-
-#footer {
- padding-top: 1em;
-}
-
-#footer #perm {
- padding-top: 1em;
- font-size: 80%;
-}
-
-#footer #copyright {
- padding: 1em 0;
- font-size: 80%;
-}
--
To view, visit https://gerrit.wikimedia.org/r/71731
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e45dc82690ee2e73f5d022b9a96efabc314f21f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits