From b3ad8718ebbea6952cd7c6200581ef6ca4570a05 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 | 388 +++++--------------- 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 | 72 ++-- 6 files changed, 389 insertions(+), 375 deletions(-) create mode 100644 misc/dist/html/styles.css diff --git a/misc/dist/html/editor.html b/misc/dist/html/editor.html index 3fc24e6b76b..eed0c8553e4 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 f0c973242b3..24f2c9b0033 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(); }