aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style-sheets-view.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/style-sheets-view.reel')
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css19
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html103
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js68
3 files changed, 190 insertions, 0 deletions
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css
new file mode 100644
index 00000000..dfb67d13
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css
@@ -0,0 +1,19 @@
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.style-sheets-view-container ul {
7 margin: 0;
8 padding: 0;
9}
10.style-sheets-view-container li {
11 list-style-type: none;
12 margin: 0 8px;
13}
14.style-sheets-view-container li:first-child {
15 margin-top: 5px;
16}
17.style-sheets-view-container li:last-child {
18 margin-bottom: 5px;
19} \ No newline at end of file
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
new file mode 100644
index 00000000..092b189f
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
@@ -0,0 +1,103 @@
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-sheets-view.css" rel="stylesheet" type="text/css">
11 <script type="text/montage-serialization">
12 {
13 "owner": {
14 "module" : "js/panels/css-panel/style-sheets-view.reel",
15 "name" : "StyleSheetsView",
16 "properties" : {
17 "element" : {"#" : "style-sheets-view-container"}
18 }
19 },
20 "arrayController" : {
21 "module" : "montage/ui/controller/array-controller",
22 "name": "ArrayController",
23 "bindings": {
24 "content": {
25 "boundObject": {"@": "owner"},
26 "boundObjectPropertyPath": "styleSheets",
27 "oneway": true
28 }
29 }
30 },
31 "styleSheetList": {
32 "module" : "montage/ui/repetition.reel",
33 "name": "Repetition",
34 "properties": {
35 "element": {"#": "sheet-list" },
36 "contentController": {"@": "arrayController"}
37 }
38 },
39 "sheet": {
40 "module": "js/panels/css-panel/style-sheet.reel",
41 "name": "StyleSheet",
42 "properties": {
43 "element": {"#": "sheet-item"}
44 },
45 "bindings": {
46 "source": {
47 "boundObject": {"@": "styleSheetList"},
48 "boundObjectPropertyPath": "objectAtCurrentIteration",
49 "oneway": true
50 }
51 }
52 },
53 "noDocumentCondition": {
54 "module": "montage/ui/condition.reel",
55 "name": "Condition",
56 "properties": {
57 "element": {"#": "no-document-message" }
58 },
59 "bindings": {
60 "condition": {
61 "boundObject": {"@": "owner" },
62 "boundObjectPropertyPath": "styleSheets.count()",
63 "boundValueMutator": {"->": {"arguments": ["val"], "body": "return !val;"}},
64 "oneway": true
65 }
66 }
67 },
68 "showToolbarCondition": {
69 "module": "montage/ui/condition.reel",
70 "name": "Condition",
71 "properties": {
72 "element": {"#": "style-sheets-toolbar-container" }
73 },
74 "bindings" : {
75 "condition": {
76 "boundObject": {"@": "owner"},
77 "boundObjectPropertyPath": "styleSheets.count()",
78 "oneway": true
79 }
80 }
81 },
82 "toolbar": {
83 "module": "js/components/toolbar.reel",
84 "name": "Toolbar",
85 "properties": {
86 "element": {"#": "style-sheets-toolbar"}
87 }
88 }
89 }
90 </script>
91</head>
92<body>
93<div id="style-sheets-view-container" class="style-sheets-view-container">
94 <h4 id="no-document-message" class="panel-message">No style sheets to display.</h4>
95 <ul id="sheet-list">
96 <li><div id="sheet-item"></div></li>
97 </ul>
98 <div id="style-sheets-toolbar-container">
99 <div id="style-sheets-toolbar"></div>
100 </div>
101</div>
102</body>
103</html> \ No newline at end of file
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
new file mode 100644
index 00000000..b1315311
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
@@ -0,0 +1,68 @@
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.StyleSheetsView = Montage.create(Component, {
11 noDocumentCondition : {
12 value: true
13 },
14 showToolbar : {
15 value: false
16 },
17 styleSheets : {
18 value: []
19 },
20 stylesController : {
21 value: null
22 },
23 deserializedFromTemplate : {
24 value: function() {
25 console.log("style sheet view - deserialized");
26
27 this.stylesController = this.application.ninja.stylesController;
28
29 this.eventManager.addEventListener("styleSheetsReady", this, false);
30 this.eventManager.addEventListener("newStyleSheet", this, false);
31 }
32 },
33 _initView : {
34 value: false
35 },
36 handleStyleSheetsReady : {
37 value: function(e) {
38 this._initView = this.needsDraw = true;
39
40// this.noDocumentCondition = false;
41// this.showToolbar = true;
42// this.styleSheets = this.stylesController.userStyleSheets;
43
44 }
45 },
46 handleNewStyleSheet : {
47 value: function(e) {
48 this.styleSheets.push(e._event.detail);
49 }
50 },
51 prepareForDraw : {
52 value: function() {
53 console.log("style sheet view - prepare for draw");
54 }
55 },
56 draw : {
57 value: function() {
58 console.log("styles sheet view - draw");
59
60 if(this._initView) {
61 this.noDocumentCondition = false;
62 this.showToolbar = true;
63 this.styleSheets = this.stylesController.userStyleSheets;
64 this._initView = false;
65 }
66 }
67 }
68}); \ No newline at end of file