Jack Phoenix has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/149789

Change subject: A not-so-awesome way of adding class="section" to 
#mw-content-text for proper styling.
......................................................................

A not-so-awesome way of adding class="section" to #mw-content-text for proper 
styling.

Change-Id: I9cb8b153f6d54e0569d78bfc23135e873572fbb4
---
M BlueSky.skin.php
1 file changed, 25 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/89/149789/1

diff --git a/BlueSky.skin.php b/BlueSky.skin.php
index cb931ec..5386266 100644
--- a/BlueSky.skin.php
+++ b/BlueSky.skin.php
@@ -1287,6 +1287,31 @@
                        header( 'HTTP/1.1 404 Not Found' );
                }
 
+               // <copypasta type="awful" absolutely="true">
+               // The following is copypasted from core 
/includes/SkinTemplate.php
+               // in order to add the section class to #mw-content-text, 
because that's
+               // what it's "supposed" to look like
+               $title = $this->getTitle();
+               # An ID that includes the actual body text; without categories, 
contentSub, ...
+               $realBodyAttribs = array( 'id' => 'mw-content-text' );
+
+               # Add a mw-content-ltr/rtl class to be able to style based on 
text direction
+               # when the content is different from the UI language, i.e.:
+               # not for special pages or file pages AND only when viewing AND 
if the page exists
+               # (or is in MW namespace, because that has default content)
+               if ( !in_array( $title->getNamespace(), array( NS_SPECIAL, 
NS_FILE ) ) &&
+                       Action::getActionName( $this ) === 'view' &&
+                       ( $title->exists() || $title->getNamespace() == 
NS_MEDIAWIKI ) ) {
+                       $pageLang = $title->getPageViewLanguage();
+                       $realBodyAttribs['lang'] = $pageLang->getHtmlCode();
+                       $realBodyAttribs['dir'] = $pageLang->getDir();
+                       $realBodyAttribs['class'] = 'section mw-content-' . 
$pageLang->getDir();
+               }
+
+               $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, 
$out->mBodytext );
+               $tpl->setRef( 'bodytext', $out->mBodytext );
+               // </copypasta>
+
                // Interlanguage links
                $language_urls = array();
                if ( !$wgHideInterlanguageLinks ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/149789
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cb8b153f6d54e0569d78bfc23135e873572fbb4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <j...@countervandalism.net>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to