Tablesorter: Add a title attribute to sort arrows ( Bug 21453 )
[lhc/web/wiklou.git] / resources / jquery / jquery.tablesorter.js
index 5086565..500447b 100644 (file)
                                                        // Check next parser, reset rows
                                                        i++;
                                                        rowIndex = 0;
+                                                       concurrent = 0;
                                                }
                                        } else {
                                                // Empty cell
                                //  }
                        }
 
-                       function buildHeaders( table ) {
+                       function buildHeaders( table, msg ) {
                                var maxSeen = 0;
                                var longest;
                                // if ( table.config.debug ) {
                                        if ( $( this ).is( '.unsortable' ) ) this.sortDisabled = true;
 
                                        if ( !this.sortDisabled ) {
-                                               var $th = $( this ).addClass( table.config.cssHeader );
+                                               var $th = $( this ).addClass( table.config.cssHeader ).attr( 'title', msg[1] );
+                                               
                                                //if ( table.config.onRenderHeader ) table.config.onRenderHeader.apply($th);
                                        }
 
                                return false;
                        }
 
-                       function setHeadersCss( table, $headers, list, css ) {
+                       function setHeadersCss( table, $headers, list, css, msg ) {
                                // remove all header information
                                $headers.removeClass( css[0] ).removeClass( css[1] );
 
 
                                var l = list.length;
                                for ( var i = 0; i < l; i++ ) {
-                                       h[list[i][0]].addClass( css[list[i][1]] );
+                                       h[ list[i][0] ].addClass( css[ list[i][1] ] ).attr( 'title', msg[ list[i][1] ] );
                                }
                        }
 
                                        $this = $( this );
                                        // save the settings where they read
                                        $.data( this, "tablesorter", config );
+
+                                       // get the css class names, could be done else where.
+                                       var sortCSS = [ config.cssDesc, config.cssAsc ];
+                                       var sortMsg = [ mw.msg( 'sort-descending' ), mw.msg( 'sort-ascending' ) ];
+
                                        // build headers
-                                       $headers = buildHeaders( this );
+                                       $headers = buildHeaders( this, sortMsg );
                                        // Grab and process locale settings
                                        buildTransformTable();
                                        buildDateTable();
                                        //performance improvements in some browsers
                                        cacheRegexs();
 
-                                       // get the css class names, could be done else where.
-                                       var sortCSS = [config.cssDesc, config.cssAsc];
                                        // apply event handling to headers
                                        // this is to big, perhaps break it out?
                                        $headers.click( 
                                                        }
                                                        setTimeout( function () {
                                                                // set css for headers
-                                                               setHeadersCss( $this[0], $headers, config.sortList, sortCSS );
+                                                               setHeadersCss( $this[0], $headers, config.sortList, sortCSS, sortMsg );
                                                                appendToTable( 
                                                                $this[0], multisort( 
                                                                $this[0], config.sortList, cache ) );