diff options
author | Pushkar Joshi | 2012-05-31 12:20:03 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-05-31 12:20:03 -0700 |
commit | 4bc52365b1f81a386c3c59fd7c6ad874bb387cb5 (patch) | |
tree | c5b17297aba04bd54a59cf6214d29486e089031b /js/panels/css-panel/styles-view-container.reel | |
parent | 75a862d305bc4502e22bc5aa65fa271143b8cf6c (diff) | |
parent | 6042bdc5f2aada4412912fd01602d32c9088dc26 (diff) | |
download | ninja-4bc52365b1f81a386c3c59fd7c6ad874bb387cb5.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'js/panels/css-panel/styles-view-container.reel')
3 files changed, 299 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%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowMTYyOTg1RURFNTIxMUUwQkQyRkUwNDk1QUNCRDQ2NiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowMTYyOTg1RkRFNTIxMUUwQkQyRkUwNDk1QUNCRDQ2NiI%2BIDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bX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-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..93ac3793 --- /dev/null +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.html | |||
@@ -0,0 +1,82 @@ | |||
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 | "prototype" : "js/panels/css-panel/styles-view-container.reel", | ||
15 | "properties" : { | ||
16 | "element" : {"#" : "container"}, | ||
17 | "ruleListContainer": {"@": "ruleListContainer" }, | ||
18 | "computedStyleView": {"@": "computedStyleView" }, | ||
19 | "substitution": {"@": "substitution" }, | ||
20 | "delegate": {"@": "stylesViewDelegate"}, | ||
21 | "toolbar": {"@": "toolbar"} | ||
22 | } | ||
23 | }, | ||
24 | "substitution": { | ||
25 | "prototype": "montage/ui/substitution.reel", | ||
26 | "properties": { | ||
27 | "element": {"#": "sub-panel-slot"}, | ||
28 | "switchComponents": { | ||
29 | "rules": {"@": "ruleListContainer"}, | ||
30 | "computed": {"@": "computedStyleView"} | ||
31 | } | ||
32 | }, | ||
33 | "bindings": { | ||
34 | "switchValue": { "<-": "@owner.contentPanel" } | ||
35 | } | ||
36 | }, | ||
37 | "stylesViewDelegate" : { | ||
38 | "prototype": "js/panels/css-panel/styles-view-delegate", | ||
39 | "properties": { | ||
40 | "ruleListContainer": {"@": "ruleListContainer"} | ||
41 | } | ||
42 | }, | ||
43 | "ruleListContainer": { | ||
44 | "prototype": "js/panels/css-panel/rule-list-container.reel", | ||
45 | "properties": { | ||
46 | "focusDelegate": {"@": "stylesViewDelegate"} | ||
47 | } | ||
48 | }, | ||
49 | "computedStyleView": { | ||
50 | "prototype": "js/panels/CSSPanel/ComputedStyleSubPanel.reel" | ||
51 | }, | ||
52 | "toolbar": { | ||
53 | "prototype": "js/components/toolbar.reel", | ||
54 | "properties": { | ||
55 | "element": {"#": "styles-view-toolbar"}, | ||
56 | "delegate": {"@": "stylesViewDelegate" }, | ||
57 | "buttons": [ | ||
58 | { | ||
59 | "title": "Add", | ||
60 | "identifier": "add" | ||
61 | }, | ||
62 | { | ||
63 | "title": "Computed Styles", | ||
64 | "identifier": "computed", | ||
65 | "leftAlign": true | ||
66 | } | ||
67 | ] | ||
68 | } | ||
69 | } | ||
70 | } | ||
71 | </script> | ||
72 | </head> | ||
73 | <body> | ||
74 | <div id="container" class="styles-view-container"> | ||
75 | <h4 data-montage-id="no-styles-message" class="panel-message">No styles to display.</h4> | ||
76 | <div data-montage-id="sub-panel-slot" class="sub-panel-slot"></div> | ||
77 | <div class="styles-view-toolbar-container"> | ||
78 | <div data-montage-id="styles-view-toolbar"></div> | ||
79 | </div> | ||
80 | </div> | ||
81 | </body> | ||
82 | </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..4a391421 --- /dev/null +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js | |||
@@ -0,0 +1,184 @@ | |||
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 | _prevSelection : { | ||
33 | value: null | ||
34 | }, | ||
35 | prevSelection : { | ||
36 | get: function() { | ||
37 | return this._prevSelection; | ||
38 | }, | ||
39 | set: function(value) { | ||
40 | this._prevSelection = value; | ||
41 | } | ||
42 | }, | ||
43 | _hasStyles : { | ||
44 | value: false | ||
45 | }, | ||
46 | hasStyles : { | ||
47 | get: function() { | ||
48 | return this._hasStyles; | ||
49 | }, | ||
50 | set: function(hasThem) { | ||
51 | this._hasStyles = hasThem; | ||
52 | //caller needs to set ndt | ||
53 | //this.needsDraw = true; | ||
54 | } | ||
55 | }, | ||
56 | |||
57 | _getElementLabel : { | ||
58 | value: function(el) { | ||
59 | var id = '#'+el.id, | ||
60 | className = '.'+Array.prototype.slice.call(el.classList).join('.'), | ||
61 | nodeName = el.nodeName; | ||
62 | |||
63 | if(id.length > 1) { | ||
64 | return nodeName + id; | ||
65 | } else if(className.length > 1) { | ||
66 | return nodeName + className; | ||
67 | } | ||