From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001
From: Kris Kowal
Date: Fri, 6 Jul 2012 11:52:06 -0700
Subject: Expand tabs
---
js/panels/Materials/MaterialsPanel.js | 4 +-
.../materials-library-panel.html | 26 +-
.../materials-library-panel.js | 18 +-
.../materials-popup.reel/materials-popup.css | 4 +-
.../materials-popup.reel/materials-popup.html | 20 +-
.../materials-popup.reel/materials-popup.js | 842 ++++++++++-----------
6 files changed, 457 insertions(+), 457 deletions(-)
(limited to 'js/panels/Materials')
diff --git a/js/panels/Materials/MaterialsPanel.js b/js/panels/Materials/MaterialsPanel.js
index 9d7f447a..4291f39b 100755
--- a/js/panels/Materials/MaterialsPanel.js
+++ b/js/panels/Materials/MaterialsPanel.js
@@ -29,8 +29,8 @@ POSSIBILITY OF SUCH DAMAGE.
*/
var Montage = require("montage/core/core").Montage,
- PanelBase = require("js/panels/PanelBase").PanelBase,
- MaterialsLibraryPanel = require("js/panels/Materials/materials-library-panel.reel").MaterialsLibraryPanel;
+ PanelBase = require("js/panels/PanelBase").PanelBase,
+ MaterialsLibraryPanel = require("js/panels/Materials/materials-library-panel.reel").MaterialsLibraryPanel;
exports.MaterialsPanel = Montage.create(PanelBase, {
id : {value : "materialsPanel", writable:true, enumerable:true, configurable:true},
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
index f77d3186..3204ce50 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
@@ -29,16 +29,16 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->
-
-
-
+
+
+
-
-
-
+ }
+
+
+
+
-
+
@@ -125,7 +125,7 @@ POSSIBILITY OF SUCH DAMAGE.
-
+
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
index b5d6bb96..1cf3cec7 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
@@ -40,8 +40,8 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
},
_hasFocus: {
- enumerable: false,
- value: false
+ enumerable: false,
+ value: false
},
didCreate: {
@@ -98,10 +98,10 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
},
_showMaterialPopup: {
- enumerable: false,
- value: function (materialObj) {
+ enumerable: false,
+ value: function (materialObj) {
- if(!this._materialPopup)
+ if(!this._materialPopup)
{
this._materialPopup = Popup.create();
this._materialPopup.content = this._materialInfo;
@@ -113,15 +113,15 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
materialID = materialObj.materialId;
this._materialInfo.loadMaterials(materialID, materialObj.useSelection, materialObj.whichMaterial);
- }
+ }
},
handleHideMaterialPopup: {
- enumerable: false,
- value: function (event) {
+ enumerable: false,
+ value: function (event) {
if(this._materialPopup){
this._materialPopup.hide();
}
- }
+ }
}
});
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.
.mp_properties_list > .mp_property > .colortoolbar
{
- width: 27px !important;
- height: 27px !important;
+ width: 27px !important;
+ height: 27px !important;
overflow:hidden !important;
margin-top: -6px;
}
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
POSSIBILITY OF SUCH DAMAGE.
-->
-
+
-
+
-
+
-
-
+
-
-
+
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, {
serializable: true
},
- // Material Properties
+ // Material Properties
_materialName: {
enumerable: true,
value: ""
},
- _useSelection: { value: false, enumerable: true },
- _whichMaterial: { value: "fill", enumerable: true },
- _originalValues: {value: null, enumerable: true },
-
- captureAction: {
- value:function(event) {
- switch(event._currentTarget.label)
- {
- case "Cancel":
- console.log("Cancel material edit");
- this.revertToOriginalValues();
- break;
- case "OK":
- console.log("Committing material with the following values:");
+ _useSelection: { value: false, enumerable: true },
+ _whichMaterial: { value: "fill", enumerable: true },
+ _originalValues: {value: null, enumerable: true },
+
+ captureAction: {
+ value:function(event) {
+ switch(event._currentTarget.label)
+ {
+ case "Cancel":
+ console.log("Cancel material edit");
+ this.revertToOriginalValues();
+ break;
+ case "OK":
+ console.log("Committing material with the following values:");
for(var i=0, len=this.materialsProperties.childComponents.length; i< len; i++)
{
var childControl = this.materialsProperties.childComponents[i];
@@ -88,53 +88,53 @@ exports.MaterialsPopup = Montage.create(Component, {
console.log("--------------");
}
- break;
- }
+ break;
+ }
// Notify Materials Library to close popup
NJevent("hideMaterialPopup");
- }
- },
-
- revertToOriginalValues:
- {
- value: function()
- {
- if (this._originalValues)
- {
- this._material.importJSON( this._originalValues );
-
- if (this._useSelection)
- {
- var selection = this.application.ninja.selectedElements;
- if (selection && (selection.length > 0))
- {
- var nObjs = selection.length;
- for (var iObj=0; iObj 0))
+ {
+ var nObjs = selection.length;
+ for (var iObj=0; iObj 0))
- {
- var nObjs = selection.length;
- for (var iObj=0; iObj 0))
- {
- var index = value.lastIndexOf( "/" );
- if (index < 0) index = value.lastIndexOf( "\\" );
- if (index >= 0)
- {
- value = value.substr( index+1 );
- value = "assets/images/" + value;
- }
- rtnValue = value.slice(0);
- }
- break;
-
- case "checkbox":
- rtnValue = value;
- break;
-
- default:
- console.log( "unrecognized material control type: " + type );
- break;
- }
- return rtnValue;
- }
- },
+ applyProperty:
+ {
+ value: function( propLabel, propValue)
+ {
+ // find the property lable in the array
+ // This assumes no duplication in labels
+ if (this._propLabels)
+ {
+ // the label cones through with a trailing ':'. remove that
+ var ch = propLabel[ propLabel.length - 1];
+ if (ch == ':')
+ propLabel = propLabel.substr(0, propLabel.length - 1);
+
+ var index;
+ var nProps = this._propLabels.length;
+ for (var i=0; i 0))
+ {
+ var nObjs = selection.length;
+ for (var iObj=0; iObj 0))
+ {
+ var index = value.lastIndexOf( "/" );
+ if (index < 0) index = value.lastIndexOf( "\\" );
+ if (index >= 0)
+ {
+ value = value.substr( index+1 );
+ value = "assets/images/" + value;
+ }
+ rtnValue = value.slice(0);
+ }
+ break;
+
+ case "checkbox":
+ rtnValue = value;
+ break;
+
+ default:
+ console.log( "unrecognized material control type: " + type );
+ break;
+ }
+ return rtnValue;
+ }
+ },
////////////////////////////////////////////////////////////////////
- //
- prepareForDraw: {
- enumerable: false,
- value: function() {
+ //
+ prepareForDraw: {
+ enumerable: false,
+ value: function() {
this.cancelButton.addEventListener("action", this, true);
this.okButton.addEventListener("action", this, true);
}
},
- ////////////////////////////////////////////////////////////////////
- //
- didDraw: {
- enumerable: false,
- value: function() {
+ ////////////////////////////////////////////////////////////////////
+ //
+ didDraw: {
+ enumerable: false,
+ value: function() {
this.materialTitle.innerHTML = this._materialName;
- }
- },
-
- //Garbage collection (Manual method)
- destroy: {
- enumerable: false,
- value: function() {
- // add cleanup routines here
- }
- },
-
- loadMaterials:
- {
- enumerable: true,
- value: function(materialID, useSelection, whichMaterial)
- {
- //TODO - Hack to force repetition to draw. Setting .length = 0 did not work.
- this.materialsData = [];
-
- var material;
- this._materialName = materialID;
- if (useSelection)
- {
- this._useSelection = true;
- var selection = this.application.ninja.selectedElements;
- if (selection && (selection.length > 0))
- {
- var canvas = selection[0];
- var obj;
- this._whichMaterial = whichMaterial;
- if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj;
- if (obj)
- material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial();
- }
- }
- else
- {
- this._useSelection = false;
-
- if(
- (materialID === "Bump Metal") ||
- (materialID === "Deform") ||
- (materialID === "Flat") ||
- (materialID === "Flag") ||
- (materialID === "Fly") ||
- (materialID === "Julia") ||
- (materialID === "Keleidoscope") ||
- (materialID === "Linear Gradient") ||
- (materialID === "Mandel") ||
- (materialID === "Paris") ||
- (materialID === "Plasma") ||
- (materialID === "Pulse") ||
- (materialID === "Radial Blur") ||
- (materialID === "Radial Gradient") ||
- (materialID === "Raiders") ||
- (materialID === "Relief Tunnel") ||
- (materialID === "Square Tunnel") ||
- (materialID === "Star") ||
- (materialID === "Taper") ||
- (materialID === "Tunnel") ||
- (materialID === "Twist") ||
- (materialID === "Twist Vertex") ||
- (materialID === "Uber") ||
- (materialID === "Water") ||
- (materialID === "Z-Invert")
- )
- {
- material = MaterialsModel.getMaterial( materialID );
- }
- }
-
- if (material)
- {
- this._material = material;
- this._originalValues = material.exportJSON();
- this.materialsData = this.getMaterialData( material );
- }
- else
- {
- this.materialsData = this[materialID];
- }
- this.needsDraw = true;
- }
- },
-
- getMaterialData:
- {
- value: function( material )
- {
- // declare the array to hold the results
- var rtnArray = [];
-
- var propNames = [], propValues = [], propTypes = [], propLabels = [];
- this._propNames = propNames;
- this._propValues = propValues;
- this._propTypes = propTypes;
- this._propLabels = propLabels;
- material.getAllProperties( propNames, propValues, propTypes, propLabels);
- var n = propNames.length;
- for (var i=0; i 0))
+ {
+ var canvas = selection[0];
+ var obj;
+ this._whichMaterial = whichMaterial;
+ if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj;
+ if (obj)
+ material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial();
+ }
+ }
+ else
+ {
+ this._useSelection = false;
+
+ if(
+ (materialID === "Bump Metal") ||
+ (materialID === "Deform") ||
+ (materialID === "Flat") ||
+ (materialID === "Flag") ||
+ (materialID === "Fly") ||
+ (materialID === "Julia") ||
+ (materialID === "Keleidoscope") ||
+ (materialID === "Linear Gradient") ||
+ (materialID === "Mandel") ||
+ (materialID === "Paris") ||
+ (materialID === "Plasma") ||
+ (materialID === "Pulse") ||
+ (materialID === "Radial Blur") ||
+ (materialID === "Radial Gradient") ||
+ (materialID === "Raiders") ||
+ (materialID === "Relief Tunnel") ||
+ (materialID === "Square Tunnel") ||
+ (materialID === "Star") ||
+ (materialID === "Taper") ||
+ (materialID === "Tunnel") ||
+ (materialID === "Twist") ||
+ (materialID === "Twist Vertex") ||
+ (materialID === "Uber") ||
+ (materialID === "Water") ||
+ (materialID === "Z-Invert")
+ )
+ {
+ material = MaterialsModel.getMaterial( materialID );
+ }
+ }
+
+ if (material)
+ {
+ this._material = material;
+ this._originalValues = material.exportJSON();
+ this.materialsData = this.getMaterialData( material );
+ }
+ else
+ {
+ this.materialsData = this[materialID];
+ }
+ this.needsDraw = true;
+ }
+ },
+
+ getMaterialData:
+ {
+ value: function( material )
+ {
+ // declare the array to hold the results
+ var rtnArray = [];
+
+ var propNames = [], propValues = [], propTypes = [], propLabels = [];
+ this._propNames = propNames;
+ this._propValues = propValues;
+ this._propTypes = propTypes;
+ this._propLabels = propLabels;
+ material.getAllProperties( propNames, propValues, propTypes, propLabels);
+ var n = propNames.length;
+ for (var i=0; i 2)
- {
- obj["defaults"]["data"][2] =
- {
- "label": "Z",
- "description": "Z value",
- "controlType": "HotText",
- "defaults":
- {
- "minValue": -1.e8,
- "maxValue": 1.e8,
- "value": value[2]
- }
- }
- }
-
- return obj;
- }
- },
+ }
+
+ if (dimen > 2)
+ {
+ obj["defaults"]["data"][2] =
+ {
+ "label": "Z",
+ "description": "Z value",
+ "controlType": "HotText",
+ "defaults":
+ {
+ "minValue": -1.e8,
+ "maxValue": 1.e8,
+ "value": value[2]
+ }
+ }
+ }
+
+ return obj;
+ }
+ },
// _dummyData1
CheckerBoard: {
@@ -800,11 +800,11 @@ exports.MaterialsPopup = Montage.create(Component, {
},
_materialsData: {
- enumerable: true,
+ enumerable: true,
serializable: true,
- value: []
+ value: []
- },
+ },
materialsData: {
enumerable: true,
--
cgit v1.2.3
From 04343eda8c2f870b0da55cfdc8003c99fe1cc4de Mon Sep 17 00:00:00 2001
From: Kris Kowal
Date: Fri, 6 Jul 2012 11:53:10 -0700
Subject: Remove trailing spaces
---
.../materials-library-panel.reel/materials-library-panel.js | 2 +-
js/panels/Materials/materials-popup.reel/materials-popup.js | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
(limited to 'js/panels/Materials')
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
index 1cf3cec7..98a87b07 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
@@ -96,7 +96,7 @@ exports.MaterialsLibraryPanel = Montage.create(Component, {
enumerable:true,
serializable: true
},
-
+
_showMaterialPopup: {
enumerable: false,
value: function (materialObj) {
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js
index cecb0a71..12a86c47 100755
--- a/js/panels/Materials/materials-popup.reel/materials-popup.js
+++ b/js/panels/Materials/materials-popup.reel/materials-popup.js
@@ -202,7 +202,7 @@ exports.MaterialsPopup = Montage.create(Component, {
var ch = propLabel[ propLabel.length - 1];
if (ch == ':')
propLabel = propLabel.substr(0, propLabel.length - 1);
-
+
var index;
var nProps = this._propLabels.length;
for (var i=0; i
-
+
--
cgit v1.2.3
From 9461e7731f91dd03a15b0a62667e722a60c84721 Mon Sep 17 00:00:00 2001
From: Kris Kowal
Date: Fri, 6 Jul 2012 12:44:57 -0700
Subject: Remove byte order markers (BOM)
---
.../Materials/materials-library-panel.reel/materials-library-panel.html | 2 +-
js/panels/Materials/materials-popup.reel/materials-popup.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'js/panels/Materials')
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
index 6f2ea27a..bda89b2c 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
@@ -1,4 +1,4 @@
-
+