fix(administration): add theme preview

This commit is contained in:
Francis Lachapelle
2022-05-12 16:11:23 -04:00
parent 1e9ae3184b
commit 33217456fc
7 changed files with 133 additions and 4 deletions

View File

@@ -0,0 +1,39 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
(function() {
'use strict';
/**
* @ngInject
*/
configure.$inject = ['$mdThemingProvider'];
function configure($mdThemingProvider) {
$mdThemingProvider.registerStyles([
'.foreground-1 { color: "{{foreground-1}}" }',
'.foreground-2 { color: "{{foreground-2}}" }',
'.foreground-3 { color: "{{foreground-3}}" }',
'.foreground-4 { color: "{{foreground-4}}" }',
'.background-contrast { color: "{{background-contrast}}" }',
'.background-contrast-secondary { color: "{{background-contrast-secondary}}" }',
'.background-default { background-color: "{{background-default}}" }',
].join(''));
$mdThemingProvider.generateThemesOnDemand(false);
}
/**
* @ngInject
*/
ThemePreviewController.$inject = ['$mdTheming'];
function ThemePreviewController($mdTheming) {
this.defaultTheme = $mdTheming.THEMES[$mdTheming.defaultTheme()];
this.jsonDefaultTheme = JSON.stringify(this.defaultTheme, undefined, 2);
}
angular
.module('SOGo.AdministrationUI')
.config(configure)
.controller('ThemePreviewController', ThemePreviewController);
})();