Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F8800
34325.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 12:09 AM
2014-11-22 00:09:18 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
34325.diff
View Options
diff --git a/MobileFrontend.body.php b/MobileFrontend.body.php
index d479423..18eea44 100644
--- a/MobileFrontend.body.php
+++ b/MobileFrontend.body.php
@@ -1184,8 +1184,14 @@ class ExtMobileFrontend {
}
public function getApplicationTemplate() {
- global $wgAppleTouchIcon, $wgExtensionAssetsPath, $wgScriptPath, $wgCookiePath;
+ global $wgAppleTouchIcon, $wgExtensionAssetsPath, $wgScriptPath, $wgCookiePath, $wgOut;
wfProfileIn( __METHOD__ );
+ if( self::$isBetaGroupMember ) {
+ $wgOut->addModuleStyles( 'ext.mobileFrontendBeta' );
+ } else {
+ $wgOut->addModuleStyles( 'ext.mobileFrontend' );
+ }
+ $cssLinks = $wgOut->buildCssLinks();
$applicationTemplate = new ApplicationTemplate();
$options = array(
'dir' => self::$dir,
@@ -1196,6 +1202,7 @@ class ExtMobileFrontend {
'isBetaGroupMember' => self::$isBetaGroupMember,
'minifyJS' => self::$minifyJS,
'device' => self::$device,
+ 'cssLinks' => str_replace( 'skins.vector', '', $cssLinks ),
'wgExtensionAssetsPath' => $wgExtensionAssetsPath,
'wgScriptPath' => $wgScriptPath,
'isFilePage' => self::$isFilePage,
diff --git a/MobileFrontend.php b/MobileFrontend.php
index cdb8d3c..4e12c0d 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -196,3 +196,15 @@ function efExtMobileFrontendUnitTests( &$files ) {
* Whether this extension should provide its extracts to OpenSearchXml extension
*/
$wgMFExtendOpenSearchXml = false;
+
+// enable ResourceLoader for css
+$wgResourceModules['ext.mobileFrontend'] = array(
+ 'styles' => array( 'stylesheets/common.css' ),
+ 'localBasePath' => dirname( __FILE__ ),
+ 'remoteExtPath' => 'MobileFrontend',
+);
+$wgResourceModules['ext.mobileFrontendBeta'] = array(
+ 'styles' => 'stylesheets/beta_common.css',
+ 'localBasePath' => dirname( __FILE__ ),
+ 'remoteExtPath' => 'MobileFrontend',
+);
diff --git a/templates/ApplicationTemplate.php b/templates/ApplicationTemplate.php
index 4f088b2..75264d3 100644
--- a/templates/ApplicationTemplate.php
+++ b/templates/ApplicationTemplate.php
@@ -75,7 +75,7 @@ HTML;
<head>
<title>{$this->data['htmlTitle']}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />{$robots}
- <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version={$wgMobileResourceVersion}' media='all' rel='Stylesheet' type='text/css' />
+ {$this->data['cssLinks']}
<link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version={$wgMobileResourceVersion}' media='all' rel='Stylesheet' type='text/css' />
{$filePageStyle}
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes">
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8315
Default Alt Text
34325.diff (2 KB)
Attached To
Mode
T36325: MobileFrontend extension doesn't load MediaWiki:Common.css
Attached
Detach File
Event Timeline
Log In to Comment