diff options
author | Jonathan Duran | 2012-06-19 08:40:26 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-19 08:40:26 -0700 |
commit | 6f25a2e70079de6bcbb8c3411ddef88c2ed1ea39 (patch) | |
tree | 253e5f6dd5923218e3155f78fa67ff3e43de0ebc /js/panels/color/colorpanelpopup.reel | |
parent | b51c9448bc187f9bfa3ab39c366657ec2bb9e2fb (diff) | |
parent | 483ad57efcd6475776f580c3af5b60e6deeaf781 (diff) | |
download | ninja-6f25a2e70079de6bcbb8c3411ddef88c2ed1ea39.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/panels/color/colorpanelpopup.reel')
-rwxr-xr-x | js/panels/color/colorpanelpopup.reel/colorpanelpopup.html | 33 | ||||
-rwxr-xr-x | js/panels/color/colorpanelpopup.reel/colorpanelpopup.js | 123 |
2 files changed, 78 insertions, 78 deletions
diff --git a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.html b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.html index 5ad5c615..596580b4 100755 --- a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.html +++ b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.html | |||
@@ -21,7 +21,18 @@ | |||
21 | "images": {"#": "cntnr_images"}, | 21 | "images": {"#": "cntnr_images"}, |
22 | "gradients": {"#": "cntnr_gradients"}, | 22 | "gradients": {"#": "cntnr_gradients"}, |
23 | "palettes": {"#": "cntnr_palettes"}, | 23 | "palettes": {"#": "cntnr_palettes"}, |
24 | "alpha": {"#": "cntnr_alpha"} | 24 | "alpha": {"#": "cntnr_alpha"}, |
25 | "alphaSlider": {"#": "alpha_slider"}, | ||
26 | "alphaHottext": {"#": "alpha_hottext"}, | ||
27 | "btnPrevious": {"#": "btn_previous"}, | ||
28 | "btnCurrent": {"#": "btn_current"}, | ||
29 | "btnWheel": {"#": "btn_wheel"}, | ||
30 | "btnImage": {"#": "btn_images"}, | ||
31 | "btnGradient": {"#": "btn_gradients"}, | ||
32 | "btnPalette": {"#": "btn_palettes"}, | ||
33 | "btnNocolor": {"#": "btn_nocolor"}, | ||
34 | "inputHex": {"#": "input_hex"} | ||
35 | |||
25 | } | 36 | } |
26 | } | 37 | } |
27 | } | 38 | } |
@@ -36,18 +47,18 @@ | |||
36 | 47 | ||
37 | <div class="cp_pu_history"> | 48 | <div class="cp_pu_history"> |
38 | 49 | ||
39 | <button class="cp_pu_color_previous">Previous Color</button> | 50 | <button data-montage-id="btn_previous" class="cp_pu_color_previous">Previous Color</button> |
40 | <button class="cp_pu_color_current">Current Color</button> | 51 | <button data-montage-id="btn_current" class="cp_pu_color_current">Current Color</button> |
41 | 52 | ||
42 | </div> | 53 | </div> |
43 | 54 | ||
44 | <div class="cp_pu_hex">#<input class="cp_pu_hottext_hex" maxlength="6" /></div> | 55 | <div data-montage-id="input_hex" class="cp_pu_hex">#<input class="cp_pu_hottext_hex" maxlength="6" /></div> |
45 | 56 | ||
46 | <button class="cp_pu_wheel" title="Color Wheel">Color Wheel</button> | 57 | <button data-montage-id="btn_wheel" class="cp_pu_wheel" title="Color Wheel">Color Wheel</button> |
47 | <button class="cp_pu_images" title="Background Image">Images</button> | 58 | <button data-montage-id="btn_images" class="cp_pu_images" title="Background Image">Images</button> |
48 | <button class="cp_pu_gradients" title="Gradient">Gradients</button> | 59 | <button data-montage-id="btn_gradients" class="cp_pu_gradients" title="Gradient">Gradients</button> |
49 | <button class="cp_pu_palettes" title="Color Palette">Palettes</button> | 60 | <button data-montage-id="btn_palettes" class="cp_pu_palettes" title="Color Palette">Palettes</button> |
50 | <button class="cp_pu_nocolor" title="No Color">No Color</button> | 61 | <button data-montage-id="btn_nocolor" class="cp_pu_nocolor" title="No Color">No Color</button> |
51 | 62 | ||
52 | </div> | 63 | </div> |
53 | 64 | ||
@@ -60,8 +71,8 @@ | |||
60 | 71 | ||
61 | <div data-montage-id="cntnr_alpha" class="cp_pu_alpha"> | 72 | <div data-montage-id="cntnr_alpha" class="cp_pu_alpha"> |
62 | <div class="cp_pu_a_label">Alpha</div> | 73 | <div class="cp_pu_a_label">Alpha</div> |
63 | <div class="cp_pu_a_slider"></div> | 74 | <div data-montage-id="alpha_slider" class="cp_pu_a_slider"></div> |
64 | <input class="cp_pu_a_hottext"/> | 75 | <input data-montage-id="alpha_hottext" class="cp_pu_a_hottext"/> |
65 | <div class="cp_pu_a_label2">%</div> | 76 | <div class="cp_pu_a_label2">%</div> |
66 | </div> | 77 | </div> |
67 | 78 | ||
diff --git a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js index aebbbd41..192c62fb 100755 --- a/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js +++ b/js/panels/color/colorpanelpopup.reel/colorpanelpopup.js | |||
@@ -23,19 +23,13 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
23 | //////////////////////////////////////////////////////////////////// | 23 | //////////////////////////////////////////////////////////////////// |
24 | //Storing color manager | 24 | //Storing color manager |
25 | _colorManager: { | 25 | _colorManager: { |
26 | value: false | 26 | value: null |
27 | }, | 27 | }, |
28 | //////////////////////////////////////////////////////////////////// | 28 | //////////////////////////////////////////////////////////////////// |
29 | //Color manager | 29 | //Color manager |
30 | colorManager: { | 30 | colorManager: { |
31 | get: function() { | 31 | get: function() {return this._colorManager;}, |
32 | return this._colorManager; | 32 | set: function(value) {if (value !== this._colorManager) this._colorManager = value;} |
33 | }, | ||
34 | set: function(value) { | ||
35 | if (value !== this._colorManager) { | ||
36 | this._colorManager = value; | ||
37 | } | ||
38 | } | ||
39 | }, | 33 | }, |
40 | //////////////////////////////////////////////////////////////////// | 34 | //////////////////////////////////////////////////////////////////// |
41 | //Storing color panel | 35 | //Storing color panel |
@@ -45,18 +39,19 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
45 | //////////////////////////////////////////////////////////////////// | 39 | //////////////////////////////////////////////////////////////////// |
46 | //Color panel | 40 | //Color panel |
47 | colorPanel: { | 41 | colorPanel: { |
48 | get: function() { | 42 | get: function() {return this._colorPanel;}, |
49 | return this._colorPanel; | 43 | set: function(value) {this._colorPanel = value;} |
50 | }, | 44 | }, |
51 | set: function(value) { | 45 | //////////////////////////////////////////////////////////////////// |
52 | this._colorPanel = value; | 46 | // |
53 | } | 47 | _components: { |
48 | value: null | ||
54 | }, | 49 | }, |
55 | //////////////////////////////////////////////////////////////////// | 50 | //////////////////////////////////////////////////////////////////// |
56 | // | 51 | // |
57 | setNoColor: { | 52 | setNoColor: { |
58 | value: function (e) { | 53 | value: function (code) { |
59 | this.colorManager.applyNoColor(); | 54 | if (this.colorManager) this.colorManager.applyNoColor(code); |
60 | } | 55 | } |
61 | }, | 56 | }, |
62 | //////////////////////////////////////////////////////////////////// | 57 | //////////////////////////////////////////////////////////////////// |
@@ -64,7 +59,8 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
64 | prepareForDraw: { | 59 | prepareForDraw: { |
65 | value: function () { | 60 | value: function () { |
66 | // | 61 | // |
67 | this.element._components = {wheel: null, combo: null}; | 62 | this._components = null; |
63 | this._components = {wheel: null, combo: null}; | ||
68 | } | 64 | } |
69 | }, | 65 | }, |
70 | //////////////////////////////////////////////////////////////////// | 66 | //////////////////////////////////////////////////////////////////// |
@@ -74,14 +70,14 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
74 | // | 70 | // |
75 | this.element.style.opacity = 0; | 71 | this.element.style.opacity = 0; |
76 | // | 72 | // |
77 | this.element._components.combo = {}; | 73 | this._components.combo = {}; |
78 | this.element._components.combo.slider = Slider.create(); | 74 | this._components.combo.slider = Slider.create(); |
79 | this.element._components.combo.hottext = HotText.create(); | 75 | this._components.combo.hottext = HotText.create(); |
80 | this.element._components.combo.slider.element = this.element.getElementsByClassName('cp_pu_a_slider')[0]; | 76 | this._components.combo.slider.element = this.alphaSlider; |
81 | this.element._components.combo.hottext.element = this.element.getElementsByClassName('cp_pu_a_hottext')[0]; | 77 | this._components.combo.hottext.element = this.alphaHottext; |
82 | // | 78 | // |
83 | Object.defineBinding(this.element._components.combo.hottext, "_value", { | 79 | Object.defineBinding(this._components.combo.hottext, "value", { |
84 | boundObject: this.element._components.combo.slider, | 80 | boundObject: this._components.combo.slider, |
85 | boundObjectPropertyPath: "value", | 81 | boundObjectPropertyPath: "value", |
86 | oneway: false, | 82 | oneway: false, |
87 | boundValueMutator: function(value) { | 83 | boundValueMutator: function(value) { |
@@ -89,16 +85,8 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
89 | } | 85 | } |
90 | }); | 86 | }); |
91 | // | 87 | // |
92 | Object.defineBinding(this.element._components.combo.hottext, "value", { | ||
93 | boundObject: this.element._components.combo.slider, | ||
94 | boundObjectPropertyPath: "value", | ||
95 | oneway: false, | ||
96 | boundValueMutator: function(value) { | ||
97 | return Math.round(value); | ||
98 | } | ||
99 | }); | ||
100 | if (this.application.ninja.colorController.colorView) { | 88 | if (this.application.ninja.colorController.colorView) { |
101 | Object.defineBinding(this.element._components.combo.slider, "value", { | 89 | Object.defineBinding(this._components.combo.slider, "value", { |
102 | boundObject: this.application.ninja.colorController.colorView._combo[3].slider, | 90 | boundObject: this.application.ninja.colorController.colorView._combo[3].slider, |
103 | boundObjectPropertyPath: "value", | 91 | boundObjectPropertyPath: "value", |
104 | oneway: false, | 92 | oneway: false, |
@@ -108,25 +96,26 @@ exports.ColorPanelPopup = Montage.create(Component, { | |||
108 | }); | 96 | }); |
109 | } | 97 | } |
110 | // | 98 | // |
111 | this.element._components.combo.slider.maxValue = this.element._components.combo.hottext.maxValue = 100; | 99 | this._components.combo.slider.maxValue = this._components.combo.hottext.maxValue = 100; |
100 | // | ||
112 | if (this.application.ninja.colorController.colorView) { | 101 | if (this.application.ninja.colorController.colorView) { |
113 | this.element._components.combo.slider.customBackground = this.application.ninja.colorController.colorView._slider3Background.bind(this.application.ninja.colorController.colorView); | 102 |