Index: trunk/phase3/skins/Simple.php |
— | — | @@ -30,12 +30,12 @@ |
31 | 31 | $out->addModuleStyles( 'skins.simple' ); |
32 | 32 | |
33 | 33 | /* Add some userprefs specific CSS styling */ |
34 | | - global $wgUser, $wgContLang; |
| 34 | + global $wgUser; |
35 | 35 | $rules = array(); |
36 | 36 | $underline = ""; |
37 | 37 | |
38 | 38 | if ( $wgUser->getOption( 'underline' ) < 2 ) { |
39 | | - $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . ";"; |
| 39 | + $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . " !important;"; |
40 | 40 | } |
41 | 41 | |
42 | 42 | /* Also inherits from resourceloader */ |
— | — | @@ -45,10 +45,7 @@ |
46 | 46 | $rules[] = "a.stub:after { $underline; }"; |
47 | 47 | } |
48 | 48 | $style = implode( "\n", $rules ); |
49 | | - if ( $wgContLang->getDir() === 'rtl' ) { |
50 | | - $style = CSSJanus::transform( $style, true, false ); |
51 | | - } |
52 | | - $out->addInlineStyle( $style ); |
| 49 | + $out->addInlineStyle( $style, /* flip css if RTL */true ); |
53 | 50 | |
54 | 51 | } |
55 | 52 | } |
Index: trunk/phase3/skins/CologneBlue.php |
— | — | @@ -30,24 +30,24 @@ |
31 | 31 | $rules = array(); |
32 | 32 | |
33 | 33 | if ( 2 == $qb ) { # Right |
34 | | - $rules[] = "#quickbar { position: absolute; right: 4px; }"; |
35 | | - $rules[] = "#article { margin-left: 4px; margin-right: 148px; }"; |
| 34 | + $rules[] = "/* @noflip */#quickbar { position: absolute; right: 4px; }"; |
| 35 | + $rules[] = "/* @noflip */#article { margin-left: 4px; margin-right: 148px; }"; |
36 | 36 | } elseif ( 1 == $qb ) { |
37 | | - $rules[] = "#quickbar { position: absolute; left: 4px; }"; |
38 | | - $rules[] = "#article { margin-left: 148px; margin-right: 4px; }"; |
| 37 | + $rules[] = "/* @noflip */#quickbar { position: absolute; left: 4px; }"; |
| 38 | + $rules[] = "/* @noflip */#article { margin-left: 148px; margin-right: 4px; }"; |
39 | 39 | } elseif ( 3 == $qb ) { # Floating left |
40 | | - $rules[] = "#quickbar { position:absolute; left:4px }"; |
41 | | - $rules[] = "#topbar { margin-left: 148px }"; |
42 | | - $rules[] = "#article { margin-left:148px; margin-right: 4px; }"; |
43 | | - $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE |
| 40 | + $rules[] = "/* @noflip */#quickbar { position:absolute; left:4px }"; |
| 41 | + $rules[] = "/* @noflip */#topbar { margin-left: 148px }"; |
| 42 | + $rules[] = "/* @noflip */#article { margin-left:148px; margin-right: 4px; }"; |
| 43 | + $rules[] = "/* @noflip */body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto; bottom:4px;}"; # Hides from IE |
44 | 44 | } elseif ( 4 == $qb ) { # Floating right |
45 | | - $rules[] = "#quickbar { position: fixed; right: 4px; }"; |
46 | | - $rules[] = "#topbar { margin-right: 148px }"; |
47 | | - $rules[] = "#article { margin-right: 148px; margin-left: 4px; }"; |
48 | | - $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE |
| 45 | + $rules[] = "/* @noflip */#quickbar { position: fixed; right: 4px; }"; |
| 46 | + $rules[] = "/* @noflip */#topbar { margin-right: 148px }"; |
| 47 | + $rules[] = "/* @noflip */#article { margin-right: 148px; margin-left: 4px; }"; |
| 48 | + $rules[] = "/* @noflip */body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE |
49 | 49 | } |
50 | 50 | $style = implode( "\n", $rules ); |
51 | | - $out->addInlineStyle( $style ); |
| 51 | + $out->addInlineStyle( $style, /* flip css if RTL */true ); |
52 | 52 | } |
53 | 53 | |
54 | 54 | } |
Index: trunk/phase3/skins/Standard.php |
— | — | @@ -29,21 +29,21 @@ |
30 | 30 | $rules = array(); |
31 | 31 | |
32 | 32 | if ( 2 == $qb ) { # Right |
33 | | - $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }"; |
34 | | - $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }"; |
| 33 | + $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }"; |
| 34 | + $rules[] = "/* @noflip */#article, /* @noflip */#mw-data-after-content { margin-left: 4px; margin-right: 152px; }"; |
35 | 35 | } elseif ( 1 == $qb || 3 == $qb ) { |
36 | | - $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }"; |
37 | | - $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }"; |
| 36 | + $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }"; |
| 37 | + $rules[] = "/* @noflip */#article, /* @noflip */#mw-data-after-content { margin-left: 152px; margin-right: 4px; }"; |
38 | 38 | if( 3 == $qb ) { |
39 | | - $rules[] = "#quickbar { position: fixed; padding: 4px; }"; |
| 39 | + $rules[] = "/* @noflip */#quickbar { position: fixed; padding: 4px; }"; |
40 | 40 | } |
41 | 41 | } elseif ( 4 == $qb ) { |
42 | | - $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; |
43 | | - $rules[] = "#quickbar { border-right: 1px solid gray; }"; |
44 | | - $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }"; |
| 42 | + $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}"; |
| 43 | + $rules[] = "/* @noflip */#quickbar { border-right: 1px solid gray; }"; |
| 44 | + $rules[] = "/* @noflip */#article, /* @noflip */#mw-data-after-content { margin-right: 152px; margin-left: 4px; }"; |
45 | 45 | } |
46 | 46 | $style = implode( "\n", $rules ); |
47 | | - $out->addInlineStyle( $style ); |
| 47 | + $out->addInlineStyle( $style, /* flip css if RTL */true ); |
48 | 48 | } |
49 | 49 | |
50 | 50 | } |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2949,8 +2949,13 @@ |
2950 | 2950 | /** |
2951 | 2951 | * Adds inline CSS styles |
2952 | 2952 | * @param $style_css Mixed: inline CSS |
| 2953 | + * @param $flip Boolean: Whether to flip the CSS if needed |
2953 | 2954 | */ |
2954 | | - public function addInlineStyle( $style_css ){ |
| 2955 | + public function addInlineStyle( $style_css, $flip = false ) { |
| 2956 | + if( $flip && $this->getLang()->isRTL() ) { |
| 2957 | + # If wanted, and the interface is right-to-left, flip the CSS |
| 2958 | + $style_css = CSSJanus::transform( $style_css, true, false ); |
| 2959 | + } |
2955 | 2960 | $this->mInlineStyles .= Html::inlineStyle( $style_css ); |
2956 | 2961 | } |
2957 | 2962 | |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | // Underline: 2 = browser default, 1 = always, 0 = never |
99 | 99 | if ( $options['underline'] < 2 ) { |
100 | 100 | $rules[] = "a { text-decoration: " . |
101 | | - ( $options['underline'] ? 'underline' : 'none' ) . "; }"; |
| 101 | + ( $options['underline'] ? 'underline' : 'none' ) . " !important; }"; |
102 | 102 | } |
103 | 103 | if ( $options['highlightbroken'] ) { |
104 | 104 | $rules[] = "a.new, #quickbar a.new { color: #ba0000; }\n"; |