* (bug 8567) Added hook RawPageViewBeforeOutput just before the text is blown out in action=raw,
so extensions might influence the output.
* Correct tooltip accesskey hint for Opera on the Macintosh (it uses Shift-Esc-, not Ctrl-).
+* (bug 3446) Add user preference to hide page content below diffs, can be overridden by adding
+ diffonly=1 or diffonly=0 to the URL of the diff page
== Languages updated ==
$diff = $wgRequest->getVal( 'diff' );
$rcid = $wgRequest->getVal( 'rcid' );
$rdfrom = $wgRequest->getVal( 'rdfrom' );
+ $diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );
$wgOut->setArticleFlag( true );
if ( isset( $wgNamespaceRobotPolicies[$ns] ) ) {
$de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid );
// DifferenceEngine directly fetched the revision:
$this->mRevIdFetched = $de->mNewid;
- $de->showDiffPage();
+ $de->showDiffPage( $diffOnly );
// Needed to get the page's current revision
$this->loadPageData();
$this->mRcidMarkPatrolled = intval($rcid); # force it to be an integer
}
- function showDiffPage() {
+ function showDiffPage( $diffOnly = false ) {
global $wgUser, $wgOut, $wgContLang, $wgUseExternalEditor, $wgUseRCPatrol;
$fname = 'DifferenceEngine::showDiffPage';
wfProfileIn( $fname );
# is the first version of that article. In that case, V' does not exist.
if ( $this->mOldid === false ) {
$this->showFirstRevision();
+ $this->renderNewRevision(); // should we respect $diffOnly here or not?
wfProfileOut( $fname );
return;
}
$nextlink . $patrol;
$this->showDiff( $oldHeader, $newHeader );
+
+ if ( !$diffOnly )
+ $this->renderNewRevision();
+
+ wfProfileOut( $fname );
+ }
+
+ /**
+ * Show the new revision of the page.
+ */
+ function renderNewRevision() {
+ global $wgOut;
+ $fname = 'DifferenceEngine::renderNewRevision';
+ wfProfileIn( $fname );
+
$wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" );
if( !$this->mNewRev->isCurrent() ) {
if( is_object( $this->mNewRev ) ) {
$wgOut->setRevisionId( $this->mNewRev->getId() );
}
+
$wgOut->addSecondaryWikiText( $this->mNewtext );
if( !$this->mNewRev->isCurrent() ) {
$wgOut->setSubtitle( wfMsg( 'difference' ) );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
-
- # Show current revision
- #
- $wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" );
- if( is_object( $this->mNewRev ) ) {
- $wgOut->setRevisionId( $this->mNewRev->getId() );
- }
- $wgOut->addSecondaryWikiText( $this->mNewtext );
-
wfProfileOut( $fname );
}
'watchlisthidebots',
'watchlisthideminor',
'ccmeonemails',
+ 'diffonly',
);
/**
'tog-watchlisthideminor' => 'Hide minor edits from the watchlist',
'tog-nolangconversion' => 'Disable variants conversion',
'tog-ccmeonemails' => 'Send me copies of emails I send to other users',
+'tog-diffonly' => "Don't show page content below diffs",
'underline-always' => 'Always',
'underline-never' => 'Never',
'tog-watchlisthideminor'=> 'Piilota pienet muokkaukset',
'tog-nolangconversion' => 'Älä tee muunnoksia kielivarianttien välillä',
'tog-ccmeonemails' => 'Lähetä minulle kopio MediaWikin kautta lähetetyistä sähköposteista',
+'tog-diffonly' => 'Älä näytä sivun sisältöä versioita vertailtaessa',
'underline-always' => 'Aina',
'underline-never' => 'Ei koskaan',