http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72367
Revision: 72367
Author: tparscal
Date: 2010-09-04 10:28:41 +0000 (Sat, 04 Sep 2010)
Log Message:
-----------
Only flip CSS if dir is different from $wgContLang
Modified Paths:
--------------
trunk/phase3/includes/ResourceLoader.php
trunk/phase3/includes/ResourceLoaderContext.php
Modified: trunk/phase3/includes/ResourceLoader.php
===================================================================
--- trunk/phase3/includes/ResourceLoader.php 2010-09-04 10:24:23 UTC (rev
72366)
+++ trunk/phase3/includes/ResourceLoader.php 2010-09-04 10:28:41 UTC (rev
72367)
@@ -294,7 +294,7 @@
$context->shouldIncludeStyles() &&
( $styles .= self::$modules[$name]->getStyle(
$context ) ) !== ''
) {
- if ( $context->getDirection() == 'rtl' ) {
+ if ( $context->getFlip() ) {
$styles = self::filter( 'flip-css',
$styles );
}
$styles = $context->getDebug() ? $styles :
self::filter( 'minify-css', $styles );
Modified: trunk/phase3/includes/ResourceLoaderContext.php
===================================================================
--- trunk/phase3/includes/ResourceLoaderContext.php 2010-09-04 10:24:23 UTC
(rev 72366)
+++ trunk/phase3/includes/ResourceLoaderContext.php 2010-09-04 10:28:41 UTC
(rev 72367)
@@ -31,6 +31,7 @@
protected $modules;
protected $language;
protected $direction;
+ protected $flip;
protected $skin;
protected $debug;
protected $only;
@@ -39,7 +40,7 @@
/* Methods */
public function __construct( WebRequest $request, $server ) {
- global $wgUser, $wgLang, $wgDefaultSkin;
+ global $wgUser, $wgLang, $wgContLang, $wgDefaultSkin;
$this->request = $request;
$this->server = $server;
@@ -60,6 +61,8 @@
if ( !$this->skin ) {
$this->skin = $wgDefaultSkin;
}
+ // Evaluate flip
+ $this->flip = $wgContLang->getDir() !== $this->direction;
}
public function getRequest() {
@@ -77,11 +80,15 @@
public function getLanguage() {
return $this->language;
}
-
+
public function getDirection() {
return $this->direction;
}
+ public function getFlip() {
+ return $this->flip;
+ }
+
public function getSkin() {
return $this->skin;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs