Index: trunk/extensions/Translate/js/translate.langstats.js |
— | — | @@ -68,4 +68,29 @@ |
69 | 69 | // Add the toggle-all button above the table |
70 | 70 | $( '<p class="mw-sp-langstats-toggleall"></p>' ).append( $toggleAllButton ).insertBefore( $translateTable ); |
71 | 71 | } |
| 72 | +} ); |
| 73 | + |
| 74 | +// When hovering a row, adjust brightness of the last two custom-colored cells as well |
| 75 | +// See also translate.langstats.css for the highlighting for the other normal rows |
| 76 | +mediaWiki.loader.using( 'jquery.colorUtil' , function() { |
| 77 | + |
| 78 | + $( '.mw-sp-translate-table.wikitable tr' ).hover( function() { |
| 79 | + |
| 80 | + $( '> td:last', this ) |
| 81 | + // Get last two cells |
| 82 | + .prev( 'td' ).andSelf() |
| 83 | + // 30% more brightness |
| 84 | + .css( 'background-color', function( i, val ) { |
| 85 | + return $.colorUtil.getColorBrightness( val, +0.3 ); |
| 86 | + } ); |
| 87 | + }, function() { |
| 88 | + $( '> td:last', this ) |
| 89 | + // Get last two cells |
| 90 | + .prev( 'td' ).andSelf() |
| 91 | + // 30% less brightness |
| 92 | + .css( 'background-color', function( i, val ) { |
| 93 | + return $.colorUtil.getColorBrightness( val, -0.3 ); |
| 94 | + } ); |
| 95 | + } ); |
| 96 | + |
72 | 97 | } ); |
\ No newline at end of file |