瀏覽代碼

Editor: Reordered File menu.

Mr.doob 12 年之前
父節點
當前提交
55d6ec24d2
共有 1 個文件被更改,包括 31 次插入27 次删除
  1. 31 27
      editor/js/Menubar.File.js

+ 31 - 27
editor/js/Menubar.File.js

@@ -19,31 +19,11 @@ Menubar.File = function ( editor ) {
 	options.setDisplay( 'none' );
 	options.setDisplay( 'none' );
 	container.add( options );
 	container.add( options );
 
 
-	// open
-
-	var input = document.createElement( 'input' );
-	input.type = 'file';
-	input.addEventListener( 'change', function ( event ) {
-
-		editor.loader.loadFile( input.files[ 0 ] );
-
-	} );
+	// new
 
 
 	var option = new UI.Panel();
 	var option = new UI.Panel();
 	option.setClass( 'option' );
 	option.setClass( 'option' );
-	option.setTextContent( 'Open' );
-	option.onClick( function () {
-
-		input.click();
-
-	} );
-	options.add( option );
-
-	// reset
-
-	var option = new UI.Panel();
-	option.setClass( 'option' );
-	option.setTextContent( 'Reset' );
+	option.setTextContent( 'New' );
 	option.onClick( function () {
 	option.onClick( function () {
 
 
 		if ( confirm( 'Are you sure?' ) ) {
 		if ( confirm( 'Are you sure?' ) ) {
@@ -64,16 +44,22 @@ Menubar.File = function ( editor ) {
 	options.add( new UI.HorizontalRule() );
 	options.add( new UI.HorizontalRule() );
 
 
 
 
-	// share
+	// import
+
+	var input = document.createElement( 'input' );
+	input.type = 'file';
+	input.addEventListener( 'change', function ( event ) {
+
+		editor.loader.loadFile( input.files[ 0 ] );
+
+	} );
 
 
 	var option = new UI.Panel();
 	var option = new UI.Panel();
 	option.setClass( 'option' );
 	option.setClass( 'option' );
-	option.setTextContent( 'Share' );
+	option.setTextContent( 'Import' );
 	option.onClick( function () {
 	option.onClick( function () {
 
 
-		var exporter = new THREE.ObjectExporter();
-		var string = JSON.stringify( exporter.parse( editor.scene ) );
-		window.location.hash = 'A/' + window.btoa( RawDeflate.deflate( string ) );
+		input.click();
 
 
 	} );
 	} );
 	options.add( option );
 	options.add( option );
@@ -211,6 +197,24 @@ Menubar.File = function ( editor ) {
 
 
 	};
 	};
 
 
+	options.add( new UI.HorizontalRule() );
+
+
+	// share
+
+	var option = new UI.Panel();
+	option.setClass( 'option' );
+	option.setTextContent( 'Share' );
+	option.onClick( function () {
+
+		var exporter = new THREE.ObjectExporter();
+		var string = JSON.stringify( exporter.parse( editor.scene ) );
+		window.location.hash = 'A/' + window.btoa( RawDeflate.deflate( string ) );
+
+	} );
+	options.add( option );
+
+
 	return container;
 	return container;
 
 
 }
 }