aboutsummaryrefslogtreecommitdiff
path: root/js/components/colorwheel.reel
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-09 14:35:44 -0700
committerValerio Virgillito2012-07-09 14:35:44 -0700
commit84b3327bd92faafab7954b5eb64c7abe24a3fe13 (patch)
tree3f56cbed2f08c5a81ea79eaf0bcb9bd031d8a627 /js/components/colorwheel.reel
parentc0a42c56f768a873ba637f5b86d5f6a84d4a3312 (diff)
parent40c6eb2c06b34f65a74d59ef9687251952858bab (diff)
downloadninja-84b3327bd92faafab7954b5eb64c7abe24a3fe13.tar.gz
Merge branch 'normalize' of https://github.com/kriskowal/ninja-internal
Conflicts: js/components/gradientpicker.reel/gradientpicker.js js/components/tools-properties/text-properties.reel/text-properties.js js/document/views/base.js js/document/views/design.js js/helper-classes/3D/StageLine.js js/helper-classes/3D/draw-utils.js js/lib/drawing/world.js js/lib/geom/circle.js js/lib/geom/line.js js/lib/geom/rectangle.js js/lib/geom/shape-primitive.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/flag-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/water-material.js js/panels/Materials/materials-library-panel.reel/materials-library-panel.html js/panels/Materials/materials-library-panel.reel/materials-library-panel.js js/panels/Materials/materials-popup.reel/materials-popup.html js/panels/Materials/materials-popup.reel/materials-popup.js js/tools/LineTool.js Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/components/colorwheel.reel')
-rwxr-xr-xjs/components/colorwheel.reel/colorwheel.html68
-rwxr-xr-xjs/components/colorwheel.reel/colorwheel.js710
-rwxr-xr-xjs/components/colorwheel.reel/css/colorwheel.scss6
3 files changed, 392 insertions, 392 deletions
diff --git a/js/components/colorwheel.reel/colorwheel.html b/js/components/colorwheel.reel/colorwheel.html
index b39479a8..2de64d7e 100755
--- a/js/components/colorwheel.reel/colorwheel.html
+++ b/js/components/colorwheel.reel/colorwheel.html
@@ -1,5 +1,5 @@
1<!DOCTYPE html> 1<!doctype html>
2<!-- 2<!--
3<copyright> 3<copyright>
4Copyright (c) 2012, Motorola Mobility, Inc 4Copyright (c) 2012, Motorola Mobility, Inc
5All Rights Reserved. 5All Rights Reserved.
@@ -31,39 +31,39 @@ POSSIBILITY OF SUCH DAMAGE.
31</copyright> 31</copyright>
32--> 32-->
33<html lang="en"> 33<html lang="en">
34 <head> 34 <head>
35
36 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
37
38 <link rel="stylesheet" type="text/css" href="css/colorwheel.css">
39 35
40 <script type="text/montage-serialization"> 36 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
41 {
42 "owner": {
43 "prototype": "js/components/colorwheel.reel[ColorWheel]",
44 "properties": {
45 "element": {"#": "colorwheel"},
46 "wheel": {"#": "wheel"},
47 "wheelSelect": {"#": "wselect"},
48 "swatch": {"#": "swatch"},
49 "swatchSelect": {"#": "sselect"}
50 37
51 } 38 <link rel="stylesheet" type="text/css" href="css/colorwheel.css">
52 } 39
53 } 40 <script type="text/montage-serialization">
54 </script> 41 {
55 42 "owner": {
56 </head> 43 "prototype": "js/components/colorwheel.reel[ColorWheel]",
57 44 "properties": {
58 <body> 45 "element": {"#": "colorwheel"},
59 46 "wheel": {"#": "wheel"},
60 <div data-montage-id="colorwheel" class="colorwheel"> 47 "wheelSelect": {"#": "wselect"},
61 <canvas data-montage-id="wheel"></canvas> 48 "swatch": {"#": "swatch"},
62 <canvas data-montage-id="swatch"></canvas> 49 "swatchSelect": {"#": "sselect"}
63 <canvas data-montage-id="sselect"></canvas> 50
64 <canvas data-montage-id="wselect"></canvas> 51 }
65 </div> 52 }
66 53 }
67 </body> 54 </script>
55
56 </head>
57
58 <body>
59
60 <div data-montage-id="colorwheel" class="colorwheel">
61 <canvas data-montage-id="wheel"></canvas>
62 <canvas data-montage-id="swatch"></canvas>
63 <canvas data-montage-id="sselect"></canvas>
64 <canvas data-montage-id="wselect"></canvas>
65 </div>
66
67 </body>
68 68
69</html> 69</html>
diff --git a/js/components/colorwheel.reel/colorwheel.js b/js/components/colorwheel.reel/colorwheel.js
index a7c70038..d2664f14 100755
--- a/js/components/colorwheel.reel/colorwheel.js
+++ b/js/components/colorwheel.reel/colorwheel.js
@@ -30,14 +30,14 @@ POSSIBILITY OF SUCH DAMAGE.
30 30
31//////////////////////////////////////////////////////////////////////// 31////////////////////////////////////////////////////////////////////////
32// 32//
33var Montage = require("montage/core/core").Montage, 33var Montage = require("montage/core/core").Montage,
34 Component = require("montage/ui/component").Component; 34 Component = require("montage/ui/component").Component;
35//////////////////////////////////////////////////////////////////////// 35////////////////////////////////////////////////////////////////////////
36// 36//
37exports.ColorWheel = Montage.create(Component, { 37exports.ColorWheel = Montage.create(Component, {
38 //////////////////////////////////////////////////////////////////// 38 ////////////////////////////////////////////////////////////////////
39 // 39 //
40 hasTemplate: { 40 hasTemplate: {
41 value: true 41 value: true
42 }, 42 },
43 //////////////////////////////////////////////////////////////////// 43 ////////////////////////////////////////////////////////////////////
@@ -45,7 +45,7 @@ exports.ColorWheel = Montage.create(Component, {
45 _value: { 45 _value: {
46 value: {h: 0, s: 0, v: 0} 46 value: {h: 0, s: 0, v: 0}
47 }, 47 },
48 //////////////////////////////////////////////////////////////////// 48 ////////////////////////////////////////////////////////////////////
49 //Value of wheel in HSV (360, 100, 100) 49 //Value of wheel in HSV (360, 100, 100)
50 value: { 50 value: {
51 get: function() { 51 get: function() {
@@ -54,463 +54,463 @@ exports.ColorWheel = Montage.create(Component, {
54 set: function(value) { 54 set: function(value) {
55 this._value = value; 55 this._value = value;
56 if (this._wheelData) { 56 if (this._wheelData) {
57 if (value && !value.wasSetByCode) { 57 if (value && !value.wasSetByCode) {
58 this.wheelSelectorAngle(value.h/this._math.TAU*360); 58 this.wheelSelectorAngle(value.h/this._math.TAU*360);
59 this.drawSwatchColor(value.h/this._math.TAU*360); 59 this.drawSwatchColor(value.h/this._math.TAU*360);
60 this.drawSwatchSelector(value.s*100, value.v*100); 60 this.drawSwatchSelector(value.s*100, value.v*100);
61 } 61 }
62 if (!this._isMouseDown) { 62 if (!this._isMouseDown) {
63 this._dispatchEvent('change', true); 63 this._dispatchEvent('change', true);
64 } 64 }
65 } 65 }
66 } 66 }
67 }, 67 },
68 //////////////////////////////////////////////////////////////////// 68 ////////////////////////////////////////////////////////////////////
69 //Stroke size of wheel 69 //Stroke size of wheel
70 _strokeWidth: { 70 _strokeWidth: {
71 value: 2 71 value: 2
72 }, 72 },
73 //////////////////////////////////////////////////////////////////// 73 ////////////////////////////////////////////////////////////////////
74 //Size must be set in digits and interpreted as pixel 74 //Size must be set in digits and interpreted as pixel
75 strokeWidth: { 75 strokeWidth: {
76 get: function() { 76 get: function() {
77 return this._strokeWidth; 77 return this._strokeWidth;
78 }, 78 },
79 set: function(value) { 79 set: function(value) {
80 this._strokeWidth = value; 80 this._strokeWidth = value;
81 } 81 }
82 }, 82 },
83 //////////////////////////////////////////////////////////////////// 83 ////////////////////////////////////////////////////////////////////
84 //Stroke color of wheel 84 //Stroke color of wheel
85 _strokeColor: { 85 _strokeColor: {
86 value: 'rgb(255, 255, 255)' 86 value: 'rgb(255, 255, 255)'
87 }, 87 },
88 //////////////////////////////////////////////////////////////////// 88 ////////////////////////////////////////////////////////////////////
89 //Stroke only apply to wheel rim 89 //Stroke only apply to wheel rim
90 strokeColor: { 90 strokeColor: {
91 get: function() { 91 get: function() {
92 return this._strokeColor; 92 return this._strokeColor;
93 }, 93 },
94 set: function(value) { 94 set: function(value) {
95 this._strokeColor = value; 95 this._strokeColor = value;
96 } 96 }
97 }, 97 },
98 //////////////////////////////////////////////////////////////////// 98 ////////////////////////////////////////////////////////////////////
99 //Width of the rim 99 //Width of the rim
100 _rimWidth: { 100 _rimWidth: {
101 value: 2 101 value: 2
102 }, 102 },
103 //////////////////////////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////
104 //Width must be set using digits interpreted as pixel 104 //Width must be set using digits interpreted as pixel
105 rimWidth: { 105 rimWidth: {
106 get: function() { 106 get: function() {
107 return this._rimWidth; 107 return this._rimWidth;
108 }, 108 },
109 set: function(value) { 109 set: function(value) {
110 this._rimWidth = value; 110 this._rimWidth = value;
111 } 111 }
112 }, 112 },
113 //////////////////////////////////////////////////////////////////// 113 ////////////////////////////////////////////////////////////////////
114 // 114 //
115 _math: { 115 _math: {