Merge pull request #759 from mattermost/plt-242-3

PLT-242 Implement custom UI theme colors.
Этот коммит содержится в:
Harrison Healey
2015-09-23 15:04:22 -04:00
родитель 301706f255 e4a15076f4
Коммит 15f15de8ca
41 изменённых файлов: 1166 добавлений и 194 удалений

Просмотреть файл

@@ -12,6 +12,7 @@ var PostStore = require('../stores/post_store.jsx');
var UserStore = require('../stores/user_store.jsx');
var Utils = require('../utils/utils.jsx');
var Constants = require('../utils/constants.jsx');
export default class ChannelLoader extends React.Component {
constructor(props) {
@@ -68,25 +69,10 @@ export default class ChannelLoader extends React.Component {
/* Update CSS classes to match user theme */
var user = UserStore.getCurrentUser();
if (user.props && user.props.theme) {
Utils.changeCss('div.theme', 'background-color:' + user.props.theme + ';');
Utils.changeCss('.btn.btn-primary', 'background: ' + user.props.theme + ';');
Utils.changeCss('.modal .modal-header', 'background: ' + user.props.theme + ';');
Utils.changeCss('.mention', 'background: ' + user.props.theme + ';');
Utils.changeCss('.mention-link', 'color: ' + user.props.theme + ';');
Utils.changeCss('@media(max-width: 768px){.search-bar__container', 'background: ' + user.props.theme + ';}');
Utils.changeCss('.search-item-container:hover', 'background: ' + Utils.changeOpacity(user.props.theme, 0.05) + ';');
}
if (user.props.theme !== '#000000' && user.props.theme !== '#585858') {
Utils.changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background: ' + Utils.changeColor(user.props.theme, -10) + ';');
Utils.changeCss('a.theme', 'color:' + user.props.theme + '; fill:' + user.props.theme + '!important;');
} else if (user.props.theme === '#000000') {
Utils.changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background: ' + Utils.changeColor(user.props.theme, +50) + ';');
$('.team__header').addClass('theme--black');
} else if (user.props.theme === '#585858') {
Utils.changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background: ' + Utils.changeColor(user.props.theme, +10) + ';');
$('.team__header').addClass('theme--gray');
if ($.isPlainObject(user.theme_props) && !$.isEmptyObject(user.theme_props)) {
Utils.applyTheme(user.theme_props);
} else {
Utils.applyTheme(Constants.THEMES.default);
}
/* Setup global mouse events */