diff options
Diffstat (limited to 'js/panels/css-panel/rule-components/css-style-rule.reel')
3 files changed, 327 insertions, 0 deletions
diff --git a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.css b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.css new file mode 100644 index 00000000..03d43ebf --- /dev/null +++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.css | |||
@@ -0,0 +1,69 @@ | |||
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 | .css-style-rule-item { | ||
7 | min-height: 69px; | ||
8 | position: relative; | ||
9 | } | ||
10 | .css-style-rule-item:after { | ||
11 | content: "}"; | ||
12 | padding: 0 0 0 4px; | ||
13 | position: relative; | ||
14 | top: -10px; | ||
15 | } | ||
16 | .style-rule-heading { | ||
17 | background-color: #f3f3f3; | ||
18 | /*background-color: #DDDDDD;*/ | ||
19 | border: 1px #e7e7e7; | ||
20 | /*border: 1px #CCC;*/ | ||
21 | border-style: solid none; | ||
22 | box-shadow: inset 0 0 1px #FFF; | ||
23 | padding: 4px; | ||
24 | } | ||
25 | .style-sheet-name { | ||
26 | color: #333; | ||
27 | font-family: "Droid Sans", sans-serif; | ||
28 | padding-top: 1px; | ||
29 | position: absolute; | ||
30 | right: 8px; | ||
31 | text-decoration: none; | ||
32 | } | ||
33 | .css-style-rule-item .nj-css-selector { | ||
34 | position: relative; | ||
35 | border: 1px solid rgba(0,0,0,0); | ||
36 | } | ||
37 | .css-style-rule-item .nj-css-selector.editable { | ||
38 | border: 1px solid #999; | ||
39 | border-radius: 3px; | ||
40 | box-shadow: 1px 1px 1px #CCC; | ||
41 | color: #333; | ||
42 | display: inline-block; | ||
43 | margin-right: 7px; | ||
44 | max-width: none; | ||
45 | overflow: visible; | ||
46 | -webkit-user-select: text; | ||
47 | } | ||
48 | .css-style-rule-item .nj-css-selector:after { | ||
49 | position: absolute; | ||
50 | |||
51 | right: -10px; | ||
52 | |||
53 | } | ||
54 | |||
55 | /* ------------------- | ||
56 | Unapplied Rule | ||
57 | ------------------ */ | ||
58 | .unapplied-css-rule { | ||
59 | opacity: .8; | ||
60 | background-color: #f3f3f3; | ||
61 | } | ||
62 | .unapplied-css-rule .style-rule-heading { | ||
63 | background-repeat: no-repeat; | ||
64 | background-position: 6px 6px; | ||
65 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAYAAABGbhwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMzYyMERFNTQwNzMxMUUxQTREQ0IxQTRGNEI2MTE3RiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMzYyMERFNjQwNzMxMUUxQTREQ0IxQTRGNEI2MTE3RiI%2BIDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjAzNjIwREUzNDA3MzExRTFBNERDQjFBNEY0QjYxMTdGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAzNjIwREU0NDA3MzExRTFBNERDQjFBNEY0QjYxMTdGIi8%2BIDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY%2BIDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8%2Bc4fwegAAAWpJREFUeNo8kLtLA0EQxr%2B9l3lcDAaCBsEqEOysBFEQsRAsRVCEpBREsbIUSxtBrAxEewsrK8VHQIhK%2FoIUUVJIQFFjYi65XDZ36%2Bz5GFgWZr75fjPDhBD4C%2BucjWgaphjQdTgK%2FfPi5a%2FGpPDtjEVjERyqKlag%2FlY8gHPsfzSwPbQgbDyfIs6vURa3EKK8Jf6jmhUy51yiWDlBUDED2NF0JKGQS3IPVn4ATXqIL0EYJgwD42YQG4quE45EggOtCwbWrUM1Ej%2F0jkXDAYaOtOa6iIH2YSQOBugPj4KN3aFdnIThkprynoeUYjtwIRO0hCLxiU3wp12odgl0AXhUa3VQ0xoWCqEApiNhEpFzt7Tm%2F4Tzo9kGvtq4UjNzqJB1mswURvNoqayP57V7KcB7HfZnE8v%2BHYtZtmiGcBzqQ1TSZUPP85HVlo1MfCaX94WPpSO83qwO6wbWCTtBQocoD70eDgZncw3Z%2BC3AAFMzlxlnnpevAAAAAElFTkSuQmCC); | ||
66 | } | ||
67 | .unapplied-css-rule .nj-css-selector { | ||
68 | margin-left: 16px; | ||
69 | } \ No newline at end of file | ||
diff --git a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html new file mode 100644 index 00000000..05ea669f --- /dev/null +++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html | |||
@@ -0,0 +1,110 @@ | |||
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 href="css-style-rule.css" rel="stylesheet" type="text/css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "owner": { | ||
14 | "module" : "js/panels/css-panel/rule-components/css-style-rule.reel", | ||
15 | "name" : "CssStyleRule", | ||
16 | "properties" : { | ||
17 | "element" : {"#" : "rule-item"}, | ||
18 | "selectorField": {"@": "selector"}, | ||
19 | "declarationComponent": {"@": "declaration"} | ||
20 | } | ||
21 | }, | ||
22 | "sheetName": { | ||
23 | "module": "montage/ui/dynamic-text.reel", | ||
24 | "name" : "DynamicText", | ||
25 | "properties": { | ||
26 | "element": {"#": "style-sheet-name"} | ||
27 | }, | ||
28 | "bindings": { | ||
29 | "value" : { | ||
30 | "boundObject": {"@": "owner"}, | ||
31 | "boundObjectPropertyPath": "sheetName", | ||
32 | "oneway": true | ||
33 | } | ||
34 | } | ||
35 | }, | ||
36 | "selector": { | ||
37 | "module": "js/components/hintable.reel", | ||
38 | "name" : "Hintable", | ||
39 | "properties": { | ||
40 | "startOnEvent": "click", | ||
41 | "element": {"#": "rule-selector"} | ||
42 | }, | ||
43 | "bindings": { | ||
44 | "value" : { | ||
45 | "boundObject": {"@": "owner"}, | ||
46 | "boundObjectPropertyPath": "selector", | ||
47 | "oneway": true | ||
48 | } | ||
49 | } | ||
50 | }, | ||
51 | "declaration": { | ||
52 | "module": "js/panels/css-panel/style-declaration.reel", | ||
53 | "name": "StyleDeclaration", | ||
54 | "properties": { | ||
55 | "element": {"#": "declaration-list"} | ||
56 | }, | ||
57 | "bindings": { | ||
58 | "focusDelegate" : { | ||
59 | "boundObject": {"@": "owner"}, | ||
60 | "boundObjectPropertyPath": "focusDelegate", | ||
61 | "oneway": true | ||
62 | }, | ||
63 | "declaration" : { | ||
64 | "boundObject": {"@": "owner"}, | ||
65 | "boundObjectPropertyPath": "_declaration", | ||
66 | "oneway": true | ||
67 | } | ||
68 | } | ||
69 | }, | ||
70 | "sheetLink": { | ||
71 | "module": "montage/ui/anchor.reel", | ||
72 | "name": "Anchor", | ||
73 | "properties": { | ||
74 | "element": {"#": "style-sheet-name"} | ||
75 | } | ||
76 | } | ||
77 | } | ||
78 | </script> | ||
79 | <script type="text/json"> | ||
80 | "declaration": { | ||
81 | "module": "js/panels/css-panel/declaration.reel", | ||
82 | "name": "Declaration", | ||
83 | "properties": { | ||
84 | "element": {"#": "declaration-list"} | ||
85 | }, | ||
86 | "bindings": { | ||
87 | "focusDelegate" : { | ||
88 | "boundObject": {"@": "owner"}, | ||
89 | "boundObjectPropertyPath": "focusDelegate", | ||
90 | "oneway": true | ||
91 | }, | ||
92 | "declaration" : { | ||
93 | "boundObject": {"@": "owner"}, | ||
94 | "boundObjectPropertyPath": "_declaration", | ||
95 | "oneway": true | ||
96 | } | ||
97 | } | ||
98 | }, | ||
99 | </script> | ||
100 | </head> | ||
101 | <body> | ||
102 | <li data-montage-id="rule-item" class="css-style-rule-item"> | ||
103 | <div class="style-rule-heading"> | ||
104 | <a href="#" id="style-sheet-name" class="style-sheet-name"></a> | ||
105 | <span id="rule-selector" class="nj-css-selector"></span> | ||
106 | </div> | ||
107 | <dl id="declaration-list"></dl> | ||
108 | </li> | ||
109 | </body> | ||
110 | </html> \ No newline at end of file | ||
diff --git a/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js new file mode 100644 index 00000000..ac714bfa --- /dev/null +++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js | |||
@@ -0,0 +1,148 @@ | |||
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, | ||