Daniel 9 lat temu
rodzic
commit
7c872a3301

+ 2 - 2
editor/js/Cmd.js

@@ -10,7 +10,7 @@
 
 Cmd = function ( editorRef ) {
 
-	this.id = -1;
+	this.id = - 1;
 	this.inMemory = false;
 	this.updatable = false;
 	this.type = '';
@@ -43,4 +43,4 @@ Cmd.prototype.fromJSON = function ( json ) {
 	this.id = json.id;
 	this.name = json.name;
 
-};
+};

+ 1 - 1
editor/js/CmdMoveObject.js

@@ -103,4 +103,4 @@ CmdMoveObject.prototype = {
 
 	}
 
-};
+};

+ 4 - 4
editor/js/CmdMultiCmds.js

@@ -24,7 +24,7 @@ CmdMultiCmds.prototype = {
 
 		this.editor.signals.sceneGraphChanged.active = false;
 
-		for ( var i = 0; i < this.cmdArray.length; i++ ) {
+		for ( var i = 0; i < this.cmdArray.length; i ++ ) {
 
 			this.cmdArray[ i ].execute();
 
@@ -39,7 +39,7 @@ CmdMultiCmds.prototype = {
 
 		this.editor.signals.sceneGraphChanged.active = false;
 
-		for ( var i = this.cmdArray.length - 1; i >= 0; i-- ) {
+		for ( var i = this.cmdArray.length - 1; i >= 0; i -- ) {
 
 			this.cmdArray[ i ].undo();
 
@@ -55,7 +55,7 @@ CmdMultiCmds.prototype = {
 		var output = Cmd.prototype.toJSON.call( this );
 
 		var cmds = [];
-		for ( var i = 0; i < this.cmdArray.length; i++ ) {
+		for ( var i = 0; i < this.cmdArray.length; i ++ ) {
 
 			cmds.push( this.cmdArray[ i ].toJSON() );
 
@@ -71,7 +71,7 @@ CmdMultiCmds.prototype = {
 		Cmd.prototype.fromJSON.call( this, json );
 
 		var cmds = json.cmds;
-		for ( var i = 0; i < cmds.length; i++ ) {
+		for ( var i = 0; i < cmds.length; i ++ ) {
 
 			var cmd = new window[ cmds[ i ].type ]();	// creates a new object of type "json.type"
 			cmd.fromJSON( cmds[ i ] );

+ 1 - 1
editor/js/CmdRemoveObject.js

@@ -138,4 +138,4 @@ CmdRemoveObject.prototype = {
 
 	}
 
-};
+};

+ 1 - 0
editor/js/CmdRemoveScript.js

@@ -22,6 +22,7 @@ CmdRemoveScript = function ( object, script ) {
 		this.index = this.editor.scripts[ this.object.uuid ].indexOf( this.script );
 
 	}
+
 };
 
 CmdRemoveScript.prototype = {

+ 1 - 0
editor/js/CmdSetMaterial.js

@@ -111,6 +111,7 @@ CmdSetMaterial.prototype = {
 			return materials[ json.materials[ 0 ].uuid ];
 
 		}
+
 	}
 
 };

+ 1 - 1
editor/js/CmdSetPosition.js

@@ -79,4 +79,4 @@ CmdSetPosition.prototype = {
 
 	}
 
-};
+};

+ 4 - 4
editor/js/CmdSetRotation.js

@@ -19,7 +19,7 @@ CmdSetRotation = function ( object, newRotation, optionalOldRotation ) {
 
 	this.object = object;
 
-	if ( object !== undefined && newRotation !== undefined) {
+	if ( object !== undefined && newRotation !== undefined ) {
 
 		this.oldRotation = object.rotation.clone();
 		this.newRotation = newRotation.clone();
@@ -75,9 +75,9 @@ CmdSetRotation.prototype = {
 		Cmd.prototype.fromJSON.call( this, json );
 
 		this.object = this.editor.objectByUuid( json.objectUuid );
-		this.oldRotation = new THREE.Euler().fromArray(json.oldRotation);
-		this.newRotation = new THREE.Euler().fromArray(json.newRotation);
+		this.oldRotation = new THREE.Euler().fromArray( json.oldRotation );
+		this.newRotation = new THREE.Euler().fromArray( json.newRotation );
 
 	}
 
-};
+};

+ 1 - 1
editor/js/CmdSetScale.js

@@ -80,4 +80,4 @@ CmdSetScale.prototype = {
 
 	}
 
-};
+};

+ 1 - 0
editor/js/CmdSetScene.js

@@ -30,6 +30,7 @@ CmdSetScene = function ( scene ) {
 		}
 
 	}
+
 };
 
 CmdSetScene.prototype = {

+ 13 - 13
editor/js/History.js

@@ -68,7 +68,7 @@ History.prototype = {
 			// the command is not updatable and is added as a new part of the history
 
 			this.undos.push( cmd );
-			cmd.id = ++this.idCounter;
+			cmd.id = ++ this.idCounter;
 
 		}
 		cmd.name = ( optionalName !== undefined ) ? optionalName : cmd.name;
@@ -93,7 +93,7 @@ History.prototype = {
 
 		if ( this.historyDisabled ) {
 
-			alert("Undo/Redo disabled while scene is playing.");
+			alert( "Undo/Redo disabled while scene is playing." );
 			return;
 
 		}
@@ -128,7 +128,7 @@ History.prototype = {
 
 		if ( this.historyDisabled ) {
 
-			alert("Undo/Redo disabled while scene is playing.");
+			alert( "Undo/Redo disabled while scene is playing." );
 			return;
 
 		}
@@ -166,7 +166,7 @@ History.prototype = {
 		history.undos = [];
 		history.redos = [];
 
-		if ( !this.serializationEnabled ) {
+		if ( ! this.serializationEnabled ) {
 
 			return history;
 
@@ -174,7 +174,7 @@ History.prototype = {
 
 		// Append Undos to History
 
-		for ( var i = 0 ; i < this.undos.length; i++ ) {
+		for ( var i = 0 ; i < this.undos.length; i ++ ) {
 
 			if ( this.undos[ i ].hasOwnProperty( "json" ) ) {
 
@@ -186,7 +186,7 @@ History.prototype = {
 
 		// Append Redos to History
 
-		for ( var i = 0 ; i < this.redos.length; i++ ) {
+		for ( var i = 0 ; i < this.redos.length; i ++ ) {
 
 			if ( this.redos[ i ].hasOwnProperty( "json" ) ) {
 
@@ -206,7 +206,7 @@ History.prototype = {
 
 		this.serializationEnabled = json.serializationEnabled;
 
-		for ( var i = 0; i < json.undos.length ; i++ ) {
+		for ( var i = 0; i < json.undos.length; i ++ ) {
 
 			var cmdJSON = json.undos[ i ];
 			var cmd = new window[ cmdJSON.type ]();	// creates a new object of type "json.type"
@@ -218,7 +218,7 @@ History.prototype = {
 
 		}
 
-		for ( var i = 0; i < json.redos.length ; i++ ) {
+		for ( var i = 0; i < json.redos.length; i ++ ) {
 
 			var cmdJSON = json.redos[ i ];
 			var cmd = new window[ cmdJSON.type ]();	// creates a new object of type "json.type"
@@ -249,7 +249,7 @@ History.prototype = {
 
 		if ( this.historyDisabled ) {
 
-			alert("Undo/Redo disabled while scene is playing.");
+			alert( "Undo/Redo disabled while scene is playing." );
 			return;
 
 		}
@@ -292,7 +292,7 @@ History.prototype = {
 
 	enableSerialization: function ( id ) {
 
-		if ( this.serializationEnabled ) { return; }
+		if ( this.serializationEnabled ) return;
 
 		/**
 		 * because there might be commands in this.undos and this.redos
@@ -301,7 +301,7 @@ History.prototype = {
 		 * while also calling .toJSON() on them.
 		 */
 
-		this.goToState(-1);
+		this.goToState( - 1 );
 
 		this.editor.signals.sceneGraphChanged.active = false;
 		this.editor.signals.historyChanged.active = false;
@@ -309,7 +309,7 @@ History.prototype = {
 		var cmd = this.redo();
 		while ( cmd !== undefined ) {
 
-			if ( !cmd.hasOwnProperty( "json" ) ) {
+			if ( ! cmd.hasOwnProperty( "json" ) ) {
 
 				cmd.json = cmd.toJSON();
 
@@ -329,7 +329,7 @@ History.prototype = {
 
 	disableSerialization: function () {
 
-		if ( !this.serializationEnabled ) { return; }
+		if ( ! this.serializationEnabled ) return;
 
 		this.serializationEnabled = false;
 

+ 3 - 3
editor/js/Sidebar.History.js

@@ -20,7 +20,7 @@ Sidebar.History = function ( editor ) {
 
 	// Actions
 
-	var objectActions = new UI.Select().setPosition('absolute').setRight( '8px' ).setFontSize( '11px' );
+	var objectActions = new UI.Select().setPosition( 'absolute' ).setRight( '8px' ).setFontSize( '11px' );
 	objectActions.setOptions( {
 
 		'Actions': 'Actions',
@@ -99,7 +99,7 @@ Sidebar.History = function ( editor ) {
 
 				var object = objects[ i ];
 
-				var html = pad + "<span style='color: #0000cc '>" + enumerator++ + ". Undo: " + object.name + "</span>";
+				var html = pad + "<span style='color: #0000cc '>" + enumerator ++ + ". Undo: " + object.name + "</span>";
 
 				options.push( { value: object.id, html: html } );
 
@@ -114,7 +114,7 @@ Sidebar.History = function ( editor ) {
 
 				var object = objects[ i ];
 
-				var html = pad + "<span style='color: #71544e'>" + enumerator++ + ". Redo: " +  object.name + "</span>";
+				var html = pad + "<span style='color: #71544e'>" + enumerator ++ + ". Redo: " +  object.name + "</span>";
 
 				options.push( { value: object.id, html: html } );