From 07df6989a152823135800c6c627f2b9285de8b14 Mon Sep 17 00:00:00 2001 From: Marek Zeman Date: Thu, 17 Oct 2024 21:59:44 +0200 Subject: [PATCH 1/2] Optimize the Web-Editor build and styles --- misc/dist/html/editor.html | 377 +++++--------------- misc/dist/html/manifest.json | 2 +- misc/dist/html/service-worker.js | 29 +- misc/dist/html/styles.css | 242 +++++++++++++ platform/web/emscripten_helpers.py | 31 +- platform/web/js/libs/library_godot_input.js | 3 +- 6 files changed, 358 insertions(+), 326 deletions(-) create mode 100644 misc/dist/html/styles.css diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index ef19c0032ec..3621116f972 100644 --- a/misc/dist/html/editor.html +++ b/misc/dist/html/editor.html @@ -9,8 +9,8 @@ - - + + @@ -24,211 +24,7 @@ Redot Engine Web Editor (___GODOT_VERSION___) - +
Important - Please read
- - - - - +
+ +
+
+ + +
+
+ + +
@@ -345,14 +147,15 @@

Important - Please read

- + - + - - + diff --git a/misc/dist/html/service-worker.js b/misc/dist/html/service-worker.js index 64fda4ebd2b..6bf91433e1d 100644 --- a/misc/dist/html/service-worker.js +++ b/misc/dist/html/service-worker.js @@ -154,7 +154,7 @@ self.addEventListener('message', (event) => { if (msg === 'claim') { self.skipWaiting().then(() => self.clients.claim()); } else if (msg === 'clear') { - void caches.delete(CACHE_NAME); + caches.delete(CACHE_NAME); } else if (msg === 'update') { self.skipWaiting().then(() => self.clients.claim()).then(() => self.clients.matchAll()).then((all) => all.forEach((c) => c.navigate(c.url))); } diff --git a/platform/web/js/libs/library_godot_input.js b/platform/web/js/libs/library_godot_input.js index 83474716819..d4c3f27b9bc 100644 --- a/platform/web/js/libs/library_godot_input.js +++ b/platform/web/js/libs/library_godot_input.js @@ -47,7 +47,9 @@ const GodotIME = { ime_active: function (active) { function focus_timer() { - if (!GodotIME.ime) return; + if (!GodotIME.ime) { + return; + } GodotIME.active = true; GodotIME.ime.focus(); }