diff options
author | Armen Kesablyan | 2012-06-01 13:13:21 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-01 13:13:21 -0700 |
commit | 10d97af27fca224752ad04551ca5c41982222d1f (patch) | |
tree | 27d2899cca3a9f28a0b6e222d39436d83009fafc /js/panels | |
parent | 9e187e40d9982654081e52be656e00b3ca4d36b5 (diff) | |
parent | 77677e5ffb08a5dec4bf0be279130d7b1a99d03f (diff) | |
download | ninja-10d97af27fca224752ad04551ca5c41982222d1f.tar.gz |
Merge branch 'binding' of https://github.com/dhg637/ninja-internal into binding
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.css | 11 | ||||
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.html | 30 | ||||
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.js | 14 | ||||
-rw-r--r-- | js/panels/binding/binding-item.reel/binding-item.css | 45 | ||||
-rw-r--r-- | js/panels/binding/binding-item.reel/binding-item.html | 85 | ||||
-rw-r--r-- | js/panels/binding/binding-item.reel/binding-item.js | 88 | ||||
-rw-r--r-- | js/panels/objects/object.reel/object.html | 2 | ||||
-rw-r--r-- | js/panels/objects/object.reel/object.js | 32 |
8 files changed, 278 insertions, 29 deletions
diff --git a/js/panels/binding-panel.reel/binding-panel.css b/js/panels/binding-panel.reel/binding-panel.css index e69de29b..f29b66c1 100644 --- a/js/panels/binding-panel.reel/binding-panel.css +++ b/js/panels/binding-panel.reel/binding-panel.css | |||
@@ -0,0 +1,11 @@ | |||
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 | |||
8 | .bindings-list { | ||
9 | padding: 0; | ||
10 | margin: 0; | ||
11 | } | ||
diff --git a/js/panels/binding-panel.reel/binding-panel.html b/js/panels/binding-panel.reel/binding-panel.html index 0db7b95f..2850b67c 100644 --- a/js/panels/binding-panel.reel/binding-panel.html +++ b/js/panels/binding-panel.reel/binding-panel.html | |||
@@ -15,6 +15,32 @@ | |||
15 | "properties": { | 15 | "properties": { |
16 | "element": {"#": "binding"} | 16 | "element": {"#": "binding"} |
17 | } | 17 | } |
18 | }, | ||
19 | "arrayController": { | ||
20 | "prototype": "montage/ui/controller/array-controller", | ||
21 | "bindings": { | ||
22 | "content" : {"<-": "@owner.bindings" } | ||
23 | } | ||
24 | }, | ||
25 | "repetition": { | ||
26 | "prototype": "montage/ui/repetition.reel", | ||
27 | "properties": { | ||
28 | "element": {"#": "bindings-list"}, | ||
29 | "contentController": {"@": "arrayController"} | ||
30 | } | ||
31 | }, | ||
32 | "bindingItem": { | ||
33 | "prototype": "js/panels/binding/binding-item.reel", | ||
34 | "properties": { | ||
35 | "element": {"#": "binding-item"} | ||
36 | }, | ||
37 | "bindings": { | ||
38 | "sourceObjectPropertyPath": {"<-": "@repetition.objectAtCurrentIteration.sourceObjectPropertyPath"}, | ||
39 | "sourceObject": {"<-": "@repetition.objectAtCurrentIteration.sourceObject"}, | ||
40 | "boundObjectPropertyPath": {"<-": "@repetition.objectAtCurrentIteration.boundObjectPropertyPath"}, | ||
41 | "boundObject": {"<-": "@repetition.objectAtCurrentIteration.boundObject"}, | ||
42 | "oneway": {"<-": "@repetition.objectAtCurrentIteration.oneway"} | ||
43 | } | ||
18 | } | 44 | } |
19 | 45 | ||
20 | } | 46 | } |
@@ -22,7 +48,9 @@ | |||
22 | </head> | 48 | </head> |
23 | <body> | 49 | <body> |
24 | <div data-montage-id="binding"> | 50 | <div data-montage-id="binding"> |
25 | this is a test | 51 | <ul data-montage-id="bindings-list" class="bindings-list"> |
52 | <li data-montage-id="binding-item" class="binding-item"></li> | ||
53 | </ul> | ||
26 | </div> | 54 | </div> |
27 | </body> | 55 | </body> |
28 | </html> \ No newline at end of file | 56 | </html> \ No newline at end of file |
diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 03fe5723..9fdec416 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js | |||
@@ -4,6 +4,20 @@ var Montage = require("montage/core/core").Montage, | |||
4 | 4 | ||
5 | exports.BindingPanel = Montage.create(Component, { | 5 | exports.BindingPanel = Montage.create(Component, { |
6 | 6 | ||
7 | bindings : { | ||
8 | value: null | ||
9 | }, | ||
10 | |||
11 | templateDidLoad : { | ||
12 | value: function() { | ||
13 | Object.defineBinding(this, 'bindings', { | ||
14 | boundObject: this.application.ninja.objectsController, | ||
15 | boundObjectPropertyPath: "currentObjectBindings", | ||
16 | oneway: true | ||
17 | }); | ||
18 | } | ||
19 | }, | ||
20 | |||
7 | prepareForDraw: { | 21 | prepareForDraw: { |
8 | value: function() { | 22 | value: function() { |
9 | console.log("test- objects"); | 23 | console.log("test- objects"); |
diff --git a/js/panels/binding/binding-item.reel/binding-item.css b/js/panels/binding/binding-item.reel/binding-item.css new file mode 100644 index 00000000..0f4416b9 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.css | |||
@@ -0,0 +1,45 @@ | |||
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 | .binding-item { | ||
8 | color: #FFF; | ||
9 | margin: 0 8px; | ||
10 | padding: 3px; | ||
11 | border-bottom: 1px solid #505050; | ||
12 | list-style-type: none; | ||
13 | display: -webkit-box; | ||
14 | -webkit-box-orient: horizontal; | ||
15 | } | ||
16 | .binding-item > * { | ||
17 | -webkit-box-flex: 1; | ||
18 | } | ||
19 | .source-object, .bound-object { | ||
20 | padding: 5px 0 3px; | ||
21 | } | ||
22 | .source-object {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vfhQMvFos7lO1T0zRlBiwOxAD1edYW%2FuCgJEv7OZfluH7OWtTPF95E1Hy2bNs%2B8U0Uj8fR9JbfREqAnHuHbvAdyjXnJqXcoW%2FcGr890QWtBFlF10Rzc2%2F%2BM6RD9xdAya3tZy%2F%2FfwIMAMwfSVrTb5e6AAAAAElFTkSuQmCC); | ||
24 | background-position: right center; | ||
25 | background-repeat: no-repeat; | ||
26 | padding-right: 30px; | ||
27 | } | ||
28 | .bound-object { | ||
29 | padding-left: 12px; | ||
30 | } | ||
31 | .so-object-identifier, .bo-object-identifier { | ||
32 | float: right; | ||
33 | color: #999; | ||
34 | } | ||
35 | .binding-item .binding-edit-button { | ||
36 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiI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FV6vWLBYPDD8Xi8oJ%2FkarVaKhVatLlHxhgny7KfPCGdTt%2FS945W%2FEPUNO2KNihGIpH44XBI0Tak8Xh8hoJ4PC7RGCZN0BkOh3fEHUV6Gdi50%2BnUqaWxXC6FfD7%2FDQXNZvMtXdZyOBw6IUtw%2FwQYACT6GJDDh744AAAAAElFTkSuQmCC); | ||
37 | background-repeat: no-repeat; | ||
38 | background-position: right center; | ||
39 | border: 0 none; | ||
40 | cursor: pointer; | ||
41 | padding-top: 6px; | ||
42 | width: 12px; | ||
43 | height: 100%; | ||
44 | margin-left: 10px; | ||
45 | } \ No newline at end of file | ||
diff --git a/js/panels/binding/binding-item.reel/binding-item.html b/js/panels/binding/binding-item.reel/binding-item.html new file mode 100644 index 00000000..a569b8b4 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.html | |||
@@ -0,0 +1,85 @@ | |||
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 lang="en"> | ||
8 | <head> | ||
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
10 | <link rel="stylesheet" href="binding-item.css" type="text/css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "owner": { | ||
14 | "prototype": "js/panels/binding/binding-item.reel", | ||
15 | "properties": { | ||
16 | "element": {"#": "binding-item"} | ||
17 | } | ||
18 | }, | ||
19 | "soProperty": { | ||
20 | "prototype": "montage/ui/dynamic-text.reel", | ||
21 | "properties": { | ||
22 | "element": {"#": "so-property"} | ||
23 | }, | ||
24 | "bindings": { | ||
25 | "value": {"<-": "@owner.sourceObjectPropertyPath"} | ||
26 | } | ||
27 | }, | ||
28 | "soObject": { | ||
29 | "prototype": "montage/ui/dynamic-text.reel", | ||
30 | "properties": { | ||
31 | "element": {"#": "so-object"} | ||
32 | }, | ||
33 | "bindings": { | ||
34 | "value": {"<-": "@owner.sourceObjectLabel"} | ||
35 | } | ||
36 | }, | ||
37 | "boProperty" : { | ||
38 | "prototype": "montage/ui/dynamic-text.reel", | ||
39 | "properties": { | ||
40 | "element": {"#": "bo-property"} | ||
41 | }, | ||
42 | "bindings": { | ||
43 | "value": {"<-": "@owner.boundObjectPropertyPath"} | ||
44 | } | ||
45 | }, | ||
46 | "boObject": { | ||
47 | "prototype": "montage/ui/dynamic-text.reel", | ||
48 | "properties": { | ||
49 | "element": {"#": "bo-object"} | ||
50 | }, | ||
51 | "bindings": { | ||