From: Chad Horohoe Date: Sat, 21 Jun 2008 23:40:26 +0000 (+0000) Subject: Add MediaWiki:Print.css back in. Now applies to printable=yes -and- actual printing... X-Git-Tag: 1.31.0-rc.0~46909 X-Git-Url: https://git.cyclocoop.org/%27%20.%20%24this-%3EgetSkin%28%29-%3EescapeSearchLink%28%29%20.%20%27?a=commitdiff_plain;h=7b6245af2aca1124b57832bcb65331c024e4ac76;p=lhc%2Fweb%2Fwiklou.git Add MediaWiki:Print.css back in. Now applies to printable=yes -and- actual printing media. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 839f87e7d7..e96c2cd387 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -160,6 +160,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14558) New system message (emailuserfooter) is now added to the footer of e-mails sent with Special:Emailuser * Add support for Hijri (Islamic) calendar +* (bug 2889) MediaWiki:Print.css applies to the printable version === Bug fixes in 1.13 === diff --git a/includes/Skin.php b/includes/Skin.php index 3f8c6b983f..86c8c05ed5 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -416,7 +416,7 @@ class Skin extends Linker { # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way) function getUserStylesheet() { - global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion; + global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion, $wgOut; $sheet = $this->getStylesheet(); $s = "@import \"$wgStylePath/common/shared.css?$wgStyleVersion\";\n"; $s .= "@import \"$wgStylePath/common/oldshared.css?$wgStyleVersion\";\n"; @@ -428,6 +428,8 @@ class Skin extends Linker { '@import "' . self::makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n"; $s .= $this->doGetUserStyles(); + if($wgOut->isPrintable()) $s .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ) . "\";\n"; + else $s .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ) . "\" print;\n"; return $s."\n"; } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c60cfb4e7b..5339160e5b 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -962,7 +962,8 @@ class SkinTemplate extends Skin { function setupUserCss() { wfProfileIn( __METHOD__ ); - global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; + global $wgRequest, $wgAllowUserCss, $wgUseSiteCss, + $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser, $wgOut; $sitecss = ''; $usercss = ''; @@ -1005,6 +1006,8 @@ class SkinTemplate extends Skin { $sitecss .= '@import "' . self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) . '";' . "\n"; $sitecss .= '@import "' . self::makeNSUrl( ucfirst( $this->skinname ) . '.css', $query, NS_MEDIAWIKI ) . '";' . "\n"; $sitecss .= '@import "' . self::makeUrl( '-', "action=raw&gen=css$siteargs$skinquery" ) . '";' . "\n"; + if( $wgOut->isPrintable()) $sitecss .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI) . '";' . "\n"; + else $sitecss .= '@import "' . self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI) . '" print;' . "\n"; } # If we use any dynamic CSS, make a little CDATA block out of it. diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 9bcc004926..e879229e33 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2669,6 +2669,7 @@ All transwiki import actions are logged at the [[Special:Log/import|import log]] 'chick.css' => '/* CSS placed here will affect users of the Chick skin */', # only translate this message to other languages if you have to change it 'simple.css' => '/* CSS placed here will affect users of the Simple skin */', # only translate this message to other languages if you have to change it 'modern.css' => '/* CSS placed here will affect users of the Modern skin */', # only translate this message to other languages if you have to change it +'print.css' => '/* CSS placed here will be applied to the printable version */', # only translate this message to other languages if you have to change it # Scripts 'common.js' => '/* Any JavaScript here will be loaded for all users on every page load. */', # only translate this message to other languages if you have to change it diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index da23f94281..008a9b966b 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -202,6 +202,7 @@ $wgOptionalMessages = array( 'chick.css', 'simple.css', 'modern.css', + 'print.css', 'common.js', 'standard.js', 'nostalgia.js', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 882f0c0a99..debf8c5b8c 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1890,6 +1890,7 @@ $wgMessageStructure = array( 'chick.css', 'simple.css', 'modern.css', + 'print.css', ), 'scripts' => array( 'common.js',