Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -21,6 +21,7 @@ |
22 | 22 | * New user preference for limitting the image size for images on image description |
23 | 23 | pages |
24 | 24 | * Error pages no more offer edit / talk / watch links (bug #502) |
| 25 | +* Allow user to preview article on first edit (bug #530) |
25 | 26 | * ... and more! |
26 | 27 | |
27 | 28 | === Caveats === |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -309,7 +309,6 @@ |
310 | 310 | /** |
311 | 311 | * @access private |
312 | 312 | */ |
313 | | - |
314 | 313 | function mainPrefsForm( $err ) { |
315 | 314 | global $wgUser, $wgOut, $wgLang, $wgUseDynamicDates, $wgValidSkinNames; |
316 | 315 | global $wgAllowRealName, $wgImageLimits; |
— | — | @@ -513,6 +512,7 @@ |
514 | 513 | </div> " . |
515 | 514 | $this->getToggle( "editwidth" ) . |
516 | 515 | $this->getToggle( "showtoolbar" ) . |
| 516 | + $this->getToggle( "previewonfirst" ) . |
517 | 517 | $this->getToggle( "previewontop" ) . |
518 | 518 | $this->getToggle( "watchdefault" ) . |
519 | 519 | $this->getToggle( "minordefault" ) . " |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | } |
68 | 68 | if ( $this->save ) { |
69 | 69 | $this->editForm( 'save' ); |
70 | | - } else if ( $this->preview ) { |
| 70 | + } else if ( $this->preview or $wgUser->getOption('previewonfirst')) { |
71 | 71 | $this->editForm( 'preview' ); |
72 | 72 | } else { # First time through |
73 | 73 | $this->editForm( 'initial' ); |
— | — | @@ -402,8 +402,14 @@ |
403 | 403 | $parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions ); |
404 | 404 | $wgOut->addHTML( $parserOutput->mText ); |
405 | 405 | } 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 | + |
406 | 411 | $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $this->textbox1 ) ."\n\n", |
407 | | - $wgTitle, $parserOptions ); |
| 412 | + $wgTitle, $parserOptions ); |
| 413 | + |
408 | 414 | $previewHTML = $parserOutput->mText; |
409 | 415 | |
410 | 416 | if($wgUser->getOption('previewontop')) { |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -132,6 +132,7 @@ |
133 | 133 | 'watchdefault', |
134 | 134 | 'minordefault', |
135 | 135 | 'previewontop', |
| 136 | + 'previewonfirst', |
136 | 137 | 'nocache', |
137 | 138 | ); |
138 | 139 | |
— | — | @@ -255,6 +256,7 @@ |
256 | 257 | 'tog-watchdefault' => 'Add pages you edit to your watchlist', |
257 | 258 | 'tog-minordefault' => 'Mark all edits minor by default', |
258 | 259 | 'tog-previewontop' => 'Show preview before edit box and not after it', |
| 260 | +'tog-previewonfirst' => 'Show preview on first edit', |
259 | 261 | 'tog-nocache' => 'Disable page caching', |
260 | 262 | |
261 | 263 | # dates |