mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-24 22:39:31 +00:00
fix(administration): add theme preview
This commit is contained in:
@@ -45,6 +45,16 @@
|
||||
stateUser: stateUser,
|
||||
stateFolder: stateFolder
|
||||
}
|
||||
})
|
||||
.state('administration.theme', {
|
||||
url: '/theme',
|
||||
views: {
|
||||
module: {
|
||||
templateUrl: 'UIxThemePreview', // UI/Templates/Administration/UIxThemePreview.wox
|
||||
controller: 'ThemePreviewController',
|
||||
controllerAs: 'ctrl'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// if none of the above states are matched, use this as the fallback
|
||||
|
||||
@@ -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);
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user