r5301 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5300‎ | r5301 | r5302 >
Date:17:09, 19 September 2004
Author:hashar
Status:old
Tags:
Comment:
Allow user to always preview text on editing ( implement http://bugzilla.wikipedia.org/show_bug.cgi?id=530 )
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -21,6 +21,7 @@
2222 * New user preference for limitting the image size for images on image description
2323 pages
2424 * Error pages no more offer edit / talk / watch links (bug #502)
 25+* Allow user to preview article on first edit (bug #530)
2526 * ... and more!
2627
2728 === Caveats ===
Index: trunk/phase3/includes/SpecialPreferences.php
@@ -309,7 +309,6 @@
310310 /**
311311 * @access private
312312 */
313 -
314313 function mainPrefsForm( $err ) {
315314 global $wgUser, $wgOut, $wgLang, $wgUseDynamicDates, $wgValidSkinNames;
316315 global $wgAllowRealName, $wgImageLimits;
@@ -513,6 +512,7 @@
514513 </div> " .
515514 $this->getToggle( "editwidth" ) .
516515 $this->getToggle( "showtoolbar" ) .
 516+ $this->getToggle( "previewonfirst" ) .
517517 $this->getToggle( "previewontop" ) .
518518 $this->getToggle( "watchdefault" ) .
519519 $this->getToggle( "minordefault" ) . "
Index: trunk/phase3/includes/EditPage.php
@@ -66,7 +66,7 @@
6767 }
6868 if ( $this->save ) {
6969 $this->editForm( 'save' );
70 - } else if ( $this->preview ) {
 70+ } else if ( $this->preview or $wgUser->getOption('previewonfirst')) {
7171 $this->editForm( 'preview' );
7272 } else { # First time through
7373 $this->editForm( 'initial' );
@@ -402,8 +402,14 @@
403403 $parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
404404 $wgOut->addHTML( $parserOutput->mText );
405405 } else {
 406+ # if user want to see preview when he edit an article
 407+ if( $wgUser->getOption('previewonfirst') and ($this->textbox1 == '')) {
 408+ $this->textbox1 = $this->mArticle->getContent(true);
 409+ }
 410+
406411 $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $this->textbox1 ) ."\n\n",
407 - $wgTitle, $parserOptions );
 412+ $wgTitle, $parserOptions );
 413+
408414 $previewHTML = $parserOutput->mText;
409415
410416 if($wgUser->getOption('previewontop')) {
Index: trunk/phase3/languages/Language.php
@@ -132,6 +132,7 @@
133133 'watchdefault',
134134 'minordefault',
135135 'previewontop',
 136+ 'previewonfirst',
136137 'nocache',
137138 );
138139
@@ -255,6 +256,7 @@
256257 'tog-watchdefault' => 'Add pages you edit to your watchlist',
257258 'tog-minordefault' => 'Mark all edits minor by default',
258259 'tog-previewontop' => 'Show preview before edit box and not after it',
 260+'tog-previewonfirst' => 'Show preview on first edit',
259261 'tog-nocache' => 'Disable page caching',
260262
261263 # dates

Status & tagging log