From: Marcel Werk Date: Sat, 23 Mar 2013 23:16:30 +0000 (+0100) Subject: Add optimizations for mobile devices (WIP) X-Git-Tag: 2.0.0_Beta_1~414 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=55a41acc82bcd9355104612a4cba1860b06ce327;p=GitHub%2FWoltLab%2FWCF.git Add optimizations for mobile devices (WIP) --- diff --git a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php index 2c0fd85549..1f51feb356 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php @@ -48,15 +48,16 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { * @param string $link * @param integer $pageNo * @param integer $activePage + * @param integer $pages * @return string */ - protected function makeLink($link, $pageNo, $activePage, $break = false) { + protected function makeLink($link, $pageNo, $activePage, $pages) { // first page if ($activePage != $pageNo) { return '
  • '.StringUtil::formatInteger($pageNo).'
  • '."\n"; } else { - return '
  • '.StringUtil::formatInteger($pageNo).'
  • '."\n"; + return '
  • '.StringUtil::formatInteger($pageNo).'
  • '."\n"; } } @@ -130,7 +131,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { $html .= $this->makePreviousLink($link, $tagArgs['page']); // first page - $html .= $this->makeLink($link, 1, $tagArgs['page']); + $html .= $this->makeLink($link, 1, $tagArgs['page'], $tagArgs['pages']); // calculate page links $maxLinks = static::SHOW_LINKS - 4; @@ -172,7 +173,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { // left ... links if ($left > 1) { if ($left - 1 < 2) { - $html .= $this->makeLink($link, 2, $tagArgs['page']); + $html .= $this->makeLink($link, 2, $tagArgs['page'], $tagArgs['pages']); } else { $html .= '
  • '.StringUtil::HELLIP.'
  • '."\n"; @@ -181,13 +182,13 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { // visible links for ($i = $left + 1; $i < $right; $i++) { - $html .= $this->makeLink($link, $i, $tagArgs['page']); + $html .= $this->makeLink($link, $i, $tagArgs['page'], $tagArgs['pages']); } // right ... links if ($right < $tagArgs['pages']) { if ($tagArgs['pages'] - $right < 2) { - $html .= $this->makeLink($link, $tagArgs['pages'] - 1, $tagArgs['page']); + $html .= $this->makeLink($link, $tagArgs['pages'] - 1, $tagArgs['page'], $tagArgs['pages']); } else { $html .= '
  • '.StringUtil::HELLIP.'
  • '."\n"; @@ -195,7 +196,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin { } // last page - $html .= $this->makeLink($link, $tagArgs['pages'], $tagArgs['page']); + $html .= $this->makeLink($link, $tagArgs['pages'], $tagArgs['page'], $tagArgs['pages']); // next page $html .= $this->makeNextLink($link, $tagArgs['page'], $tagArgs['pages']); diff --git a/wcfsetup/install/files/style/layout.less b/wcfsetup/install/files/style/layout.less index b0f812bd64..3940d35541 100644 --- a/wcfsetup/install/files/style/layout.less +++ b/wcfsetup/install/files/style/layout.less @@ -166,10 +166,14 @@ } /* hide user panel labels */ - > a > span:not(.icon), + > a > span:not(.icon):not(.badge), &#pageLanguageContainer > div > div > hgroup { display: none; } + + > a > .badge { + top: -4px; + } } } @@ -608,10 +612,55 @@ @media only screen and (max-width: 640px) { /* hide sidebar */ #main { + position: relative; margin-top: 7px; - .sidebar { - display: none; + &.sidebarOrientationRight { + .sidebar { + display: none; + } + } + + &.sidebarOrientationLeft { + .sidebar { + float: none; + padding-top: 0; + position: absolute; + right: 0px; + top: 14px; + width: 100%; + + &.mobileSidebar { + &:before { + content: "\f03a"; + font-family: FontAwesome; + font-size: 21px; + right: 7px; + position: absolute; + top: 0; + } + + &:hover { + > div { + display: block; + } + } + + > div { + background-color: @wcfSidebarBackgroundColor; + margin-top: 28px; + padding-top: 14px; + } + } + + > div { + display: none; + + > fieldset.jsOnly { + display: none; + } + } + } } .content { @@ -824,6 +873,10 @@ .containerContentType { display: none; } + + > div > div > .buttonList { + display: none; + } } &.infoBoxList { @@ -941,29 +994,33 @@ white-space: nowrap; } } - - &.doubleColumned, - &.tripleColumned { - .clearfix(); - - > li { - float: left; +} + +@media only screen and (min-width: 641px) { + .containerBoxList { + &.doubleColumned, + &.tripleColumned { + .clearfix(); - > div { - margin-right: @wcfGapLarge; + > li { + float: left; + + > div { + margin-right: @wcfGapLarge; + } } } - } - - &.doubleColumned { - > li { - width: 50%; + + &.doubleColumned { + > li { + width: 50%; + } } - } - - &.tripleColumned { - > li { - width: 33%; + + &.tripleColumned { + > li { + width: 33%; + } } } } @@ -1189,6 +1246,32 @@ margin-bottom: @wcfGapSmall; } +@media only screen and (max-width: 640px) { + .tabMenu { + > ul { + margin-left: @wcfGapTiny; + margin-right: @wcfGapTiny; + + > li { + &.ui-state-active { + > a { + font-size: 100%; + padding-left: 10px; + padding-right: 10px; + } + } + + > a { + font-size: 100%; + padding-left: 5px; + padding-right: 5px; + } + } + } + + } +} + /* ToDo: 2x hidden? */ .ui-tabs .ui-tabs-hide { display: none !important; @@ -1605,7 +1688,7 @@ ul.inlineDataList { .textShadow(@wcfButtonBackgroundColor); } - > span { + > span:not(.invisible) { display: inline-block; } } @@ -1618,6 +1701,18 @@ ul.inlineDataList { &:not(.skip):not(.active) { display: none; } + + &.active { + > span { + &.invisible { + display: inline-block; + } + + &:not(.invisible) { + display: none; + } + } + } } } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 831fd189d1..0bebafcb07 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -939,6 +939,7 @@ + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index bcd933ba0f..13f4db5c7d 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -931,6 +931,7 @@ +