Foxtrott has uploaded a new change for review. https://gerrit.wikimedia.org/r/274009
Change subject: Add MW indicators ...................................................................... Add MW indicators Change-Id: I3bd1dfe942f284784a5ede9d7ba8a86ed3136968 --- M resources/styles/screen.less M src/Components/MainContent.php 2 files changed, 58 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon refs/changes/09/274009/1 diff --git a/resources/styles/screen.less b/resources/styles/screen.less index dd47aef..5c0218e 100644 --- a/resources/styles/screen.less +++ b/resources/styles/screen.less @@ -416,3 +416,17 @@ .mw-headline-anchor { display: none; } + +.mw-indicators { + float: right; + line-height: 1.6; + font-size: @font-size-small; + position: relative; + z-index: 1; + + .mw-indicator { + display: inline-block; + //zoom: 1; + } +} + diff --git a/src/Components/MainContent.php b/src/Components/MainContent.php index ca64fe9..508fb3f 100644 --- a/src/Components/MainContent.php +++ b/src/Components/MainContent.php @@ -60,6 +60,7 @@ ) . $idRegistry->element( 'a', array( 'id' => 'top' ) ) . + $this->indent(1) . $idRegistry->element( 'div', array( 'id' => 'mw-indicators', 'class' => 'mw-indicators', ), $this->buildMwIndicators() ) . $this->indent() . '<div ' . \Html::expandAttributes( array( 'id' => $idRegistry->getId( 'mw-js-message' ), @@ -71,7 +72,7 @@ $ret .= $this->buildContentBody(); $ret .= $this->buildCategoryLinks(); - $ret .= $this->indent( -1 ) . '</div>' . "\n"; + $ret .= $this->indent( -1 ) . '</div>'; // END content return $ret; @@ -85,7 +86,7 @@ $skintemplate = $this->getSkinTemplate(); $idRegistry = IdRegistry::getRegistry(); - $ret = $this->indent( 1 ) . '<div class ="contentHeader">' . + $ret = $this->indent() . '<div class ="contentHeader">' . $this->indent( 1 ) . '<!-- title of the page -->' . $this->indent() . $idRegistry->element( 'h1', array( 'id' => 'firstHeading', 'class' => 'firstHeading' ), $skintemplate->get( 'title' ) ) . @@ -123,10 +124,12 @@ * @return string */ protected function buildContentBody() { - return IdRegistry::getRegistry()->element( 'div', array( 'id' => 'bodyContent' ), - $this->indent() . '<!-- body text -->' . "\n" . + return $this->indent() . IdRegistry::getRegistry()->element( 'div', array( 'id' => 'bodyContent' ), + $this->indent( 1 ) . '<!-- body text -->' . "\n" . $this->indent() . $this->getSkinTemplate()->get( 'bodytext' ) . - $this->buildDataAfterContent() + $this->indent() . '<!-- end body text -->' . + $this->buildDataAfterContent() . + $this->indent( -1 ) ); } @@ -158,4 +161,40 @@ return ''; } + + /** + * @return string + */ + private function buildMwIndicators() { + + $idRegistry = IdRegistry::getRegistry(); + $indicators = $this->getSkinTemplate()->get( 'indicators' ); + + if ( !is_array( $indicators ) || count( $indicators ) === 0 ) { + return ''; + } + + $this->indent( 1 ); + + $ret = ''; + + foreach ( $indicators as $id => $content ) { + $id = \Sanitizer::escapeId( "mw-indicator-$id" ); + + $ret .= + $this->indent() . + $idRegistry->element( 'div', + array( + 'id' => $id, + 'class' => "mw-indicator $id", + ), + $content + ); + } + + $ret .= $this->indent( -1 ); + + return $ret; + } + } -- To view, visit https://gerrit.wikimedia.org/r/274009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bd1dfe942f284784a5ede9d7ba8a86ed3136968 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/chameleon Gerrit-Branch: master Gerrit-Owner: Foxtrott <s7ep...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits