From: Ed Sanders Date: Mon, 17 Jul 2017 20:19:33 +0000 (+0100) Subject: Export revision IDs to JS config on diff pages X-Git-Tag: 1.31.0-rc.0~2686^2 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=a469795efc5bc1c585c9f84ee289ee099833661d;p=lhc%2Fweb%2Fwiklou.git Export revision IDs to JS config on diff pages Bug: T169574 Change-Id: Ic4abaae6e9c74509f7a114a697cdbb78dd1b89b6 --- diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30 index 87e6ce553f..51f9764156 100644 --- a/RELEASE-NOTES-1.30 +++ b/RELEASE-NOTES-1.30 @@ -41,6 +41,7 @@ section). enabled by setting $wgUsePigLatinVariant to true. * Added RecentChangesPurgeRows hook to allow extensions to purge data that depends on the recentchanges table. +* Added JS config values wgDiffOldId/wgDiffNewId to the output of diff pages. === Languages updated in 1.30 === diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 0b58cc1bc6..70e138c839 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -377,6 +377,11 @@ class DifferenceEngine extends ContextSource { } } + $out->addJsConfigVars( [ + 'wgDiffOldId' => $this->mOldid, + 'wgDiffNewId' => $this->mNewid, + ] ); + # Make "next revision link" # Skip next link on the top revision if ( $samePage && !$this->mNewRev->isCurrent() ) {