|
@@ -19,31 +19,11 @@ Menubar.File = function ( editor ) {
|
|
|
options.setDisplay( 'none' );
|
|
|
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();
|
|
|
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 () {
|
|
|
|
|
|
if ( confirm( 'Are you sure?' ) ) {
|
|
@@ -64,16 +44,22 @@ Menubar.File = function ( editor ) {
|
|
|
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();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Share' );
|
|
|
+ option.setTextContent( 'Import' );
|
|
|
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 );
|
|
@@ -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;
|
|
|
|
|
|
}
|