Index: branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FRDependencyUpdate.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | # Get any links that are only in the stable version... |
27 | 27 | $cLinks = $this->getCurrentVersionLinks(); |
28 | 28 | foreach ( $this->sLinks as $ns => $titles ) { |
29 | | - foreach ( $titles as $title ) { |
| 29 | + foreach ( $titles as $title => $pageId ) { |
30 | 30 | if ( !isset( $cLinks[$ns][$title] ) ) { |
31 | 31 | self::addDependency( $deps, $ns, $title ); |
32 | 32 | } |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | } |
35 | 35 | # Get any images that are only in the stable version... |
36 | 36 | $cImages = $this->getCurrentVersionImages(); |
37 | | - foreach ( $this->sImages as $image ) { |
| 37 | + foreach ( $this->sImages as $image => $n ) { |
38 | 38 | if ( !isset( $cImages[$image] ) ) { |
39 | 39 | self::addDependency( $deps, NS_FILE, $image ); |
40 | 40 | } |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | # Get any templates that are only in the stable version... |
43 | 43 | $cTemplates = $this->getCurrentVersionTemplates(); |
44 | 44 | foreach ( $this->sTemplates as $ns => $titles ) { |
45 | | - foreach ( $titles as $title ) { |
| 45 | + foreach ( $titles as $title => $id ) { |
46 | 46 | if ( !isset( $cTemplates[$ns][$title] ) ) { |
47 | 47 | self::addDependency( $deps, $ns, $title ); |
48 | 48 | } |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | } |
51 | 51 | # Get any categories that are only in the stable version... |
52 | 52 | $cCategories = $this->getCurrentVersionCategories(); |
53 | | - foreach ( $this->sCategories as $category ) { |
| 53 | + foreach ( $this->sCategories as $category => $sort ) { |
54 | 54 | if ( !isset( $cCategories[$category] ) ) { |
55 | 55 | self::addDependency( $deps, NS_CATEGORY, $category ); |
56 | 56 | } |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | } else { |
110 | 110 | $diffs = $dbkeys; |
111 | 111 | } |
112 | | - foreach ( $diffs as $dbk ) { |
| 112 | + foreach ( $diffs as $dbk => $id ) { |
113 | 113 | $arr[] = array( |
114 | 114 | 'ftr_from' => $this->title->getArticleId(), |
115 | 115 | 'ftr_namespace' => $ns, |
— | — | @@ -125,7 +125,7 @@ |
126 | 126 | */ |
127 | 127 | protected function getDepDeletions( array $existing, array $new ) { |
128 | 128 | $del = array(); |
129 | | - foreach ( $existing as $ns ) { |
| 129 | + foreach ( $existing as $ns => $dbkeys ) { |
130 | 130 | if ( isset( $new[$ns] ) ) { |
131 | 131 | $del[$ns] = array_diff_key( $existing[$ns], $new[$ns] ); |
132 | 132 | } else { |
Index: branches/chad-pre-wmf-merge/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: branches/chad-pre-wmf-merge/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 { |
Property changes on: branches/chad-pre-wmf-merge/extensions/FlaggedRevs |
___________________________________________________________________ |
Modified: svn:mergeinfo |
213 | 208 | Merged /trunk/extensions/FlaggedRevs:r76599-76600 |