Theming: color scheme editing. Unfinished! Doesn't have any effect on css files yet.

This commit is contained in:
Neil Lalonde
2014-04-16 09:49:06 -04:00
parent 0f4014eef1
commit feaaf55a0c
34 changed files with 1086 additions and 84 deletions
@@ -0,0 +1,28 @@
/**
An input field for a color.
@param hexValue is a reference to the color's hex value.
@class Discourse.ColorInputComponent
@extends Ember.Component
@namespace Discourse
@module Discourse
**/
Discourse.ColorInputComponent = Ember.Component.extend({
layoutName: 'components/color-input',
hexValueChanged: function() {
var hex = this.get('hexValue');
if (hex && (hex.length === 3 || hex.length === 6) && this.get('brightnessValue')) {
this.$('input').attr('style', 'color: ' + (this.get('brightnessValue') > 125 ? 'black' : 'white') + '; background-color: #' + hex + ';');
}
}.observes('hexValue', 'brightnessValue'),
didInsertElement: function() {
var self = this;
this._super();
Em.run.schedule('afterRender', function() {
self.hexValueChanged();
});
}
});