* New user preference for limitting the image size for images on image description
pages
* Error pages no more offer edit / talk / watch links (bug #502)
+* Allow user to preview article on first edit (bug #530)
* ... and more!
=== Caveats ===
}
if ( $this->save ) {
$this->editForm( 'save' );
- } else if ( $this->preview ) {
+ } else if ( $this->preview or $wgUser->getOption('previewonfirst')) {
$this->editForm( 'preview' );
} else { # First time through
$this->editForm( 'initial' );
$parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
$wgOut->addHTML( $parserOutput->mText );
} else {
+ # if user want to see preview when he edit an article
+ if( $wgUser->getOption('previewonfirst') and ($this->textbox1 == '')) {
+ $this->textbox1 = $this->mArticle->getContent(true);
+ }
+
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $this->textbox1 ) ."\n\n",
- $wgTitle, $parserOptions );
+ $wgTitle, $parserOptions );
+
$previewHTML = $parserOutput->mText;
if($wgUser->getOption('previewontop')) {
/**
* @access private
*/
-
function mainPrefsForm( $err ) {
global $wgUser, $wgOut, $wgLang, $wgUseDynamicDates, $wgValidSkinNames;
global $wgAllowRealName, $wgImageLimits;
</div> " .
$this->getToggle( "editwidth" ) .
$this->getToggle( "showtoolbar" ) .
+ $this->getToggle( "previewonfirst" ) .
$this->getToggle( "previewontop" ) .
$this->getToggle( "watchdefault" ) .
$this->getToggle( "minordefault" ) . "
'watchdefault',
'minordefault',
'previewontop',
+ 'previewonfirst',
'nocache',
);
'tog-watchdefault' => 'Add pages you edit to your watchlist',
'tog-minordefault' => 'Mark all edits minor by default',
'tog-previewontop' => 'Show preview before edit box and not after it',
+'tog-previewonfirst' => 'Show preview on first edit',
'tog-nocache' => 'Disable page caching',
# dates