r76604 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76603‎ | r76604 | r76605 >
Date:23:31, 12 November 2010
Author:pdhanda
Status:ok
Tags:
Comment:
Followup to r76599. Change how jQuery is included. API call now uses page instead of oldid for the latest version
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/client/flaggedrevs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -57,12 +57,11 @@
5858 # Get JS/CSS file locations
5959 $encCssFile = htmlspecialchars( "$stylePath/flaggedrevs.css?$wgFlaggedRevStyleVersion" );
6060 $encJsFile = htmlspecialchars( "$stylePath/flaggedrevs.js?$wgFlaggedRevStyleVersion" );
61 - $encJQueryFile = "jquery.js";
6261 # Add CSS file
6362 $linkedStyle = Html::linkedStyle( $encCssFile );
6463 $wgOut->addHeadItem( 'FlaggedRevs', $linkedStyle );
6564 # Add main JS file
66 - $wgOut->addScriptFile( $encJQueryFile );
 65+ $wgOut->includeJQuery();
6766 $wgOut->addScriptFile( $encJsFile );
6867 # Add review form JS for reviewers
6968 if ( $wgUser->isAllowed( 'review' ) ) {
@@ -112,7 +111,6 @@
113112 }
114113 $globalVars['wgStableRevisionId'] = $stableId;
115114 $globalVars['wgLatestRevisionId'] = $fa->getLatest();
116 - //$globalVars['wgPageId'] = $fa->getID();
117115 $revisionContents = (object) array(
118116 'error' => wfMsgHtml( 'revcontents-error' ),
119117 'waiting' => wfMsgHtml( 'revcontents-waiting' )
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js
@@ -188,12 +188,18 @@
189189 var prevLink = document.getElementById("differences-prevlink");
190190 var nextLink = document.getElementById("differences-nextlink");
191191 var timeoutId = null;
192 - if( contentsDiv ) {
 192+ if( contentsDiv ) {
193193 var diffUIParams = document.getElementById("mw-fr-diff-dataform");
194194 var oldRevId = diffUIParams.getElementsByTagName('input')[1].value;
195195 var origContents = contentsDiv.innerHTML;
196196 contentsDiv.innerHTML = "<span class='loading mw-small-spinner spinner'></span><span class='loading' >" + wgRevContents.waiting + "</span>";
197 - var requestArgs = 'action=parse&prop=text&format=xml&oldid=' + oldRevId;
 197+ var requestArgs = 'action=parse&prop=text&format=xml';
 198+ if ( window.wgLatestRevisionId == oldRevId && window.wgPageName ) {
 199+ requestArgs += '&page=' + window.wgPageName;
 200+ } else {
 201+ requestArgs += '&oldid=' + oldRevId;
 202+ }
 203+
198204 var call = jQuery.ajax({
199205 url : wgScriptPath + '/api.php',
200206 type : "GET",

Follow-up revisions

RevisionCommit summaryAuthorDate
r76605MFT r76604demon23:58, 12 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76599Changes to make flaggedrevs.js work with deployment branch. More coming...pdhanda21:51, 12 November 2010

Status & tagging log