From bad64ce05d7345f094ba58607b0036bc0cc57a91 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 29 Aug 2008 13:46:06 +0000 Subject: [PATCH] Fix breakage of Live preview (patch by dantman himself) --- includes/EditPage.php | 15 +++++++++++---- skins/common/shared.css | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index c71942e6de..de414416c5 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1515,14 +1515,21 @@ END protected function displayPreviewArea( $previewOutput, $isOnTop = false ) { global $wgOut; - $classes = array( 'wikiPreview' ); - if( $isOnTop ) $classes[] = 'ontop'; - $attribs = array( 'class' => implode( ' ', $classes ) ); - if( $this->formtype != 'preview' ) $attribs['style'] = 'display: none;'; + $classes = array(); + if( $isOnTop ) + $classes[] = 'ontop'; + + $attribs = array( 'id' => 'wikiPreview', 'class' => implode( ' ', $classes ) ); + + if( $this->formtype != 'preview' ) + $attribs['style'] = 'display: none;'; + $wgOut->addHTML( Xml::openElement( 'div', $attribs ) ); + if ( $this->formtype == 'preview' ) { $this->showPreview( $previewOutput ); } + $wgOut->addHTML( '' ); if ( $this->formtype == 'diff') { diff --git a/skins/common/shared.css b/skins/common/shared.css index 9da982161f..daba44b7e4 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -11,7 +11,7 @@ span.texhtml { font-family: serif; } /* add a bit of margin space between the preview and the toolbar */ /* this replaces the ugly


we used to insert into the page source */ -.wikiPreview.ontop { margin-bottom: 1em; } +#wikiPreview.ontop { margin-bottom: 1em; } /* Stop floats from intruding into edit area in previews */ #toolbar, #wpTextbox1 { clear: both; } -- 2.20.1