Index: trunk/phase3/resources/mediawiki/mediawiki.util.js |
— | — | @@ -109,6 +109,17 @@ |
110 | 110 | /* Main body */ |
111 | 111 | |
112 | 112 | /** |
| 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 | + /** |
113 | 124 | * Encode the string like PHP's rawurlencode |
114 | 125 | * |
115 | 126 | * @param str string String to be encoded |