This adds a class 'mw-textarea-oldrev' to the editing area when an old
page revision is edited. It seems that the warning MediaWiki:Editingold
is not sufficient for some users and some css tweaks might be
appreciated, as is already done for protected pages.
Bug: T124226
Change-Id: Ifc53af0f827a5cebfd9cc220b0aa247210e8dcfc
*/
protected $context;
+ /**
+ * @var bool Whether an old revision is edited
+ */
+ private $isOldRev = false;
+
/**
* @param Article $article
*/
if ( !$revision->isCurrent() ) {
$this->mArticle->setOldSubtitle( $revision->getId() );
$wgOut->addWikiMsg( 'editingold' );
+ $this->isOldRev = true;
}
} elseif ( $this->mTitle->exists() ) {
// Something went wrong
$classes[] = 'mw-textarea-cprotected';
}
}
+ # Is an old revision being edited?
+ if ( $this->isOldRev ) {
+ $classes[] = 'mw-textarea-oldrev';
+ }
$attribs = [ 'tabindex' => 1 ];