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

Editor: Export JSON = Download #28221

merged 1 commit into from
May 13, 2024

Conversation

ycw
Copy link
Contributor

@ycw ycw commented Apr 25, 2024

Related issue: #28209

This PR changes 'EXPORT JSON' button behavior to satisfy user needs:

clicking the button will now download the JSON file instead of dumping string in a small new window.

@ycw
Copy link
Contributor Author

ycw commented Apr 25, 2024

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...

@Mugen87 Mugen87 added this to the r165 milestone May 13, 2024
@Mugen87
Copy link
Collaborator

Mugen87 commented May 13, 2024

Since it seems most users want to save the JSON in a file, this PR is an improvement. Merging.

@Mugen87 Mugen87 merged commit cb1464c into mrdoob:dev May 13, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants