瀏覽代碼

Editor: Clean up.

heqiang 4 年之前
父節點
當前提交
c42466efcf
共有 5 個文件被更改,包括 14 次插入13 次删除
  1. 1 1
      editor/index.html
  2. 7 7
      editor/js/History.js
  3. 3 2
      editor/js/Script.js
  4. 2 2
      editor/js/Sidebar.Material.js
  5. 1 1
      editor/js/Viewport.Info.js

+ 1 - 1
editor/index.html

@@ -63,7 +63,7 @@
 
 			Number.prototype.format = function () {
 
-				return this.toString().replace( /(\d)(?=(\d{3})+(?!\d))/g, "$1," );
+				return this.toString().replace( /(\d)(?=(\d{3})+(?!\d))/g, '$1,' );
 
 			};
 

+ 7 - 7
editor/js/History.js

@@ -45,7 +45,7 @@ History.prototype = {
 			lastCmd.script === cmd.script &&
 			lastCmd.attributeName === cmd.attributeName;
 
-		if ( isUpdatableCmd && cmd.type === "SetScriptValueCommand" ) {
+		if ( isUpdatableCmd && cmd.type === 'SetScriptValueCommand' ) {
 
 			// When the cmd.type is "SetScriptValueCommand" the timeDifference is ignored
 
@@ -89,7 +89,7 @@ History.prototype = {
 
 		if ( this.historyDisabled ) {
 
-			alert( "Undo/Redo disabled while scene is playing." );
+			alert( 'Undo/Redo disabled while scene is playing.' );
 			return;
 
 		}
@@ -124,7 +124,7 @@ History.prototype = {
 
 		if ( this.historyDisabled ) {
 
-			alert( "Undo/Redo disabled while scene is playing." );
+			alert( 'Undo/Redo disabled while scene is playing.' );
 			return;
 
 		}
@@ -171,7 +171,7 @@ History.prototype = {
 
 		for ( var i = 0; i < this.undos.length; i ++ ) {
 
-			if ( this.undos[ i ].hasOwnProperty( "json" ) ) {
+			if ( this.undos[ i ].hasOwnProperty( 'json' ) ) {
 
 				history.undos.push( this.undos[ i ].json );
 
@@ -183,7 +183,7 @@ History.prototype = {
 
 		for ( var i = 0; i < this.redos.length; i ++ ) {
 
-			if ( this.redos[ i ].hasOwnProperty( "json" ) ) {
+			if ( this.redos[ i ].hasOwnProperty( 'json' ) ) {
 
 				history.redos.push( this.redos[ i ].json );
 
@@ -242,7 +242,7 @@ History.prototype = {
 
 		if ( this.historyDisabled ) {
 
-			alert( "Undo/Redo disabled while scene is playing." );
+			alert( 'Undo/Redo disabled while scene is playing.' );
 			return;
 
 		}
@@ -300,7 +300,7 @@ History.prototype = {
 		var cmd = this.redo();
 		while ( cmd !== undefined ) {
 
-			if ( ! cmd.hasOwnProperty( "json" ) ) {
+			if ( ! cmd.hasOwnProperty( 'json' ) ) {
 
 				cmd.json = cmd.toJSON();
 

+ 3 - 2
editor/js/Script.js

@@ -379,7 +379,7 @@ function Script( editor ) {
 
 					mode = 'glsl';
 					name = 'Vertex Shader';
-					source = object.material.vertexShader || "";
+					source = object.material.vertexShader || '';
 
 					break;
 
@@ -387,7 +387,7 @@ function Script( editor ) {
 
 					mode = 'glsl';
 					name = 'Fragment Shader';
-					source = object.material.fragmentShader || "";
+					source = object.material.fragmentShader || '';
 
 					break;
 
@@ -403,6 +403,7 @@ function Script( editor ) {
 					source = JSON.stringify( json, null, '\t' );
 
 			}
+
 			title.setValue( object.material.name + ' / ' + name );
 
 		}

+ 2 - 2
editor/js/Sidebar.Material.js

@@ -628,7 +628,7 @@ function SidebarMaterial( editor ) {
 
 				material = new materialClasses[ materialClass.getValue() ]();
 
-				if ( material.type === "RawShaderMaterial" ) {
+				if ( material.type === 'RawShaderMaterial' ) {
 
 					material.vertexShader = vertexShaderVariables + material.vertexShader;
 
@@ -1209,7 +1209,7 @@ function SidebarMaterial( editor ) {
 
 		if ( textureWarning ) {
 
-			console.warn( "Can't set texture, model doesn't have texture coordinates" );
+			console.warn( 'Can\'t set texture, model doesn\'t have texture coordinates' );
 
 		}
 

+ 1 - 1
editor/js/Viewport.Info.js

@@ -88,7 +88,7 @@ function ViewportInfo( editor ) {
 
 	function updateFrametime( frametime ) {
 
-		frametimeText.setValue( Number( frametime ).toFixed( 2 ) + " ms" );
+		frametimeText.setValue( Number( frametime ).toFixed( 2 ) + ' ms' );
 
 	}