diff options
Diffstat (limited to 'js/panels/Materials/materials-popup.reel')
3 files changed, 375 insertions, 375 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.css b/js/panels/Materials/materials-popup.reel/materials-popup.css index d53cb795..03ea13cd 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.css +++ b/js/panels/Materials/materials-popup.reel/materials-popup.css | |||
@@ -130,8 +130,8 @@ POSSIBILITY OF SUCH DAMAGE. | |||
130 | 130 | ||
131 | .mp_properties_list > .mp_property > .colortoolbar | 131 | .mp_properties_list > .mp_property > .colortoolbar |
132 | { | 132 | { |
133 | width: 27px !important; | 133 | width: 27px !important; |
134 | height: 27px !important; | 134 | height: 27px !important; |
135 | overflow:hidden !important; | 135 | overflow:hidden !important; |
136 | margin-top: -6px; | 136 | margin-top: -6px; |
137 | } | 137 | } |
@@ -177,4 +177,4 @@ POSSIBILITY OF SUCH DAMAGE. | |||
177 | .materials_popup .mp_reset_btn { | 177 | .materials_popup .mp_reset_btn { |
178 | float: right; | 178 | float: right; |
179 | margin-right: 8px; | 179 | margin-right: 8px; |
180 | } \ No newline at end of file | 180 | } |
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.html b/js/panels/Materials/materials-popup.reel/materials-popup.html index db53e0e9..ac8f0a94 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.html +++ b/js/panels/Materials/materials-popup.reel/materials-popup.html | |||
@@ -1,4 +1,4 @@ | |||
1 | <!DOCTYPE html> | 1 | <!doctype html> |
2 | <!-- <copyright> | 2 | <!-- <copyright> |
3 | Copyright (c) 2012, Motorola Mobility, Inc | 3 | Copyright (c) 2012, Motorola Mobility, Inc |
4 | All Rights Reserved. | 4 | All Rights Reserved. |
@@ -29,13 +29,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
29 | POSSIBILITY OF SUCH DAMAGE. | 29 | POSSIBILITY OF SUCH DAMAGE. |
30 | </copyright> --> | 30 | </copyright> --> |
31 | <html lang="en"> | 31 | <html lang="en"> |
32 | <head> | 32 | <head> |
33 | 33 | ||
34 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | 34 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
35 | 35 | ||
36 | <link rel="stylesheet" type="text/css" href="materials-popup.css"> | 36 | <link rel="stylesheet" type="text/css" href="materials-popup.css"> |
37 | 37 | ||
38 | <script type="text/montage-serialization"> | 38 | <script type="text/montage-serialization"> |
39 | { | 39 | { |
40 | "okButton": { | 40 | "okButton": { |
41 | "prototype": "montage/ui/button.reel", | 41 | "prototype": "montage/ui/button.reel", |
@@ -127,10 +127,10 @@ POSSIBILITY OF SUCH DAMAGE. | |||
127 | } | 127 | } |
128 | </script> | 128 | </script> |
129 | 129 | ||
130 | </head> | 130 | </head> |
131 | 131 | ||
132 | <body> | 132 | <body> |
133 | <div data-montage-id="materials_popup" class="materials_popup"> | 133 | <div data-montage-id="materials_popup" class="materials_popup"> |
134 | <div data-montage-id="mp_title" class="mp_title">Material Name</div> | 134 | <div data-montage-id="mp_title" class="mp_title">Material Name</div> |
135 | <hr /> | 135 | <hr /> |
136 | <div data-montage-id="mp_preview" class="mp_preview"> | 136 | <div data-montage-id="mp_preview" class="mp_preview"> |
@@ -147,6 +147,6 @@ POSSIBILITY OF SUCH DAMAGE. | |||
147 | <button data-montage-id="mp_ok_btn" class="mp_ok_btn nj-skinned"></button> | 147 | <button data-montage-id="mp_ok_btn" class="mp_ok_btn nj-skinned"></button> |
148 | <button data-montage-id="mp_saveAs_btn" class="mp_saveAs_btn nj-skinned"></button> | 148 | <button data-montage-id="mp_saveAs_btn" class="mp_saveAs_btn nj-skinned"></button> |
149 | </div> | 149 | </div> |
150 | </div> | 150 | </div> |
151 | </body> | 151 | </body> |
152 | </html> | 152 | </html> |
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index 0d0435a4..501df282 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -79,25 +79,25 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
79 | serializable: true | 79 | serializable: true |
80 | }, | 80 | }, |
81 | 81 | ||
82 | // Material Properties | 82 | // Material Properties |
83 | _materialName: { | 83 | _materialName: { |
84 | enumerable: true, | 84 | enumerable: true, |
85 | value: "" | 85 | value: "" |
86 | }, | 86 | }, |
87 | 87 | ||
88 | _useSelection: { value: false, enumerable: true }, | 88 | _useSelection: { value: false, enumerable: true }, |
89 | _whichMaterial: { value: "fill", enumerable: true }, | 89 | _whichMaterial: { value: "fill", enumerable: true }, |
90 | _originalValues: {value: null, enumerable: true }, | 90 | _originalValues: {value: null, enumerable: true }, |
91 | 91 | ||
92 | captureAction: { | 92 | captureAction: { |
93 | value:function(event) { | 93 | value:function(event) { |
94 | switch(event._currentTarget.label) | 94 | switch(event._currentTarget.label) |
95 | { | 95 | { |
96 | case "Cancel": | 96 | case "Cancel": |
97 | // console.log("Cancel material edit"); | 97 | // console.log("Cancel material edit"); |
98 | this.revertToOriginalValues(); | 98 | this.revertToOriginalValues(); |
99 | break; | 99 | break; |
100 | case "OK": | 100 | case "OK": |
101 | // console.log("Committing material with the following values:"); | 101 | // console.log("Committing material with the following values:"); |
102 | for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++) | 102 | for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++) |
103 | { | 103 | { |
@@ -116,19 +116,19 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
116 | console.log("--------------"); | 116 | console.log("--------------"); |
117 | 117 | ||
118 | } | 118 | } |
119 | break; | 119 | break; |
120 | case "Save As...": | 120 | case "Save As...": |
121 | this.saveAs(); | 121 | this.saveAs(); |
122 | break; | 122 | break; |
123 | case "Reset": | 123 | case "Reset": |
124 | this.reset(); | 124 | this.reset(); |
125 | break; | 125 | break; |
126 | } | 126 | } |
127 | 127 | ||
128 | // Notify Materials Library to close popup | 128 | // Notify Materials Library to close popup |
129 | NJevent("hideMaterialPopup"); | 129 | NJevent("hideMaterialPopup"); |
130 | } | 130 | } |
131 | }, | 131 | }, |
132 | 132 | ||
133 | saveAs: | 133 | saveAs: |
134 | { | 134 | { |
@@ -152,45 +152,45 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
152 | } | 152 | } |
153 | }, | 153 | }, |
154 | 154 | ||
155 | revertToOriginalValues: | 155 | revertToOriginalValues: |
156 | { | 156 | { |
157 | value: function() | 157 | value: function() |
158 | { | 158 | { |
159 | if (this._originalValues) | 159 | if (this._originalValues) |
160 | { | 160 | { |
161 | this._material.importJSON( this._originalValues ); | 161 | this._material.importJSON( this._originalValues ); |
162 | 162 | ||
163 | if (this._useSelection) | 163 | if (this._useSelection) |
164 | { | 164 | { |
165 | var selection = this.application.ninja.selectedElements; | 165 | var selection = this.application.ninja.selectedElements; |
166 | if (selection && (selection.length > 0)) | 166 | if (selection && (selection.length > 0)) |
167 | { | 167 | { |
168 | var nObjs = selection.length; | 168 | var nObjs = selection.length; |
169 | for (var iObj=0; iObj<nObjs; iObj++) | 169 | for (var iObj=0; iObj<nObjs; iObj++) |
170 | { | 170 | { |
171 | var canvas = selection[iObj]; | 171 | var canvas = selection[iObj]; |
172 | var obj; | 172 | var obj; |
173 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; | 173 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; |
174 | if (obj) | 174 | if (obj) |
175 | { | 175 | { |
176 | var matArray = obj._materialArray; | 176 | var matArray = obj._materialArray; |
177 | var matTypeArray = obj._materialTypeArray; | 177 | var matTypeArray = obj._materialTypeArray; |
178 | var nMats = matArray.length; | 178 | var nMats = matArray.length; |
179 | for (var iMat=0; iMat<nMats; iMat++) | 179 | for (var iMat=0; iMat<nMats; iMat++) |
180 | { | 180 | { |
181 | if (matTypeArray[iMat] === this._whichMaterial) | 181 | if (matTypeArray[iMat] === this._whichMaterial) |
182 | matArray[iMat].importJSON( this._originalValues ); | 182 | matArray[iMat].importJSON( this._originalValues ); |