Merge pull request #623 from nextcloud/stable9-fix-searchbox-background

[stable9] fix searchbox background
This commit is contained in:
Morris Jobke 2016-07-30 10:05:15 +02:00 committed by GitHub
commit 393f7f843f
3 changed files with 68 additions and 5 deletions

View File

@ -213,7 +213,7 @@ class ThemingController extends Controller {
$color = $this->config->getAppValue($this->appName, 'color'); $color = $this->config->getAppValue($this->appName, 'color');
if($color !== '') { if($color !== '') {
$responseCss .= sprintf( $responseCss .= sprintf(
'#body-user #header,#body-settings #header,#body-public #header {background-color: %s}', '#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}',
$color $color
); );
} }

View File

@ -305,6 +305,33 @@ class ThemingControllerTest extends TestCase {
} }
public function testGetStylesheetWithOnlyColor() { public function testGetStylesheetWithOnlyColor() {
$this->config
->expects($this->at(0))
->method('getAppValue')
->with('theming', 'cachebuster', '0')
->willReturn('0');
$this->config
->expects($this->at(1))
->method('getAppValue')
->with('theming', 'color', '')
->willReturn('#000');
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('theming', 'logoMime', '')
->willReturn('');
$this->config
->expects($this->at(3))
->method('getAppValue')
->with('theming', 'backgroundMime', '')
->willReturn('');
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #000}', 'style', 'text/css');
$expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
}
public function testGetStylesheetWithOnlyColorInvert() {
$this->config $this->config
->expects($this->at(0)) ->expects($this->at(0))
->method('getAppValue') ->method('getAppValue')
@ -326,7 +353,7 @@ class ThemingControllerTest extends TestCase {
->with('theming', 'backgroundMime', '') ->with('theming', 'backgroundMime', '')
->willReturn(''); ->willReturn('');
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #fff}', 'style', 'text/css'); $expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}', 'style', 'text/css');
$expected->cacheFor(3600); $expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet()); @$this->assertEquals($expected, $this->themingController->getStylesheet());
} }
@ -416,7 +443,43 @@ class ThemingControllerTest extends TestCase {
->with('theming', 'backgroundMime', '') ->with('theming', 'backgroundMime', '')
->willReturn('image/png'); ->willReturn('image/png');
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #abc}#header .logo { $expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #abc}#header .logo {
background-image: url(\'./logo?v=0\');
background-size: contain;
}
#header .logo-icon {
background-image: url(\'./logo?v=0\');
background-size: contain;
}#body-login {
background-image: url(\'./loginbackground?v=0\');
}', 'style', 'text/css');
$expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
}
public function testGetStylesheetWithAllCombinedInverted() {
$this->config
->expects($this->at(0))
->method('getAppValue')
->with('theming', 'cachebuster', '0')
->willReturn('0');
$this->config
->expects($this->at(1))
->method('getAppValue')
->with('theming', 'color', '')
->willReturn('#fff');
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('theming', 'logoMime', '')
->willReturn('text/svg');
$this->config
->expects($this->at(3))
->method('getAppValue')
->with('theming', 'backgroundMime', '')
->willReturn('image/png');
$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}#header .logo {
background-image: url(\'./logo?v=0\'); background-image: url(\'./logo?v=0\');
background-size: contain; background-size: contain;
} }

View File

@ -108,7 +108,7 @@ body {
width: 155px; width: 155px;
max-width: 50%; max-width: 50%;
cursor: text; cursor: text;
background-color: transparent; background-color: #0082c9;
border: 1px solid rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .5);
} }