r92752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92751‎ | r92752 | r92753 >
Date:16:41, 21 July 2011
Author:krinkle
Status:ok
Tags:
Comment:
Remove mw.util.inArray
- redundant and makes it even more confusing than jQuery's "inArray" already was.
- Reverts r92261
- Fixed usage in /trunk/*
-- http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=245&hash=4ef50cd2f7017954e562155ccceba878

While at it, also took take of the r92297 fixme. Item argument must be before array argument.
Modified paths:
  • /trunk/phase3/resources/mediawiki.page/mediawiki.page.ajaxCategories.js (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.util.js
@@ -109,17 +109,6 @@
110110 /* Main body */
111111
112112 /**
113 - * Wether a value is in an array. Using jQuery's inArray cross-browser utility,
114 - * (for browsers without Array indexOf support).
115 - * @param val {Mixed} Needle
116 - * @param arr {Array} Haystack
117 - * @return Boolean
118 - */
119 - 'inArray' : function( val, arr ) {
120 - return $.inArray( val, arr ) !== -1;
121 - },
122 -
123 - /**
124113 * Encode the string like PHP's rawurlencode
125114 *
126115 * @param str string String to be encoded
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ajaxCategories.js
@@ -44,7 +44,7 @@
4545
4646 var _saveAllButton;
4747 var _cancelAllButton;
48 - var _multiEdit = mw.util.inArray( mw.config.get( 'wgUserGroups' ), 'user' );
 48+ var _multiEdit = $.inArray( 'user', mw.config.get( 'wgUserGroups' ) ) !== -1;
4949
5050 /**
5151 * Helper function for $.fn.suggestion

Follow-up revisions

RevisionCommit summaryAuthorDate
r97875MFT r92752 - remove mw.util.inArray function that got added just before the 1...brion01:00, 23 September 2011
r97882MFT r92752 - remove mw.util.inArray function that got added just before the 1...brion01:10, 23 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92261Add boolean inArray utilitykrinkle18:10, 15 July 2011
r92297r92288 : Missed second arg to inArraydiebuche20:24, 15 July 2011

Status & tagging log