| Index: trunk/phase3/includes/SkinTemplate.php |
| — | — | @@ -397,18 +397,23 @@ |
| 398 | 398 | $tpl->set( 'bottomscripts', $this->bottomScripts() ); |
| 399 | 399 | $tpl->set( 'printfooter', $this->printSource() ); |
| 400 | 400 | |
| 401 | | - # Add a <div class="mw-content-ltr/rtl"> around the body text |
| | 401 | + # An ID that includes the actual body text; without categories, contentSub, ... |
| | 402 | + $realBodyAttribs = array( 'id' => 'mw-content-text' ); |
| | 403 | + |
| | 404 | + # Add a mw-content-ltr/rtl class to be able to style based on text direction |
| | 405 | + # when the content is different from the UI language, i.e.: |
| 402 | 406 | # not for special pages or file pages AND only when viewing AND if the page exists |
| 403 | 407 | # (or is in MW namespace, because that has default content) |
| 404 | 408 | if( !in_array( $title->getNamespace(), array( NS_SPECIAL, NS_FILE ) ) && |
| 405 | 409 | in_array( $request->getVal( 'action', 'view' ), array( 'view', 'historysubmit' ) ) && |
| 406 | 410 | ( $title->exists() || $title->getNamespace() == NS_MEDIAWIKI ) ) { |
| 407 | 411 | $pageLang = $title->getPageLanguage(); |
| 408 | | - $realBodyAttribs = array( 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir(), |
| 409 | | - 'class' => 'mw-content-'.$pageLang->getDir() ); |
| 410 | | - $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
| | 412 | + $realBodyAttribs['lang'] = $pageLang->getHtmlCode(); |
| | 413 | + $realBodyAttribs['dir'] = $pageLang->getDir(); |
| | 414 | + $realBodyAttribs['class'] = 'mw-content-'.$pageLang->getDir(); |
| 411 | 415 | } |
| 412 | 416 | |
| | 417 | + $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
| 413 | 418 | $tpl->setRef( 'bodytext', $out->mBodytext ); |
| 414 | 419 | |
| 415 | 420 | # Language links |
| Index: trunk/phase3/RELEASE-NOTES-1.20 |
| — | — | @@ -17,6 +17,8 @@ |
| 18 | 18 | * (bug 32341) Add upload by URL domain limitation. |
| 19 | 19 | * &useskin=default will now always display the default skin. Useful for users with a |
| 20 | 20 | preference for the non-default skin to look at something using the default skin. |
| | 21 | +* (bug 31417) New ID mw-content-text around the actual page text, without categories, |
| | 22 | + contentSub, ... The same div often also contains the class mw-content-ltr/rtl. |
| 21 | 23 | |
| 22 | 24 | === Bug fixes in 1.20 === |
| 23 | 25 | * (bug 30245) Use the correct way to construct a log page title. |