aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials/materials-popup.reel
diff options
context:
space:
mode:
authorKris Kowal2012-07-06 11:52:06 -0700
committerKris Kowal2012-07-06 15:01:48 -0700
commit648ee61ae84216d0236e0dbc211addc13b2cfa3a (patch)
tree8f0f55557bd0c47a84e49c1977c950645d284607 /js/panels/Materials/materials-popup.reel
parentaedd14b18695d031f695d27dfbd94df5614495bb (diff)
downloadninja-648ee61ae84216d0236e0dbc211addc13b2cfa3a.tar.gz
Expand tabs
Diffstat (limited to 'js/panels/Materials/materials-popup.reel')
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.css4
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.html20
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js842
3 files changed, 433 insertions, 433 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.css b/js/panels/Materials/materials-popup.reel/materials-popup.css
index a5362615..3ddc8a98 100755
--- a/js/panels/Materials/materials-popup.reel/materials-popup.css
+++ b/js/panels/Materials/materials-popup.reel/materials-popup.css
@@ -105,8 +105,8 @@ POSSIBILITY OF SUCH DAMAGE.
105 105
106.mp_properties_list > .mp_property > .colortoolbar 106.mp_properties_list > .mp_property > .colortoolbar
107{ 107{
108 width: 27px !important; 108 width: 27px !important;
109 height: 27px !important; 109 height: 27px !important;
110 overflow:hidden !important; 110 overflow:hidden !important;
111 margin-top: -6px; 111 margin-top: -6px;
112} 112}
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.html b/js/panels/Materials/materials-popup.reel/materials-popup.html
index b377fa2d..eb2433e3 100755
--- a/js/panels/Materials/materials-popup.reel/materials-popup.html
+++ b/js/panels/Materials/materials-popup.reel/materials-popup.html
@@ -29,13 +29,13 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29POSSIBILITY OF SUCH DAMAGE. 29POSSIBILITY 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",
@@ -109,13 +109,13 @@ POSSIBILITY OF SUCH DAMAGE.
109 } 109 }
110 </script> 110 </script>
111 111
112 </head> 112 </head>
113 113
114 <body> 114 <body>
115 <div data-montage-id="materials_popup" class="materials_popup"> 115 <div data-montage-id="materials_popup" class="materials_popup">
116 <div data-montage-id="mp_title" class="mp_title">Material Name</div> 116 <div data-montage-id="mp_title" class="mp_title">Material Name</div>
117 <hr /> 117 <hr />
118 <div data-montage-id="mp_preview" class="mp_preview">Preview Pane</div> 118 <div data-montage-id="mp_preview" class="mp_preview">Preview Pane</div>
119 <hr /> 119 <hr />
120 <div data-montage-id="mp_properties_list" class="mp_properties_list"> 120 <div data-montage-id="mp_properties_list" class="mp_properties_list">
121 <div data-montage-id="mp_property" class="mp_property"></div> 121 <div data-montage-id="mp_property" class="mp_property"></div>
@@ -125,6 +125,6 @@ POSSIBILITY OF SUCH DAMAGE.
125 <button data-montage-id="mp_cancel_btn" class="mp_cancel_btn nj-skinned"></button> 125 <button data-montage-id="mp_cancel_btn" class="mp_cancel_btn nj-skinned"></button>
126 <button data-montage-id="mp_ok_btn" class="mp_ok_btn nj-skinned"></button> 126 <button data-montage-id="mp_ok_btn" class="mp_ok_btn nj-skinned"></button>
127 </div> 127 </div>
128 </div> 128 </div>
129 </body> 129 </body>
130</html> 130</html>
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js
index 7c5493c6..cecb0a71 100755
--- a/js/panels/Materials/materials-popup.reel/materials-popup.js
+++ b/js/panels/Materials/materials-popup.reel/materials-popup.js
@@ -51,26 +51,26 @@ exports.MaterialsPopup = Montage.create(Component, {
51 serializable: true 51 serializable: true
52 }, 52 },
53 53
54 // Material Properties 54 // Material Properties
55 _materialName: { 55 _materialName: {
56 enumerable: true, 56 enumerable: true,
57 value: "" 57 value: ""
58 }, 58 },
59 59
60 _useSelection: { value: false, enumerable: true }, 60 _useSelection: { value: false, enumerable: true },
61 _whichMaterial: { value: "fill", enumerable: true }, 61 _whichMaterial: { value: "fill", enumerable: true },
62 _originalValues: {value: null, enumerable: true }, 62 _originalValues: {value: null, enumerable: true },
63 63
64 captureAction: { 64 captureAction: {
65 value:function(event) { 65 value:function(event) {
66 switch(event._currentTarget.label) 66 switch(event._currentTarget.label)
67 { 67 {
68 case "Cancel": 68 case "Cancel":
69 console.log("Cancel material edit"); 69 console.log("Cancel material edit");
70 this.revertToOriginalValues(); 70 this.revertToOriginalValues();
71 break; 71 break;
72 case "OK": 72 case "OK":
73 console.log("Committing material with the following values:"); 73 console.log("Committing material with the following values:");
74 for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++) 74 for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++)
75 { 75 {
76 var childControl = this.materialsProperties.childComponents[i]; 76 var childControl = this.materialsProperties.childComponents[i];
@@ -88,53 +88,53 @@ exports.MaterialsPopup = Montage.create(Component, {
88 console.log("--------------"); 88 console.log("--------------");
89 89
90 } 90 }
91 break; 91 break;
92 } 92 }
93 93
94 // Notify Materials Library to close popup 94 // Notify Materials Library to close popup
95 NJevent("hideMaterialPopup"); 95 NJevent("hideMaterialPopup");
96 } 96 }
97 }, 97 },
98 98
99 revertToOriginalValues: 99 revertToOriginalValues:
100 { 100 {
101 value: function() 101 value: function()
102 { 102 {
103 if (this._originalValues) 103 if (this._originalValues)
104 { 104 {
105 this._material.importJSON( this._originalValues ); 105 this._material.importJSON( this._originalValues );
106 106
107 if (this._useSelection) 107 if (this._useSelection)
108 { 108 {
109 var selection = this.application.ninja.selectedElements; 109 var selection = this.application.ninja.selectedElements;
110 if (selection && (selection.length > 0)) 110 if (selection && (selection.length > 0))
111 { 111 {
112 var nObjs = selection.length; 112 var nObjs = selection.length;
113 for (var iObj=0; iObj<nObjs; iObj++) 113 for (var iObj=0; iObj<nObjs; iObj++)
114 { 114 {
115 var canvas = selection[iObj]; 115 var canvas = selection[iObj];
116 var obj; 116 var obj;
117 if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; 117 if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj;
118 if (obj) 118 if (obj)
119 { 119 {
120 var matArray = obj._materialArray; 120 var matArray = obj._materialArray;
121 var matTypeArray = obj._materialTypeArray; 121 var matTypeArray = obj._materialTypeArray;
122 var nMats = matArray.length; 122 var nMats = matArray.length;
123 for (var iMat=0; iMat<nMats; iMat++) 123 for (var iMat=0; iMat<nMats; iMat++)
124 { 124 {
125 if (matTypeArray[iMat] === this._whichMaterial) 125 if (matTypeArray[iMat] === this._whichMaterial)
126 matArray[iMat].importJSON( this._originalValues ); 126 matArray[iMat].importJSON( this._originalValues );
127 } 127 }
128 var world = obj.getWorld(); 128 var world = obj.getWorld();
129 if (world) 129 if (world)
130 world.restartRenderLoop(); 130 world.restartRenderLoop();
131 } 131 }
132 } 132 }
133 } 133 }
134 } 134 }
135 } 135 }