Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume COMPAGNON <gcompagnon@outlook.com>2019-08-21 18:18:23 +0300
committerDaniel Kesselberg <mail@danielkesselberg.de>2019-11-24 23:51:43 +0300
commited399a31bdf501dd2a5cf35a736b85ecbc9cf4a2 (patch)
treec95fab03907150266c090fb565b6abbb6ef821ec
parentcd7af395d7d0442fbe9b87a28345fb70ddd9b7a4 (diff)
add var for theming images , advanced options
Signed-off-by: Guillaume COMPAGNON <gcompagnon@outlook.com>
-rw-r--r--apps/theming/css/theming.scss4
-rw-r--r--apps/theming/lib/Capabilities.php2
-rw-r--r--apps/theming/lib/ThemingDefaults.php6
-rw-r--r--apps/theming/tests/ThemingDefaultsTest.php4
-rw-r--r--core/css/css-variables.scss2
-rw-r--r--core/css/variables.scss2
6 files changed, 13 insertions, 7 deletions
diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss
index f21f00f438a..368b3f33c5d 100644
--- a/apps/theming/css/theming.scss
+++ b/apps/theming/css/theming.scss
@@ -153,7 +153,7 @@ $invert: luma($color-primary) > 0.6;
@if variable_exists('theming-logoheader-mime') and $theming-logoheader-mime != '' {
#theming .advanced-option-logoheader .image-preview,
body:not(#body-login) #header .logo {
- background-image: url(#{$image-logoheader});
+ background-image: $image-logoheader;
}
} @else {
#theming .advanced-option-favicon .image-preview {
@@ -163,7 +163,7 @@ $invert: luma($color-primary) > 0.6;
@if variable_exists('theming-favicon-mime') and $theming-favicon-mime != '' {
#theming .advanced-option-favicon .image-preview {
- background-image: url(#{$image-favicon});
+ background-image: $image-favicon;
}
} @else {
#theming .advanced-option-favicon .image-preview {
diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php
index a75403a1fd5..e48c63d50fa 100644
--- a/apps/theming/lib/Capabilities.php
+++ b/apps/theming/lib/Capabilities.php
@@ -83,6 +83,8 @@ class Capabilities implements IPublicCapability {
$this->url->getAbsoluteURL($this->theming->getBackground()),
'background-plain' => $backgroundLogo === 'backgroundColor',
'background-default' => !$this->util->isBackgroundThemed(),
+ 'logoheader' => $this->url->getAbsoluteURL($this->theming->getLogo()),
+ 'favicon' => $this->url->getAbsoluteURL($this->theming->getLogo()),
],
];
}
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index bca3d70e4ef..32a1eaad4cf 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -285,10 +285,10 @@ class ThemingDefaults extends \OC_Defaults {
'theming-logoheader-mime' => "'" . $this->config->getAppValue('theming', 'logoheaderMime') . "'",
'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'"
];
-
+
$variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')";
- $variables['image-logoheader'] = "'".$this->imageManager->getImageUrl('logoheader')."'";
- $variables['image-favicon'] = "'".$this->imageManager->getImageUrl('favicon')."'";
+ $variables['image-logoheader'] = "url('".$this->imageManager->getImageUrl('logoheader')."')";
+ $variables['image-favicon'] = "url('".$this->imageManager->getImageUrl('favicon')."')";
$variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')";
$variables['image-login-plain'] = 'false';
diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php
index ea8ab6975ef..e3434118cbc 100644
--- a/apps/theming/tests/ThemingDefaultsTest.php
+++ b/apps/theming/tests/ThemingDefaultsTest.php
@@ -680,8 +680,8 @@ class ThemingDefaultsTest extends TestCase {
'color-primary-element' => '#aaaaaa',
'theming-logoheader-mime' => '\'jpeg\'',
'theming-favicon-mime' => '\'jpeg\'',
- 'image-logoheader' => '\'custom-logoheader?v=0\'',
- 'image-favicon' => '\'custom-favicon?v=0\'',
+ 'image-logoheader' => "url('custom-logoheader?v=0')",
+ 'image-favicon' => "url('custom-favicon?v=0')",
'has-legal-links' => 'false'
];
$this->assertEquals($expected, $this->template->getScssVariables());
diff --git a/core/css/css-variables.scss b/core/css/css-variables.scss
index e369874dec7..23c01988676 100644
--- a/core/css/css-variables.scss
+++ b/core/css/css-variables.scss
@@ -27,6 +27,8 @@
--image-logo: $image-logo;
--image-login-background: $image-login-background;
+ --image-logoheader: $image-logoheader;
+ --image-favicon: $image-favicon;
--color-loading-light: $color-loading-light;
--color-loading-dark: $color-loading-dark;
diff --git a/core/css/variables.scss b/core/css/variables.scss
index 114cbd83370..35036248e55 100644
--- a/core/css/variables.scss
+++ b/core/css/variables.scss
@@ -65,6 +65,8 @@ $color-text-lighter: nc-lighten($color-main-text, 30%) !default;
$image-logo: url('../img/logo/logo.svg?v=1') !default;
$image-login-background: url('../img/background.png?v=2') !default;
+$image-logoheader: url('../img/logo/logo.svg?v=1') !default;
+$image-favicon: url('../img/logo/logo.svg?v=1') !default;
$color-loading-light: #ccc !default;
$color-loading-dark: #444 !default;