From: Roan Kattouw Date: Wed, 4 Jan 2012 20:01:29 +0000 (+0000) Subject: Redo r107066 properly: apply CSSJanus to user CSS previews when needed. Ping r94421 X-Git-Tag: 1.31.0-rc.0~25528 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=6de6b5f6bf9ae7f732b29161db5472b8cefd4950;p=lhc%2Fweb%2Fwiklou.git Redo r107066 properly: apply CSSJanus to user CSS previews when needed. Ping r94421 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 05b3bf0e76..090a08b760 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3166,7 +3166,8 @@ $templates * @return string */ public function buildCssLinks() { - global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs; + global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, + $wgLang, $wgContLang; $this->getSkin()->setupSkinUserCss( $this ); @@ -3195,8 +3196,15 @@ $templates $otherTags .= $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, false, array( 'excludepage' => $this->getTitle()->getPrefixedDBkey() ) ); + // Load the previewed CSS - $otherTags .= Html::inlineStyle( $this->getRequest()->getText( 'wpTextbox1' ) ); + // If needed, Janus it first. This is user-supplied CSS, so it's + // assumed to be right for the content language directionality. + $previewedCSS = $this->getRequest()->getText( 'wpTextbox1' ); + if ( $wgLang->getDir() !== $wgContLang->getDir() ) { + $previewedCSS = CSSJanus::transform( $previewedCSS, true, false ); + } + $otherTags .= Html::inlineStyle( $previewedCSS ); } else { // Load the user styles normally $moduleStyles[] = 'user';