From: glaisher Date: Sat, 22 Nov 2014 09:35:58 +0000 (+0500) Subject: Hide 'redirectedfrom' notice when printing articles X-Git-Tag: 1.31.0-rc.0~13130^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=f752a7079622ab23bb818d1dd996bb9d25f356e9;p=lhc%2Fweb%2Fwiklou.git Hide 'redirectedfrom' notice when printing articles Wrap the 'redirectedfrom' message in "mw-redirectedfrom" id and then add it to commonPrint.css to hide it when printing. Bug: 16296 Change-Id: I077bda9596c37b122a1f6964470d9d85108d834e --- diff --git a/includes/page/Article.php b/includes/page/Article.php index cf53f1d59a..e3541bd9a8 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1003,7 +1003,9 @@ class Article implements Page { array( 'redirect' => 'no' ) ); - $outputPage->addSubtitle( wfMessage( 'redirectedfrom' )->rawParams( $redir ) ); + $outputPage->addSubtitle( "" . + wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse() + . "" ); // Add the script to update the displayed URL and // set the fragment if one was specified in the redirect @@ -1025,7 +1027,9 @@ class Article implements Page { // If it was reported from a trusted site, supply a backlink. if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) { $redir = Linker::makeExternalLink( $rdfrom, $rdfrom ); - $outputPage->addSubtitle( wfMessage( 'redirectedfrom' )->rawParams( $redir ) ); + $outputPage->addSubtitle( "" . + wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse() + . "" ); // Add the script to update the displayed URL $outputPage->addJsConfigVars( array( diff --git a/resources/src/mediawiki.legacy/commonPrint.css b/resources/src/mediawiki.legacy/commonPrint.css index 9405719f96..ef2d71e128 100644 --- a/resources/src/mediawiki.legacy/commonPrint.css +++ b/resources/src/mediawiki.legacy/commonPrint.css @@ -34,6 +34,7 @@ span.mw-filepage-other-resolutions, #filetoc, .usermessage, .patrollink, +.ns-0 .mw-redirectedfrom, #mw-navigation, #siteNotice { display: none;