diff options
Diffstat (limited to 'js/panels/css-panel/style-sheets-view.reel')
3 files changed, 302 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..7a46e387 --- /dev/null +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css | |||
@@ -0,0 +1,49 @@ | |||
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 ul { | ||
13 | margin: 0; | ||
14 | padding: 0; | ||
15 | min-height: 55px; | ||
16 | } | ||
17 | .style-sheets-view-container li { | ||
18 | list-style-type: none; | ||
19 | margin: 0 8px; | ||
20 | } | ||
21 | .style-sheets-view-container li:first-child { | ||
22 | margin-top: 5px; | ||
23 | } | ||
24 | .style-sheets-view-container li:last-child { | ||
25 | margin-bottom: 5px; | ||
26 | } | ||
27 | |||
28 | /* --------------- | ||
29 | Toolbar | ||
30 | ------------------- */ | ||
31 | |||
32 | .style-sheets-toolbar-container { | ||
33 | bottom: 0; | ||
34 | height: 24px; | ||
35 | position: absolute; | ||
36 | width: 100%; | ||
37 | } | ||
38 | |||
39 | /* ------------------ | ||
40 | Resizer | ||
41 | ------------------ */ | ||
42 | |||
43 | .sub-panel-resizer { | ||
44 | bottom: 0; | ||
45 | cursor: row-resize; | ||
46 | height: 4px; | ||
47 | position: absolute; | ||
48 | width: 100%; | ||
49 | } \ 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..09e2e3ce --- /dev/null +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html | |||
@@ -0,0 +1,127 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No 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 | "styleSheetList" : {"@" : "styleSheetList"} | ||
19 | } | ||
20 | }, | ||
21 | "arrayController" : { | ||
22 | "module" : "montage/ui/controller/array-controller", | ||
23 | "name": "ArrayController", | ||
24 | "bindings": { | ||
25 | "content": { | ||
26 | "boundObject": {"@": "owner"}, | ||
27 | "boundObjectPropertyPath": "styleSheets", | ||
28 | "oneway": true | ||
29 | } | ||
30 | } | ||
31 | }, | ||
32 | "styleSheetList": { | ||
33 | "module" : "montage/ui/repetition.reel", | ||
34 | "name": "Repetition", | ||
35 | "properties": { | ||
36 | "element": {"#": "sheet-list" }, | ||
37 | "contentController": {"@": "arrayController"} | ||
38 | } | ||
39 | }, | ||
40 | "sheet": { | ||
41 | "module": "js/panels/css-panel/style-sheet.reel", | ||
42 | "name": "StyleSheet", | ||
43 | "properties": { | ||
44 | "element": {"#": "sheet-item"} | ||
45 | }, | ||
46 | "bindings": { | ||
47 | "source": { | ||
48 | "boundObject": {"@": "styleSheetList"}, | ||
49 | "boundObjectPropertyPath": "objectAtCurrentIteration", | ||
50 | "oneway": true | ||
51 | } | ||
52 | } | ||
53 | }, | ||
54 | "noDocumentCondition": { | ||
55 | "module": "montage/ui/condition.reel", | ||
56 | "name": "Condition", | ||
57 | "properties": { | ||
58 | "element": {"#": "no-document-message" } | ||
59 | }, | ||
60 | "bindings": { | ||
61 | "condition": { | ||
62 | "boundObject": {"@": "owner" }, | ||
63 | "boundObjectPropertyPath": "styleSheets.count()", | ||
64 | "boundValueMutator": {"->": {"arguments": ["val"], "body": "return !val;"}}, | ||
65 | "oneway": true | ||
66 | } | ||
67 | } | ||
68 | }, | ||
69 | "showToolbarCondition": { | ||
70 | "module": "montage/ui/condition.reel", | ||
71 | "name": "Condition", | ||
72 | "properties": { | ||
73 | "element": {"#": "style-sheets-toolbar-container" } | ||
74 | }, | ||
75 | "bindings" : { | ||
76 | "condition": { | ||
77 | "boundObject": {"@": "owner"}, | ||
78 | "boundObjectPropertyPath": "styleSheets.count()", | ||
79 | "oneway": true | ||
80 | } | ||
81 | } | ||
82 | }, | ||
83 | "toolbar": { | ||
84 | "module": "js/components/toolbar.reel", | ||
85 | "name": "Toolbar", | ||
86 | "properties": { | ||
87 | "element": {"#": "style-sheets-toolbar"} | ||
88 | } | ||
89 | }, | ||
90 | "resizer": { | ||
91 | "module": "js/panels/resize-composer", | ||
92 | "name": "ResizeComposer", | ||
93 | "properties": { | ||
94 | "element": {"#": "resizeBar"}, | ||
95 | "component": {"@": "owner"} | ||
96 | }, | ||
97 | "listeners": [ | ||
98 | { | ||
99 | "type": "resizeStart", | ||
100 | "listener": {"@": "owner"} | ||
101 | }, | ||
102 | { | ||
103 | "type": "resizeMove", | ||
104 | "listener": {"@": "owner"} | ||
105 | }, | ||
106 | { | ||
107 | "type": "resizeEnd", | ||
108 | "listener": {"@": "owner"} | ||
109 | } | ||
110 | ] | ||
111 | } | ||
112 | } | ||
113 | </script> | ||
114 | </head> | ||
115 | <body> | ||
116 | <div id="style-sheets-view-container" class="style-sheets-view-container"> | ||
117 | <h4 id="no-document-message" class="panel-message">No style sheets to display.</h4> | ||
118 | <ul id="sheet-list"> | ||
119 | <li><div id="sheet-item"></div></li> | ||
120 | </ul> | ||
121 | <div id="style-sheets-toolbar-container" class="style-sheets-toolbar-container"> | ||
122 | <div id="style-sheets-toolbar"></div> | ||
123 | </div> | ||
124 | <div data-montage-id="resizeBar" class="sub-panel-resizer"></div> | ||
125 | </div> | ||
126 | </body> | ||
127 | </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..95adddd0 --- /dev/null +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | |||
@@ -0,0 +1,126 @@ | |||
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 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.StyleSheetsView = Montage.create(Component, { | ||
11 | noDocumentCondition : { | ||
12 | value: true | ||
13 | }, | ||
14 | showToolbar : { | ||
15 | value: false | ||
16 | }, | ||
17 | _resizedHeight : { | ||
18 | value: null | ||
19 | }, | ||
20 | isResizing : { | ||
21 | value: null | ||
22 | }, | ||
23 | _height: { | ||
24 | value: null | ||