Also, if saving a file is canceled, only try to cancel project save
telemetry if the save was a project save.
Also also, don't skip showing the save dialog just because a file
doesn't have an extension. Instead, just skip trying to determine
filters for the extension in this case.
Note that the code inside app.jsx is exactly what used to be in index.js
so this change causes no functional difference and just represents
preparation for upcoming changes. It simplifies at least two upcoming
changes: one wants the app code to be in a different file and the other
is simplified by JSX syntax.
Links which cause the browser to navigate to another page should be
removed or disabled in Scratch Desktop to prevent Electron from
navigating away from the editor. If we miss disabling or removing such a
link, this last-resort hook will disable navigation after the user
clicks a link.
- Closing behavior on Mac is now consistent with other platforms
- The main window is not shown until ready
- Minor code reorg to separate concerns and improve readability
The `scratch-gui` project saver uses `onbeforeunload` to request
confirmation before navigating away from an unsaved project.
Unfortunately Electron suppresses the confirmation dialog that browsers
would normally display. Instead, Electron offers a `will-prevent-unload`
event in the main process: this event fires when `onbeforeunload`
requests a confirmation dialog.
This change adds a handler for `will-prevent-unload` which displays a
quit confirmation dialog so that the overall behavior is similar to what
happens in a regular browser.
Match the versions of Webpack, Babel, and related plugins as used in
scratch-gui. That plus a few other tweaks means that this repository
builds the same with or without `npm ln scratch-gui`, and also means
that all syntax used in scratch-gui should build the same here.