Commit graph

28 commits

Author SHA1 Message Date
Rémi Verschelde
06f4a28306 Update docs links still pointing to 3.4 2022-06-29 12:03:04 +02:00
Hugo Locurcio
d9acd21b46 Display a modal dialog if threads are unavailable in the web editor
Threads are required for the web editor to function. If the web server
is not correctly configured, threads won't be available.

This makes troubleshooting easier for people looking to self-host
the web editor.

(cherry picked from commit 304a286502)
2022-05-16 21:12:21 +02:00
Hugo Locurcio
695da68188
Tweak logo max width on the web editor
The logo's maximum width is now dependent on the viewport height
in addition to the page width. This prevents the "Start Godot editor"
button from overflowing the page on mobile devices (although the
"Clear persistent data" and "Web editor documentation" buttons will
still overflow for now).

(cherry picked from commit 34a4ff0cef)
2022-02-15 12:23:46 +01:00
Fabio Alessandrelli
afdfe7c03b [HTML5] Improve editor progressive web app behavior.
Ensures early claim for aggressive caching.
Adds a button to update when it detects a new version asking
confirmation due to the necessary reload.
2022-02-06 18:33:13 +01:00
Hugo Locurcio
b8a7a74264
Tweak theme color to match the Godot editor's background color
This makes for a more seamless-looking address bar/status bar
when using the web editor on a mobile device, either directly
in the brower or installed as a progressive web app.

This also specifies a theme color for the web editor's offline
fallback.

(cherry picked from commit 7ef459c2d7)
2022-01-25 18:13:59 +01:00
Max Hilbrunner
717801c9cb Fix docs links in 3.x after docs reorg 2022-01-05 11:54:52 +01:00
Fabio Alessandrelli
3a61d0990e [HTML5] Editor video driver option. Replace canvas on exit.
Default is "Auto", but can be forced to a specific WebGL version if the
automatic detection fails.

The game and editor canvas are now replaced with a new one in the exit
hooks. This helps the browser do some context cleanup, and allow us to
create a new context of a different type (WebGL/WebGL2).

Enable GLES3/WebGL2 in the Web Editor.
2021-10-19 15:52:02 +02:00
Rémi Verschelde
f0b37b1519
doc: Point URLs to 3.4 version of the online docs 2021-08-12 17:08:10 +02:00
Hugo Locurcio
1304b85c63
Add a welcome dialog to the HTML5 editor
This modal dialog displayed when the page is loaded. It can be
dismissed permanently by clicking the "OK, don't show again" button.
Clicking outside the modal will only dismiss it once.

This dialog is used to remind people that the HTML5 editor is still in
release candidate stage and isn't considered production-ready yet.

(cherry picked from commit 8b08146894)
2021-04-20 20:12:52 +02:00
Rémi Verschelde
1d20bba0c4
HTML5: Fix link to documentation on editor template 2021-03-30 11:47:43 +02:00
Hugo Locurcio
4126d27468
Add Open Graph metadata to the HTML5 editor
- Consistently use double quotes in the HTML markup.
- Define English language to assist screen readers and search engines.
- Add missing `alt` text for the logo image.
- Remove duplicate `id` for the preload project ZIP input.

(cherry picked from commit 197d391f08)
2021-03-26 13:47:53 +01:00
Rémi Verschelde
015973df04
doc: Make all tutorial links point to 3.3 branch of docs 2021-03-26 10:43:43 +01:00
Fabio Alessandrelli
64feaed39b [HTML5] Drag and drop zip in project manager.
With a very nice hack, a new hidden configuration option that delays
dropped files removal at exit.

This still leaks while the project manager is running, but will clear
memory as soon as it exits or load something.
(reminder, dropped files are reguarly removed after the signal is
emitted specifically to avoid leaks, but I prefer hacking the HTML5
config then the project manager).

