Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable9] fix searchbox background #623

Merged
merged 3 commits into from
Jul 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/theming/lib/controller/themingcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(
IRootFolder $rootFolder
) {
parent::__construct($appName, $request);

$this->template = $template;
$this->l = $l;
$this->config = $config;
Expand Down Expand Up @@ -213,7 +213,7 @@ public function getStylesheet() {
$color = $this->config->getAppValue($this->appName, 'color');
if($color !== '') {
$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
);
}
Expand Down
67 changes: 65 additions & 2 deletions apps/theming/tests/lib/controller/ThemingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,33 @@ public function testGetLoginBackground() {
}

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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate unit test, as the color inverting was not backported to Nc9, but I guess this doesn't hurt.

$this->config
->expects($this->at(0))
->method('getAppValue')
Expand All @@ -326,7 +353,7 @@ public function testGetStylesheetWithOnlyColor() {
->with('theming', 'backgroundMime', '')
->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);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
}
Expand Down Expand Up @@ -416,7 +443,43 @@ public function testGetStylesheetWithAllCombined() {
->with('theming', 'backgroundMime', '')
->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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

$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-size: contain;
}
Expand Down
2 changes: 1 addition & 1 deletion core/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ body {
width: 155px;
max-width: 50%;
cursor: text;
background-color: transparent;
background-color: #0082c9;
border: 1px solid rgba(255, 255, 255, .5);
}

Expand Down