* user{css,js}preview was not shown since r40066
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 28 Sep 2008 14:56:07 +0000 (14:56 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 28 Sep 2008 14:56:07 +0000 (14:56 +0000)
* readd !preview condition to usercssjsyoucanpreview

includes/EditPage.php

index 40cf39a..f11affc 100644 (file)
@@ -1178,7 +1178,9 @@ class EditPage {
                        if ( $this->isCssJsSubpage ) {
                                # Check the skin exists
                                if ( $this->isValidCssJsSubpage ) {
-                                       $wgOut->addWikiMsg( 'usercssjsyoucanpreview' );
+                                       if ( $this->formtype !== 'preview' ) {
+                                               $wgOut->addWikiMsg( 'usercssjsyoucanpreview' );
+                                       }
                                } else {
                                        $wgOut->addWikiMsg( 'userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage() );
                                }
@@ -1645,9 +1647,8 @@ END
                                $previewtext = wfMsg('userjspreview');
                        }
                        $parserOptions->setTidy(true);
-                       $parserOutput = $wgParser->parse( $previewtext , $this->mTitle, $parserOptions );
-                       //$wgOut->addHTML( $parserOutput->mText );
-                       $previewHTML = '';
+                       $parserOutput = $wgParser->parse( $previewtext, $this->mTitle, $parserOptions );
+                       $previewHTML = $parserOutput->mText;
                } elseif ( $rt = Title::newFromRedirect( $this->textbox1 ) ) {
                        $previewHTML = $this->mArticle->viewRedirect( $rt, false );
                } else {