From 444684821ca364d4d10b38d72b276bc557d7ddec Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 19 Jul 2016 12:05:57 +0200 Subject: [PATCH 1/3] fix searchbox overlapping on mobile --- apps/theming/lib/controller/themingcontroller.php | 4 ++-- core/css/styles.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/theming/lib/controller/themingcontroller.php b/apps/theming/lib/controller/themingcontroller.php index 0dec95cc67747..12fea2f1975da 100644 --- a/apps/theming/lib/controller/themingcontroller.php +++ b/apps/theming/lib/controller/themingcontroller.php @@ -70,7 +70,7 @@ public function __construct( IRootFolder $rootFolder ) { parent::__construct($appName, $request); - + $this->template = $template; $this->l = $l; $this->config = $config; @@ -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,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}', $color ); } diff --git a/core/css/styles.css b/core/css/styles.css index 830ff4bacbb27..3c782813405d2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -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); } From 5bc34c2d8d01930f3aa61473a2872eeeb6eb61e2 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Tue, 19 Jul 2016 12:08:59 +0200 Subject: [PATCH 2/3] also adjust log in background color in theme --- apps/theming/lib/controller/themingcontroller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/theming/lib/controller/themingcontroller.php b/apps/theming/lib/controller/themingcontroller.php index 12fea2f1975da..440e7f747e037 100644 --- a/apps/theming/lib/controller/themingcontroller.php +++ b/apps/theming/lib/controller/themingcontroller.php @@ -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,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {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 ); } From 176fbf95fdef4d686de53a0febc72dfcedc8b880 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 21 Jul 2016 23:44:50 +0200 Subject: [PATCH 3/3] theming tests need to be fixed --- .../lib/controller/ThemingControllerTest.php | 67 ++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/apps/theming/tests/lib/controller/ThemingControllerTest.php b/apps/theming/tests/lib/controller/ThemingControllerTest.php index 9ce93ec900ae0..5699b42e10857 100644 --- a/apps/theming/tests/lib/controller/ThemingControllerTest.php +++ b/apps/theming/tests/lib/controller/ThemingControllerTest.php @@ -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() { $this->config ->expects($this->at(0)) ->method('getAppValue') @@ -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()); } @@ -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() { + $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; }