diff options
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.css | 11 | ||||
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.html | 26 | ||||
-rw-r--r-- | js/panels/binding-panel.reel/binding-panel.js | 14 | ||||
-rw-r--r-- | js/panels/binding/binding-item.reel/binding-item.css | 13 | ||||
-rw-r--r-- | js/panels/binding/binding-item.reel/binding-item.html | 37 | ||||
-rw-r--r-- | js/panels/binding/binding-item.reel/binding-item.js | 26 |
6 files changed, 126 insertions, 1 deletions
diff --git a/js/panels/binding-panel.reel/binding-panel.css b/js/panels/binding-panel.reel/binding-panel.css index e69de29b..8597a926 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 | } \ No newline at end of file | ||
diff --git a/js/panels/binding-panel.reel/binding-panel.html b/js/panels/binding-panel.reel/binding-panel.html index 0db7b95f..d2e18e99 100644 --- a/js/panels/binding-panel.reel/binding-panel.html +++ b/js/panels/binding-panel.reel/binding-panel.html | |||
@@ -15,6 +15,28 @@ | |||
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 | } | ||
18 | } | 40 | } |
19 | 41 | ||
20 | } | 42 | } |
@@ -22,7 +44,9 @@ | |||
22 | </head> | 44 | </head> |
23 | <body> | 45 | <body> |
24 | <div data-montage-id="binding"> | 46 | <div data-montage-id="binding"> |
25 | this is a test | 47 | <ul data-montage-id="bindings-list" class="bindings-list"> |
48 | <li data-montage-id="binding-item" class="binding-item"></li> | ||
49 | </ul> | ||
26 | </div> | 50 | </div> |
27 | </body> | 51 | </body> |
28 | </html> \ No newline at end of file | 52 | </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..dc90f162 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.css | |||
@@ -0,0 +1,13 @@ | |||
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 #FFF; | ||
12 | list-style-type: none; | ||
13 | } \ 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..23182345 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.html | |||
@@ -0,0 +1,37 @@ | |||
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 | "label": { | ||
20 | "prototype": "montage/ui/dynamic-text.reel", | ||
21 | "properties": { | ||
22 | "element": {"#": "label"} | ||
23 | }, | ||
24 | "bindings": { | ||
25 | "value": {"<-": "@owner.sourceObjectPropertyPath"} | ||
26 | } | ||
27 | } | ||
28 | |||
29 | } | ||
30 | </script> | ||
31 | </head> | ||
32 | <body> | ||
33 | <li data-montage-id="binding-item" class="binding-item"> | ||
34 | <span data-montage-id="label"></span> | ||
35 | </li> | ||
36 | </body> | ||
37 | </html> \ No newline at end of file | ||
diff --git a/js/panels/binding/binding-item.reel/binding-item.js b/js/panels/binding/binding-item.reel/binding-item.js new file mode 100644 index 00000000..9365da65 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.js | |||
@@ -0,0 +1,26 @@ | |||
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 | |||
11 | exports.BindingItem = Montage.create(Component, { | ||
12 | |||
13 | sourceObjectPropertyPath : { value: null }, | ||
14 | |||
15 | templateDidLoad : { | ||
16 | value: function() { | ||
17 | console.log("loaded binding item"); | ||
18 | } | ||
19 | }, | ||
20 | |||
21 | prepareForDraw: { | ||
22 | value: function() { | ||
23 | console.log("preparing to draw binding item"); | ||
24 | } | ||
25 | } | ||
26 | }); \ No newline at end of file | ||