diff options
author | Pierre Frisch | 2011-12-22 07:25:50 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-01-27 11:18:17 -0800 |
commit | b89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch) | |
tree | 0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/components/ui/color-chip.reel | |
parent | 2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff) | |
download | ninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz |
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/components/ui/color-chip.reel')
-rw-r--r-- | js/components/ui/color-chip.reel/color-chip.css | 31 | ||||
-rw-r--r-- | js/components/ui/color-chip.reel/color-chip.html | 36 | ||||
-rw-r--r-- | js/components/ui/color-chip.reel/color-chip.js | 41 |
3 files changed, 108 insertions, 0 deletions
diff --git a/js/components/ui/color-chip.reel/color-chip.css b/js/components/ui/color-chip.reel/color-chip.css new file mode 100644 index 00000000..da75c41e --- /dev/null +++ b/js/components/ui/color-chip.reel/color-chip.css | |||
@@ -0,0 +1,31 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | .colorChipContainer { | ||
8 | display:block; | ||
9 | cursor:default; | ||
10 | -webkit-user-select:none; | ||
11 | width:18px !important; | ||
12 | height:18px !important; | ||
13 | background-color: #000000; | ||
14 | } | ||
15 | |||
16 | .colorChipContainer .chipContainer button { | ||
17 | display: block; | ||
18 | border: 0; | ||
19 | padding: 0; | ||
20 | background: none; | ||
21 | } | ||
22 | |||
23 | .colortoolbar .chipContainer { | ||
24 | margin: 1px 1px 1px 1px !important; | ||
25 | width: 40px !important; | ||
26 | height: 20px !important; | ||
27 | border: 0; | ||
28 | padding: 0; | ||
29 | background-image: url(../../../../images/colorpanel/transparent.png) !important; | ||
30 | background-repeat: repeat !important; | ||
31 | } \ No newline at end of file | ||
diff --git a/js/components/ui/color-chip.reel/color-chip.html b/js/components/ui/color-chip.reel/color-chip.html new file mode 100644 index 00000000..a365d775 --- /dev/null +++ b/js/components/ui/color-chip.reel/color-chip.html | |||
@@ -0,0 +1,36 @@ | |||
1 | <!DOCTYPE HTML> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html> | ||
8 | <head> | ||
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
10 | <link rel="stylesheet" type="text/css" href="color-chip.css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "owner": { | ||
14 | "module": "js/components/ui/color-chip.reel", | ||
15 | "name": "ColorChip", | ||
16 | "properties": { | ||
17 | "element": {"#": "colorChipContainer"}, | ||
18 | "icon": {"#": "chipIcon"}, | ||
19 | "chipBtn": {"#": "chipButton"} | ||
20 | } | ||
21 | } | ||
22 | } | ||
23 | </script> | ||
24 | </head> | ||
25 | <body> | ||
26 | <!-- TODO: This should not use the 'colortoolbar' class, this is the wrong application of this class --> | ||
27 | <div id="colorChipContainer" class="colortoolbar"> | ||
28 | |||
29 | <div id="chipIcon"></div> | ||
30 | |||
31 | <div class="chipContainer"><button id="chipButton"></button></div> | ||
32 | |||
33 | </div> | ||
34 | |||
35 | </body> | ||
36 | </html> \ No newline at end of file | ||
diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js new file mode 100644 index 00000000..5bef7020 --- /dev/null +++ b/js/components/ui/color-chip.reel/color-chip.js | |||
@@ -0,0 +1,41 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | var ColorChip = exports.ColorChip = Montage.create(Component, { | ||
11 | |||
12 | hasIcon: { | ||
13 | value: true | ||
14 | }, | ||
15 | |||
16 | mode: { | ||
17 | value: "stroke" | ||
18 | }, | ||
19 | |||
20 | prepareForDraw: { | ||
21 | value: function() { | ||
22 | // this.colorButton.props = {side: 'right', align: 'bottom', wheel: true, palette: true, gradient: true, image: true, offset: 20}; | ||
23 | // this.application.ninja.colorController.addButton('chip', this.colorButton); | ||
24 | |||
25 | |||
26 | this.addEventListener("firstDraw", this, false); | ||
27 | } | ||
28 | }, | ||
29 | |||
30 | draw: { | ||
31 | value: function() { | ||
32 | |||
33 | if(this.hasIcon) this.application.ninja.colorController.addButton(this.mode + 'Icon', this.icon); | ||
34 | |||
35 | // this.application.ninja.colorController.addButton(this.mode, this.chipBtn); | ||
36 | this.chipBtn.props = {side: 'right', align: 'top', wheel: true, palette: true, gradient: true, image: true, offset: 20}; | ||
37 | this.application.ninja.colorController.addButton(this.mode, this.chipBtn); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | }); | ||