diff options
Diffstat (limited to 'js/panels/CSSPanel/ComputedStyleSubPanel.reel')
3 files changed, 51 insertions, 48 deletions
diff --git a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html index a65fd32f..1bd53f99 100755 --- a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html +++ b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html | |||
@@ -1,25 +1,26 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <!-- <copyright> | 2 | <!-- <copyright> |
3 | Copyright (c) 2012, Motorola Mobility, Inc | 3 | Copyright (c) 2012, Motorola Mobility LLC. |
4 | All Rights Reserved. | 4 | All Rights Reserved. |
5 | BSD License. | ||
6 | 5 | ||
7 | Redistribution and use in source and binary forms, with or without | 6 | Redistribution and use in source and binary forms, with or without |
8 | modification, are permitted provided that the following conditions are met: | 7 | modification, are permitted provided that the following conditions are met: |
9 | 8 | ||
10 | - Redistributions of source code must retain the above copyright notice, | 9 | * Redistributions of source code must retain the above copyright notice, |
11 | this list of conditions and the following disclaimer. | 10 | this list of conditions and the following disclaimer. |
12 | - Redistributions in binary form must reproduce the above copyright | 11 | |
13 | notice, this list of conditions and the following disclaimer in the | 12 | * Redistributions in binary form must reproduce the above copyright notice, |
14 | documentation and/or other materials provided with the distribution. | 13 | this list of conditions and the following disclaimer in the documentation |
15 | - Neither the name of Motorola Mobility nor the names of its contributors | 14 | and/or other materials provided with the distribution. |
16 | may be used to endorse or promote products derived from this software | 15 | |
17 | without specific prior written permission. | 16 | * Neither the name of Motorola Mobility LLC nor the names of its |
17 | contributors may be used to endorse or promote products derived from this | ||
18 | software without specific prior written permission. | ||
18 | 19 | ||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 24 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 25 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 26 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
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 |