Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Export JSON = Download #28221

Merged
merged 1 commit into from May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions editor/js/Sidebar.Geometry.js
Expand Up @@ -192,11 +192,7 @@ function SidebarGeometry( editor ) {

}

const left = ( screen.width - 500 ) / 2;
const top = ( screen.height - 500 ) / 2;

const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain;charset=utf-8' } ) );
window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
Copy link
Collaborator

@Mugen87 Mugen87 Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrdoob Was there a special reason for showing the JSON in a new window? Maybe @ycw and myself overlook a use case here...

editor.utils.save( new Blob( [ output ] ), `${ geometryName.getValue() || 'geometry' }.json` );

} );
container.add( exportJson );
Expand Down
6 changes: 1 addition & 5 deletions editor/js/Sidebar.Material.js
Expand Up @@ -445,11 +445,7 @@ function SidebarMaterial( editor ) {

}

const left = ( screen.width - 500 ) / 2;
const top = ( screen.height - 500 ) / 2;

const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain;charset=utf-8' } ) );
window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
editor.utils.save( new Blob( [ output ] ), `${ materialName.getValue() || 'material' }.json` );

} );
container.add( exportJson );
Expand Down
5 changes: 1 addition & 4 deletions editor/js/Sidebar.Object.js
Expand Up @@ -409,11 +409,8 @@ function SidebarObject( editor ) {

}

const left = ( screen.width - 500 ) / 2;
const top = ( screen.height - 500 ) / 2;

const url = URL.createObjectURL( new Blob( [ output ], { type: 'text/plain;charset=utf-8' } ) );
window.open( url, '_blank', `location=no,left=${left},top=${top},width=500,height=500` );
editor.utils.save( new Blob( [ output ] ), `${ objectName.getValue() || 'object' }.json` );

} );
container.add( exportJson );
Expand Down