aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/rule-components
diff options
context:
space:
mode:
authorEric Guzman2012-03-02 10:55:51 -0800
committerEric Guzman2012-03-02 10:55:51 -0800
commit1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d (patch)
tree885ed3352f89e124bca7261d7c0edd4c95d3fff5 /js/panels/css-panel/rule-components
parent53bdb1e7773069c4cca59e88d6da91cd0f58c94a (diff)
downloadninja-1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d.tar.gz
CSS Panel - Updating components, created toolbar components, and small changes to styles controller
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.css5
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html57
-rw-r--r--js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js48
3 files changed, 110 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..0441c1cf
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.css
@@ -0,0 +1,5 @@
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> */ \ 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..e8661bf9
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.html
@@ -0,0 +1,57 @@
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 }
19 },
20 "sheetName": {
21 "module": "montage/ui/dynamic-text.reel",
22 "name" : "DynamicText",
23 "properties": {
24 "element": {"#": "style-sheet-name"}
25 },
26 "bindings": {
27 "value" : {
28 "boundObject": {"@": "owner"},
29 "boundObjectPropertyPath": "sheetName",
30 "oneway": true
31 }
32 }
33 },
34 "selector": {
35 "module": "montage/ui/dynamic-text.reel",
36 "name" : "DynamicText",
37 "properties": {
38 "element": {"#": "rule-selector"}
39 },
40 "bindings": {
41 "value" : {
42 "boundObject": {"@": "owner"},
43 "boundObjectPropertyPath": "selector",
44 "oneway": true
45 }
46 }
47 }
48 }
49 </script>
50</head>
51<body>
52<div id="rule-item" class="css-style-rule-item">
53 <a href="#" id="style-sheet-name"></a>
54 <span id="rule-selector" class="nj-css-selector"></span>
55</div>
56</body>
57</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..f90104e1
--- /dev/null
+++ b/js/panels/css-panel/rule-components/css-style-rule.reel/css-style-rule.js
@@ -0,0 +1,48 @@
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 hasTemplate: {
12 value: true
13 },
14 _rule : {
15 value : null
16 },
17 rule : {
18 get: function() {
19 return this._rule;
20 },
21 set: function(rule) {
22 this.cssText = rule.cssText;
23 this.sheetName = rule.href || 'Style Tag';
24 this.selector = rule.selectorText;
25console.log('Rule with selector "' +rule.selectorText+ '" is set on componenet.');
26 this._rule = rule;
27 }
28 },
29 condition: {
30 value: false
31 },
32 templateDidLoad : {
33 value: function() {
34 console.log("css style rule : template did load");
35 //this.condition = true;
36 }
37 },
38 prepareForDraw : {
39 value: function() {
40 console.log("css panel : prepare for draw");
41 }
42 },
43 draw : {
44 value: function() {
45 console.log("css panel : draw");
46 }
47 }
48});