r108078 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108077‎ | r108078 | r108079 >
Date:20:01, 4 January 2012
Author:catrope
Status:ok
Tags:
Comment:
Redo r107066 properly: apply CSSJanus to user CSS previews when needed. Ping r94421
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -3166,7 +3166,8 @@
31673167 * @return string
31683168 */
31693169 public function buildCssLinks() {
3170 - global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs;
 3170+ global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs,
 3171+ $wgLang, $wgContLang;
31713172
31723173 $this->getSkin()->setupSkinUserCss( $this );
31733174
@@ -3195,8 +3196,15 @@
31963197 $otherTags .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, false,
31973198 array( 'excludepage' => $this->getTitle()->getPrefixedDBkey() )
31983199 );
 3200+
31993201 // Load the previewed CSS
3200 - $otherTags .= Html::inlineStyle( $this->getRequest()->getText( 'wpTextbox1' ) );
 3202+ // If needed, Janus it first. This is user-supplied CSS, so it's
 3203+ // assumed to be right for the content language directionality.
 3204+ $previewedCSS = $this->getRequest()->getText( 'wpTextbox1' );
 3205+ if ( $wgLang->getDir() !== $wgContLang->getDir() ) {
 3206+ $previewedCSS = CSSJanus::transform( $previewedCSS, true, false );
 3207+ }
 3208+ $otherTags .= Html::inlineStyle( $previewedCSS );
32013209 } else {
32023210 // Load the user styles normally
32033211 $moduleStyles[] = 'user';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94421(bug 26283) Previewing user JS/CSS pages doesn't load other user JS/CSS pagescatrope17:27, 13 August 2011
r107066apply CSS::Janus when user preview its CSS style...hashar13:35, 22 December 2011

Status & tagging log