aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style-shorthand.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/style-shorthand.reel')
-rw-r--r--js/panels/css-panel/style-shorthand.reel/style-shorthand.css14
-rw-r--r--js/panels/css-panel/style-shorthand.reel/style-shorthand.html167
-rw-r--r--js/panels/css-panel/style-shorthand.reel/style-shorthand.js56
3 files changed, 237 insertions, 0 deletions
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.css b/js/panels/css-panel/style-shorthand.reel/style-shorthand.css
new file mode 100644
index 00000000..b29a8fd6
--- /dev/null
+++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.css
@@ -0,0 +1,14 @@
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.css-tree-branch {
8 padding-left: 10px;
9}
10.css-tree-branch .css-tree-branch {
11 padding-left: 20px;
12 margin-top: 0;
13 margin-bottom: 0;
14} \ No newline at end of file
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.html b/js/panels/css-panel/style-shorthand.reel/style-shorthand.html
new file mode 100644
index 00000000..391aa846
--- /dev/null
+++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.html
@@ -0,0 +1,167 @@
1<!DOCTYPE html>
2<!-- <copyright>
3This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4No 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 href="style-shorthand.css" rel="stylesheet" type="text/css" />
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "module" : "js/panels/css-panel/style-shorthand.reel",
15 "name" : "StyleShorthand",
16 "properties" : {
17 "element" : {"#" : "branch"},
18 "label" : { "@" : "textComponent" },
19 "branchList": {"#" : "branchList"},
20 "styleListDisclosure": {"#": "style-list-disclosure"},
21 "arrayController": {"@": "arrayController" },
22 "repetition": {"@": "repetition"},
23 "leafComponent": {"@": "leaf"},
24 "branchComponent": {"@": "branch"}
25
26 }
27 },
28
29 "property": {
30 "module": "montage/ui/dynamic-text.reel",
31 "name": "DynamicText",
32 "properties": {
33 "element": {"#": "property"}
34 },
35 "bindings": {
36 "value" : {
37 "boundObject": {"@": "owner"},
38 "boundObjectPropertyPath": "propertyText",
39 "oneway": true
40 }
41 }
42 },
43 "value": {
44 "module": "montage/ui/dynamic-text.reel",
45 "name": "DynamicText",
46 "properties": {
47 "element": {"#": "value"}
48 },
49 "bindings": {
50 "value" : {
51 "boundObject": {"@": "owner"},
52 "boundObjectPropertyPath": "valueText",
53 "oneway": true
54 }
55 }
56 },
57
58 "arrayController": {
59 "module": "montage/ui/controller/array-controller",
60 "name": "ArrayController",
61 "bindings": {
62 "content": {
63 "boundObject": {"@": "owner"},
64 "boundObjectPropertyPath": "childNodes"
65 }
66 }
67 },
68
69 "style": {
70 "module": "js/panels/css-panel/style.reel",
71 "name": "Style",
72 "bindings": {
73 "sourceObject": {
74 "boundObject": {"@": "repetition" },
75 "boundObjectPropertyPath": "objectAtCurrentIteration",
76 "oneway": true
77 },
78 "labelKey" : {
79 "boundObject": {"@": "owner" },
80 "boundObjectPropertyPath": "labelKey",
81 "oneway": true
82 },
83 "branchKey" : {
84 "boundObject": {"@": "owner" },
85 "boundObjectPropertyPath": "branchKey",
86 "oneway": true
87 },
88 "treeView" : {
89 "boundObject": {"@": "owner" },
90 "boundObjectPropertyPath": "treeView",
91 "oneway": true
92 }
93 }
94 },
95
96 "shorthand": {
97 "module": "js/panels/css-panel/style-shorthand.reel",
98 "name": "StyleShorthand",
99 "bindings": {
100 "sourceObject": {
101 "boundObject": {"@": "repetition" },
102 "boundObjectPropertyPath": "objectAtCurrentIteration",
103 "oneway": true
104 },
105 "labelKey" : {
106 "boundObject": {"@": "owner" },
107 "boundObjectPropertyPath": "labelKey",
108 "oneway": true
109 },
110 "branchKey" : {
111 "boundObject": {"@": "owner" },
112 "boundObjectPropertyPath": "branchKey",
113 "oneway": true
114 },
115 "treeView" : {
116 "boundObject": {"@": "owner" },
117 "boundObjectPropertyPath": "treeView",
118 "oneway": true
119 }
120 }
121 },
122
123 "repetition": {
124 "module": "montage/ui/repetition.reel",
125 "name": "Repetition",
126 "properties": {
127 "element": { "#": "branchList" },
128 "contentController": {"@": "arrayController" },
129 "selectionEnabled": true
130 }
131 },
132
133 "substitution": {
134 "module": "montage/ui/substitution.reel",
135 "name": "Substitution",
136 "properties": {
137 "element": {"#": "treeItem"},
138 "switchComponents": {
139 "leaf": {"@": "style"},
140 "branch": {"@": "shorthand"}
141
142 }
143 },
144 "bindings": {
145 "switchValue": {
146 "boundObject": {"@": "repetition"},
147 "boundObjectPropertyPath": "objectAtCurrentIteration.treeNodeType",
148 "oneway": true
149 }
150 }
151 }
152 }
153 </script>
154</head>
155<body>
156 <div id="branch" class="style-shorthand-branch">
157 <div>
158 <dt id="property" class="css-property"></dt>
159 <dd id="value" class="css-value"></dd>
160 <a href="#" id="style-list-disclosure" class="list-disclorue">A</a>
161 </div>
162 <dl id="branchList" class="css-tree-branch">
163 <div id="treeItem"></div>
164 </dl>
165 </div>
166</body>
167</html> \ No newline at end of file
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.js b/js/panels/css-panel/style-shorthand.reel/style-shorthand.js
new file mode 100644
index 00000000..00749faa
--- /dev/null
+++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.js
@@ -0,0 +1,56 @@
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
7var Montage = require("montage").Montage,
8 TreeNode = require("js/components/treeview/tree-node").TreeNode;
9
10var styleShorthand = exports.StyleShorthand= Montage.create(TreeNode, {
11 repetition: { value: null },
12 propertyText : { value: "property" },
13 valueText : { value: "value" },
14
15 handleSourceObjectSet: {
16 value: function() {
17 this.propertyText = this.sourceObject.name;
18 this.valueText = this.sourceObject.value;
19 }
20 },
21 prepareForDraw : {