add localizations for englisch and german
This commit is contained in:
1 parent
34df35d54c
commit
a47ce3650b
1 file changed
+415
-87
+415
-87
@@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Jitsi Meeting öffnen</title>
|
<title>Jitsi Meeting</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
@@ -110,7 +110,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: #181818;
|
background: #181818;
|
||||||
color: #eee;
|
color: #eee;
|
||||||
@@ -143,117 +142,373 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|
||||||
<!-- NORMALER LAUNCHER -->
|
<!-- NORMALER LAUNCHER -->
|
||||||
<div id="launcher" class="hidden">
|
<div id="launcher" class="hidden">
|
||||||
<h1>Jitsi Meeting</h1>
|
<h1 data-i18n="launcher.title">Jitsi Meeting</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Das Meeting <span class="room"><strong id="roomName"></strong></span> wird geöffnet.
|
<span data-i18n="launcher.meetingPrefix">
|
||||||
|
The meeting
|
||||||
|
</span>
|
||||||
|
<span class="room">
|
||||||
|
<strong id="roomName"></strong>
|
||||||
|
</span>
|
||||||
|
<span data-i18n="launcher.meetingSuffix">
|
||||||
|
will be opened.
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button id="openButton" class="button primary" type="button">Meeting öffnen</button>
|
<button id="openButton" class="button primary" type="button" data-i18n="launcher.openButton">
|
||||||
|
Open meeting
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- STARTVORGANG -->
|
<!-- STARTVORGANG -->
|
||||||
<div id="starting" class="hidden">
|
<div id="starting" class="hidden">
|
||||||
<h1>Jitsi Meet wird gestartet …</h1>
|
<h1 data-i18n="starting.title">
|
||||||
|
Starting Jitsi Meet …
|
||||||
|
</h1>
|
||||||
|
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<span class="spinner"></span>
|
<span class="spinner"></span>
|
||||||
Der Jitsi Meet Desktop-Client wird geöffnet.
|
<span data-i18n="starting.status">
|
||||||
|
The Jitsi Meet desktop client is being opened.
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- FALLBACK -->
|
<!-- FALLBACK -->
|
||||||
<div id="fallback" class="hidden">
|
<div id="fallback" class="hidden">
|
||||||
<h1>Jitsi Meet konnte nicht geöffnet werden</h1>
|
<h1 data-i18n="fallback.title">
|
||||||
<p>
|
Jitsi Meet could not be opened
|
||||||
Der Jitsi Meet Desktop-Client wurde möglicherweise nicht gestartet.
|
</h1>
|
||||||
|
|
||||||
|
<p data-i18n="fallback.description">
|
||||||
|
The Jitsi Meet desktop client may not have been started.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<button id="retryButton" class="button primary" type="button">Erneut versuchen</button>
|
<button id="retryButton" class="button primary" type="button" data-i18n="fallback.retryButton">
|
||||||
|
Try again
|
||||||
|
</button>
|
||||||
|
|
||||||
<!-- Windows -->
|
<!-- Windows -->
|
||||||
<div id="windowsDownload" class="download hidden">
|
<div id="windowsDownload" class="download hidden">
|
||||||
<h2>Jitsi Meet für Windows</h2>
|
<h2 data-i18n="downloads.windows.title">
|
||||||
|
Jitsi Meet for Windows
|
||||||
|
</h2>
|
||||||
|
|
||||||
<p>
|
<p data-i18n="downloads.windows.description">
|
||||||
Installiere den Jitsi Meet Desktop-Client und versuche anschließend erneut, das Meeting zu öffnen.
|
Install the Jitsi Meet desktop client and then try opening the
|
||||||
|
meeting again.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a id="windowsLink" class="button secondary" target="_blank" rel="noopener noreferrer">Jitsi für Windows herunterladen</a>
|
<a id="windowsLink" class="button secondary" target="_blank" rel="noopener noreferrer" data-i18n="downloads.windows.button">
|
||||||
|
Download Jitsi for Windows
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- macOS -->
|
<!-- macOS -->
|
||||||
<div id="macosDownload" class="download hidden">
|
<div id="macosDownload" class="download hidden">
|
||||||
<h2>Jitsi Meet für macOS</h2>
|
<h2 data-i18n="downloads.macos.title">
|
||||||
|
Jitsi Meet for macOS
|
||||||
|
</h2>
|
||||||
|
|
||||||
<p>
|
<p data-i18n="downloads.macos.description">
|
||||||
Installiere den Jitsi Meet Desktop-Client und versuche anschließend erneut, das Meeting zu öffnen.
|
Install the Jitsi Meet desktop client and then try opening the
|
||||||
|
meeting again.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a id="macosLink" class="button secondary" target="_blank" rel="noopener noreferrer">Jitsi für macOS herunterladen</a>
|
<a id="macosLink" class="button secondary" target="_blank" rel="noopener noreferrer" data-i18n="downloads.macos.button">
|
||||||
|
Download Jitsi for macOS
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Linux / unbekannt -->
|
<!-- Linux / unbekannt -->
|
||||||
<div id="otherDownload" class="download hidden">
|
<div id="otherDownload" class="download hidden">
|
||||||
<h2>Jitsi Meet Desktop</h2>
|
<h2 data-i18n="downloads.other.title">
|
||||||
|
Jitsi Meet Desktop
|
||||||
|
</h2>
|
||||||
|
|
||||||
<p>
|
<p data-i18n="downloads.other.description">
|
||||||
Für dein Betriebssystem ist kein Desktop-Download hinterlegt.
|
No desktop download is configured for your operating system.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Browser -->
|
<!-- Browser -->
|
||||||
<div class="download">
|
<div class="download">
|
||||||
<h2>Im Browser teilnehmen</h2>
|
<h2 data-i18n="browser.title">
|
||||||
|
Join in browser
|
||||||
|
</h2>
|
||||||
|
|
||||||
<p>
|
<p data-i18n="browser.description">
|
||||||
Du kannst dem Meeting auch direkt über deinen Browser beitreten.
|
You can also join the meeting directly in your browser.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a id="browserLink" class="button secondary">Im Browser beitreten</a>
|
<a id="browserLink" class="button secondary" data-i18n="browser.button">
|
||||||
|
Join in browser
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- FEHLER -->
|
<!-- FEHLER -->
|
||||||
<div id="invalidRoom" class="hidden">
|
<div id="invalidRoom" class="hidden">
|
||||||
<h1>Kein Meeting angegeben</h1>
|
<h1 data-i18n="error.title">
|
||||||
|
No meeting specified
|
||||||
|
</h1>
|
||||||
|
|
||||||
<div class="error">
|
<div class="error">
|
||||||
Bitte gib ein Meeting über den Parameter <code>?room=...</code> an.
|
<span data-i18n="error.description">
|
||||||
|
Please specify a meeting using the
|
||||||
|
</span>
|
||||||
|
<code>?room=...</code>
|
||||||
|
<span data-i18n="error.descriptionSuffix">
|
||||||
|
parameter.
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/* KONFIGURATION */
|
/* ============================================================
|
||||||
|
* KONFIGURATION
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
const CONFIG = {
|
const CONFIG = {
|
||||||
/*
|
/*
|
||||||
* Deine Jitsi-Domain.
|
* Your Jitsi Domain.
|
||||||
*
|
|
||||||
* Absichtlich fest eingetragen und nicht aus
|
|
||||||
* window.location.host übernommen.
|
|
||||||
*/
|
*/
|
||||||
jitsiHost: "meet.bnvb-ingenieure.de",
|
jitsiHost: "<YOURJITSIINSTANCEADDRESS>",
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Timeout für den Versuch, den Desktop-Client
|
* Timeout trying to start the jitsi-meet-electron client
|
||||||
* zu starten.
|
|
||||||
*/
|
*/
|
||||||
launchTimeout: 1750,
|
launchTimeout: 2000,
|
||||||
|
|
||||||
/* HIER DIE TATSÄCHLICHEN DOWNLOAD-URLS EINTRAGEN. */
|
/*
|
||||||
|
* Download URLs for jitsi-meet-electron client
|
||||||
|
*/
|
||||||
downloads: {
|
downloads: {
|
||||||
windows: "https://github.com/jitsi/jitsi-meet-electron/releases",
|
windows: "https://github.com/jitsi/jitsi-meet-electron/releases",
|
||||||
macos: "https://github.com/jitsi/jitsi-meet-electron/releases"
|
macos: "https://github.com/jitsi/jitsi-meet-electron/releases"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DOM-ELEMENTE */
|
/* ============================================================
|
||||||
|
* Translations
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
const TRANSLATIONS = {
|
||||||
|
en: {
|
||||||
|
pageTitle: "Jitsi Meeting",
|
||||||
|
|
||||||
|
launcher: {
|
||||||
|
title: "Jitsi Meeting",
|
||||||
|
meetingPrefix: "The meeting",
|
||||||
|
meetingSuffix: "will be joined.",
|
||||||
|
openButton: "Join meeting"
|
||||||
|
},
|
||||||
|
|
||||||
|
starting: {
|
||||||
|
title: "Starting Jitsi Meet …",
|
||||||
|
status: "The Jitsi Meet desktop client is being opened."
|
||||||
|
},
|
||||||
|
|
||||||
|
fallback: {
|
||||||
|
title: "Jitsi Meet could not be opened",
|
||||||
|
description: "The Jitsi Meet desktop client may not have been started.",
|
||||||
|
retryButton: "Try again"
|
||||||
|
},
|
||||||
|
|
||||||
|
downloads: {
|
||||||
|
windows: {
|
||||||
|
title: "Jitsi Meet for Windows",
|
||||||
|
description:
|
||||||
|
"Install the Jitsi Meet desktop client and then try opening the meeting again.",
|
||||||
|
button: "Download Jitsi for Windows"
|
||||||
|
},
|
||||||
|
|
||||||
|
macos: {
|
||||||
|
title: "Jitsi Meet for macOS",
|
||||||
|
description:
|
||||||
|
"Install the Jitsi Meet desktop client and then try opening the meeting again.",
|
||||||
|
button: "Download Jitsi for macOS"
|
||||||
|
},
|
||||||
|
|
||||||
|
other: {
|
||||||
|
title: "Jitsi Meet Desktop",
|
||||||
|
description:
|
||||||
|
"No desktop download is configured for your operating system."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
browser: {
|
||||||
|
title: "Join in browser",
|
||||||
|
description:
|
||||||
|
"You can also join the meeting directly in your browser.",
|
||||||
|
button: "Join in browser"
|
||||||
|
},
|
||||||
|
|
||||||
|
error: {
|
||||||
|
title: "No meeting specified",
|
||||||
|
description: "Please specify a meeting using the",
|
||||||
|
descriptionSuffix: "parameter."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
de: {
|
||||||
|
pageTitle: "Jitsi Meeting öffnen",
|
||||||
|
|
||||||
|
launcher: {
|
||||||
|
title: "Jitsi Meeting",
|
||||||
|
meetingPrefix: "Das Meeting",
|
||||||
|
meetingSuffix: "wird geöffnet.",
|
||||||
|
openButton: "An Meeting teilnehmen"
|
||||||
|
},
|
||||||
|
|
||||||
|
starting: {
|
||||||
|
title: "Jitsi Meet wird gestartet …",
|
||||||
|
status: "Der Jitsi Meet Desktop-Client wird geöffnet."
|
||||||
|
},
|
||||||
|
|
||||||
|
fallback: {
|
||||||
|
title: "Jitsi Meet konnte nicht geöffnet werden",
|
||||||
|
description:
|
||||||
|
"Der Jitsi Meet Desktop-Client wurde möglicherweise nicht gestartet.",
|
||||||
|
retryButton: "Erneut versuchen"
|
||||||
|
},
|
||||||
|
|
||||||
|
downloads: {
|
||||||
|
windows: {
|
||||||
|
title: "Jitsi Meet für Windows",
|
||||||
|
description:
|
||||||
|
"Installiere den Jitsi Meet Desktop-Client und versuche anschließend erneut, das Meeting zu öffnen.",
|
||||||
|
button: "Jitsi für Windows herunterladen"
|
||||||
|
},
|
||||||
|
|
||||||
|
macos: {
|
||||||
|
title: "Jitsi Meet für macOS",
|
||||||
|
description:
|
||||||
|
"Installiere den Jitsi Meet Desktop-Client und versuche anschließend erneut, das Meeting zu öffnen.",
|
||||||
|
button: "Jitsi für macOS herunterladen"
|
||||||
|
},
|
||||||
|
|
||||||
|
other: {
|
||||||
|
title: "Jitsi Meet Desktop",
|
||||||
|
description:
|
||||||
|
"Für dein Betriebssystem ist kein Desktop-Download hinterlegt."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
browser: {
|
||||||
|
title: "Im Browser teilnehmen",
|
||||||
|
description:
|
||||||
|
"Du kannst dem Meeting auch direkt über deinen Browser beitreten.",
|
||||||
|
button: "Im Browser beitreten"
|
||||||
|
},
|
||||||
|
|
||||||
|
error: {
|
||||||
|
title: "Kein Meeting angegeben",
|
||||||
|
description:
|
||||||
|
"Bitte gib ein Meeting über den Parameter",
|
||||||
|
descriptionSuffix: "an."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ============================================================
|
||||||
|
* Detect language
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
function detectLanguage() {
|
||||||
|
const languages = navigator.languages || [navigator.language];
|
||||||
|
|
||||||
|
for (const language of languages) {
|
||||||
|
if (!language) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const languageCode = language
|
||||||
|
.toLowerCase()
|
||||||
|
.split("-")[0];
|
||||||
|
|
||||||
|
if (TRANSLATIONS[languageCode]) {
|
||||||
|
return languageCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Englisch ist der Standard/Fallback.
|
||||||
|
*/
|
||||||
|
return "en";
|
||||||
|
}
|
||||||
|
|
||||||
|
const currentLanguage = detectLanguage();
|
||||||
|
const translation = TRANSLATIONS[currentLanguage];
|
||||||
|
|
||||||
|
/* ============================================================
|
||||||
|
* Apply translations to webpage
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
function applyTranslations() {
|
||||||
|
document.documentElement.lang = currentLanguage;
|
||||||
|
document.title = translation.pageTitle;
|
||||||
|
|
||||||
|
document
|
||||||
|
.querySelectorAll("[data-i18n]")
|
||||||
|
.forEach((element) => {
|
||||||
|
const key = element.dataset.i18n;
|
||||||
|
const value = getTranslation(key);
|
||||||
|
|
||||||
|
if (value !== null) {
|
||||||
|
element.textContent = value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Übersetzung anhand eines Pfades lesen.
|
||||||
|
*
|
||||||
|
* Beispiel:
|
||||||
|
*
|
||||||
|
* "downloads.windows.title"
|
||||||
|
*
|
||||||
|
* ergibt:
|
||||||
|
*
|
||||||
|
* translation.downloads.windows.title
|
||||||
|
*/
|
||||||
|
function getTranslation(key) {
|
||||||
|
const parts = key.split(".");
|
||||||
|
let value = translation;
|
||||||
|
|
||||||
|
for (const part of parts) {
|
||||||
|
if (
|
||||||
|
value === null ||
|
||||||
|
value === undefined ||
|
||||||
|
typeof value !== "object" ||
|
||||||
|
!(part in value)
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = value[part];
|
||||||
|
}
|
||||||
|
|
||||||
|
return typeof value === "string" ? value : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ============================================================
|
||||||
|
* DOM elements
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
const launcher = document.getElementById("launcher");
|
const launcher = document.getElementById("launcher");
|
||||||
const starting = document.getElementById("starting");
|
const starting = document.getElementById("starting");
|
||||||
const fallback = document.getElementById("fallback");
|
const fallback = document.getElementById("fallback");
|
||||||
@@ -268,14 +523,13 @@
|
|||||||
const windowsLink = document.getElementById("windowsLink");
|
const windowsLink = document.getElementById("windowsLink");
|
||||||
const macosLink = document.getElementById("macosLink");
|
const macosLink = document.getElementById("macosLink");
|
||||||
|
|
||||||
/*
|
/* ============================================================
|
||||||
* ============================================================
|
* GET ROOM FROM QUERY-PARAMETER
|
||||||
* ROOM AUS QUERY-PARAMETER
|
|
||||||
* ============================================================
|
* ============================================================
|
||||||
*
|
*
|
||||||
* Beispiel:
|
* Beispiel:
|
||||||
*
|
*
|
||||||
* https://meet.bnvb-ingenieure.de/launch.html?room=abc-defg-hij
|
* https://<YOURJITSIINSTANCEADDRESS>/launch.html?room=abc-defg-hij
|
||||||
*
|
*
|
||||||
* ergibt:
|
* ergibt:
|
||||||
*
|
*
|
||||||
@@ -283,9 +537,12 @@
|
|||||||
*
|
*
|
||||||
* ============================================================
|
* ============================================================
|
||||||
*/
|
*/
|
||||||
function getRoom() {
|
|
||||||
|
|
||||||
const params = new URLSearchParams(window.location.search);
|
function getRoom() {
|
||||||
|
const params = new URLSearchParams(
|
||||||
|
window.location.search
|
||||||
|
);
|
||||||
|
|
||||||
const room = params.get("room");
|
const room = params.get("room");
|
||||||
|
|
||||||
if (!room) {
|
if (!room) {
|
||||||
@@ -304,10 +561,8 @@
|
|||||||
return trimmed;
|
return trimmed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ============================================================
|
||||||
/*
|
* VALIDATE ROOM
|
||||||
* ============================================================
|
|
||||||
* ROOM VALIDIEREN
|
|
||||||
* ============================================================
|
* ============================================================
|
||||||
*
|
*
|
||||||
* Jitsi-Roomnamen können je nach Konfiguration relativ
|
* Jitsi-Roomnamen können je nach Konfiguration relativ
|
||||||
@@ -315,10 +570,11 @@
|
|||||||
*
|
*
|
||||||
* Wir verhindern hier lediglich Steuerzeichen und
|
* Wir verhindern hier lediglich Steuerzeichen und
|
||||||
* offensichtliche URL-Manipulation.
|
* offensichtliche URL-Manipulation.
|
||||||
|
*
|
||||||
* ============================================================
|
* ============================================================
|
||||||
*/
|
*/
|
||||||
function isValidRoom(room) {
|
|
||||||
|
|
||||||
|
function isValidRoom(room) {
|
||||||
if (!room) {
|
if (!room) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -343,19 +599,40 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* JITSI WEB URL */
|
/* ============================================================
|
||||||
|
* JITSI WEB URL
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
function createBrowserUrl(room) {
|
function createBrowserUrl(room) {
|
||||||
return ("https://" + CONFIG.jitsiHost + "/" + encodeURIComponent(room));
|
return (
|
||||||
|
"https://" +
|
||||||
|
CONFIG.jitsiHost +
|
||||||
|
"/" +
|
||||||
|
encodeURIComponent(room)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* JITSI DESKTOP PROTOCOL URL */
|
/* ============================================================
|
||||||
|
* JITSI DESKTOP PROTOCOL URL
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
function createAppUrl(room) {
|
function createAppUrl(room) {
|
||||||
return ("jitsi-meet://" + CONFIG.jitsiHost + "/" + encodeURIComponent(room));
|
return (
|
||||||
|
"jitsi-meet://" +
|
||||||
|
CONFIG.jitsiHost +
|
||||||
|
"/" +
|
||||||
|
encodeURIComponent(room)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BETRIEBSSYSTEM ERKENNEN */
|
/* ============================================================
|
||||||
function detectOperatingSystem() {
|
* DETECT OPERATING SYSTEM
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
function detectOperatingSystem() {
|
||||||
const ua = navigator.userAgent;
|
const ua = navigator.userAgent;
|
||||||
|
|
||||||
/* iPhone / iPad / iPod */
|
/* iPhone / iPad / iPod */
|
||||||
@@ -380,9 +657,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* macOS */
|
/* macOS */
|
||||||
if (
|
if (/Macintosh|Mac OS X/i.test(ua)) {
|
||||||
/Macintosh|Mac OS X/i.test(ua)
|
|
||||||
) {
|
|
||||||
return "macos";
|
return "macos";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,9 +669,12 @@
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BROWSER ERKENNEN */
|
/* ============================================================
|
||||||
function detectBrowser() {
|
* BROWSER ERKENNEN
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
function detectBrowser() {
|
||||||
const ua = navigator.userAgent;
|
const ua = navigator.userAgent;
|
||||||
|
|
||||||
if (/Edg\//i.test(ua)) {
|
if (/Edg\//i.test(ua)) {
|
||||||
@@ -425,7 +703,11 @@
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DOWNLOADS */
|
/* ============================================================
|
||||||
|
* DOWNLOADS
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
function configureDownloads() {
|
function configureDownloads() {
|
||||||
const os = detectOperatingSystem();
|
const os = detectOperatingSystem();
|
||||||
|
|
||||||
@@ -451,15 +733,24 @@
|
|||||||
otherDownload.classList.remove("hidden");
|
otherDownload.classList.remove("hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FALLBACK ANZEIGEN */
|
/* ============================================================
|
||||||
|
* FALLBACK ANZEIGEN
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
function showFallback() {
|
function showFallback() {
|
||||||
starting.classList.add("hidden");
|
starting.classList.add("hidden");
|
||||||
launcher.classList.add("hidden");
|
launcher.classList.add("hidden");
|
||||||
fallback.classList.remove("hidden");
|
fallback.classList.remove("hidden");
|
||||||
|
|
||||||
configureDownloads();
|
configureDownloads();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* JITSI DESKTOP STARTEN */
|
/* ============================================================
|
||||||
|
* JITSI DESKTOP STARTEN
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
function launchJitsi() {
|
function launchJitsi() {
|
||||||
const room = getRoom();
|
const room = getRoom();
|
||||||
|
|
||||||
@@ -470,10 +761,14 @@
|
|||||||
const protocolUrl = createAppUrl(room);
|
const protocolUrl = createAppUrl(room);
|
||||||
const browserUrl = createBrowserUrl(room);
|
const browserUrl = createBrowserUrl(room);
|
||||||
|
|
||||||
/* Browser-Fallback vorbereiten. */
|
/*
|
||||||
|
* Browser-Fallback vorbereiten.
|
||||||
|
*/
|
||||||
browserLink.href = browserUrl;
|
browserLink.href = browserUrl;
|
||||||
|
|
||||||
/* UI auf "Startvorgang" setzen. */
|
/*
|
||||||
|
* UI auf "Startvorgang" setzen.
|
||||||
|
*/
|
||||||
launcher.classList.add("hidden");
|
launcher.classList.add("hidden");
|
||||||
fallback.classList.add("hidden");
|
fallback.classList.add("hidden");
|
||||||
starting.classList.remove("hidden");
|
starting.classList.remove("hidden");
|
||||||
@@ -481,13 +776,16 @@
|
|||||||
let completed = false;
|
let completed = false;
|
||||||
let timeout = null;
|
let timeout = null;
|
||||||
|
|
||||||
/* Unsichtbarer iframe für den Protocol Handler. */
|
/*
|
||||||
|
* Unsichtbarer iframe für den Protocol Handler.
|
||||||
|
*/
|
||||||
const iframe = document.createElement("iframe");
|
const iframe = document.createElement("iframe");
|
||||||
iframe.style.display = "none";
|
iframe.style.display = "none";
|
||||||
|
|
||||||
/* Aufräumen. */
|
/*
|
||||||
|
* Aufräumen.
|
||||||
|
*/
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
|
||||||
if (completed) {
|
if (completed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -517,21 +815,23 @@
|
|||||||
|
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
|
|
||||||
/* Protocol Handler starten. */
|
/*
|
||||||
|
* Protocol Handler starten.
|
||||||
|
*/
|
||||||
try {
|
try {
|
||||||
iframe.src = protocolUrl;
|
iframe.src = protocolUrl;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
"Fehler beim Öffnen des Jitsi Protocol Handlers:",
|
"Error opening the Jitsi Protocol Handler:",
|
||||||
error
|
error
|
||||||
);
|
);
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
showFallback();
|
showFallback();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* --------------------------------------------------------
|
* --------------------------------------------------------
|
||||||
* FALLBACK
|
* FALLBACK
|
||||||
@@ -554,41 +854,53 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
|
|
||||||
if (completed) {
|
if (completed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
showFallback();
|
showFallback();
|
||||||
|
|
||||||
}, CONFIG.launchTimeout);
|
}, CONFIG.launchTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* INITIALISIERUNG */
|
/* ============================================================
|
||||||
function initialize() {
|
* INITIALISIERUNG
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
function initialize() {
|
||||||
const room = getRoom();
|
const room = getRoom();
|
||||||
|
|
||||||
/* Kein room-Parameter */
|
/*
|
||||||
|
* Kein room-Parameter
|
||||||
|
*/
|
||||||
if (!isValidRoom(room)) {
|
if (!isValidRoom(room)) {
|
||||||
invalidRoom.classList.remove("hidden");
|
invalidRoom.classList.remove("hidden");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Room anzeigen. */
|
/*
|
||||||
|
* Room anzeigen.
|
||||||
|
*/
|
||||||
roomName.textContent = room;
|
roomName.textContent = room;
|
||||||
|
|
||||||
/* Browser-Fallback vorbereiten. */
|
/*
|
||||||
|
* Browser-Fallback vorbereiten.
|
||||||
|
*/
|
||||||
browserLink.href = createBrowserUrl(room);
|
browserLink.href = createBrowserUrl(room);
|
||||||
|
|
||||||
/* Launcher anzeigen. */
|
/*
|
||||||
|
* Launcher anzeigen.
|
||||||
|
*/
|
||||||
launcher.classList.remove("hidden");
|
launcher.classList.remove("hidden");
|
||||||
|
|
||||||
/* Debug-Informationen. */
|
/*
|
||||||
|
* Debug-Informationen.
|
||||||
|
*/
|
||||||
console.log(
|
console.log(
|
||||||
"Jitsi Launcher",
|
"Jitsi Launcher",
|
||||||
{
|
{
|
||||||
|
language: currentLanguage,
|
||||||
room: room,
|
room: room,
|
||||||
operatingSystem: detectOperatingSystem(),
|
operatingSystem: detectOperatingSystem(),
|
||||||
browser: detectBrowser(),
|
browser: detectBrowser(),
|
||||||
@@ -598,11 +910,27 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EVENTS */
|
/* ============================================================
|
||||||
openButton.addEventListener("click", launchJitsi);
|
* EVENTS
|
||||||
retryButton.addEventListener("click", launchJitsi);
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
/* Start */
|
openButton.addEventListener(
|
||||||
|
"click",
|
||||||
|
launchJitsi
|
||||||
|
);
|
||||||
|
|
||||||
|
retryButton.addEventListener(
|
||||||
|
"click",
|
||||||
|
launchJitsi
|
||||||
|
);
|
||||||
|
|
||||||
|
/* ============================================================
|
||||||
|
* START
|
||||||
|
* ============================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
applyTranslations();
|
||||||
initialize();
|
initialize();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in new issue
Block a user