Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -117,7 +117,8 @@ |
118 | 118 | # but this section (the actual wikitext) should be in page content language |
119 | 119 | $pageLang = $this->mTitle->getPageLanguage(); |
120 | 120 | $wgOut->addHTML( Xml::openElement( 'div', array( 'id' => 'mw-imagepage-content', |
121 | | - 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ) ) ); |
| 121 | + 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
| 122 | + 'class' => 'mw-content-'.$pageLang->getDir() ) ) ); |
122 | 123 | parent::view(); |
123 | 124 | $wgOut->addHTML( Xml::closeElement( 'div' ) ); |
124 | 125 | } else { |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -462,7 +462,8 @@ |
463 | 463 | in_array( $action, array( 'view', 'render', 'print' ) ) && |
464 | 464 | ( $this->getTitle()->exists() || $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) ) { |
465 | 465 | $pageLang = $this->getTitle()->getPageLanguage(); |
466 | | - $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); |
| 466 | + $realBodyAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
| 467 | + 'class' => 'mw-content-'.$pageLang->getDir() ); |
467 | 468 | $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
468 | 469 | } |
469 | 470 | } |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2098,7 +2098,8 @@ |
2099 | 2099 | global $wgBetterDirectionality; |
2100 | 2100 | if( $wgBetterDirectionality ) { |
2101 | 2101 | $pageLang = $this->mTitle->getPageLanguage(); |
2102 | | - $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); |
| 2102 | + $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
| 2103 | + 'class' => 'mw-content-'.$pageLang->getDir() ); |
2103 | 2104 | $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML ); |
2104 | 2105 | } |
2105 | 2106 | wfProfileOut( __METHOD__ ); |
Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -179,10 +179,13 @@ |
180 | 180 | $r = wfMsgExt( 'category-empty', array( 'parse' ) ); |
181 | 181 | } |
182 | 182 | |
183 | | - global $wgBetterDirectionality, $wgLang; |
| 183 | + global $wgBetterDirectionality, $wgTitle; |
184 | 184 | if( $wgBetterDirectionality ) { |
185 | | - $langAttribs = array( 'lang' => $wgLang->getCode(), 'dir' => $wgLang->getDir() ); |
186 | | - $r = Html::rawElement( 'div', $langAttribs, $r ); |
| 185 | + $pageLang = $wgTitle->getPageLanguage(); |
| 186 | + $langAttribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); |
| 187 | + # close the previous div, show the headings in user language, |
| 188 | + # then open a new div with the page content language again |
| 189 | + $r = '</div>' . $r . Html::openElement( 'div', $langAttribs ); |
187 | 190 | } |
188 | 191 | |
189 | 192 | wfProfileOut( __METHOD__ ); |
— | — | @@ -516,7 +519,8 @@ |
517 | 520 | global $wgBetterDirectionality, $wgTitle; |
518 | 521 | if( $wgBetterDirectionality ) { |
519 | 522 | $pageLang = $wgTitle->getPageLanguage(); |
520 | | - $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir() ); |
| 523 | + $attribs = array( 'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(), |
| 524 | + 'class' => 'mw-content-'.$pageLang->getDir() ); |
521 | 525 | $list = Html::rawElement( 'div', $attribs, $list ); |
522 | 526 | } |
523 | 527 | |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -62,7 +62,9 @@ |
63 | 63 | float: right; |
64 | 64 | margin-left: 5px; |
65 | 65 | } |
66 | | - |
| 66 | +/* Correct directionality when page dir is different from site/user dir */ |
| 67 | +/* @noflip */.mw-content-ltr .editsection, .mw-content-rtl [dir="ltr"] .editsection { float: right; } |
| 68 | +/* @noflip */.mw-content-rtl .editsection, .mw-content-ltr [dir="rtl"] .editsection { float: left; } |
67 | 69 | /** |
68 | 70 | * File histories |
69 | 71 | */ |
— | — | @@ -614,6 +616,18 @@ |
615 | 617 | background-repeat: no-repeat; |
616 | 618 | } |
617 | 619 | |
| 620 | +/* Correct directionality when page dir is different from site/user dir */ |
| 621 | +/* @noflip */.mw-content-ltr ul, .mw-content-ltr ol, |
| 622 | +.mw-content-rtl [dir="ltr"] ul, .mw-content-rtl [dir="ltr"] ol { |
| 623 | + margin: .3em 0 0 1.5em; |
| 624 | +} |
| 625 | +/* @noflip */.mw-content-rtl ul, .mw-content-rtl ol, |
| 626 | +.mw-content-ltr [dir="rtl"] ul, .mw-content-ltr [dir="rtl"] ol { |
| 627 | + margin: .3em 1.5em 0 0; |
| 628 | +} |
| 629 | +/* @noflip */ { |
| 630 | + margin: .3em 1.5em 0 0; |
| 631 | +} |
618 | 632 | /* Localised ordered list numbering for some languages */ |
619 | 633 | ol:lang(bcc) li, |
620 | 634 | ol:lang(bqi) li, |
— | — | @@ -640,6 +654,26 @@ |
641 | 655 | list-style-type: oriya; |
642 | 656 | } |
643 | 657 | |
| 658 | +/* Correct directionality when page dir is different from site/user dir */ |
| 659 | +/* @noflip */.mw-content-ltr .toc ul, .mw-content-ltr #toc ul, |
| 660 | +.mw-content-rtl [dir="ltr"] .toc ul, .mw-content-rtl [dir="ltr"] #toc ul { |
| 661 | + text-align: left; |
| 662 | + margin-left: 0; |
| 663 | +} |
| 664 | +/* @noflip */.mw-content-rtl .toc ul, .mw-content-rtl #toc ul, |
| 665 | +.mw-content-ltr [dir="rtl"] .toc ul, .mw-content-ltr [dir="rtl"] #toc ul { |
| 666 | + text-align: right; |
| 667 | + margin-right: 0; |
| 668 | +} |
| 669 | +/* @noflip */.mw-content-ltr .toc ul ul, .mw-content-ltr #toc ul ul, |
| 670 | +.mw-content-rtl [dir="ltr"] .toc ul ul, .mw-content-rtl [dir="ltr"] #toc ul ul { |
| 671 | + margin: 0 0 0 2em; |
| 672 | +} |
| 673 | +/* @noflip */.mw-content-rtl .toc ul ul, .mw-content-rtl #toc ul ul, |
| 674 | +.mw-content-ltr [dir="rtl"] .toc ul ul, .mw-content-ltr [dir="rtl"] #toc ul ul { |
| 675 | + margin: 0 2em 0 0; |
| 676 | +} |
| 677 | + |
644 | 678 | /* tooltip styles */ |
645 | 679 | .mw-help-field-hint { |
646 | 680 | display: none; |
— | — | @@ -737,3 +771,7 @@ |
738 | 772 | direction: ltr !important; |
739 | 773 | unicode-bidi: embed; |
740 | 774 | } |
| 775 | + |
| 776 | +#mw-revision-info, #mw-revision-nav { |
| 777 | + direction: ltr; |
| 778 | +} |
\ No newline at end of file |