aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/rule-components
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/rule-components')
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.css69
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html89
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js148
3 files changed, 306 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..bf101719
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html
@@ -0,0 +1,89 @@
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="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/declaration.reel",
53 "name": "Declaration",
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</head>
80<body>
81<li data-montage-id="rule-item" class="css-style-rule-item">
82 <div class="style-rule-heading">
83 <a href="#" id="style-sheet-name" class="style-sheet-name"></a>
84 <span id="rule-selector" class="nj-css-selector"></span>
85 </div>
86 <dl id="declaration-list"></dl>
87</li>
88</body>
89</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..7a6a3957
--- /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
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10exports.CssStyleRule = Montage.create(Component, {
11 unappliedClass : {
12 value: 'unapplied-css-rule'
13 },
14 cssText: {
15 value: null
16 },
17 hasTemplate: {
18 value: true
19 },
20 focusDelegate : {
21 value: null
22 },
23 _applied : {
24 value: true,
25 distinct: true
26 },
27 applied : {
28 get: function() {
29 return this._applied;
30 },