Merge "jquery.tablesorter: use of expand-child class"
[lhc/web/wiklou.git] / resources / src / jquery / jquery.tablesorter.js
index f6857e8..f8216c9 100644 (file)
 
        function detectParserForColumn( table, rows, column ) {
                var l = parsers.length,
+                       config = $( table ).data( 'tablesorter' ).config,
                        cellIndex,
                        nodeValue,
                        // Start with 1 because 0 is the fallback parser
                        needed = ( rows.length > 4 ) ? 5 : rows.length;
 
                while ( i < l ) {
-                       if ( rows[ rowIndex ] ) {
+                       // if this is a child row, continue to the next row (as buildCache())
+                       if ( rows[ rowIndex ] && !$( rows[ rowIndex ] ).hasClass( config.cssChildRow ) ) {
                                if ( rowIndex !== lastRowIndex ) {
                                        lastRowIndex = rowIndex;
                                        cellIndex = $( rows[ rowIndex ] ).data( 'columnToCell' )[ column ];
         * in default (ascending) order when their header cell is clicked the next time.
         *
         * @param {jQuery} $headers
-        * @param {Number[][]} sortList
-        * @param {Number[][]} headerToColumns
+        * @param {number[][]} sortList
+        * @param {number[][]} headerToColumns
         */
        function setHeadersOrder( $headers, sortList, headerToColumns ) {
                // Loop through all headers to retrieve the indices of the columns the header spans across:
                                new RegExp( /(https?|ftp|file):\/\// )
                        ],
                        isoDate: [
-                               new RegExp( /^([-+]?\d{1,4})-([01]\d)-([0-3]\d)([T\s]((([01]\d|2[0-3])(:?[0-5]\d)?|24:?00)?(:?([0-5]\d))?([.,]\d+)?)([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?/ ),
+                               new RegExp( /^([-+]?\d{1,4})-([01]\d)-([0-3]\d)([T\s]((([01]\d|2[0-3])(:?[0-5]\d)?|24:?00)?(:?([0-5]\d|60))?([.,]\d+)?)([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?/ ),
                                new RegExp( /^([-+]?\d{1,4})-([01]\d)-([0-3]\d)/ )
                        ],
                        usLongDate: [
                                        return $.tablesorter.formatFloat( 0 );
                                }
                        } else {
-                               isodate = new Date( $.trim( s ) );
+                               matches = s.match( ts.rgx.isoDate[ 0 ] );
+                               if ( matches ) {
+                                       isodate = new Date( $.trim( matches[ 0 ] ) );
+                               } else {
+                                       return $.tablesorter.formatFloat( 0 );
+                               }
                        }
                        return $.tablesorter.formatFloat( ( isodate !== undefined ) ? isodate.getTime() : 0 );
                },