diff options
author | Kruti Shah | 2012-07-17 12:40:00 -0700 |
---|---|---|
committer | Kruti Shah | 2012-07-17 12:40:00 -0700 |
commit | bf2d7bdb22c28089dc1067bc9094ebc590daac87 (patch) | |
tree | 2156d9920ea1b7db49ed6460545fea7cda121bae /js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js | |
parent | 7e2c2dbd040ed79a3f0678f91bd4b6db9cf69231 (diff) | |
parent | b4b3e45d6684e77d361b4f8ca5be4889428320c5 (diff) | |
download | ninja-bf2d7bdb22c28089dc1067bc9094ebc590daac87.tar.gz |
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Diffstat (limited to 'js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js')
-rwxr-xr-x | js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js index e214a49b..c997a207 100755 --- a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js +++ b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.js | |||
@@ -1,24 +1,25 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | Copyright (c) 2012, Motorola Mobility, Inc | 2 | Copyright (c) 2012, Motorola Mobility LLC. |
3 | All Rights Reserved. | 3 | All Rights Reserved. |
4 | BSD License. | ||
5 | 4 | ||
6 | Redistribution and use in source and binary forms, with or without | 5 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions are met: | 6 | modification, are permitted provided that the following conditions are met: |
8 | 7 | ||
9 | - Redistributions of source code must retain the above copyright notice, | 8 | * Redistributions of source code must retain the above copyright notice, |
10 | this list of conditions and the following disclaimer. | 9 | this list of conditions and the following disclaimer. |
11 | - Redistributions in binary form must reproduce the above copyright | 10 | |
12 | notice, this list of conditions and the following disclaimer in the | 11 | * Redistributions in binary form must reproduce the above copyright notice, |
13 | documentation and/or other materials provided with the distribution. | 12 | this list of conditions and the following disclaimer in the documentation |
14 | - Neither the name of Motorola Mobility nor the names of its contributors | 13 | and/or other materials provided with the distribution. |
15 | may be used to endorse or promote products derived from this software | 14 | |
16 | without specific prior written permission. | 15 | * Neither the name of Motorola Mobility LLC nor the names of its |
16 | contributors may be used to endorse or promote products derived from this | ||
17 | software without specific prior written permission. | ||
17 | 18 | ||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
@@ -49,25 +50,25 @@ exports.ComputedStyleSubPanel = Montage.create(Component, { | |||
49 | }, | 50 | }, |
50 | // prepareForDraw : { | 51 | // prepareForDraw : { |
51 | // value: function() { | 52 | // value: function() { |
52 | // | 53 | // |
53 | // } | 54 | // } |
54 | // }, | 55 | // }, |
55 | willDraw : { | 56 | willDraw : { |
56 | value: function() { | 57 | value: function() { |
57 | if(this._declaration) { | 58 | if(this._declaration) { |
58 | 59 | ||
59 | var group = this.staticGroupingMap[this._group], | 60 | var group = this.staticGroupingMap[this._group], |
60 | matchedInGroup, elementList; | 61 | matchedInGroup, elementList; |
61 | 62 | ||
62 | if(this._group === 'all' && !group) { | 63 | if(this._group === 'all' && !group) { |
63 | group = this.staticGroupingMap['all'] = nj.toArray(this._declaration).sort(); | 64 | group = this.staticGroupingMap['all'] = nj.toArray(this._declaration).sort(); |
64 | } | 65 | } |
65 | 66 | ||
66 | ///// Filter group to show only the styles that match search filter | 67 | ///// Filter group to show only the styles that match search filter |
67 | matchedInGroup = group.filter(function(item) { | 68 | matchedInGroup = group.filter(function(item) { |
68 | return (item.indexOf(this._filter) > -1); | 69 | return (item.indexOf(this._filter) > -1); |
69 | }, this); | 70 | }, this); |
70 | 71 | ||
71 | this._elementList = matchedInGroup.map(function(propName) { | 72 | this._elementList = matchedInGroup.map(function(propName) { |
72 | var propEl = nj.make('dt'), | 73 | var propEl = nj.make('dt'), |
73 | valEl = nj.make('dd'), | 74 | valEl = nj.make('dd'), |
@@ -75,20 +76,20 @@ exports.ComputedStyleSubPanel = Montage.create(Component, { | |||
75 | 76 | ||
76 | propEl.appendChild(nj.textNode(propName)); | 77 | propEl.appendChild(nj.textNode(propName)); |
77 | propEl.title = propName; | 78 | propEl.title = propName; |
78 | 79 | ||
79 | valEl.appendChild(nj.textNode(this._declaration.getPropertyValue(propName))); | 80 | valEl.appendChild(nj.textNode(this._declaration.getPropertyValue(propName))); |
80 | valEl.title = this._declaration.getPropertyValue(propName); | 81 | valEl.title = this._declaration.getPropertyValue(propName); |
81 | 82 | ||
82 | contEl.appendChild(propEl); | 83 | contEl.appendChild(propEl); |
83 | contEl.appendChild(valEl); | 84 | contEl.appendChild(valEl); |
84 | 85 | ||
85 | return contEl; | 86 | return contEl; |
86 | }, this); | 87 | }, this); |
87 | 88 | ||
88 | /*if(matchedInGroup.length) { | 89 | /*if(matchedInGroup.length) { |
89 | 90 | ||
90 | } else { | 91 | } else { |
91 | 92 | ||
92 | }*/ | 93 | }*/ |
93 | } | 94 | } |
94 | } | 95 | } |
@@ -101,7 +102,7 @@ exports.ComputedStyleSubPanel = Montage.create(Component, { | |||
101 | ///// Append style elements to the list container | 102 | ///// Append style elements to the list container |
102 | this._elementList.forEach(function(el) { | 103 | this._elementList.forEach(function(el) { |
103 | this.computedListEl.appendChild(el); | 104 | this.computedListEl.appendChild(el); |
104 | }, this); | 105 | }, this); |
105 | } | 106 | } |
106 | } | 107 | } |
107 | }, | 108 | }, |
@@ -138,7 +139,7 @@ exports.ComputedStyleSubPanel = Montage.create(Component, { | |||
138 | ///// Get computed style of passed in node | 139 | ///// Get computed style of passed in node |
139 | declaration = this._declaration = source.ownerDocument.defaultView.getComputedStyle(source); | 140 | declaration = this._declaration = source.ownerDocument.defaultView.getComputedStyle(source); |
140 | } | 141 | } |
141 | 142 | ||
142 | this.needsDraw = true; | 143 | this.needsDraw = true; |
143 | } | 144 | } |
144 | }, | 145 | }, |
@@ -194,7 +195,7 @@ exports.ComputedStyleSubPanel = Montage.create(Component, { | |||
194 | 'dimensions' : [ | 195 | 'dimensions' : [ |
195 | 'width', 'height', 'top', 'right', 'bottom', 'left', | 196 | 'width', 'height', 'top', 'right', 'bottom', 'left', |
196 | 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', | 197 | 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', |
197 | 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', | 198 | 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', |
198 | 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width' | 199 | 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width' |
199 | ], | 200 | ], |
200 | 'border' : [ | 201 | 'border' : [ |
@@ -203,7 +204,7 @@ exports.ComputedStyleSubPanel = Montage.create(Component, { | |||
203 | 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style' | 204 | 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style' |
204 | ], | 205 | ], |
205 | 'font' : [ | 206 | 'font' : [ |
206 | 'font-family', 'font-size', 'font-weight', 'font-style', 'color', 'text-transform', | 207 | 'font-family', 'font-size', 'font-weight', 'font-style', 'color', 'text-transform', |
207 | 'text-decoration', 'letter-spacing', 'word-spacing', 'line-height', 'text-align', | 208 | 'text-decoration', 'letter-spacing', 'word-spacing', 'line-height', 'text-align', |
208 | 'vertical-align', 'direction' | 209 | 'vertical-align', 'direction' |
209 | ], | 210 | ], |