diff options
Diffstat (limited to 'js/panels/css-panel/styles-view-container.reel')
3 files changed, 311 insertions, 0 deletions
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.css b/js/panels/css-panel/styles-view-container.reel/styles-view-container.css new file mode 100644 index 00000000..f4d70212 --- /dev/null +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.css | |||
@@ -0,0 +1,33 @@ | |||
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 | .sub-panel-slot { | ||
7 | background-color: #FFF; | ||
8 | display: -webkit-box; | ||
9 | -webkit-box-orient: vertical; | ||
10 | -webkit-box-flex: 1; | ||
11 | } | ||
12 | .no-styles .sub-panel-slot, .no-styles .styles-view-toolbar-container { | ||
13 | display: none; | ||
14 | } | ||
15 | .styles-view-container .panel-message { | ||
16 | display: none; | ||
17 | } | ||
18 | .styles-view-container.no-styles .panel-message { | ||
19 | display: block; | ||
20 | } | ||
21 | /*.styles-view-toolbar-container {*/ | ||
22 | /*border-top: 1px solid #303030;*/ | ||
23 | /*}*/ | ||
24 | /*.styles-view-toolbar-container .toolbar-container {*/ | ||
25 | /*border-top: 1px solid #5c5c5c;*/ | ||
26 | /*}*/ | ||
27 | |||
28 | /* ----- Toolbar ----*/ | ||
29 | |||
30 | .styles-view-container .toolbar-computed-button { | ||
31 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4Onh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5M6dO%2FcQkG0BxFz4NDNBbWP48eMHN5CSBGLhFy9eyCkpKdlOmDBhNpCvh88QkAF%2FQQw2NjZuX1%2FfxNDQ0AIREREbkJi%2Bvr7OxIkTZwGZaiAl2AxgBGLtVatW7RMVFRXDZcvBgwcnNDQ01AKZX9DlmIH417Vr186ws7NzPn78%2BNW9e%2Feevnz5kkFGRgYUiAyXLl26XFFR0QBkvoC5FpsrOIFYHIjlQX4OCgqaAgrYvr6%2B60C%2BHRBzQ73LAqVRwuA%2FEH8H4pdA%2FBCI7wO98%2FjRo0dPgE4%2FYmJi8hcalXxxcXG2QFoKOTyYsTnpPxCIiYkZRkREBL5%2B%2FfruuXPnzgKFJSorK5cpKCioHDt27BqQ%2FwnkJSYs%2Bn8DNTyFuozh7du3skBKEZRGvn37xuft7Z2Ym5sLChMlkEtYsDkAFLDMzMx%2FQBwzMzMvHR0d3d%2B%2Ff3Pw8vKCUisDMIzCgfK%2FgemkghFHzAkkJSXlxsbGNuGK2p9A4OHhoc%2BCQ%2F7LvHnz5j98%2BPCepKSk1r9%2F%2F5g%2Ff%2F4sBkxkYbKystzAVPt7ypQpIMPfEUrmHKDQhyZ3mwULFjzZsWPHTy8vrxogXxpXJOACSsAMdxro%2FwJkzYwkGMANdc0PWBSCBAECDAAwy7PLmtswugAAAABJRU5ErkJggg%3D%3D); | ||
32 | |||
33 | } \ No newline at end of file | ||
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.html b/js/panels/css-panel/styles-view-container.reel/styles-view-container.html new file mode 100644 index 00000000..1dd83468 --- /dev/null +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.html | |||
@@ -0,0 +1,92 @@ | |||
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="styles-view-container.css" rel="stylesheet" type="text/css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "owner": { | ||
14 | "module" : "js/panels/css-panel/styles-view-container.reel", | ||
15 | "name" : "StylesViewContainer", | ||
16 | "properties" : { | ||
17 | "element" : {"#" : "container"}, | ||
18 | "ruleListContainer": {"@": "ruleListContainer" }, | ||
19 | "computedStyleView": {"@": "computedStyleView" }, | ||
20 | "substitution": {"@": "substitution" }, | ||
21 | "delegate": {"@": "stylesViewDelegate"}, | ||
22 | "toolbar": {"@": "toolbar"} | ||
23 | } | ||
24 | }, | ||
25 | "substitution": { | ||
26 | "module": "montage/ui/substitution.reel", | ||
27 | "name": "Substitution", | ||
28 | "properties": { | ||
29 | "element": {"#": "sub-panel-slot"}, | ||
30 | "switchComponents": { | ||
31 | "rules": {"@": "ruleListContainer"}, | ||
32 | "computed": {"@": "computedStyleView"} | ||
33 | } | ||
34 | }, | ||
35 | "bindings": { | ||
36 | "switchValue": { | ||
37 | "boundObject": {"@": "owner"}, | ||
38 | "boundObjectPropertyPath": "contentPanel", | ||
39 | "oneway": true | ||
40 | } | ||
41 | } | ||
42 | }, | ||
43 | "stylesViewDelegate" : { | ||
44 | "module": "js/panels/css-panel/styles-view-delegate", | ||
45 | "name": "StylesViewMediator", | ||
46 | "properties": { | ||
47 | "ruleListContainer": {"@": "ruleListContainer"} | ||
48 | } | ||
49 | }, | ||
50 | "ruleListContainer": { | ||
51 | "module": "js/panels/css-panel/rule-list-container.reel", | ||
52 | "name": "RuleListContainer", | ||
53 | "properties": { | ||
54 | "focusDelegate": {"@": "stylesViewDelegate"} | ||
55 | } | ||
56 | }, | ||
57 | "computedStyleView": { | ||
58 | "module": "js/panels/CSSPanel/ComputedStyleSubPanel.reel", | ||
59 | "name": "ComputedStyleSubPanel" | ||
60 | }, | ||
61 | "toolbar": { | ||
62 | "module": "js/components/toolbar.reel", | ||
63 | "name": "Toolbar", | ||
64 | "properties": { | ||
65 | "element": {"#": "styles-view-toolbar"}, | ||
66 | "delegate": {"@": "stylesViewDelegate" }, | ||
67 | "buttons": [ | ||
68 | { | ||
69 | "title": "Add", | ||
70 | "identifier": "add" | ||
71 | }, | ||
72 | { | ||
73 | "title": "Computed Styles", | ||
74 | "identifier": "computed", | ||
75 | "leftAlign": true | ||
76 | } | ||
77 | ] | ||
78 | } | ||
79 | } | ||
80 | } | ||
81 | </script> | ||
82 | </head> | ||
83 | <body> | ||
84 | <div id="container" class="styles-view-container"> | ||
85 | <h4 data-montage-id="no-styles-message" class="panel-message">No styles to display.</h4> | ||
86 | <div data-montage-id="sub-panel-slot" class="sub-panel-slot"></div> | ||
87 | <div class="styles-view-toolbar-container"> | ||
88 | <div data-montage-id="styles-view-toolbar"></div> | ||
89 | </div> | ||
90 | </div> | ||
91 | </body> | ||
92 | </html> \ No newline at end of file | ||
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js new file mode 100644 index 00000000..3f0cd47e --- /dev/null +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js | |||
@@ -0,0 +1,186 @@ | |||
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.StylesViewContainer = Montage.create(Component, { | ||
11 | contentController : { | ||
12 | value: null | ||
13 | }, | ||
14 | contentPanel : { | ||
15 | value: 'rules' | ||
16 | }, | ||
17 | _selectionNameLabelText : { | ||
18 | value: null | ||
19 | }, | ||
20 | selectionNameLabelText : { | ||
21 | get: function() { | ||
22 | return this._selectionNameLabelText; | ||
23 | }, | ||
24 | set: function(value) { | ||
25 | if(value === this._selectionNameLabelText) { return false; } | ||
26 | |||
27 | this._selectionNameLabelText = value; | ||
28 | |||
29 | this.needsDraw = true; | ||
30 | } | ||
31 | }, | ||
32 | _lastSelection : { | ||
33 | value: null | ||
34 | }, | ||
35 | _hasStyles : { | ||
36 | value: false | ||
37 | }, | ||
38 | hasStyles : { | ||
39 | get: function() { | ||
40 | return this._hasStyles; | ||
41 | }, | ||
42 | set: function(hasThem) { | ||
43 | this._hasStyles = hasThem; | ||
44 | //caller needs to set ndt | ||
45 | //this.needsDraw = true; | ||
46 | } | ||
47 | }, | ||
48 | |||
49 | _getElementLabel : { | ||
50 | value: function(el) { | ||
51 | var id = '#'+el.id, | ||
52 | className = '.'+Array.prototype.slice.call(el.classList).join('.'), | ||
53 | nodeName = el.nodeName; | ||
54 | |||
55 | if(id.length > 1) { | ||
56 | return nodeName + id; | ||
57 | } else if(className.length > 1) { | ||
58 | return nodeName + className; | ||
59 | } | ||
60 | |||
61 | return nodeName; | ||
62 | <