From a0506cac1762fa1b8304513ff6999d8f9b2024fc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 3 Apr 2004 10:23:26 +0000 Subject: [PATCH] Basic page rendering and editing now works in XHTML! Yeah! To test: $wgMimeType = "text/xml"; $wgDocType = "-//W3C//DTD XHTML 1.0 Transitional//EN"; $wgDTD = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"; --- includes/EditPage.php | 8 ++++---- includes/Parser.php | 10 +++++----- includes/Skin.php | 17 +++++++++++++---- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 8ce60faaaa..e2946a8321 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -304,11 +304,11 @@ class EditPage { $watchhtml = ""; if ( 0 != $wgUser->getID() ) { - $watchhtml = "watchthis?" checked":"")." id='wpWatchthis'>". + $watchhtml = "watchthis?" checked":"")." id='wpWatchthis' />". ""; } - $checkboxhtml = $minoredithtml . $watchhtml . "
"; + $checkboxhtml = $minoredithtml . $watchhtml . "
"; if ( "preview" == $formtype) { $previewhead="

" . wfMsg( "preview" ) . "

\n

" . @@ -338,11 +338,11 @@ class EditPage { # Otherwise, show a summary field at the bottom $summarytext = htmlspecialchars( $wgLang->recodeForEdit( $this->summary ) ); # FIXME if( $this->section == "new" ) { - $commentsubject="{$subject}:
"; + $commentsubject="{$subject}:
"; $editsummary = ""; } else { $commentsubject = ""; - $editsummary="{$summary}:
"; + $editsummary="{$summary}:
"; } if( !$this->preview ) { diff --git a/includes/Parser.php b/includes/Parser.php index b526d2d4d9..b7e88122e8 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -968,7 +968,8 @@ class Parser # and making lists from lines starting with * # : etc. # $a = explode( "\n", $text ); - $text = $lastPref = ""; + $text = "

"; # ?? + $lastPref = ""; $this->mDTopen = $inBlockElem = false; if ( ! $linestart ) { $text .= array_shift( $a ); } @@ -1029,8 +1030,9 @@ class Parser if ( " " == $t{0} ) { $newSection = "pre"; # $t = wfEscapeHTML( $t ); + } else { + $newSection = "p"; } - else { $newSection = "p"; } if ( 0 == strcmp( "", trim( $oLine ) ) ) { $text .= $this->closeParagraph(); @@ -1056,9 +1058,7 @@ class Parser --$npl; } if ( "" != $this->mLastSection ) { - if ( "p" != $this->mLastSection ) { - $text .= "mLastSection . ">"; - } + $text .= "mLastSection . ">"; $this->mLastSection = ""; } wfProfileOut( $fname ); diff --git a/includes/Skin.php b/includes/Skin.php index 13c345d3be..7090698dc9 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -335,7 +335,6 @@ class Skin { $s .= $this->pageTitle(); $s .= $this->pageSubtitle() ; $s .= getCategories(); // For some odd reason, zhis can't be a function of the object - $s .= "\n

"; wfProfileOut( $fname ); return $s; } @@ -2323,8 +2322,7 @@ class Skin { // toolbar for common editing functions. It can be disabled in the user preferences. // The necsesary JavaScript code can be found in style/wikibits.js. function getEditToolbar() { - - global $wgUploadPath,$wgLang; + global $wgUploadPath, $wgLang, $wgMimeType; // toolarray an array of arrays which each include the filename of // the button image (without path), the opening tag, the closing tag, @@ -2389,6 +2387,12 @@ class Skin { "tip"=>wfMsg("hr_tip")) ); $toolbar =""; + $toolbar.="document.writeln(\"\");\n"; + + if( $xml ) { + $toolbar .= "]]>"; + } + $toolbar.=""; return $toolbar; } } -- 2.20.1