Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -57,11 +57,12 @@ |
58 | 58 | # Get JS/CSS file locations |
59 | 59 | $encCssFile = htmlspecialchars( "$stylePath/flaggedrevs.css?$wgFlaggedRevStyleVersion" ); |
60 | 60 | $encJsFile = htmlspecialchars( "$stylePath/flaggedrevs.js?$wgFlaggedRevStyleVersion" ); |
61 | | - |
| 61 | + $encJQueryFile = "jquery.js"; |
62 | 62 | # Add CSS file |
63 | 63 | $linkedStyle = Html::linkedStyle( $encCssFile ); |
64 | 64 | $wgOut->addHeadItem( 'FlaggedRevs', $linkedStyle ); |
65 | 65 | # Add main JS file |
| 66 | + $wgOut->addScriptFile( $encJQueryFile ); |
66 | 67 | $wgOut->addScriptFile( $encJsFile ); |
67 | 68 | # Add review form JS for reviewers |
68 | 69 | if ( $wgUser->isAllowed( 'review' ) ) { |
— | — | @@ -111,7 +112,7 @@ |
112 | 113 | } |
113 | 114 | $globalVars['wgStableRevisionId'] = $stableId; |
114 | 115 | $globalVars['wgLatestRevisionId'] = $fa->getLatest(); |
115 | | - $globalVars['wgPageId'] = $fa->getID(); |
| 116 | + //$globalVars['wgPageId'] = $fa->getID(); |
116 | 117 | $revisionContents = (object) array( |
117 | 118 | 'error' => wfMsgHtml( 'revcontents-error' ), |
118 | 119 | 'waiting' => wfMsgHtml( 'revcontents-waiting' ) |
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.js |
— | — | @@ -193,19 +193,14 @@ |
194 | 194 | var oldRevId = diffUIParams.getElementsByTagName('input')[1].value; |
195 | 195 | var origContents = contentsDiv.innerHTML; |
196 | 196 | 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'; |
198 | | - if ( window.wgLatestRevisionId == oldRevId ) { |
199 | | - requestArgs += '&pageid=' + window.wgPageId; |
200 | | - } else { |
201 | | - requestArgs += '&oldid=' + oldRevId; |
202 | | - } |
203 | | - var call = $.ajax({ |
| 197 | + var requestArgs = 'action=parse&prop=text&format=xml&oldid=' + oldRevId; |
| 198 | + var call = jQuery.ajax({ |
204 | 199 | url : wgScriptPath + '/api.php', |
205 | 200 | type : "GET", |
206 | 201 | data : requestArgs, |
207 | 202 | dataType: "xml", |
208 | 203 | success : function( result ) { |
209 | | - contents = $(result).find("text"); |
| 204 | + contents = jQuery(result).find("text"); |
210 | 205 | if ( contents && contents.text() ) { |
211 | 206 | contentsDiv.innerHTML = contents.text(); |
212 | 207 | } else { |