aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/rule-components
diff options
context:
space:
mode:
authorAnanya Sen2012-05-31 10:13:40 -0700
committerAnanya Sen2012-05-31 10:13:40 -0700
commit286457b4f23974277274ba388afd283e8aa085cb (patch)
treec21bf791e7c4f572d12f97987ea6b89e74da67fe /js/panels/css-panel/rule-components
parent4d9b481c58090e8f1fc7b0e9d73a81b0f49cccc8 (diff)
parentd49c909cff7f0c5e5d0b127ad84a2fefc6677dc6 (diff)
downloadninja-286457b4f23974277274ba388afd283e8aa085cb.tar.gz
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Conflicts: js/controllers/styles-controller.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
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.css93
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html90
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js174
3 files changed, 357 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..3e7252b5
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.css
@@ -0,0 +1,93 @@
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
34/* -------------------
35 Selector Styles
36------------------ */
37
38.css-style-rule-item .nj-css-selector {
39 border: 1px solid rgba(0,0,0,0);
40 display: inline-block;
41 font-weight: bold;
42 padding: 0 2px;
43 position: relative;
44 outline: none;
45
46}
47.nj-css-selector:after {
48 content: " {";
49 font-weight: normal;
50}
51.nj-css-selector.nj-editable-focus {
52 position: relative;
53}
54.nj-css-rule-list .nj-css-selector.nj-editable-focus:after {
55 position: absolute;
56}
57.css-style-rule-item .nj-css-selector:focus {
58 box-shadow: none;
59}
60.css-style-rule-item .nj-css-selector.editable {
61 background-color: #FFF;
62 border: 1px solid #999;
63 border-radius: 2px;
64 box-shadow: 1px 1px 1px #CCC;
65 color: #333;
66 display: inline-block;
67 margin-right: 7px;
68 max-width: none;
69 overflow: visible;
70 -webkit-user-select: text;
71}
72.css-style-rule-item .nj-css-selector:after {
73 position: absolute;
74
75 right: -10px;
76
77}
78
79/* -------------------
80 Unapplied Rule
81------------------ */
82.unapplied-css-rule {
83 /*opacity: .8;*/
84 /*background-color: #f3f3f3;*/
85}
86.unapplied-css-rule .style-rule-heading {
87 background-repeat: no-repeat;
88 background-position: 6px 6px;
89 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAYAAABGbhwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxID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ag%2FlY8gHPsfzSwPbQgbDyfIs6vURa3EKK8Jf6jmhUy51yiWDlBUDED2NF0JKGQS3IPVn4ATXqIL0EYJgwD42YQG4quE45EggOtCwbWrUM1Ej%2F0jkXDAYaOtOa6iIH2YSQOBugPj4KN3aFdnIThkprynoeUYjtwIRO0hCLxiU3wp12odgl0AXhUa3VQ0xoWCqEApiNhEpFzt7Tm%2F4Tzo9kGvtq4UjNzqJB1mswURvNoqayP57V7KcB7HfZnE8v%2BHYtZtmiGcBzqQ1TSZUPP85HVlo1MfCaX94WPpSO83qwO6wbWCTtBQocoD70eDgZncw3Z%2BC3AAFMzlxlnnpevAAAAAElFTkSuQmCC);
90}
91.unapplied-css-rule .nj-css-selector {
92 margin-left: 16px;
93} \ 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..f203b61f
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html
@@ -0,0 +1,90 @@
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 "prototype" : "js/panels/css-panel/rule-components/css-style-rule.reel",
15 "properties" : {
16 "element" : {"#" : "rule-item"},
17 "selectorField": {"@": "selector"},
18 "declarationComponent": {"@": "declaration"}
19 }
20 },
21 "sheetName": {
22 "prototype": "montage/ui/dynamic-text.reel",
23 "properties": {
24 "element": {"#": "style-sheet-name"}
25 },
26 "bindings": {
27 "value" : {"<-": "@owner.sheetName" }
28 }
29 },
30 "selector": {
31 "prototype": "js/components/hintable.reel",
32 "properties": {
33 "startOnEvent": "click",
34 "element": {"#": "rule-selector"}
35 },
36 "bindings": {
37 "value" : {"<<->":"@owner.selector" }
38 }
39 },
40 "declaration": {
41 "prototype": "js/panels/css-panel/style-declaration.reel",
42 "properties": {
43 "element": {"#": "declaration-list"}
44 },
45 "bindings": {
46 "focusDelegate" : {"<-": "@owner.focusDelegate" },
47 "declaration" : {"<-": "@owner._declaration" }
48
49 }
50 },
51 "sheetLink": {
52 "prototype": "montage/ui/anchor.reel",
53 "properties": {
54 "element": {"#": "style-sheet-name"}
55 }
56 }
57 }
58 </script>
59 <script type="text/json">
60 "declaration": {
61 "module": "js/panels/css-panel/declaration.reel",
62 "name": "Declaration",
63 "properties": {
64 "element": {"#": "declaration-list"}
65 },
66 "bindings": {
67 "focusDelegate" : {
68 "boundObject": {"@": "owner"},
69 "boundObjectPropertyPath": "focusDelegate",
70 "oneway": true
71 },
72 "declaration" : {
73 "boundObject": {"@": "owner"},
74 "boundObjectPropertyPath": "_declaration",
75 "oneway": true
76 }
77 }
78 },
79 </script>
80</head>
81<body>
82<li data-montage-id="rule-item" class="css-style-rule-item">
83 <div class="style-rule-heading">
84 <a href="#" id="style-sheet-name" class="style-sheet-name"></a>
85 <span id="rule-selector" class="nj-css-selector"></span>
86 </div>
87 <dl id="declaration-list"></dl>
88</li>
89</body>
90</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..e0ffb1a8
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js
@@ -0,0 +1,174 @@
1/* <copyright>
2