Make legal notice link configurable
The legal notice link in the navbar was hardcoded to the bnvb website. Deployments without that legal notice showed a dead link to a foreign site. Move the URL into assets/config.json (legalNotice), like the Nextcloud and adhoc buttons. The link stays hidden unless the entry is configured.
This commit is contained in:
1 parent
49a3d90dc5
commit
217a076120
3 files changed
+21
-1
No files matched your search
@@ -2,6 +2,7 @@
|
|||||||
"jitsiLauncher": "server.domain.tld/subdir",
|
"jitsiLauncher": "server.domain.tld/subdir",
|
||||||
"jitsiHost": "jit.si",
|
"jitsiHost": "jit.si",
|
||||||
"nextcloudBase": "https://cloud.domain.tld",
|
"nextcloudBase": "https://cloud.domain.tld",
|
||||||
|
"legalNotice": "https://www.domain.tld/legal-notice",
|
||||||
"allowAdhocMeetings": true,
|
"allowAdhocMeetings": true,
|
||||||
"launchTimeout": 2000,
|
"launchTimeout": 2000,
|
||||||
"backgroundImage": "path/to/backgroundimage",
|
"backgroundImage": "path/to/backgroundimage",
|
||||||
|
|||||||
@@ -382,6 +382,23 @@ function applyAdhocButton() {
|
|||||||
createAdhocButton.classList.remove("hidden");
|
createAdhocButton.classList.remove("hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ============================================================
|
||||||
|
* LEGAL NOTICE LINK
|
||||||
|
* ============================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Only show if a legal notice URL is configured
|
||||||
|
* (CONFIG.legalNotice in assets/config.json).
|
||||||
|
*/
|
||||||
|
function applyLegalNoticeLink() {
|
||||||
|
if (!CONFIG.legalNotice || !legalNoticeLink) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
legalNoticeLink.href = CONFIG.legalNotice;
|
||||||
|
legalNoticeLink.classList.remove("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
* DOM elements
|
* DOM elements
|
||||||
* ============================================================
|
* ============================================================
|
||||||
@@ -432,6 +449,7 @@ const copyAdhocLinkButton = document.getElementById("copyAdhocLinkButton");
|
|||||||
const navbar = document.querySelector(".navbar");
|
const navbar = document.querySelector(".navbar");
|
||||||
const navToggle = document.getElementById("navToggle");
|
const navToggle = document.getElementById("navToggle");
|
||||||
const navActions = document.getElementById("navActions");
|
const navActions = document.getElementById("navActions");
|
||||||
|
const legalNoticeLink = document.getElementById("legalNoticeLink");
|
||||||
|
|
||||||
/* Language menu DOM elements */
|
/* Language menu DOM elements */
|
||||||
const langMenu = document.getElementById("langMenu");
|
const langMenu = document.getElementById("langMenu");
|
||||||
@@ -1621,6 +1639,7 @@ async function start() {
|
|||||||
applyFavicons();
|
applyFavicons();
|
||||||
applyNextcloudButton();
|
applyNextcloudButton();
|
||||||
applyAdhocButton();
|
applyAdhocButton();
|
||||||
|
applyLegalNoticeLink();
|
||||||
|
|
||||||
await loadTranslations();
|
await loadTranslations();
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div id="navActions" class="nav-actions">
|
<div id="navActions" class="nav-actions">
|
||||||
<a class="button secondary" href="https://www.bnvb-ingenieure.de/impressum" target="_blank" rel="noopener noreferrer" data-i18n="legal_notice">
|
<a id="legalNoticeLink" class="button secondary hidden" href="#" target="_blank" rel="noopener noreferrer" data-i18n="legal_notice">
|
||||||
Legal Notice
|
Legal Notice
|
||||||
</a>
|
</a>
|
||||||
<a class="button secondary" href="https://git.bnvb.eu/stefan.tollkuehn/jitsi-launch" target="_blank" rel="noopener noreferrer" data-i18n="source">
|
<a class="button secondary" href="https://git.bnvb.eu/stefan.tollkuehn/jitsi-launch" target="_blank" rel="noopener noreferrer" data-i18n="source">
|
||||||
|
|||||||
Reference in new issue
Block a user