Index: trunk/extensions/RTLDebug/rtl-debug.js |
— | — | @@ -1,11 +1,10 @@ |
2 | | -jQuery('*').each( function( index, elt ) { |
3 | | - var style = window.getComputedStyle( elt, null ); |
4 | | - var background; |
5 | | - if ( style.getPropertyValue( 'direction' ) == 'rtl' ) { |
6 | | - background = '#faa'; |
7 | | - } else { |
8 | | - background = '#afa'; |
9 | | - } |
10 | | - elt.style.backgroundColor = background; |
11 | | -} ); |
12 | | - |
| 2 | +(function($) { |
| 3 | + $('*').each( function() { |
| 4 | + var style = window.getComputedStyle( this, null ); |
| 5 | + if ( style.getPropertyValue( 'direction' ) == 'rtl' ) { |
| 6 | + $(this).addClass( 'mw-rtldebug-rtl' ); |
| 7 | + } else { |
| 8 | + $(this).addClass( 'mw-rtldebug-ltr' ); |
| 9 | + } |
| 10 | + } ); |
| 11 | +})(jQuery); |
Index: trunk/extensions/RTLDebug/rtl-debug.css |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +.mw-rtldebug-rtl { |
| 3 | + background-color: #afa !important; |
| 4 | +} |
| 5 | + |
| 6 | +.mw-rtldebug-ltr { |
| 7 | + background-color: #faa !important; |
| 8 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/RTLDebug/rtl-debug.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 9 | + native |
Index: trunk/extensions/RTLDebug/RTLDebug.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | |
25 | 25 | $wgResourceModules['ext.rtlDebug'] = array( |
26 | 26 | 'scripts' => 'rtl-debug.js', |
| 27 | + 'styles' => 'rtl-debug.css', |
27 | 28 | 'localBasePath' => dirname( __FILE__ ) |
28 | 29 | ); |
29 | 30 | |