Compare commits
2
Commits
0e4ba86c38
...
217a076120
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
217a076120 | ||
|
|
49a3d90dc5 |
No files matched your search
@@ -2,6 +2,7 @@
|
||||
"jitsiLauncher": "server.domain.tld/subdir",
|
||||
"jitsiHost": "jit.si",
|
||||
"nextcloudBase": "https://cloud.domain.tld",
|
||||
"legalNotice": "https://www.domain.tld/legal-notice",
|
||||
"allowAdhocMeetings": true,
|
||||
"launchTimeout": 2000,
|
||||
"backgroundImage": "path/to/backgroundimage",
|
||||
|
||||
+35
-4
@@ -12,6 +12,20 @@
|
||||
let CONFIG = {};
|
||||
const CONFIG_URL = "assets/config.json";
|
||||
|
||||
/*
|
||||
* localStorage is scoped per origin, not per path.
|
||||
* Prefix keys with the app directory so parallel
|
||||
* instances (e.g. meet.bnvb.eu/i and /p) stay
|
||||
* independent.
|
||||
*
|
||||
* "/p/launch.html" becomes "/p/"
|
||||
*/
|
||||
const STORAGE_PREFIX =
|
||||
window.location.pathname.replace(/[^/]*$/, "");
|
||||
|
||||
const LANGUAGE_KEY = STORAGE_PREFIX + "jitsiLauncherLanguage";
|
||||
const THEME_KEY = STORAGE_PREFIX + "jitsiLauncherTheme";
|
||||
|
||||
/* ============================================================
|
||||
* Translations
|
||||
* ============================================================
|
||||
@@ -34,7 +48,7 @@ function detectLanguage() {
|
||||
* Saved language choice takes precedence.
|
||||
*/
|
||||
try {
|
||||
const saved = localStorage.getItem("jitsiLauncherLanguage");
|
||||
const saved = localStorage.getItem(LANGUAGE_KEY);
|
||||
|
||||
if (saved && TRANSLATIONS[saved]) {
|
||||
return saved;
|
||||
@@ -179,7 +193,7 @@ function setLanguage(language) {
|
||||
translation = TRANSLATIONS[language];
|
||||
|
||||
try {
|
||||
localStorage.setItem("jitsiLauncherLanguage", language);
|
||||
localStorage.setItem(LANGUAGE_KEY, language);
|
||||
} catch (error) {
|
||||
/*
|
||||
* localStorage can be blocked, e.g. in private mode.
|
||||
@@ -225,8 +239,6 @@ function closeNavMenu() {
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
const THEME_KEY = "jitsiLauncherTheme";
|
||||
|
||||
function savedTheme() {
|
||||
try {
|
||||
const saved = localStorage.getItem(THEME_KEY);
|
||||
@@ -370,6 +382,23 @@ function applyAdhocButton() {
|
||||
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
|
||||
* ============================================================
|
||||
@@ -420,6 +449,7 @@ const copyAdhocLinkButton = document.getElementById("copyAdhocLinkButton");
|
||||
const navbar = document.querySelector(".navbar");
|
||||
const navToggle = document.getElementById("navToggle");
|
||||
const navActions = document.getElementById("navActions");
|
||||
const legalNoticeLink = document.getElementById("legalNoticeLink");
|
||||
|
||||
/* Language menu DOM elements */
|
||||
const langMenu = document.getElementById("langMenu");
|
||||
@@ -1609,6 +1639,7 @@ async function start() {
|
||||
applyFavicons();
|
||||
applyNextcloudButton();
|
||||
applyAdhocButton();
|
||||
applyLegalNoticeLink();
|
||||
|
||||
await loadTranslations();
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
</svg>
|
||||
</button>
|
||||
<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
|
||||
</a>
|
||||
<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