aboutsummaryrefslogtreecommitdiff
path: root/js/panels/color/colortoolbar.reel/colortoolbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/color/colortoolbar.reel/colortoolbar.js')
-rwxr-xr-xjs/panels/color/colortoolbar.reel/colortoolbar.js138
1 files changed, 0 insertions, 138 deletions
diff --git a/js/panels/color/colortoolbar.reel/colortoolbar.js b/js/panels/color/colortoolbar.reel/colortoolbar.js
deleted file mode 100755
index bf4d307f..00000000
--- a/js/panels/color/colortoolbar.reel/colortoolbar.js
+++ /dev/null
@@ -1,138 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7////////////////////////////////////////////////////////////////////////
8//
9var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component;
11////////////////////////////////////////////////////////////////////////
12//
13exports.ColorToolbar = Montage.create(Component, {
14 ////////////////////////////////////////////////////////////////////
15 //
16 hasTemplate: {
17 value: true
18 },
19 ////////////////////////////////////////////////////////////////////
20 //Storing stroke (stores color in mode use to select color)
21 _stroke: {
22 enumerable: false,
23 value: {colorMode: 'rgb', color: {r: 0, g: 0, b: 0, a: 1, css: 'rgb(0,0,0)', mode:'rgb', wasSetByCode: true, type: 'change'}, webGlColor: [0, 0, 0, 1]}
24 },
25 ////////////////////////////////////////////////////////////////////
26 //
27 stroke: {
28 enumerable: true,
29 get: function() {
30 return this._stroke;
31 },
32 set: function(value) {
33 if (value !== this._stroke) {
34 this._stroke = value;
35 }
36 }
37 },
38 ////////////////////////////////////////////////////////////////////
39 //Storing fill (stores color in mode use to select color)
40 _fill: {
41 enumerable: false,
42 value: {colorMode: 'rgb', color: {r: 255, g: 255, b: 255, a: 1, css: 'rgb(255,255,255)', mode:'rgb', wasSetByCode: true, type: 'change'}, webGlColor: [1, 1, 1, 1]}
43 },
44 ////////////////////////////////////////////////////////////////////
45 //
46 fill: {
47 enumerable: true,
48 get: function() {
49 return this._fill;
50 },
51 set: function(value) {
52 if (value !== this._fill) {
53 this._fill = value;
54 }
55 }
56 },
57 ////////////////////////////////////////////////////////////////////
58 //
59 prepareForDraw: {
60 enumerable: false,
61 value: function () {
62 //
63 }
64 },
65 ////////////////////////////////////////////////////////////////////
66 //
67 willDraw: {
68 enumerable: false,
69 value: function() {
70 //
71 var buttons = this.element.getElementsByTagName('button');
72 //
73 this.fill_btn = buttons [1];
74 this.stroke_btn = buttons[0];
75 //
76 this.fill_btn.props = {side: 'left', align: 'top', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: 20};
77 this.stroke_btn.props = {side: 'left', align: 'top', wheel: true, palette: true, gradient: false, image: false, nocolor: true, offset: 20};
78 }
79 },
80 ////////////////////////////////////////////////////////////////////
81 //
82 draw: {
83 enumerable: false,
84 value: function() {
85 //
86 this.application.ninja.colorController.addButton('chip', this.fill_btn);
87 this.application.ninja.colorController.addButton('chip', this.stroke_btn);
88 //
89 this.fill_btn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 255, g: 255, b: 255}, css: 'rgb(255,255,255)'});
90 this.stroke_btn.color('rgb', {wasSetByCode: true, type: 'change', color: {r: 0, g: 0, b: 0}, css: 'rgb(0,0,0)'});
91 }
92 },
93 ////////////////////////////////////////////////////////////////////
94 //
95 didDraw: {
96 enumerable: false,
97 value: function() {
98
99 this.fill_btn.addEventListener('change', function (e) {
100 this.fill = e._event;
101 this.fill.webGlColor = this.application.ninja.colorController.colorModel.colorToWebGl(e._event.color);
102 this.application.ninja.colorController.colorModel.input = 'fill';
103
104 var color = e._event.color;
105 if (e._event.colorMode !== 'nocolor' && color) {
106 color.wasSetByCode = false;
107 color.type = 'change';
108 color.mode = e._event.colorMode;
109 this.application.ninja.colorController.colorModel[e._event.colorMode] = color;
110 } else {
111 this.application.ninja.colorController.colorModel.applyNoColor(false);
112 }
113 this.application.ninja.colorController.colorModel.input = 'chip';
114 }.bind(this));
115
116 this.stroke_btn.addEventListener('change', function (e) {
117 this.stroke = e._event;
118 this.stroke.webGlColor = this.application.ninja.colorController.colorModel.colorToWebGl(e._event.color);
119 this.application.ninja.colorController.colorModel.input = 'stroke';
120
121 var color = e._event.color;
122 if (e._event.colorMode !== 'nocolor' && color) {
123 color.wasSetByCode = false;
124 color.type = 'change';
125 color.mode = e._event.colorMode;
126 this.application.ninja.colorController.colorModel[e._event.colorMode] = color;
127 } else {
128 this.application.ninja.colorController.colorModel.applyNoColor(false);
129 }
130 this.application.ninja.colorController.colorModel.input = 'chip';
131 }.bind(this));
132 }
133 }
134 ////////////////////////////////////////////////////////////////////
135 ////////////////////////////////////////////////////////////////////
136});
137////////////////////////////////////////////////////////////////////////
138//////////////////////////////////////////////////////////////////////// \ No newline at end of file