Merge "Removed unused Module mediawiki.userSuggest"
[lhc/web/wiklou.git] / resources / src / jquery / jquery.tablesorter.js
index 6d67ade..e9d5a91 100644 (file)
                }
                return $.makeArray( node.childNodes ).map( function ( elem ) {
                        if ( elem.nodeType === Node.ELEMENT_NODE ) {
-                               return getElementSortKey( elem );
+                               if ( $( elem ).hasClass( 'reference' ) ) {
+                                       return null;
+                               } else {
+                                       return getElementSortKey( elem );
+                               }
                        }
                        return $.text( elem );
                } ).join( '' );
                                if ( rowIndex !== lastRowIndex ) {
                                        lastRowIndex = rowIndex;
                                        cellIndex = $( rows[ rowIndex ] ).data( 'columnToCell' )[ column ];
-                                       nodeValue = $.trim( getElementSortKey( rows[ rowIndex ].cells[ cellIndex ] ) );
+                                       nodeValue = getElementSortKey( rows[ rowIndex ].cells[ cellIndex ] ).trim();
                                }
                        } else {
                                nodeValue = '';
 
        /**
         * Converts sort objects [ { Integer: String }, ... ] to the internally used nested array
-        * structure [ [ Integer , Integer ], ... ]
+        * structure [ [ Integer, Integer ], ... ]
         *
         * @param {Array} sortObjects List of sort objects.
         * @return {Array} List of internal sort definitions.
         */
        function convertSortList( sortObjects ) {
                var sortList = [];
-               $.each( sortObjects, function ( i, sortObject ) {
+               sortObjects.forEach( function ( sortObject ) {
                        $.each( sortObject, function ( columnIndex, order ) {
                                var orderIndex = ( order === 'desc' ) ? 1 : 0;
                                sortList.push( [ parseInt( columnIndex, 10 ), orderIndex ] );
                },
                format: function ( s ) {
                        var tsc;
-                       s = $.trim( s.toLowerCase() );
+                       s = s.toLowerCase().trim();
                        if ( ts.collationRegex ) {
                                tsc = ts.collationTable;
                                s = s.replace( ts.collationRegex, function ( match ) {
                        return ts.rgx.url[ 0 ].test( s );
                },
                format: function ( s ) {
-                       return $.trim( s.replace( ts.rgx.url[ 1 ], '' ) );
+                       return s.replace( ts.rgx.url[ 1 ], '' ).trim();
                },
                type: 'text'
        } );
                },
                format: function ( s ) {
                        var match, y;
-                       s = $.trim( s.toLowerCase() );
+                       s = s.toLowerCase().trim();
 
                        if ( ( match = s.match( ts.dateRegex[ 0 ] ) ) !== null ) {
                                if ( mw.config.get( 'wgDefaultDateFormat' ) === 'mdy' || mw.config.get( 'wgPageContentLanguage' ) === 'en' ) {
        ts.addParser( {
                id: 'number',
                is: function ( s ) {
-                       return $.tablesorter.numberRegex.test( $.trim( s ) );
+                       return $.tablesorter.numberRegex.test( s.trim() );
                },
                format: function ( s ) {
                        return $.tablesorter.formatDigit( s );