Merge "Add tests for WikiMap and WikiReference"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.util.js
index 93a1b3b..50fd0b4 100644 (file)
@@ -33,7 +33,7 @@
                                ];
 
                                for ( i = 0, l = selectors.length; i < l; i++ ) {
-                                       $node = $( selectors[i] );
+                                       $node = $( selectors[ i ] );
                                        if ( $node.length ) {
                                                return $node.first();
                                        }
                 * For index.php use `mw.config.get( 'wgScript' )`.
                 *
                 * @since 1.18
-                * @param str string Name of script (eg. 'api'), defaults to 'index'
-                * @return string Address to script (eg. '/w/api.php' )
+                * @param {string} str Name of script (e.g. 'api'), defaults to 'index'
+                * @return {string} Address to script (e.g. '/w/api.php' )
                 */
                wikiScript: function ( str ) {
                        str = str || 'index';
                        if ( m ) {
                                // Beware that decodeURIComponent is not required to understand '+'
                                // by spec, as encodeURIComponent does not produce it.
-                               return decodeURIComponent( m[1].replace( /\+/g, '%20' ) );
+                               return decodeURIComponent( m[ 1 ].replace( /\+/g, '%20' ) );
                        }
                        return null;
                },
                                        // Error: Invalid nextnode
                                        nextnode = undefined;
                                }
-                               if ( nextnode && ( nextnode.length !== 1 || nextnode[0].parentNode !== $ul[0] ) ) {
+                               if ( nextnode && ( nextnode.length !== 1 || nextnode[ 0 ].parentNode !== $ul[ 0 ] ) ) {
                                        // Error: nextnode must resolve to a single node
                                        // Error: nextnode must have the associated <ul> as its parent
                                        nextnode = undefined;
                        // to get a localized access key label (bug 67946).
                        $link.updateTooltipAccessKeys();
 
-                       return $item[0];
+                       return $item[ 0 ];
                },
 
                /**