Index: trunk/phase3/includes/ResourceLoaderContext.php |
— | — | @@ -31,7 +31,6 @@ |
32 | 32 | protected $modules; |
33 | 33 | protected $language; |
34 | 34 | protected $direction; |
35 | | - protected $flip; |
36 | 35 | protected $skin; |
37 | 36 | protected $debug; |
38 | 37 | protected $only; |
— | — | @@ -40,7 +39,7 @@ |
41 | 40 | /* Methods */ |
42 | 41 | |
43 | 42 | public function __construct( WebRequest $request, $server ) { |
44 | | - global $wgUser, $wgLang, $wgContLang, $wgDefaultSkin; |
| 43 | + global $wgUser, $wgLang, $wgDefaultSkin; |
45 | 44 | |
46 | 45 | $this->request = $request; |
47 | 46 | $this->server = $server; |
— | — | @@ -61,8 +60,6 @@ |
62 | 61 | if ( !$this->skin ) { |
63 | 62 | $this->skin = $wgDefaultSkin; |
64 | 63 | } |
65 | | - // Evaluate flip |
66 | | - $this->flip = $wgContLang->getDir() !== $this->direction; |
67 | 64 | } |
68 | 65 | |
69 | 66 | public function getRequest() { |
— | — | @@ -85,10 +82,6 @@ |
86 | 83 | return $this->direction; |
87 | 84 | } |
88 | 85 | |
89 | | - public function getFlip() { |
90 | | - return $this->flip; |
91 | | - } |
92 | | - |
93 | 86 | public function getSkin() { |
94 | 87 | return $this->skin; |
95 | 88 | } |
Index: trunk/phase3/includes/ResourceLoader.php |
— | — | @@ -294,7 +294,7 @@ |
295 | 295 | $context->shouldIncludeStyles() && |
296 | 296 | ( $styles .= self::$modules[$name]->getStyle( $context ) ) !== '' |
297 | 297 | ) { |
298 | | - if ( $context->getFlip() ) { |
| 298 | + if ( self::$modules[$name]->getFlip( $context ) ) { |
299 | 299 | $styles = self::filter( 'flip-css', $styles ); |
300 | 300 | } |
301 | 301 | $styles = $context->getDebug() ? $styles : self::filter( 'minify-css', $styles ); |
Index: trunk/phase3/includes/ResourceLoaderModule.php |
— | — | @@ -69,7 +69,16 @@ |
70 | 70 | global $wgResourceLoaderServerMaxage; |
71 | 71 | return $wgResourceLoaderServerMaxage; |
72 | 72 | } |
| 73 | + |
| 74 | + /** |
| 75 | + * Get whether CSS for this module should be flipped |
| 76 | + */ |
| 77 | + public function getFlip( $context ) { |
| 78 | + return $context->getDirection() === 'rtl'; |
| 79 | + } |
73 | 80 | |
| 81 | + /* Abstract Methods */ |
| 82 | + |
74 | 83 | /** |
75 | 84 | * Get all JS for this module for a given language and skin. |
76 | 85 | * Includes all relevant JS except loader scripts. |
— | — | @@ -423,7 +432,7 @@ |
424 | 433 | $this->modifiedTime[$context->getHash()] = max( $filesMtime, $msgBlobMtime ); |
425 | 434 | return $this->modifiedTime[$context->getHash()]; |
426 | 435 | } |
427 | | - |
| 436 | + |
428 | 437 | /* Protected Members */ |
429 | 438 | |
430 | 439 | /** |
— | — | @@ -689,6 +698,10 @@ |
690 | 699 | } |
691 | 700 | |
692 | 701 | public function getStyle( ResourceLoaderContext $context ) { return ''; } |
| 702 | + public function getFlip( $context ) { |
| 703 | + global $wgContLang; |
| 704 | + return $wgContLang->getDir() !== $context->getDirection(); |
| 705 | + } |
693 | 706 | public function getMessages() { return array(); } |
694 | 707 | public function getLoaderScript() { return ''; } |
695 | 708 | public function getDependencies() { return array(); } |