Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -715,3 +715,25 @@ |
716 | 716 | unicode-bidi: embed; |
717 | 717 | } |
718 | 718 | |
| 719 | +#mw-clearyourcache, #mw-sitecsspreview, #mw-sitejsspreview, #mw-usercsspreview, #mw-userjspreview { |
| 720 | + direction: ltr; |
| 721 | + unicode-bidi: embed; |
| 722 | +} |
| 723 | + |
| 724 | +/* Correct user & content directionality when viewing a diff */ |
| 725 | +.diff-currentversion-title, .diff { |
| 726 | + direction: ltr; |
| 727 | + unicode-bidi: embed; |
| 728 | +} |
| 729 | +/* @noflip */ .diff-contentalign-right td { |
| 730 | + direction: rtl; |
| 731 | + unicode-bidi: embed; |
| 732 | +} |
| 733 | +/* @noflip */ .diff-contentalign-left td { |
| 734 | + direction: ltr; |
| 735 | + unicode-bidi: embed; |
| 736 | +} |
| 737 | +.diff-otitle, .diff-ntitle, .diff-lineno { |
| 738 | + direction: ltr !important; |
| 739 | + unicode-bidi: embed; |
| 740 | +} |
Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -506,7 +506,8 @@ |
507 | 507 | global $wgOut, $wgUser; |
508 | 508 | wfProfileIn( __METHOD__ ); |
509 | 509 | # Add "current version as of X" title |
510 | | - $wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" ); |
| 510 | + $wgOut->addHTML( "<hr class='diff-hr' /> |
| 511 | + <h2 class='diff-currentversion-title'>{$this->mPagetitle}</h2>\n" ); |
511 | 512 | # Page content may be handled by a hooked call instead... |
512 | 513 | if ( wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) { |
513 | 514 | # Use the current version parser cache if applicable |
— | — | @@ -935,7 +936,17 @@ |
936 | 937 | * @return string |
937 | 938 | */ |
938 | 939 | static function addHeader( $diff, $otitle, $ntitle, $multi = '', $notice = '' ) { |
939 | | - $header = "<table class='diff'>"; |
| 940 | + global $wgBetterDirectionality; |
| 941 | + $dirclass = ''; |
| 942 | + if( $wgBetterDirectionality ) { |
| 943 | + global $wgContLang, $wgOut, $wgTitle; |
| 944 | + // shared.css sets diff in interface language/dir, |
| 945 | + // but the actual content should be in the page language/dir |
| 946 | + $getPageLang = $wgOut->parserOptions()->getTargetLanguage( $wgTitle ); |
| 947 | + $pageLang = ( $getPageLang ? $getPageLang : $wgContLang ); |
| 948 | + $dirclass = ' diff-contentalign-'.$pageLang->alignStart(); |
| 949 | + } |
| 950 | + $header = "<table class='diff $dirclass'>"; |
940 | 951 | if ( $diff ) { // Safari/Chrome show broken output if cols not used |
941 | 952 | $header .= " |
942 | 953 | <col class='diff-marker' /> |
Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -67,8 +67,10 @@ |
68 | 68 | function getTidy() { return $this->mTidy; } |
69 | 69 | function getInterfaceMessage() { return $this->mInterfaceMessage; } |
70 | 70 | function getTargetLanguage( $title = null ) { |
71 | | - // Parse mediawiki messages with correct target language |
72 | | - if ( $title && $title->getNamespace() == NS_MEDIAWIKI ) { |
| 71 | + if ( $title && $title->isCssOrJsPage() ) { |
| 72 | + return Language::factory( 'en' ); // css/js should always be LTR |
| 73 | + } elseif ( $title && $title->getNamespace() == NS_MEDIAWIKI ) { |
| 74 | + // Parse mediawiki messages with correct target language |
73 | 75 | list( /* $unused */, $lang ) = MessageCache::singleton()->figureMessage( $title->getText() ); |
74 | 76 | $obj = wfGetLangObj( $lang ); |
75 | 77 | return $obj; |
Index: trunk/phase3/includes/specials/SpecialAllmessages.php |
— | — | @@ -411,7 +411,10 @@ |
412 | 412 | } |
413 | 413 | |
414 | 414 | function getCellAttrs( $field, $value ){ |
415 | | - if( $this->mCurrentRow->am_customised && $field == 'am_title' ){ |
| 415 | + global $wgBetterDirectionality; |
| 416 | + if( $field != 'am_title' && $wgBetterDirectionality ) { |
| 417 | + return array( 'lang' => $this->langcode, 'dir' => $this->lang->getDir() ); |
| 418 | + } elseif( $this->mCurrentRow->am_customised && $field == 'am_title' ) { |
416 | 419 | return array( 'rowspan' => '2', 'class' => $field ); |
417 | 420 | } else { |
418 | 421 | return array( 'class' => $field ); |
Index: trunk/phase3/includes/Pager.php |
— | — | @@ -945,7 +945,7 @@ |
946 | 946 | * A navigation bar with images |
947 | 947 | */ |
948 | 948 | function getNavigationBar() { |
949 | | - global $wgStylePath, $wgContLang; |
| 949 | + global $wgStylePath, $wgContLang, $wgLang, $wgBetterDirectionality; |
950 | 950 | |
951 | 951 | if ( !$this->isNavigationBarShown() ) { |
952 | 952 | return ''; |
— | — | @@ -970,7 +970,8 @@ |
971 | 971 | 'next' => 'arrow_disabled_right_25.png', |
972 | 972 | 'last' => 'arrow_disabled_last_25.png', |
973 | 973 | ); |
974 | | - if( $wgContLang->isRTL() ) { |
| 974 | + $isRTL = ( $wgBetterDirectionality ? $wgLang->isRTL() : $wgContLang->isRTL() ); |
| 975 | + if( $isRTL ) { |
975 | 976 | $keys = array_keys( $labels ); |
976 | 977 | $images = array_combine( $keys, array_reverse( $images ) ); |
977 | 978 | $disabledImages = array_combine( $keys, array_reverse( $disabledImages ) ); |