(cherry picked from commit f1e810adcb)
2021-03-12 10:43:52 +01:00
Fabio Alessandrelli
d942d553ef [HTML5] Add PWA support to the editor page.
This allows to install it as an app, and provide offline support (after
the first run).
Practically, this boils down to adding a JSON file as a manifest, an
offline page to be displayed when the cached files are not avaialble,
and a JS file to cache resources and return them.

The reason for the "first run requirements" is that some browsers, will
emit an "install" by just visiting the page (to see if the JS code is
compatibile), and we do not want to force casual visitors to just
download the 10 MiB+ compressed editor WebAssembly file without pressing
the start button.

Special thanks to Hugo Locurcio (Calinou) for the initial work.
2021-03-08 17:06:41 +01:00
Fabio Alessandrelli
e3664e971b [HTML5] Make editor HTML build tag scons4-proof.
We used to have it like `$GODOT_VERSION` which caused inconsistencies
between different scons versions when substituting it.
It's now `@GODOT_VERSION@`, which is safe on both scons3 and scons4.

(cherry picked from commit 4404eb57e4)
2021-02-26 15:22:51 +01:00
Hugo Locurcio
3b4dd88e56 Improve the editor HTML template
- Darken the header tab background to match the default editor
  background color.
- Hide the distracting focus outlines for the editor and game canvas.
- Use a pure black background for the game canvas to better distinguish it
  from the editor and provide a more neutral background.
- Use a bold font weight for the Start Godot editor button on the
  loader page.
- Link to the web editor documentation on the loader page.
- Clarify what happens when clicking "OK" in the persistent data removal
  warning dialog.
- Tidy up the HTML template by removing obsolete attributes.

(cherry picked from commit 3527756943)
2021-02-25 22:37:49 +01:00
Fabio Alessandrelli
1eef8a318b [HTML5] Easier HTML templates, better deinit/cleanup. 2021-02-19 05:13:44 +01:00
Fabio Alessandrelli
5abe08f484
[HTML5] Editor: ensure canvas focus when switching tabs.
(cherry picked from commit b148ea2a64)
2021-02-11 13:17:08 +01:00
Fabio Alessandrelli
cd2a996d9e
[HTML5] Fix web editor "clear persistent data".
Was broken after update to new persistent path "/home/web_user".

(cherry picked from commit 7866cd5881)
2021-02-11 13:12:06 +01:00
Fabio Alessandrelli
2668ca7a8c [HTML5] Make home path persistent in editor.
We used to only persist specific sub-folder of /home/web_user/ when
running the Web Editor. This resulted in bad UX about default project
creation path etc.
This PR makes the whole folder persistent, move the zip preloading to a
different folder (to avoid persisting it), and automatically prompt the
user to import it if present.
2021-02-03 17:18:28 +01:00
Fabio Alessandrelli
276b831c45 [HTML5] Better editor HTML, small refactor.
Side and GDNative libraries are now added by engine.js , the dynlink pre
js had been deleted.
2021-01-25 20:16:44 +01:00
Hugo Locurcio
49c2f2fec2
Make links on the HTML5 editor more readable
This also tweaks the focus style to apply to all elements for
better keyboard navigation.

(cherry picked from commit 663466b882)
2021-01-13 16:17:08 +01:00
Hugo Locurcio
3db7ff3d82
Fix and decrease Godot logo size in the HTML5 editor loader
The logo can no longer overflow the viewport.

(cherry picked from commit d80224934e)
2020-12-29 16:02:02 +01:00
Fabio Alessandrelli
6936ac9d5d [HTML5] Add logo and favicon to editor html. 2020-12-09 18:09:30 +01:00
Hugo Locurcio
295b16dcf2 [HTML5] Improve the editor HTML template. 2020-12-09 15:35:17 +01:00
Fabio Alessandrelli
b4b1df613e [HTML5] Editor also persists cache. 2020-12-09 13:47:23 +01:00
Marcel Admiraal
e1b72e1943
Add missing javascript semi-colons.
(cherry picked from commit f42284ed07)
2020-11-17 22:25:32 +01:00
Fabio Alessandrelli
294e9752bd Add JavaScript editor html file. 2020-10-14 11:20:20 +02:00