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:
1 parent
9184f60461
commit
0e4ba86c38
4 files changed
+42
-3
No files matched your search
@@ -18,6 +18,7 @@ Rename `assets/config.json.sample` to `assets/config.json`.
|
||||
| `launchTimeout` | Timeout in ms before the browser fallback is shown after trying to start the jitsi-meet-electron client. |
|
||||
| `backgroundImage` | Path to the page background image. Empty: no background. |
|
||||
| `logo` | Path to the logo shown in the logo bar. Empty: logo bar stays hidden. |
|
||||
| `favicons` | Paths to the page icons: `ico` (fallback icon), `svg` (icon), `appleTouch` (Apple touch icon). The values from `launch.html` are kept if a key is missing. |
|
||||
| `downloads` | Download URLs for the jitsi-meet clients, shown in the fallback view per detected OS: `windows`, `macos`, `linux`, `ios`, `android`. |
|
||||
|
||||
## Third-party assets
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
"launchTimeout": 2000,
|
||||
"backgroundImage": "path/to/backgroundimage",
|
||||
"logo": "path/to/logo",
|
||||
"favicons": {
|
||||
"ico": "path/to/favicon.ico",
|
||||
"svg": "path/to/favicon.svg",
|
||||
"appleTouch": "path/to/apple-touch-icon.png"
|
||||
},
|
||||
"downloads": {
|
||||
"windows": "https://github.com/jitsi/jitsi-meet-electron/releases/latest/download/jitsi-meet.exe",
|
||||
"macos": "https://github.com/jitsi/jitsi-meet-electron/releases/latest/download/jitsi-meet.dmg",
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
+3
-3
@@ -4,9 +4,9 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Jitsi Meeting</title>
|
||||
<link href="assets/images/favicon.ico" rel="alternate icon">
|
||||
<link href="assets/images/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180">
|
||||
<link href="assets/images/favicon.svg" rel="icon" type="image/svg+xml">
|
||||
<link id="faviconIco" href="assets/images/favicon.ico" rel="alternate icon">
|
||||
<link id="appleTouchIcon" href="assets/images/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180">
|
||||
<link id="faviconSvg" href="assets/images/favicon.svg" rel="icon" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="assets/css/launch.css">
|
||||
</head>
|
||||
|
||||
|
||||
Reference in new issue
Block a user