/* <copyright>
This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
</copyright> */
////////////////////////////////////////////////////////////////////////
//
var Montage = require("montage/core/core").Montage,
Component = require("montage/ui/component").Component,
Popup = require("js/components/popup.reel").Popup,
Slider = require("js/components/slider.reel").Slider,
HotText = require("js/components/hottext.reel").HotText,
ColorBar = require("js/components/colorbar.reel").ColorBar;
////////////////////////////////////////////////////////////////////////
//Exporting as ColorPanelBase
exports.ColorPanelBase = Montage.create(Component, {
////////////////////////////////////////////////////////////////////
//
hasTemplate: {
value: true
},
////////////////////////////////////////////////////////////////////
//Storing ColorPanel sliders mode
_panelMode: {
enumerable: false,
value: 'rgb'
},
////////////////////////////////////////////////////////////////////
//Storing ColorPanel sliders mode
panelMode: {
enumerable: true,
get: function() {
return this._panelMode;
},
set: function(value) {
if (value !== this._panelMode) {
this._panelMode = value;
}
}
},
////////////////////////////////////////////////////////////////////
//
_colorBar: {
enumerable: false,
value: null
},
////////////////////////////////////////////////////////////////////
//Storing color manager
_colorManager: {
enumerable: false,
value: null
},
////////////////////////////////////////////////////////////////////
//
colorManager: {
enumerable: true,
get: function() {
return this._colorManager;
},
set: function(value) {
if (value !== this._colorManager) {
this._colorManager = value;
//Updating input buttons
this._colorManager.addEventListener('change', this._update.bind(this));
this._colorManager.addEventListener('changing', this._update.bind(this));
//Updating history buttons once color is set
this._colorManager.addEventListener('change', this._updateHistoryButtons.bind(this));
}
}
},
////////////////////////////////////////////////////////////////////
//Color Panel Container
_container: {
enumerable: false,
value: null
},
////////////////////////////////////////////////////////////////////
//
_combo: {
enumerable: false,
value: [{slider: null, hottext: null}, {slider: null, hottext: null}, {slider: null, hottext: null}, {slider: null, hottext: null}]
},
////////////////////////////////////////////////////////////////////
//
_buttons: {
enumerable: false,
value: {chip: [], fill: [], stroke: [], current: [], previous: [], rgbmode: [], hslmode: [], hexinput: [], nocolor: [], reset: [], swap: [], mlabel1: [], mlabel2: [], mlabel3: []}
},
////////////////////////////////////////////////////////////////////
//
historyCache: {
enumerable: false,
value: {current: null, previous: null}
},
////////////////////////////////////////////////////////////////////
//
colorChipProps: {
enumerable: true,
value: {side: 'top', align: 'center', wheel: true, palette: true, gradient: true, image: true, panel: false}
|