Isarra has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/341490 )
Change subject: Stuff ...................................................................... Stuff Change-Id: Ia46c4f4cf0ce1c043c5506981b4ebc4b6dc4b5d1 --- M TimelessTemplate.php M i18n/en.json M resources/screen-common.less M resources/screen-desktop.less M resources/screen-mobile.less M resources/variables.less 6 files changed, 60 insertions(+), 65 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless refs/changes/90/341490/1 diff --git a/TimelessTemplate.php b/TimelessTemplate.php index 99246ef..115e6f4 100644 --- a/TimelessTemplate.php +++ b/TimelessTemplate.php @@ -237,63 +237,6 @@ } /** - * Makes links for navigation lists. - * - * Modified to add a <span> around <a> content in navigation lists; everything else is - * basically the same as in BaseTemplate, just with extra stuff removed. - * - * Can't just use the original's options['wrapper'] because it's a piece of crap and spews - * infinite errors on the page. - */ - function makeLink( $key, $item, $options = [] ) { - if ( isset( $item['text'] ) ) { - $text = $item['text']; - } else { - $text = $this->translator->translate( isset( $item['msg'] ) ? $item['msg'] : $key ); - } - - $html = htmlspecialchars( $text ); - $html = '<span>' . $html . '</span>'; - - if ( isset( $item['href'] ) ) { - $attrs = $item; - $array = [ 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary', 'tooltip-params' ]; - foreach ( $array as $k ) { - unset( $attrs[$k] ); - } - - if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) { - $item['single-id'] = $item['id']; - } - - $tooltipParams = []; - if ( isset( $item['tooltip-params'] ) ) { - $tooltipParams = $item['tooltip-params']; - } - - if ( isset( $item['single-id'] ) ) { - if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) { - $title = Linker::titleAttrib( $item['single-id'], null, $tooltipParams ); - if ( $title !== false ) { - $attrs['title'] = $title; - } - } else { - $tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'], $tooltipParams ); - if ( isset( $tip['title'] ) && $tip['title'] !== false ) { - $attrs['title'] = $tip['title']; - } - if ( isset( $tip['accesskey'] ) && $tip['accesskey'] !== false ) { - $attrs['accesskey'] = $tip['accesskey']; - } - } - } - $html = Html::rawElement( 'a', $attrs, $html ); - } - - return $html; - } - - /** * Outputs a sidebar-chunk containing one or more portlets */ private function outputSidebarChunk( $id, $headerMessage, $content ) { @@ -411,7 +354,7 @@ if ( $user->isLoggedIn() ) { $userName = $user->getName(); // Make sure it fit firsts - if ( mb_strlen( $userName ) < 12 ) { + if ( mb_strlen( $userName ) < 9 ) { echo htmlspecialchars( $userName, ENT_QUOTES ); } else { echo wfMessage( 'timeless-loggedin' )->escaped(); @@ -437,7 +380,16 @@ <div class="p-body"> <ul<?php $this->html( 'userlangattributes' ) ?>> <?php + $extraTools = []; foreach ( $this->getPersonalTools() as $key => $item ) { + // Skip weird icon tools and the like + // No way to actually do this properly, so we'll + // just guess - if there's a 'data' attribute, + // it's weird. + if ( isset( $item['links'][0]['data'] ) ) { + $extraTools[$key] = $item; + continue; + } if ( $key == 'userpage' ) { $item['links'][0]['text'] = wfMessage( 'timeless-userpage', $user->getName() )->text(); } @@ -453,6 +405,18 @@ </div> </div> <?php + // Weird extra stuff (echo etc) here + if ( !empty( $extraTools ) ) { + echo Html::openElement( 'div', [ 'id' => 'p-personal-extra', 'class' => 'p-body' ] ); + echo Html::openElement( 'ul' ); + foreach ( $extraTools as $key => $item ) { + echo $this->makeListItem( $key, $item ); + } + echo Html::closeElement( 'ul' ); + echo Html::closeElement( 'div' ); + } + ?> + <?php } /* diff --git a/i18n/en.json b/i18n/en.json index f476f3c..fe3715d 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,7 +7,7 @@ "timeless-search-placeholder": "Search the text of approximately {{NUMBEROFPAGES}} pages", "timeless-loggedin": "Your account", "timeless-anonymous": "Anonymous", - "timeless-loggedinas": "Logged in as $1", + "timeless-loggedinas": "Logged in as '''$1'''", "timeless-notloggedin": "Not logged in", "timeless-userpage": "{{GENDER:$1|User}} page", "timeless-talkpage": "{{GENDER:$1|User}} talk", @@ -22,4 +22,3 @@ "timeless-languages": "Languages", "timeless-sitetitle": "{{MediaWiki:Sitetitle}}" } - diff --git a/resources/screen-common.less b/resources/screen-common.less index 41f8c47..688b035 100644 --- a/resources/screen-common.less +++ b/resources/screen-common.less @@ -474,6 +474,31 @@ margin-right: @column-right-size + 1em; } +/* Extension specific junk */ + +/* Echo */ + +#p-personal h2, +#p-personal-extra, +#p-personal-extra ul, +#p-personal-extra li { + display: inline-block; +} + +#p-personal-extra { + float: right; + margin: .6em .25em .15em 1em; + + ul { + list-style: none; + margin: 0; + padding: 0; + } + li { + margin: 0 .125em; + } +} + /* Hidden stuff */ #p-namespaces h3, diff --git a/resources/screen-desktop.less b/resources/screen-desktop.less index d9523ce..c14afed 100644 --- a/resources/screen-desktop.less +++ b/resources/screen-desktop.less @@ -84,7 +84,7 @@ #p-personal h2 { margin: 0; - padding: .7em 0 0 25px; + padding: .65em 0 .5em 25px; font-family: @fonts-secondary; font-weight: normal; font-size: 1.1em; @@ -93,6 +93,14 @@ background-repeat: no-repeat; .dropdown-header(); + + span { + display: inline-block; + max-width: 7.5em; + height: 1em; + overflow: hidden; + word-wrap: break-word; + } } #p-personal:hover { .pokey, diff --git a/resources/screen-mobile.less b/resources/screen-mobile.less index 5a2a372..47f0bb6 100644 --- a/resources/screen-mobile.less +++ b/resources/screen-mobile.less @@ -16,7 +16,7 @@ border-top: solid 3px @grey; } -#page-header-links #ca-view, +#mw-page-header-links #ca-view, #mw-header-nav-hack, #page-tools h2, #p-logo { @@ -35,7 +35,6 @@ } /* Dropdowns */ - .sidebar-inner, .dropdown { display: none; @@ -150,7 +149,7 @@ } } -#page-header-links a { +#mw-page-header-links a { .ca-icon(); } #ca-edit a { diff --git a/resources/variables.less b/resources/variables.less index 136f7bc..482093f 100644 --- a/resources/variables.less +++ b/resources/variables.less @@ -156,7 +156,7 @@ &:after { display: inline-block; content: ''; - width: 22px; + width: 17px; height: 12px; .background-image-svg('images/arrow-down-grey.svg', 'images/arrow-down-grey.png'); background-position: center center; -- To view, visit https://gerrit.wikimedia.org/r/341490 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia46c4f4cf0ce1c043c5506981b4ebc4b6dc4b5d1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Timeless Gerrit-Branch: master Gerrit-Owner: Isarra <zhoris...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits