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.html116
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js270
3 files changed, 439 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..9cbed273
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
@@ -0,0 +1,116 @@
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 "toolbar" : {"@": "toolbar"},
18 "styleSheetList" : {"@" : "styleSheetList"}
19 }
20 },
21 "arrayController" : {
22 "prototype" : "montage/ui/controller/array-controller",
23 "bindings": {
24 "content": {"<-": "@owner.styleSheets" }
25 }
26 },
27 "styleSheetList": {
28 "prototype" : "montage/ui/repetition.reel",
29 "properties": {
30 "element": {"#": "sheet-list" },
31 "contentController": {"@": "arrayController"}
32 }
33 },
34 "sheet": {
35 "prototype": "js/panels/css-panel/style-sheet.reel",
36 "properties": {
37 "element": {"#": "sheet-item"}
38 },
39 "bindings": {
40 "source": {"<-": "@styleSheetList.objectAtCurrentIteration" }
41 }
42 },
43 "documentLoaded": {
44 "prototype": "montage/ui/condition.reel",
45 "properties": {
46 "element": {"#": "style-sheets-toolbar-container" },
47 "removalStrategy": "hide"
48 },
49 "bindings": {
50 "condition": {"<-": "@owner.documentLoaded" }
51 }
52 },
53 "hasSheets": {
54 "prototype": "montage/ui/condition.reel",
55 "properties": {
56 "element": {"#": "no-sheets-message" }
57 },
58 "bindings" : {
59 "condition": {
60 "boundObject": {"@": "owner"},
61 "boundObjectPropertyPath": "styleSheets.count()",
62 "boundValueMutator": {"->": {"arguments": ["val"], "body": "return !val;"}},
63 "oneway": true
64 }
65 }
66 },
67 "toolbar": {
68 "prototype": "js/components/toolbar.reel",
69 "properties": {
70 "element": {"#": "style-sheets-toolbar"},
71 "delegate": {"@": "owner" },
72 "buttons": [
73 {
74 "title": "Add",
75 "identifier": "add"
76 }
77 ]
78 }
79 },
80 "resizer": {
81 "prototype": "js/panels/resize-composer",
82 "properties": {
83 "element": {"#": "resizeBar"},
84 "component": {"@": "owner"}
85 },
86 "listeners": [
87 {
88 "type": "resizeStart",
89 "listener": {"@": "owner"}
90 },
91 {
92 "type": "resizeMove",
93 "listener": {"@": "owner"}
94 },
95 {
96 "type": "resizeEnd",
97 "listener": {"@": "owner"}
98 }
99 ]
100 }
101 }
102 </script>
103</head>
104<body>
105<div data-montage-id="style-sheets-view-container" class="style-sheets-view-container">
106 <h4 data-montage-id="no-sheets-message" class="panel-message">No style sheets to display.</h4>
107 <ul data-montage-id="sheet-list" class="sheet-list">
108 <li><div data-montage-id="sheet-item"></div></li>
109 </ul>
110 <div data-montage-id="style-sheets-toolbar-container" class="style-sheets-toolbar-container">
111 <div data-montage-id="style-sheets-toolbar"></div>
112 </div>
113 <div data-montage-id="resizeBar" class="sub-panel-resizer"></div>
114</div>
115</body>
116</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..5081a124
--- /dev/null
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
@@ -0,0 +1,270 @@
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 documentLoaded : { value: false },
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 _activeDocument: {
21 value: null
22 },
23 activeDocument : {
24 get: function() {
25 return this._activeDocument;
26 },
27 set: function(value) {
28 if(value === this._activeDocument) { return;}
29
30 this.documentLoaded = !!value;
31
32 this._a