Update PoliticTalk Jitsi room policy

This commit is contained in:
2026-05-16 21:51:14 +05:30
parent 8997f4804f
commit def2d46096
20 changed files with 748 additions and 26 deletions

114
web/plugin.head.html Normal file
View File

@@ -0,0 +1,114 @@
<style>
.politictalk-room-logo {
align-items: center;
display: flex;
height: 64px;
justify-content: center;
left: max(20px, env(safe-area-inset-left));
opacity: 0.96;
position: fixed;
top: max(20px, env(safe-area-inset-top));
width: 64px;
z-index: 2147483000;
}
.politictalk-room-logo img {
display: block;
height: 100%;
object-fit: contain;
width: 100%;
}
@media (max-width: 640px) {
.politictalk-room-logo {
height: 52px;
left: max(12px, env(safe-area-inset-left));
top: max(12px, env(safe-area-inset-top));
width: 52px;
}
}
</style>
<script>
(function() {
function decodeBase64Url(value) {
var base64 = value.replace(/-/g, '+').replace(/_/g, '/');
while (base64.length % 4) {
base64 += '=';
}
var binary = window.atob(base64);
var bytes = new Uint8Array(binary.length);
for (var index = 0; index < binary.length; index += 1) {
bytes[index] = binary.charCodeAt(index);
}
return new TextDecoder().decode(bytes);
}
function getPoliticTalkMeetingTitle() {
try {
var token = new URLSearchParams(window.location.search).get('jwt');
if (!token) {
return '';
}
var payload = JSON.parse(decodeBase64Url(token.split('.')[1] || ''));
var context = payload.context || {};
var room = context.room || {};
var title = (context.politictalk && context.politictalk.title)
|| room.subject
|| room.name
|| '';
title = String(title);
return title.trim() ? title : '';
} catch (error) {
return '';
}
}
function applyPoliticTalkMeetingTitle() {
var meetingTitle = getPoliticTalkMeetingTitle();
if (!meetingTitle) {
return;
}
window.config = window.config || {};
window.config.subject = meetingTitle;
window.config.localSubject = meetingTitle;
}
function mountPoliticTalkLogo() {
if (!document.body || document.getElementById('politictalk-room-logo')) {
return;
}
var link = document.createElement('a');
link.className = 'politictalk-room-logo';
link.href = 'https://parallelglobe.io/politictalk';
link.id = 'politictalk-room-logo';
link.rel = 'noopener noreferrer';
link.target = '_blank';
var image = document.createElement('img');
image.alt = 'ParallelGlobe';
image.src = '/images/politictalk/pg_globe.png';
link.appendChild(image);
document.body.appendChild(link);
}
applyPoliticTalkMeetingTitle();
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', mountPoliticTalkLogo);
} else {
mountPoliticTalkLogo();
}
}());
</script>

9
web/title.html Normal file
View File

@@ -0,0 +1,9 @@
<title>PoliticTalk</title>
<meta property="og:title" content="PoliticTalk" />
<meta property="og:image" content="/images/politictalk/pgLogo.svg" />
<meta property="og:description" content="Join a PoliticTalk session by ParallelGlobe" />
<meta name="description" content="Join a PoliticTalk session by ParallelGlobe" />
<meta itemprop="name" content="PoliticTalk" />
<meta itemprop="description" content="Join a PoliticTalk session by ParallelGlobe" />
<meta itemprop="image" content="/images/politictalk/pgLogo.svg" />
<link rel="icon" href="/images/politictalk/favicon.ico" />