r106699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106698‎ | r106699 | r106700 >
Date:21:03, 19 December 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: Update ArticleFeedback to trunk state to pick up r106698
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5 (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.startup.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -564,7 +564,7 @@
565565 $block.find( '.articleFeedbackv5-tags ul' ).each( function () {
566566 var info = $.articleFeedbackv5.currentBucket().tagInfo;
567567 var tabIndex = 1;
568 - for ( var i in info ) {
 568+ for ( var i = 0; i < info.length; i++ ) {
569569 var key = info[i];
570570 var comm_def_msg = 'articlefeedbackv5-bucket2-' + key + '-comment-default';
571571 $.articleFeedbackv5.currentBucket().commentDefault[key] = mw.msg( comm_def_msg );
@@ -1316,7 +1316,7 @@
13171317 // Add the ratings from the options
13181318 $block.find( '.articleFeedbackv5-ratings' ).each( function () {
13191319 var info = $.articleFeedbackv5.currentBucket().ratingInfo;
1320 - for ( var i in info ) {
 1320+ for ( var i = 0; i < info.length; i++ ) {
13211321 var key = info[i];
13221322 var tip_msg = 'articlefeedbackv5-bucket5-' + key + '-tip';
13231323 var label_msg = 'articlefeedbackv5-bucket5-' + key + '-label';
@@ -1721,7 +1721,7 @@
17221722 getFormData: function () {
17231723 var data = {};
17241724 var info = $.articleFeedbackv5.currentBucket().ratingInfo;
1725 - for ( var i in info ) {
 1725+ for ( var i = 0; i < info.length; i++ ) {
17261726 var key = info[i];
17271727 data[key] = $.articleFeedbackv5.find( 'input[name="' + key + '"]' ).val();
17281728 }
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.startup.js
@@ -62,16 +62,16 @@
6363 };
6464
6565 var enable = false;
66 - for( var cat in categories['current'] ) {
 66+ for( var i = 0; i < categories['current'].length; i++ ) {
6767 // Categories are configured with underscores, but article's categories are returned with
6868 // spaces instead. Revert to underscores here for sane comparison.
69 - categories['current'][cat] = categories['current'][cat].replace(/\s/gi, '_');
 69+ categories['current'][i] = categories['current'][i].replace(/\s/gi, '_');
7070 // Check exclusion - exclusion overrides everything else
71 - if( $.inArray( categories['current'][cat], categories.exclude ) > -1 ) {
 71+ if( $.inArray( categories['current'][i], categories.exclude ) > -1 ) {
7272 // Blacklist overrides everything else
7373 return;
7474 }
75 - if( $.inArray( categories['current'][cat], categories.include ) > -1 ) {
 75+ if( $.inArray( categories['current'][i], categories.include ) > -1 ) {
7676 // One match is enough for include, however we are iterating on the 'current'
7777 // categories, and others might be blacklisted - so continue iterating
7878 enable = true;
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php
___________________________________________________________________
Modified: svn:mergeinfo
7979 Merged /trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php:r106695-106698
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5
___________________________________________________________________
Modified: svn:mergeinfo
8080 Merged /trunk/extensions/ArticleFeedbackv5:r106695-106698

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106698Use for ( i = 0; loops instead of for..in loops for looping over arrayscatrope21:01, 19 December 2011

Status & tagging log