r76601 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76600‎ | r76601 | r76602 >
Date:22:07, 12 November 2010
Author:demon
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/chad-pre-wmf-merge/extensions/FlaggedRevs (modified) (history)
  • /branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FRDependencyUpdate.php (modified) (history)
  • /branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /branches/chad-pre-wmf-merge/extensions/FlaggedRevs/client/flaggedrevs.js (modified) (history)

Diff [purge]

Index: branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FRDependencyUpdate.php
@@ -25,7 +25,7 @@
2626 # Get any links that are only in the stable version...
2727 $cLinks = $this->getCurrentVersionLinks();
2828 foreach ( $this->sLinks as $ns => $titles ) {
29 - foreach ( $titles as $title ) {
 29+ foreach ( $titles as $title => $pageId ) {
3030 if ( !isset( $cLinks[$ns][$title] ) ) {
3131 self::addDependency( $deps, $ns, $title );
3232 }
@@ -33,7 +33,7 @@
3434 }
3535 # Get any images that are only in the stable version...
3636 $cImages = $this->getCurrentVersionImages();
37 - foreach ( $this->sImages as $image ) {
 37+ foreach ( $this->sImages as $image => $n ) {
3838 if ( !isset( $cImages[$image] ) ) {
3939 self::addDependency( $deps, NS_FILE, $image );
4040 }
@@ -41,7 +41,7 @@
4242 # Get any templates that are only in the stable version...
4343 $cTemplates = $this->getCurrentVersionTemplates();
4444 foreach ( $this->sTemplates as $ns => $titles ) {
45 - foreach ( $titles as $title ) {
 45+ foreach ( $titles as $title => $id ) {
4646 if ( !isset( $cTemplates[$ns][$title] ) ) {
4747 self::addDependency( $deps, $ns, $title );
4848 }
@@ -49,7 +49,7 @@
5050 }
5151 # Get any categories that are only in the stable version...
5252 $cCategories = $this->getCurrentVersionCategories();
53 - foreach ( $this->sCategories as $category ) {
 53+ foreach ( $this->sCategories as $category => $sort ) {
5454 if ( !isset( $cCategories[$category] ) ) {
5555 self::addDependency( $deps, NS_CATEGORY, $category );
5656 }
@@ -108,7 +108,7 @@
109109 } else {
110110 $diffs = $dbkeys;
111111 }
112 - foreach ( $diffs as $dbk ) {
 112+ foreach ( $diffs as $dbk => $id ) {
113113 $arr[] = array(
114114 'ftr_from' => $this->title->getArticleId(),
115115 'ftr_namespace' => $ns,
@@ -125,7 +125,7 @@
126126 */
127127 protected function getDepDeletions( array $existing, array $new ) {
128128 $del = array();
129 - foreach ( $existing as $ns ) {
 129+ foreach ( $existing as $ns => $dbkeys ) {
130130 if ( isset( $new[$ns] ) ) {
131131 $del[$ns] = array_diff_key( $existing[$ns], $new[$ns] );
132132 } else {
Index: branches/chad-pre-wmf-merge/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -57,11 +57,12 @@
5858 # Get JS/CSS file locations
5959 $encCssFile = htmlspecialchars( "$stylePath/flaggedrevs.css?$wgFlaggedRevStyleVersion" );
6060 $encJsFile = htmlspecialchars( "$stylePath/flaggedrevs.js?$wgFlaggedRevStyleVersion" );
61 -
 61+ $encJQueryFile = "jquery.js";
6262 # Add CSS file
6363 $linkedStyle = Html::linkedStyle( $encCssFile );
6464 $wgOut->addHeadItem( 'FlaggedRevs', $linkedStyle );
6565 # Add main JS file
 66+ $wgOut->addScriptFile( $encJQueryFile );
6667 $wgOut->addScriptFile( $encJsFile );
6768 # Add review form JS for reviewers
6869 if ( $wgUser->isAllowed( 'review' ) ) {
@@ -111,7 +112,7 @@
112113 }
113114 $globalVars['wgStableRevisionId'] = $stableId;
114115 $globalVars['wgLatestRevisionId'] = $fa->getLatest();
115 - $globalVars['wgPageId'] = $fa->getID();
 116+ //$globalVars['wgPageId'] = $fa->getID();
116117 $revisionContents = (object) array(
117118 'error' => wfMsgHtml( 'revcontents-error' ),
118119 'waiting' => wfMsgHtml( 'revcontents-waiting' )
Index: branches/chad-pre-wmf-merge/extensions/FlaggedRevs/client/flaggedrevs.js
@@ -193,19 +193,14 @@
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';
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({
204199 url : wgScriptPath + '/api.php',
205200 type : "GET",
206201 data : requestArgs,
207202 dataType: "xml",
208203 success : function( result ) {
209 - contents = $(result).find("text");
 204+ contents = jQuery(result).find("text");
210205 if ( contents && contents.text() ) {
211206 contentsDiv.innerHTML = contents.text();
212207 } else {
Property changes on: branches/chad-pre-wmf-merge/extensions/FlaggedRevs
___________________________________________________________________
Modified: svn:mergeinfo
213208 Merged /trunk/extensions/FlaggedRevs:r76599-76600

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76599Changes to make flaggedrevs.js work with deployment branch. More coming...pdhanda21:51, 12 November 2010
r76600Partial revert of r75973: brokenaaron21:58, 12 November 2010

Status & tagging log