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.css53
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html126
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js245
3 files changed, 424 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..a6e83a2c
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css
@@ -0,0 +1,53 @@
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.style-sheets-view-container {
8 position: relative;
9 overflow: hidden;
10}
11
12.style-sheets-view-container .sheet-list {
13 margin: 0;
14 padding: 0;
15 min-height: 35px;
16 -webkit-box-flex: 1;
17 overflow-y: auto;
18 overflow-x: hidden;
19}
20.style-sheets-view-container .sheet-list li {
21 list-style-type: none;
22 margin: 0 8px;
23}
24.style-sheets-view-container .sheet-list li:first-child {
25 margin-top: 5px;
26}
27.style-sheets-view-container .sheet-list li:last-child {
28 margin-bottom: 5px;
29}
30
31/* ---------------
32 Toolbar
33------------------- */
34
35.style-sheets-toolbar-container {
36 /*bottom: 0;*/
37 height: 24px;
38 /*position: absolute;*/
39 width: 100%;
40 -webkit-box-flex: 0;
41}
42
43/* ------------------
44 Resizer
45 ------------------ */
46
47.sub-panel-resizer {
48 bottom: 0;
49 cursor: row-resize;
50 height: 4px;
51 position: absolute;
52 width: 100%;
53} \ 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..bbefc69b
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
@@ -0,0 +1,126 @@
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 "prototype" : "js/panels/css-panel/style-sheets-view.reel",
15 "properties" : {
16 "element" : {"#" : "style-sheets-view-container"},
17 "styleSheetList" : {"@" : "styleSheetList"}
18 }
19 },
20 "arrayController" : {
21 "prototype" : "montage/ui/controller/array-controller",
22 "bindings": {
23 "content": {
24 "boundObject": {"@": "owner"},
25 "boundObjectPropertyPath": "styleSheets",
26 "oneway": true
27 }
28 }
29 },
30 "styleSheetList": {
31 "prototype" : "montage/ui/repetition.reel",
32 "properties": {
33 "element": {"#": "sheet-list" },
34 "contentController": {"@": "arrayController"}
35 }
36 },
37 "sheet": {
38 "prototype": "js/panels/css-panel/style-sheet.reel",
39 "properties": {
40 "element": {"#": "sheet-item"}
41 },
42 "bindings": {
43 "source": {
44 "boundObject": {"@": "styleSheetList"},
45 "boundObjectPropertyPath": "objectAtCurrentIteration",
46 "oneway": true
47 }
48 }
49 },
50 "noDocumentCondition": {
51 "prototype": "montage/ui/condition.reel",
52 "properties": {
53 "element": {"#": "no-document-message" }
54 },
55 "bindings": {
56 "condition": {
57 "boundObject": {"@": "owner" },
58 "boundObjectPropertyPath": "styleSheets.count()",
59 "boundValueMutator": {"->": {"arguments": ["val"], "body": "return !val;"}},
60 "oneway": true
61 }
62 }
63 },
64 "showToolbarCondition": {
65 "prototype": "montage/ui/condition.reel",
66 "properties": {
67 "element": {"#": "style-sheets-toolbar-container" }
68 },
69 "bindings" : {
70 "condition": {
71 "boundObject": {"@": "owner"},
72 "boundObjectPropertyPath": "styleSheets.count()",
73 "oneway": true
74 }
75 }
76 },
77 "toolbar": {
78 "prototype": "js/components/toolbar.reel",
79 "properties": {
80 "element": {"#": "style-sheets-toolbar"},
81 "delegate": {"@": "owner" },
82 "buttons": [
83 {
84 "title": "Add",
85 "identifier": "add"
86 }
87 ]
88 }
89 },
90 "resizer": {
91 "prototype": "js/panels/resize-composer",
92 "properties": {
93 "element": {"#": "resizeBar"},
94 "component": {"@": "owner"}
95 },
96 "listeners": [
97 {
98 "type": "resizeStart",
99 "listener": {"@": "owner"}
100 },
101 {
102 "type": "resizeMove",
103 "listener": {"@": "owner"}
104 },
105 {
106 "type": "resizeEnd",
107 "listener": {"@": "owner"}
108 }
109 ]
110 }
111 }
112 </script>
113</head>
114<body>
115<div data-montage-id="style-sheets-view-container" class="style-sheets-view-container">
116 <h4 data-montage-id="no-document-message" class="panel-message">No style sheets to display.</h4>
117 <ul data-montage-id="sheet-list" class="sheet-list">
118 <li><div data-montage-id="sheet-item"></div></li>
119 </ul>
120 <div data-montage-id="style-sheets-toolbar-container" class="style-sheets-toolbar-container toolbar-container">
121 <div data-montage-id="style-sheets-toolbar"></div>
122 </div>
123 <div data-montage-id="resizeBar" class="sub-panel-resizer"></div>
124</div>
125</body>
126</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..d6ec5349
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
@@ -0,0 +1,245 @@
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 : { value: true },
12 showToolbar : { value: false },
13 stylesController : { value: null },
14 styleSheets : { value: [] },
15 _initView : { value: false },
16 _needsScroll : { value: false },
17 documentNameLabel : { value: null },
18 noDocumentLabelClass : { value: "no-document" },
19
20 _documentName : { value: null },
21 documentName : {