From 1acb80536b94635937d28f2368b83452af3a1e38 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 8 Mar 2025 15:34:29 +0200 Subject: [PATCH] Refactor assets loading * move fonts first * move CSS and JS along with the rest * move default auto theme media checks to the HEAD instead of imports Also, use `script defer`. This makes the JS files non-blocking. Signed-off-by: XhmikosR --- gravity.lp | 2 +- groups-clients.lp | 10 +++---- groups-domains.lp | 8 ++--- groups-lists.lp | 8 ++--- groups.lp | 8 ++--- index.lp | 4 +-- interfaces.lp | 2 +- login.lp | 4 +-- messages.lp | 2 +- network.lp | 4 +-- queries.lp | 8 ++--- scripts/lua/footer.lp | 2 +- scripts/lua/header.lp | 45 +++++++++++++++-------------- scripts/lua/header_authenticated.lp | 24 +++++++-------- search.lp | 2 +- settings-all.lp | 6 ++-- settings-api.lp | 10 +++---- settings-dhcp.lp | 8 ++--- settings-dns.lp | 6 ++-- settings-dnsrecords.lp | 10 +++---- settings-privacy.lp | 6 ++-- settings-system.lp | 10 +++---- settings-teleporter.lp | 6 ++-- style/themes/default-auto.css | 6 ---- taillog.lp | 2 +- 25 files changed, 100 insertions(+), 103 deletions(-) delete mode 100644 style/themes/default-auto.css diff --git a/gravity.lp b/gravity.lp index c2312acd..aaef944a 100644 --- a/gravity.lp +++ b/gravity.lp @@ -27,5 +27,5 @@ mg.include('scripts/lua/header_authenticated.lp','r') - + diff --git a/groups-clients.lp b/groups-clients.lp index 061bd0a4..5fd1e043 100644 --- a/groups-clients.lp +++ b/groups-clients.lp @@ -95,10 +95,10 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - - - - + + + + + diff --git a/groups-domains.lp b/groups-domains.lp index c1aa01fa..58b64c08 100644 --- a/groups-domains.lp +++ b/groups-domains.lp @@ -156,9 +156,9 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - - - + + + + diff --git a/groups-lists.lp b/groups-lists.lp index b82204ea..3e94e83b 100644 --- a/groups-lists.lp +++ b/groups-lists.lp @@ -94,9 +94,9 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - - - + + + + diff --git a/groups.lp b/groups.lp index 06db01da..dcf4691d 100644 --- a/groups.lp +++ b/groups.lp @@ -79,9 +79,9 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - - - + + + + diff --git a/index.lp b/index.lp index 36998d83..f5b3513e 100644 --- a/index.lp +++ b/index.lp @@ -279,7 +279,7 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - + + diff --git a/interfaces.lp b/interfaces.lp index d3f1a915..2d5f02ec 100644 --- a/interfaces.lp +++ b/interfaces.lp @@ -32,5 +32,5 @@ mg.include('scripts/lua/header_authenticated.lp','r') - + diff --git a/login.lp b/login.lp index 73641f89..9558ae41 100644 --- a/login.lp +++ b/login.lp @@ -117,7 +117,7 @@ mg.include('scripts/lua/header.lp','r') Donate if you found this useful. - - + + diff --git a/messages.lp b/messages.lp index 23968958..9bf440bf 100644 --- a/messages.lp +++ b/messages.lp @@ -41,6 +41,6 @@ mg.include('scripts/lua/header_authenticated.lp','r') - + diff --git a/network.lp b/network.lp index 75545221..c4566a36 100644 --- a/network.lp +++ b/network.lp @@ -64,7 +64,7 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - + + diff --git a/queries.lp b/queries.lp index baeaa1b4..9b36ad67 100644 --- a/queries.lp +++ b/queries.lp @@ -194,9 +194,9 @@ mg.include('scripts/lua/header_authenticated.lp','r') - - - - + + + + diff --git a/scripts/lua/footer.lp b/scripts/lua/footer.lp index 34885011..eb14d072 100644 --- a/scripts/lua/footer.lp +++ b/scripts/lua/footer.lp @@ -66,7 +66,7 @@ end - + diff --git a/scripts/lua/header.lp b/scripts/lua/header.lp index 0e570bf3..a2130365 100644 --- a/scripts/lua/header.lp +++ b/scripts/lua/header.lp @@ -64,18 +64,8 @@ is_authenticated = mg.request_info.is_authenticated - - - - - - - - @@ -84,13 +74,20 @@ is_authenticated = mg.request_info.is_authenticated + + + + -"> + + @@ -102,20 +99,26 @@ if startsWith(scriptname, 'groups') then + - + - + + + + + + - - - - - - - + + + + + + + diff --git a/scripts/lua/header_authenticated.lp b/scripts/lua/header_authenticated.lp index ff0e9334..277dcf72 100644 --- a/scripts/lua/header_authenticated.lp +++ b/scripts/lua/header_authenticated.lp @@ -9,18 +9,18 @@ ]]-- mg.include('header.lp','r') ?> - - - - - - - - - - - - + + + + + + + + + + + +