diff options
author | Kris Kowal | 2012-07-06 11:52:06 -0700 |
---|---|---|
committer | Kris Kowal | 2012-07-06 15:01:48 -0700 |
commit | 648ee61ae84216d0236e0dbc211addc13b2cfa3a (patch) | |
tree | 8f0f55557bd0c47a84e49c1977c950645d284607 /js/components | |
parent | aedd14b18695d031f695d27dfbd94df5614495bb (diff) | |
download | ninja-648ee61ae84216d0236e0dbc211addc13b2cfa3a.tar.gz |
Expand tabs
Diffstat (limited to 'js/components')
52 files changed, 1382 insertions, 1382 deletions
diff --git a/js/components/colorbar.reel/colorbar.html b/js/components/colorbar.reel/colorbar.html index e61cc2f2..fc31d742 100755 --- a/js/components/colorbar.reel/colorbar.html +++ b/js/components/colorbar.reel/colorbar.html | |||
@@ -31,28 +31,28 @@ POSSIBILITY OF SUCH DAMAGE. | |||
31 | </copyright> | 31 | </copyright> |
32 | --> | 32 | --> |
33 | <html> | 33 | <html> |
34 | <head> | 34 | <head> |
35 | 35 | ||
36 | <link rel="stylesheet" type="text/css" href="css/colorbar.css"> | 36 | <link rel="stylesheet" type="text/css" href="css/colorbar.css"> |
37 | 37 | ||
38 | <script type="text/montage-serialization"> | 38 | <script type="text/montage-serialization"> |
39 | { | 39 | { |
40 | "owner": { | 40 | "owner": { |
41 | "prototype": "js/components/colorbar.reel[ColorBar]", | 41 | "prototype": "js/components/colorbar.reel[ColorBar]", |
42 | "properties": { | 42 | "properties": { |
43 | "element": {"#": "colorbar"} | 43 | "element": {"#": "colorbar"} |
44 | 44 | ||
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
48 | </script> | 48 | </script> |
49 | 49 | ||
50 | </head> | 50 | </head> |
51 | |||
52 | <body> | ||
53 | 51 | ||
54 | <canvas data-montage-id="colorbar" class="colorbar"></canvas> | 52 | <body> |
55 | 53 | ||
56 | </body> | 54 | <canvas data-montage-id="colorbar" class="colorbar"></canvas> |
55 | |||
56 | </body> | ||
57 | 57 | ||
58 | </html> | 58 | </html> |
diff --git a/js/components/colorbar.reel/colorbar.js b/js/components/colorbar.reel/colorbar.js index 4f3577d9..808ada4e 100755 --- a/js/components/colorbar.reel/colorbar.js +++ b/js/components/colorbar.reel/colorbar.js | |||
@@ -30,152 +30,152 @@ POSSIBILITY OF SUCH DAMAGE. | |||
30 | 30 | ||
31 | //////////////////////////////////////////////////////////////////////// | 31 | //////////////////////////////////////////////////////////////////////// |
32 | // | 32 | // |
33 | var Montage = require("montage/core/core").Montage, | 33 | var Montage = require("montage/core/core").Montage, |
34 | Component = require("montage/ui/component").Component; | 34 | Component = require("montage/ui/component").Component; |
35 | //////////////////////////////////////////////////////////////////////// | 35 | //////////////////////////////////////////////////////////////////////// |
36 | //Exporting as ColorBar | 36 | //Exporting as ColorBar |
37 | exports.ColorBar = Montage.create(Component, { | 37 | exports.ColorBar = Montage.create(Component, { |
38 | //////////////////////////////////////////////////////////////////// | 38 | //////////////////////////////////////////////////////////////////// |
39 | //No reel needed since it's just a bar component | 39 | //No reel needed since it's just a bar component |
40 | hasTemplate: { | 40 | hasTemplate: { |
41 | value: true | 41 | value: true |
42 | }, | 42 | }, |
43 | //////////////////////////////////////////////////////////////////// | 43 | //////////////////////////////////////////////////////////////////// |
44 | //Width of spectrum (not including b/w buttons) | 44 | //Width of spectrum (not including b/w buttons) |
45 | _colorBarSpectrumWidth: { | 45 | _colorBarSpectrumWidth: { |
46 | value: null | 46 | value: null |
47 | }, | 47 | }, |
48 | //////////////////////////////////////////////////////////////////// | 48 | //////////////////////////////////////////////////////////////////// |
49 | //Width of spectrum steps (used to calculate size of B/W buttons) | 49 | //Width of spectrum steps (used to calculate size of B/W buttons) |
50 | _colorBarSpectrumWidthSteps: { | 50 | _colorBarSpectrumWidthSteps: { |
51 | value: 10 | 51 | value: 10 |
52 | }, | 52 | }, |
53 | //////////////////////////////////////////////////////////////////// | 53 | //////////////////////////////////////////////////////////////////// |
54 | //Default value | 54 | //Default value |
55 | _value: { | 55 | _value: { |
56 | value: {h: 0, s: 0, v: 0} | 56 | value: {h: 0, s: 0, v: 0} |
57 | }, | 57 | }, |
58 | //////////////////////////////////////////////////////////////////// | 58 | //////////////////////////////////////////////////////////////////// |
59 | //HSV Value selected from bar | 59 | //HSV Value selected from bar |
60 | value: { | 60 | value: { |
61 | get: function() {return this._value;}, | 61 | get: function() {return this._value;}, |
62 | set: function(value) { | 62 | set: function(value) { |
63 | if (value) { | 63 | if (value) { |
64 | //Checking for limits (Max and Min HSV values) | 64 | //Checking for limits (Max and Min HSV values) |
65 | if (value.h > Math.PI*2) { | 65 | if (value.h > Math.PI*2) { |
66 | value.h = Math.PI*2; | 66 | value.h = Math.PI*2; |
67 | } else if (value.h < 0) { | 67 | } else if (value.h < 0) { |
68 | value.h = 0; | 68 | value.h = 0; |
69 | } | 69 | } |
70 | // | 70 | // |
71 | if (value.s > 1) { | 71 | if (value.s > 1) { |
72 | value.s = 1; | 72 | value.s = 1; |
73 | } else if (value.s < 0) { | 73 | } else if (value.s < 0) { |
74 | value.s = 0; | 74 | value.s = 0; |
75 | } | 75 | } |
76 | // | 76 | // |
77 | if (value.v > 1) { | 77 | if (value.v > 1) { |
78 | value.v = 1; | 78 | value.v = 1; |
79 | } else if (value.v < 0) { | 79 | } else if (value.v < 0) { |
80 |