Make favicon paths configurable

The favicons were hardcoded in launch.html, so
rebranding the page required editing the template.

The paths now come from the favicons block in
assets/config.json. Missing keys keep the defaults
from launch.html.
This commit is contained in:
stefan.tollkuehn committed 2026-11-02 15:48:19 +01:00
1 parent 9184f60461
commit 0e4ba86c38
4 files changed
+42 -3

No files matched your search

+33
View File
@@ -309,6 +309,33 @@ function applyLogo() {
logoBar.classList.remove("hidden");
}
/* ============================================================
* FAVICONS
* ============================================================
*/
/*
* Overwrite the default icons from launch.html
* (CONFIG.favicons in assets/config.json).
*/
function applyFavicons() {
if (!CONFIG.favicons) {
return;
}
if (CONFIG.favicons.ico) {
faviconIco.href = CONFIG.favicons.ico;
}
if (CONFIG.favicons.svg) {
faviconSvg.href = CONFIG.favicons.svg;
}
if (CONFIG.favicons.appleTouch) {
appleTouchIcon.href = CONFIG.favicons.appleTouch;
}
}
/* ============================================================
* NEXTCLOUD BUTTON
* ============================================================
@@ -412,6 +439,11 @@ const invalidRoomName = document.getElementById("invalidRoomName");
const logoBar = document.getElementById("logoBar");
const logoImage = document.getElementById("logoImage");
/* Favicon DOM elements */
const faviconIco = document.getElementById("faviconIco");
const faviconSvg = document.getElementById("faviconSvg");
const appleTouchIcon = document.getElementById("appleTouchIcon");
/* Theme DOM elements */
const themeButton = document.getElementById("themeButton");
const themeIconSun = document.getElementById("themeIconSun");
@@ -1574,6 +1606,7 @@ async function start() {
applyBackgroundImage();
applyLogo();
applyFavicons();
applyNextcloudButton();
applyAdhocButton();