Index: trunk/phase3/skins/Simple.php |
— | — | @@ -21,36 +21,31 @@ |
22 | 22 | var $skinname = 'simple', $stylename = 'simple', |
23 | 23 | $template = 'MonoBookTemplate', $useHeadElement = true; |
24 | 24 | |
25 | | - function setupSkinUserCss( OutputPage $out ){ |
| 25 | + function setupSkinUserCss( OutputPage $out ) { |
26 | 26 | parent::setupSkinUserCss( $out ); |
27 | 27 | |
28 | | - $out->addStyle( 'simple/main.css', 'screen' ); |
29 | | - } |
| 28 | + $out->addModuleStyles( 'skins.simple' ); |
30 | 29 | |
31 | | - function reallyGenerateUserStylesheet() { |
32 | | - global $wgUser; |
33 | | - $s = ''; |
34 | | - if( $wgUser->getOption( 'highlightbroken' ) ) { |
35 | | - $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n"; |
36 | | - } else { |
37 | | - $s .= <<<CSS |
38 | | -a.new, #quickbar a.new, |
39 | | -a.stub, #quickbar a.stub { |
40 | | - color: inherit; |
41 | | - text-decoration: inherit; |
42 | | -} |
43 | | -a.new:after, #quickbar a.new:after { |
44 | | - content: "?"; |
45 | | - color: #CC2200; |
46 | | - text-decoration: $underline; |
47 | | -} |
48 | | -a.stub:after, #quickbar a.stub:after { |
49 | | - content: "!"; |
50 | | - color: #772233; |
51 | | - text-decoration: $underline; |
52 | | -} |
53 | | -CSS; |
| 30 | + /* Add some userprefs specific CSS styling */ |
| 31 | + global $wgUser, $wgContLang; |
| 32 | + $rules = array(); |
| 33 | + $underline = ""; |
| 34 | + |
| 35 | + if ( $wgUser->getOption( 'underline' ) < 2 ) { |
| 36 | + $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . ";"; |
54 | 37 | } |
55 | | - return $s; |
| 38 | + |
| 39 | + /* Also inherits from resourceloader */ |
| 40 | + if( !$wgUser->getOption( 'highlightbroken' ) ) { |
| 41 | + $rules[] = "a.new, a.stub { color: inherit; text-decoration: inherit;}"; |
| 42 | + $rules[] = "a.new:after { color: #CC2200; $underline;}"; |
| 43 | + $rules[] = "a.stub:after { $underline; }"; |
| 44 | + } |
| 45 | + $style = implode( "\n", $rules ); |
| 46 | + if ( $wgContLang->getDir() === 'rtl' ) { |
| 47 | + $style = CSSJanus::transform( $style, true, false ); |
| 48 | + } |
| 49 | + $out->addInlineStyle( $style ); |
| 50 | + |
56 | 51 | } |
57 | 52 | } |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -21,6 +21,9 @@ |
22 | 22 | //$GLOBALS['wgHandheldStyle'] => array( 'media' => 'handheld' ), |
23 | 23 | ), |
24 | 24 | ), |
| 25 | + 'skins.simple' => array( |
| 26 | + 'styles' => array( 'skins/simple/main.css' => array( 'media' => 'screen' ) ), |
| 27 | + ), |
25 | 28 | |
26 | 29 | /* jQuery */ |
27 | 30 | |