r96974 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96973‎ | r96974 | r96975 >
Date:15:48, 13 September 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Use classes by suggestion of Roan
Modified paths:
  • /trunk/extensions/RTLDebug/RTLDebug.php (modified) (history)
  • /trunk/extensions/RTLDebug/rtl-debug.css (added) (history)
  • /trunk/extensions/RTLDebug/rtl-debug.js (modified) (history)

Diff [purge]

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
19 + native
Index: trunk/extensions/RTLDebug/RTLDebug.php
@@ -23,6 +23,7 @@
2424
2525 $wgResourceModules['ext.rtlDebug'] = array(
2626 'scripts' => 'rtl-debug.js',
 27+ 'styles' => 'rtl-debug.css',
2728 'localBasePath' => dirname( __FILE__ )
2829 );
2930

Status & tagging log