From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- skins/Simple.php | 61 ++++++++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 39 deletions(-) (limited to 'skins/Simple.php') diff --git a/skins/Simple.php b/skins/Simple.php index 416dc3f6..87bb0b7e 100644 --- a/skins/Simple.php +++ b/skins/Simple.php @@ -21,48 +21,31 @@ class SkinSimple extends SkinTemplate { var $skinname = 'simple', $stylename = 'simple', $template = 'MonoBookTemplate', $useHeadElement = true; - function setupSkinUserCss( OutputPage $out ){ - $out->addStyle( 'simple/main.css', 'screen' ); - $out->addStyle( 'simple/rtl.css', '', '', 'rtl' ); - } + function setupSkinUserCss( OutputPage $out ) { + parent::setupSkinUserCss( $out ); - function reallyGenerateUserStylesheet() { - global $wgUser; - $s = ''; - if( ( $undopt = $wgUser->getOption( 'underline' ) ) != 2 ) { - $underline = $undopt ? 'underline' : 'none'; - $s .= "a { text-decoration: $underline; }\n"; - } - if( $wgUser->getOption( 'highlightbroken' ) ) { - $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n"; - } else { - $s .= <<getOption( 'justify' ) ) { - $s .= "#article, #bodyContent { text-align: justify; }\n"; + $out->addModuleStyles( 'skins.simple' ); + + /* Add some userprefs specific CSS styling */ + global $wgUser, $wgContLang; + $rules = array(); + $underline = ""; + + if ( $wgUser->getOption( 'underline' ) < 2 ) { + $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . ";"; } - if( !$wgUser->getOption( 'showtoc' ) ) { - $s .= "#toc { display: none; }\n"; + + /* Also inherits from resourceloader */ + if( !$wgUser->getOption( 'highlightbroken' ) ) { + $rules[] = "a.new, a.stub { color: inherit; text-decoration: inherit;}"; + $rules[] = "a.new:after { color: #CC2200; $underline;}"; + $rules[] = "a.stub:after { $underline; }"; } - if( !$wgUser->getOption( 'editsection' ) ) { - $s .= ".editsection { display: none; }\n"; + $style = implode( "\n", $rules ); + if ( $wgContLang->getDir() === 'rtl' ) { + $style = CSSJanus::transform( $style, true, false ); } - return $s; + $out->addInlineStyle( $style ); + } } -- cgit v1.2.3-54-g00ecf