3368 lines
138 KiB
HTML
3368 lines
138 KiB
HTML
<style>
|
|
html:not(.politictalk-direct-access-blocked),
|
|
html:not(.politictalk-direct-access-blocked) body,
|
|
html:not(.politictalk-direct-access-blocked) #react,
|
|
html:not(.politictalk-direct-access-blocked) #videoconference_page {
|
|
background-color: #101820 !important;
|
|
background-image: url('/images/politictalk/background_pt.png') !important;
|
|
background-position: center center !important;
|
|
background-repeat: no-repeat !important;
|
|
background-size: cover !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) {
|
|
--politictalk-avatar-background: #63477a;
|
|
--politictalk-stage-bottom-inset: 128px;
|
|
--politictalk-stage-side-inset: 8px;
|
|
--politictalk-stage-top-inset: 96px;
|
|
--politictalk-tile-border-color: #63477a;
|
|
--politictalk-toolbar-bottom-offset: 12px;
|
|
--politictalk-toolbar-mobile-scale: 0.96;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) body {
|
|
min-height: 100vh;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .conference,
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer,
|
|
html:not(.politictalk-direct-access-blocked) .large-video-container,
|
|
html:not(.politictalk-direct-access-blocked) .stage-view,
|
|
html:not(.politictalk-direct-access-blocked) .filmstrip,
|
|
html:not(.politictalk-direct-access-blocked) .filmstrip__videos,
|
|
html:not(.politictalk-direct-access-blocked) .filmstrip__videos-container,
|
|
html:not(.politictalk-direct-access-blocked) #filmstripRemoteVideosContainer,
|
|
html:not(.politictalk-direct-access-blocked) .remote-videos {
|
|
background-color: transparent !important;
|
|
background-image: none !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #largeVideo,
|
|
html:not(.politictalk-direct-access-blocked) .large-video-background {
|
|
background-color: transparent !important;
|
|
background-image: none !important;
|
|
}
|
|
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace {
|
|
bottom: var(--politictalk-stage-bottom-inset, 128px) !important;
|
|
box-sizing: border-box !important;
|
|
display: block !important;
|
|
height: calc(100% - var(--politictalk-stage-top-inset, 96px) - var(--politictalk-stage-bottom-inset, 128px)) !important;
|
|
left: var(--politictalk-stage-side-inset, 8px) !important;
|
|
min-height: 0 !important;
|
|
overflow: hidden !important;
|
|
position: absolute !important;
|
|
right: var(--politictalk-stage-side-inset, 8px) !important;
|
|
top: var(--politictalk-stage-top-inset, 96px) !important;
|
|
width: auto !important;
|
|
}
|
|
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace #largeVideoContainer {
|
|
bottom: auto !important;
|
|
box-sizing: border-box !important;
|
|
height: 100% !important;
|
|
left: 0 !important;
|
|
max-height: 100% !important;
|
|
min-height: 0 !important;
|
|
overflow: hidden !important;
|
|
position: absolute !important;
|
|
right: 0 !important;
|
|
top: 0 !important;
|
|
transform: none !important;
|
|
width: 100% !important;
|
|
}
|
|
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace > span,
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace .filmstrip,
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace #remoteVideos,
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace .filmstrip__videos,
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace .remote-videos {
|
|
height: 100% !important;
|
|
max-height: 100% !important;
|
|
min-height: 0 !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
html.politictalk-stage-brand-inset:not(.politictalk-direct-access-blocked) #videospace .remote-videos > div {
|
|
max-height: 100% !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-themed-tile,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="participant_"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="remoteVideo_"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos #localVideo_container {
|
|
background: transparent !important;
|
|
background-color: transparent !important;
|
|
border: 0 !important;
|
|
box-shadow: none !important;
|
|
box-sizing: border-box !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-role-individual {
|
|
--politictalk-avatar-background: #63477a;
|
|
--politictalk-tile-border-color: #63477a;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-role-organisation {
|
|
--politictalk-avatar-background: #937dc6;
|
|
--politictalk-tile-border-color: #937dc6;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-role-ordinary {
|
|
--politictalk-avatar-background: #33243e;
|
|
--politictalk-tile-border-color: #33243e;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-role-guest {
|
|
--politictalk-avatar-background: #63477a;
|
|
--politictalk-tile-border-color: #63477a;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-themed-tile::after,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="participant_"]::after,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="remoteVideo_"]::after,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos #localVideo_container::after {
|
|
border: 2px solid var(--politictalk-tile-border-color, #63477a) !important;
|
|
border-radius: 3px !important;
|
|
bottom: 2px;
|
|
box-sizing: border-box !important;
|
|
content: "";
|
|
left: 0;
|
|
pointer-events: none;
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
z-index: 12;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace #largeVideoContainer,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #largeVideoContainer.politictalk-themed-tile,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .filmstrip,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .filmstrip__videos,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .remote-videos {
|
|
border: 0 !important;
|
|
outline: 0 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-tile-transparent-layer {
|
|
background: transparent !important;
|
|
background-color: transparent !important;
|
|
background-image: none !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="participant_"] > [class*="containerBackground"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="remoteVideo_"] > [class*="containerBackground"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos #localVideo_container > [class*="containerBackground"] {
|
|
background: transparent !important;
|
|
background-color: transparent !important;
|
|
background-image: none !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-shell {
|
|
background: transparent !important;
|
|
border-radius: 50% !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .avatar-container,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #dominantSpeakerAvatarContainer {
|
|
background: transparent !important;
|
|
border-radius: 50% !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-themed-tile > .avatar-container,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-themed-tile > [class*="avatar-container"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-themed-tile > [class*="avatarContainer"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="participant_"] > .avatar-container,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="participant_"] > [class*="avatar-container"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="participant_"] > [class*="avatarContainer"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="remoteVideo_"] > .avatar-container,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="remoteVideo_"] > [class*="avatar-container"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos [id^="remoteVideo_"] > [class*="avatarContainer"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos #localVideo_container > .avatar-container,
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos #localVideo_container > [class*="avatar-container"],
|
|
html:not(.politictalk-direct-access-blocked) #videospace #remoteVideos #localVideo_container > [class*="avatarContainer"] {
|
|
bottom: auto !important;
|
|
left: 50% !important;
|
|
margin: 0 !important;
|
|
position: absolute !important;
|
|
right: auto !important;
|
|
top: 50% !important;
|
|
transform: translate(-50%, -50%) !important;
|
|
}
|
|
|
|
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer #dominantSpeaker {
|
|
align-items: center !important;
|
|
bottom: 0 !important;
|
|
display: flex !important;
|
|
height: 100% !important;
|
|
justify-content: center !important;
|
|
left: 0 !important;
|
|
margin: 0 !important;
|
|
overflow: visible !important;
|
|
pointer-events: none !important;
|
|
position: absolute !important;
|
|
right: 0 !important;
|
|
top: 0 !important;
|
|
transform: none !important;
|
|
width: 100% !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer #dominantSpeaker .dynamic-shadow {
|
|
left: 50% !important;
|
|
pointer-events: none !important;
|
|
position: absolute !important;
|
|
top: 50% !important;
|
|
transform: translate(-50%, -50%) !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer #dominantSpeakerAvatarContainer {
|
|
bottom: auto !important;
|
|
flex: 0 0 auto !important;
|
|
left: auto !important;
|
|
margin: 0 !important;
|
|
pointer-events: auto !important;
|
|
position: relative !important;
|
|
right: auto !important;
|
|
top: auto !important;
|
|
transform: none !important;
|
|
z-index: 2 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer.politictalk-hide-dominant-speaker #dominantSpeaker,
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer.politictalk-hide-dominant-speaker [data-testid="stage-display-name"],
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer.politictalk-hide-dominant-speaker #remotePresenceMessage,
|
|
html:not(.politictalk-direct-access-blocked) #largeVideoContainer.politictalk-hide-dominant-speaker #remoteConnectionMessage,
|
|
html.politictalk-multi-tile-view:not(.politictalk-direct-access-blocked) #largeVideoContainer #dominantSpeaker,
|
|
html.politictalk-multi-tile-view:not(.politictalk-direct-access-blocked) #largeVideoContainer [data-testid="stage-display-name"],
|
|
html.politictalk-multi-tile-view:not(.politictalk-direct-access-blocked) #largeVideoContainer #remotePresenceMessage,
|
|
html.politictalk-multi-tile-view:not(.politictalk-direct-access-blocked) #largeVideoContainer #remoteConnectionMessage {
|
|
opacity: 0 !important;
|
|
pointer-events: none !important;
|
|
visibility: hidden !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .avatar:not(img),
|
|
html:not(.politictalk-direct-access-blocked) #videospace .userAvatar:not(img),
|
|
html:not(.politictalk-direct-access-blocked) #videospace #dominantSpeakerAvatar:not(img) {
|
|
border-radius: 50% !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-themed {
|
|
background: var(--politictalk-avatar-background, #63477a) !important;
|
|
background-color: var(--politictalk-avatar-background, #63477a) !important;
|
|
border-radius: 50% !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-shell img,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-shell canvas,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-themed > img,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-themed picture,
|
|
html:not(.politictalk-direct-access-blocked) #videospace .politictalk-avatar-themed picture > img,
|
|
html:not(.politictalk-direct-access-blocked) #videospace img.avatar,
|
|
html:not(.politictalk-direct-access-blocked) #videospace img.userAvatar {
|
|
border-radius: 50% !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #participants-pane .politictalk-avatar-themed,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] .politictalk-avatar-themed {
|
|
background: var(--politictalk-avatar-background, #63477a) !important;
|
|
background-color: var(--politictalk-avatar-background, #63477a) !important;
|
|
border-radius: 50% !important;
|
|
color: #fff !important;
|
|
overflow: hidden !important;
|
|
text-shadow: none !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #participants-pane .politictalk-avatar-themed *:not(img):not(picture):not(svg),
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] .politictalk-avatar-themed *:not(img):not(picture):not(svg) {
|
|
color: #fff !important;
|
|
text-shadow: none !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #participants-pane .politictalk-avatar-themed > img,
|
|
html:not(.politictalk-direct-access-blocked) #participants-pane .politictalk-avatar-themed picture,
|
|
html:not(.politictalk-direct-access-blocked) #participants-pane .politictalk-avatar-themed picture > img,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] .politictalk-avatar-themed > img,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] .politictalk-avatar-themed picture,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] .politictalk-avatar-themed picture > img {
|
|
border-radius: 50% !important;
|
|
}
|
|
|
|
.politictalk-room-logo {
|
|
align-items: center;
|
|
display: flex;
|
|
height: 64px;
|
|
justify-content: flex-start;
|
|
left: max(20px, env(safe-area-inset-left));
|
|
opacity: 0.96;
|
|
position: fixed;
|
|
text-decoration: none;
|
|
top: max(20px, env(safe-area-inset-top));
|
|
width: min(202px, calc(100vw - 40px));
|
|
z-index: 20;
|
|
}
|
|
|
|
.politictalk-room-logo img {
|
|
display: block;
|
|
flex: 0 1 auto;
|
|
height: 64px;
|
|
max-width: 100%;
|
|
object-fit: contain;
|
|
object-position: left center;
|
|
width: auto;
|
|
}
|
|
|
|
.politictalk-room-logo__text {
|
|
display: none;
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
html:not(.politictalk-direct-access-blocked) {
|
|
--politictalk-avatar-background: #33243e;
|
|
--politictalk-tile-border-color: rgba(99, 71, 122, 0.58);
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked),
|
|
html:not(.politictalk-direct-access-blocked) body,
|
|
html:not(.politictalk-direct-access-blocked) #react,
|
|
html:not(.politictalk-direct-access-blocked) #videoconference_page {
|
|
background-color: #f7f3fb !important;
|
|
background-image: url('/images/politictalk/pt_bg_light.png') !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel-container,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane-container,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane-content,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] {
|
|
background-color: #b3a5e4 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer,
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer *,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel-container,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel-container *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container *,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane *,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane *,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane-container,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane-container *,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane-content,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane-content *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] * {
|
|
color: #63477a !important;
|
|
caret-color: #63477a !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer svg,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer svg,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel svg,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel-container svg,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container svg,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane svg,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] svg {
|
|
color: #63477a !important;
|
|
fill: currentColor !important;
|
|
stroke: currentColor !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer input,
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer textarea,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer input,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer textarea,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel input,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel textarea,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container input,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container textarea,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane input,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] input {
|
|
background-color: rgba(255, 255, 255, 0.42) !important;
|
|
border-color: rgba(99, 71, 122, 0.42) !important;
|
|
color: #63477a !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] input::placeholder {
|
|
color: rgba(99, 71, 122, 0.72) !important;
|
|
opacity: 1 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container input,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container textarea,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [contenteditable="true"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] [contenteditable="true"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] [contenteditable="true"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] [contenteditable="true"] {
|
|
background-color: rgba(48, 45, 55, 0.86) !important;
|
|
border-color: rgba(255, 255, 255, 0.62) !important;
|
|
color: #ffffff !important;
|
|
caret-color: #ffffff !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] textarea::placeholder {
|
|
color: rgba(255, 255, 255, 0.74) !important;
|
|
opacity: 1 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [role="button"],
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [aria-haspopup],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-recipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatRecipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatRecipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="recipientDropdown"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="RecipientDropdown"] {
|
|
background-color: rgba(48, 45, 55, 0.9) !important;
|
|
border-color: rgba(255, 255, 255, 0.34) !important;
|
|
color: #ffffff !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #chat-recipient select,
|
|
html:not(.politictalk-direct-access-blocked) #chat-recipient select option,
|
|
html:not(.politictalk-direct-access-blocked) #select-chat-recipient,
|
|
html:not(.politictalk-direct-access-blocked) #select-chat-recipient option,
|
|
html:not(.politictalk-direct-access-blocked) [class*="privateMessageRecipientsList"] select,
|
|
html:not(.politictalk-direct-access-blocked) [class*="privateMessageRecipientsList"] select option {
|
|
color: #ffffff !important;
|
|
-webkit-text-fill-color: #ffffff !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [role="button"] svg,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [aria-haspopup] svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-recipient"] svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatRecipient"] svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatRecipient"] svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="recipientDropdown"] svg,
|
|
html:not(.politictalk-direct-access-blocked) [class*="RecipientDropdown"] svg {
|
|
color: #ffffff !important;
|
|
fill: currentColor !important;
|
|
stroke: currentColor !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #sideToolbarContainer button,
|
|
html:not(.politictalk-direct-access-blocked) .sideToolbarContainer button,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel button,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container button,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane button,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane button,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] button,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] button {
|
|
color: #63477a !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #polls-tab-panel button[aria-label="Create a poll"],
|
|
html:not(.politictalk-direct-access-blocked) #polls-tab-panel button[class*="button-primary"],
|
|
html:not(.politictalk-direct-access-blocked) [aria-labelledby="polls-tab"] button[aria-label="Create a poll"],
|
|
html:not(.politictalk-direct-access-blocked) [aria-labelledby="polls-tab"] button[class*="button-primary"] {
|
|
background: #ffffff !important;
|
|
background-color: #ffffff !important;
|
|
border-color: rgba(99, 71, 122, 0.22) !important;
|
|
box-shadow: none !important;
|
|
color: #63477a !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #polls-tab-panel button[aria-label="Create a poll"] *,
|
|
html:not(.politictalk-direct-access-blocked) #polls-tab-panel button[class*="button-primary"] *,
|
|
html:not(.politictalk-direct-access-blocked) [aria-labelledby="polls-tab"] button[aria-label="Create a poll"] *,
|
|
html:not(.politictalk-direct-access-blocked) [aria-labelledby="polls-tab"] button[class*="button-primary"] * {
|
|
color: #63477a !important;
|
|
fill: currentColor !important;
|
|
stroke: currentColor !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel-container *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-container *,
|
|
html:not(.politictalk-direct-access-blocked) .participants-pane *,
|
|
html:not(.politictalk-direct-access-blocked) .participants_pane *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="participantsPane"] * {
|
|
border-color: rgba(99, 71, 122, 0.34) !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .chatmessage,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .chatmessage *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .usermessage,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .usermessage *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .privatemessage,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .privatemessage *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .messagecontent,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .messagecontent *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .message-content,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation .message-content *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation [class*="message-bubble"],
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation [class*="message-bubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation [class*="messageBubble"],
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation [class*="messageBubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation [class*="MessageBubble"],
|
|
html:not(.politictalk-direct-access-blocked) #chatconversation [class*="MessageBubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .chatmessage,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .chatmessage *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .usermessage,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .usermessage *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .privatemessage,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .privatemessage *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .messagecontent,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .messagecontent *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .message-content,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel .message-content *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel [class*="message-bubble"],
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel [class*="message-bubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel [class*="messageBubble"],
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel [class*="messageBubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel [class*="MessageBubble"],
|
|
html:not(.politictalk-direct-access-blocked) .chat-panel [class*="MessageBubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .chatmessage,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .chatmessage *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .usermessage,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .usermessage *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .privatemessage,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .privatemessage *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .messagecontent,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .messagecontent *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .message-content,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] .message-content *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] [class*="message-bubble"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] [class*="message-bubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] [class*="messageBubble"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] [class*="messageBubble"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] [class*="MessageBubble"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatPanel"] [class*="MessageBubble"] * {
|
|
color: #ffffff !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container input,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container textarea,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [contenteditable="true"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] [contenteditable="true"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] [contenteditable="true"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] input,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] textarea,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] [contenteditable="true"] {
|
|
background-color: rgba(48, 45, 55, 0.86) !important;
|
|
border-color: rgba(255, 255, 255, 0.62) !important;
|
|
color: #ffffff !important;
|
|
caret-color: #ffffff !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-input"] textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatInput"] textarea::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] input::placeholder,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatInput"] textarea::placeholder {
|
|
color: rgba(255, 255, 255, 0.74) !important;
|
|
opacity: 1 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [role="button"],
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [aria-haspopup],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-recipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatRecipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatRecipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="recipientDropdown"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="RecipientDropdown"] {
|
|
background-color: rgba(48, 45, 55, 0.9) !important;
|
|
border-color: rgba(255, 255, 255, 0.34) !important;
|
|
color: #ffffff !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [role="button"] *,
|
|
html:not(.politictalk-direct-access-blocked) .chat-input-container [aria-haspopup] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-recipient"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatRecipient"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatRecipient"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="recipientDropdown"] *,
|
|
html:not(.politictalk-direct-access-blocked) [class*="RecipientDropdown"] * {
|
|
color: #ffffff !important;
|
|
fill: currentColor !important;
|
|
stroke: currentColor !important;
|
|
}
|
|
|
|
}
|
|
|
|
html.politictalk-direct-access-blocked,
|
|
html.politictalk-direct-access-blocked body {
|
|
background: #202424 !important;
|
|
min-height: 100%;
|
|
}
|
|
|
|
html.politictalk-direct-access-blocked #react {
|
|
display: none !important;
|
|
}
|
|
|
|
html.politictalk-direct-access-blocked body > *:not(.politictalk-direct-access):not(.politictalk-room-logo) {
|
|
visibility: hidden !important;
|
|
}
|
|
|
|
.politictalk-direct-access {
|
|
align-items: center;
|
|
background: rgba(13, 15, 16, 0.48);
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
inset: 0;
|
|
justify-content: center;
|
|
padding: 24px;
|
|
position: fixed;
|
|
z-index: 2147482999;
|
|
}
|
|
|
|
.politictalk-direct-access__dialog {
|
|
background: #111111;
|
|
border: 1px solid rgba(255, 255, 255, 0.16);
|
|
border-radius: 8px;
|
|
box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
|
|
box-sizing: border-box;
|
|
color: #f5f5f5;
|
|
max-width: 520px;
|
|
padding: 32px;
|
|
width: min(100%, 520px);
|
|
}
|
|
|
|
.politictalk-direct-access__title {
|
|
font-family: inherit;
|
|
font-size: 26px;
|
|
font-weight: 700;
|
|
line-height: 1.2;
|
|
margin: 0 0 16px;
|
|
}
|
|
|
|
.politictalk-direct-access__message {
|
|
color: rgba(255, 255, 255, 0.78);
|
|
font-size: 17px;
|
|
line-height: 1.5;
|
|
margin: 0;
|
|
}
|
|
|
|
.politictalk-direct-access__actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
margin-top: 28px;
|
|
}
|
|
|
|
.politictalk-direct-access__button {
|
|
background: #ffffff;
|
|
border: 0;
|
|
border-radius: 6px;
|
|
color: #151515;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
font-weight: 700;
|
|
min-width: 96px;
|
|
padding: 13px 22px;
|
|
}
|
|
|
|
.politictalk-direct-access__button:focus {
|
|
outline: 3px solid rgba(255, 255, 255, 0.42);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
html.politictalk-host-user button[aria-label*="Leave meeting" i],
|
|
html.politictalk-host-user button[aria-label*="Leave conference" i],
|
|
html.politictalk-host-user [role="button"][aria-label*="Leave meeting" i],
|
|
html.politictalk-host-user [role="button"][aria-label*="Leave conference" i] {
|
|
display: none !important;
|
|
}
|
|
|
|
.politictalk-hidden-av-request {
|
|
display: none !important;
|
|
}
|
|
|
|
.politictalk-hidden-local-leave-toast {
|
|
display: none !important;
|
|
}
|
|
|
|
.politictalk-hidden-video-screen-control {
|
|
display: none !important;
|
|
}
|
|
|
|
.politictalk-room-chat-only-hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #chat-recipient,
|
|
html:not(.politictalk-direct-access-blocked) #select-chat-recipient,
|
|
html:not(.politictalk-direct-access-blocked) [class*="privateMessageRecipientsList"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chat-recipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="chatRecipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="ChatRecipient"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="recipientDropdown"],
|
|
html:not(.politictalk-direct-access-blocked) [class*="RecipientDropdown"] {
|
|
display: none !important;
|
|
}
|
|
|
|
@media (max-width: 640px) {
|
|
html:not(.politictalk-direct-access-blocked),
|
|
html:not(.politictalk-direct-access-blocked) body,
|
|
html:not(.politictalk-direct-access-blocked) #react,
|
|
html:not(.politictalk-direct-access-blocked) #videoconference_page {
|
|
background-position: center center !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) {
|
|
--politictalk-stage-bottom-inset: 132px;
|
|
--politictalk-stage-side-inset: 6px;
|
|
--politictalk-stage-top-inset: 88px;
|
|
}
|
|
|
|
.politictalk-room-logo {
|
|
height: 48px;
|
|
left: max(14px, env(safe-area-inset-left));
|
|
top: max(18px, env(safe-area-inset-top));
|
|
width: min(150px, calc(100vw - 28px));
|
|
}
|
|
|
|
.politictalk-room-logo img {
|
|
flex-basis: auto;
|
|
height: 48px;
|
|
max-width: 100%;
|
|
width: auto;
|
|
}
|
|
|
|
.details-container {
|
|
top: calc(max(18px, env(safe-area-inset-top)) + 58px) !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #new-toolbox,
|
|
html:not(.politictalk-direct-access-blocked) .toolbox,
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content,
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content-wrapper {
|
|
opacity: 1 !important;
|
|
transition: none !important;
|
|
visibility: visible !important;
|
|
z-index: 1000 !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) #new-toolbox,
|
|
html:not(.politictalk-direct-access-blocked) .toolbox {
|
|
bottom: var(--politictalk-toolbar-bottom-offset, 12px) !important;
|
|
height: auto !important;
|
|
left: 0 !important;
|
|
overflow: visible !important;
|
|
pointer-events: none !important;
|
|
position: fixed !important;
|
|
right: 0 !important;
|
|
top: auto !important;
|
|
transform: none !important;
|
|
width: 100% !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content,
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content-wrapper {
|
|
max-width: calc(100vw - 24px) !important;
|
|
pointer-events: auto !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content-wrapper {
|
|
bottom: var(--politictalk-toolbar-bottom-offset, 12px) !important;
|
|
display: block !important;
|
|
left: 50% !important;
|
|
min-height: 0 !important;
|
|
overflow: visible !important;
|
|
position: fixed !important;
|
|
right: auto !important;
|
|
top: auto !important;
|
|
transform: translateX(-50%) scale(var(--politictalk-toolbar-mobile-scale, 0.96)) !important;
|
|
transform-origin: bottom center !important;
|
|
width: fit-content !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content {
|
|
border-radius: 8px !important;
|
|
box-sizing: border-box !important;
|
|
bottom: auto !important;
|
|
left: auto !important;
|
|
margin-left: auto !important;
|
|
margin-right: auto !important;
|
|
max-width: calc(100vw - 24px) !important;
|
|
overflow: visible !important;
|
|
position: relative !important;
|
|
right: auto !important;
|
|
top: auto !important;
|
|
transform: none !important;
|
|
width: max-content !important;
|
|
}
|
|
|
|
html:not(.politictalk-direct-access-blocked) .toolbox-content-mobile .toolbox-content-items {
|
|
padding: 6px !important;
|
|
border-radius: 3px !important;
|
|
}
|
|
|
|
.politictalk-direct-access {
|
|
align-items: flex-start;
|
|
padding: 150px 18px 18px;
|
|
}
|
|
|
|
.politictalk-direct-access__dialog {
|
|
padding: 24px;
|
|
}
|
|
|
|
.politictalk-direct-access__title {
|
|
font-size: 24px;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
(function() {
|
|
var PARALLEL_GLOBE_URL = 'https://parallelglobe.io';
|
|
var POLITICTALK_ROLE_COLORS = {
|
|
guest: '#63477a',
|
|
individual: '#63477a',
|
|
organisation: '#937dc6',
|
|
ordinary: '#33243e'
|
|
};
|
|
var POLITICTALK_ROLE_CLASS_NAMES = [
|
|
'politictalk-role-guest',
|
|
'politictalk-role-individual',
|
|
'politictalk-role-organisation',
|
|
'politictalk-role-ordinary'
|
|
];
|
|
var politicTalkParticipantRolesByEndpointId = {};
|
|
var politicTalkParticipantRolesByUserId = {};
|
|
|
|
disablePoliticTalkPwaInstallPrompt();
|
|
|
|
var restoredMeetingToken = restoreMeetingTokenFromSession();
|
|
|
|
if (restoredMeetingToken) {
|
|
return;
|
|
}
|
|
|
|
rememberMeetingToken();
|
|
|
|
var directAccessBlocked = isDirectRoomAccess();
|
|
|
|
if (directAccessBlocked) {
|
|
document.documentElement.classList.add('politictalk-direct-access-blocked');
|
|
document.title = 'Access required - PoliticTalk';
|
|
}
|
|
|
|
function getRoomPath() {
|
|
return window.location.pathname.replace(/\/+$/, '');
|
|
}
|
|
|
|
function disablePoliticTalkPwaInstallPrompt() {
|
|
window.addEventListener('beforeinstallprompt', function(event) {
|
|
event.preventDefault();
|
|
});
|
|
|
|
rewritePoliticTalkManifestLinks();
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', rewritePoliticTalkManifestLinks);
|
|
}
|
|
|
|
if ('serviceWorker' in window.navigator) {
|
|
window.navigator.serviceWorker.getRegistrations()
|
|
.then(function(registrations) {
|
|
registrations.forEach(function(registration) {
|
|
registration.unregister();
|
|
});
|
|
})
|
|
.catch(function() {
|
|
// The meeting does not depend on the PWA worker.
|
|
});
|
|
}
|
|
}
|
|
|
|
function rewritePoliticTalkManifestLinks() {
|
|
if (!document.head) {
|
|
return;
|
|
}
|
|
|
|
var links = document.querySelectorAll('link[rel~="manifest"]');
|
|
|
|
if (!links.length) {
|
|
var link = document.createElement('link');
|
|
link.rel = 'manifest';
|
|
link.href = '/manifest.json';
|
|
document.head.appendChild(link);
|
|
return;
|
|
}
|
|
|
|
links.forEach(function(link) {
|
|
link.href = '/manifest.json';
|
|
});
|
|
}
|
|
|
|
function updateMobileToolbarViewportOffset() {
|
|
if (!window.matchMedia || !window.matchMedia('(max-width: 640px)').matches) {
|
|
document.documentElement.style.removeProperty('--politictalk-toolbar-bottom-offset');
|
|
document.documentElement.style.removeProperty('--politictalk-toolbar-mobile-scale');
|
|
if (document.body) {
|
|
document.body.style.removeProperty('--politictalk-toolbar-bottom-offset');
|
|
document.body.style.removeProperty('--politictalk-toolbar-mobile-scale');
|
|
}
|
|
return;
|
|
}
|
|
|
|
var viewport = window.visualViewport;
|
|
var bottomGap = 0;
|
|
|
|
if (viewport) {
|
|
bottomGap = Math.max(0, window.innerHeight - viewport.height - viewport.offsetTop);
|
|
}
|
|
|
|
var baseOffset = Math.round(bottomGap + 12);
|
|
|
|
setMobileToolbarBottomOffset(baseOffset);
|
|
|
|
window.cancelAnimationFrame(window.politicTalkToolbarOffsetFrame);
|
|
window.politicTalkToolbarOffsetFrame = window.requestAnimationFrame(function() {
|
|
var toolbar = getVisiblePoliticTalkToolbar();
|
|
|
|
if (!toolbar) {
|
|
return;
|
|
}
|
|
|
|
var rect = toolbar.getBoundingClientRect();
|
|
var currentScale = getMobileToolbarScale();
|
|
var unscaledWidth = currentScale ? rect.width / currentScale : rect.width;
|
|
var availableWidth = (viewport ? viewport.width : window.innerWidth) - 28;
|
|
var nextScale = Math.min(0.96, Math.max(0.86, availableWidth / unscaledWidth));
|
|
var visibleBottom = viewport
|
|
? Math.min(window.innerHeight, viewport.offsetTop + viewport.height)
|
|
: window.innerHeight;
|
|
var overflow = Math.ceil(rect.bottom - (visibleBottom - 12));
|
|
|
|
setMobileToolbarScale(nextScale);
|
|
|
|
if (overflow > 0) {
|
|
setMobileToolbarBottomOffset(baseOffset + overflow);
|
|
}
|
|
});
|
|
}
|
|
|
|
function setMobileToolbarBottomOffset(offset) {
|
|
var value = Math.max(12, offset) + 'px';
|
|
|
|
document.documentElement.style.setProperty('--politictalk-toolbar-bottom-offset', value);
|
|
|
|
if (document.body) {
|
|
document.body.style.setProperty('--politictalk-toolbar-bottom-offset', value);
|
|
}
|
|
}
|
|
|
|
function getMobileToolbarScale() {
|
|
var value = window.getComputedStyle(document.documentElement)
|
|
.getPropertyValue('--politictalk-toolbar-mobile-scale');
|
|
var scale = Number.parseFloat(value);
|
|
|
|
return Number.isFinite(scale) && scale > 0 ? scale : 0.96;
|
|
}
|
|
|
|
function setMobileToolbarScale(scale) {
|
|
var value = String(Math.round(scale * 1000) / 1000);
|
|
|
|
document.documentElement.style.setProperty('--politictalk-toolbar-mobile-scale', value);
|
|
|
|
if (document.body) {
|
|
document.body.style.setProperty('--politictalk-toolbar-mobile-scale', value);
|
|
}
|
|
}
|
|
|
|
function getVisiblePoliticTalkToolbar() {
|
|
var toolbars = Array.prototype.slice.call(document.querySelectorAll(
|
|
'.toolbox-content, .toolbox-content-wrapper, #new-toolbox, .toolbox'
|
|
));
|
|
|
|
return toolbars
|
|
.map(function(toolbar) {
|
|
var rect = toolbar.getBoundingClientRect();
|
|
var style = window.getComputedStyle(toolbar);
|
|
|
|
return {
|
|
element: toolbar,
|
|
rect: rect,
|
|
area: Math.max(0, rect.width) * Math.max(0, rect.height),
|
|
visible: style.display !== 'none'
|
|
&& style.visibility !== 'hidden'
|
|
&& Number(style.opacity || 1) > 0
|
|
&& rect.width > 0
|
|
&& rect.height > 0
|
|
};
|
|
})
|
|
.filter(function(entry) {
|
|
return entry.visible;
|
|
})
|
|
.sort(function(first, second) {
|
|
return second.rect.bottom - first.rect.bottom || second.area - first.area;
|
|
})
|
|
.map(function(entry) {
|
|
return entry.element;
|
|
})[0] || null;
|
|
}
|
|
|
|
function mountMobileToolbarPositioning() {
|
|
updateMobileToolbarViewportOffset();
|
|
|
|
window.addEventListener('resize', updateMobileToolbarViewportOffset, { passive: true });
|
|
window.addEventListener('orientationchange', updateMobileToolbarViewportOffset, { passive: true });
|
|
|
|
if (window.visualViewport) {
|
|
window.visualViewport.addEventListener('resize', updateMobileToolbarViewportOffset, { passive: true });
|
|
window.visualViewport.addEventListener('scroll', updateMobileToolbarViewportOffset, { passive: true });
|
|
}
|
|
|
|
var attempts = 0;
|
|
var interval = window.setInterval(function() {
|
|
attempts += 1;
|
|
updateMobileToolbarViewportOffset();
|
|
|
|
if (attempts >= 40) {
|
|
window.clearInterval(interval);
|
|
}
|
|
}, 250);
|
|
}
|
|
|
|
function isSideToolbarOpen() {
|
|
var sideToolbar = document.getElementById('sideToolbarContainer')
|
|
|| document.querySelector('.sideToolbarContainer');
|
|
|
|
if (!sideToolbar) {
|
|
return false;
|
|
}
|
|
|
|
var rect = sideToolbar.getBoundingClientRect();
|
|
var style = window.getComputedStyle(sideToolbar);
|
|
|
|
return style.display !== 'none'
|
|
&& style.visibility !== 'hidden'
|
|
&& Number(style.opacity || 1) > 0
|
|
&& rect.width > 120
|
|
&& rect.height > 240;
|
|
}
|
|
|
|
function updatePoliticTalkStageBrandInset() {
|
|
if (directAccessBlocked || !document.body) {
|
|
document.documentElement.classList.remove('politictalk-stage-brand-inset');
|
|
return;
|
|
}
|
|
|
|
document.documentElement.classList.toggle('politictalk-stage-brand-inset', !isSideToolbarOpen());
|
|
}
|
|
|
|
function mountPoliticTalkStageBrandInset() {
|
|
updatePoliticTalkStageBrandInset();
|
|
|
|
window.addEventListener('resize', updatePoliticTalkStageBrandInset, { passive: true });
|
|
window.addEventListener('orientationchange', updatePoliticTalkStageBrandInset, { passive: true });
|
|
|
|
if (window.politicTalkStageInsetObserver || !document.body) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkStageInsetObserver = new MutationObserver(function() {
|
|
window.cancelAnimationFrame(window.politicTalkStageInsetFrame);
|
|
window.politicTalkStageInsetFrame = window.requestAnimationFrame(updatePoliticTalkStageBrandInset);
|
|
});
|
|
window.politicTalkStageInsetObserver.observe(document.body, {
|
|
attributes: true,
|
|
attributeFilter: [ 'class', 'style' ],
|
|
childList: true,
|
|
subtree: true
|
|
});
|
|
}
|
|
|
|
function isIgnoredJitsiPath(path) {
|
|
return /^\/(?:static|images|libs|css|sounds|fonts|transcripts)\//.test(path);
|
|
}
|
|
|
|
function getMeetingTokenFromUrl() {
|
|
var params = new URLSearchParams(window.location.search);
|
|
|
|
return params.get('jwt') || params.get('token') || '';
|
|
}
|
|
|
|
function hasMeetingToken() {
|
|
return Boolean(getMeetingTokenFromUrl());
|
|
}
|
|
|
|
function getRoomSessionKey(name) {
|
|
var path = getRoomPath() || '/';
|
|
|
|
return 'politictalk:' + path + ':' + name;
|
|
}
|
|
|
|
function readRoomSessionValue(name) {
|
|
try {
|
|
return window.sessionStorage.getItem(getRoomSessionKey(name)) || '';
|
|
} catch (error) {
|
|
return '';
|
|
}
|
|
}
|
|
|
|
function writeRoomSessionValue(name, value) {
|
|
try {
|
|
window.sessionStorage.setItem(getRoomSessionKey(name), value);
|
|
} catch (error) {
|
|
// Ignore storage failures. The direct-access guard still works.
|
|
}
|
|
}
|
|
|
|
function removeRoomSessionValue(name) {
|
|
try {
|
|
window.sessionStorage.removeItem(getRoomSessionKey(name));
|
|
} catch (error) {
|
|
// Ignore storage failures.
|
|
}
|
|
}
|
|
|
|
function getStoredMeetingToken() {
|
|
return readRoomSessionValue('jwt');
|
|
}
|
|
|
|
function isJwtUsable(token) {
|
|
try {
|
|
var payload = JSON.parse(decodeBase64Url((token || '').split('.')[1] || ''));
|
|
var expiresAt = Number(payload.exp || 0);
|
|
|
|
return !expiresAt || expiresAt > Math.floor(Date.now() / 1000) + 10;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function rememberMeetingToken() {
|
|
var token = getMeetingTokenFromUrl();
|
|
|
|
if (!token || !isJwtUsable(token)) {
|
|
return;
|
|
}
|
|
|
|
writeRoomSessionValue('jwt', token);
|
|
|
|
var payload = getPoliticTalkJwtPayloadFromToken(token);
|
|
var meetingTitle = getPoliticTalkMeetingTitleFromPayload(payload);
|
|
|
|
if (meetingTitle) {
|
|
writeRoomSessionValue('title', meetingTitle);
|
|
}
|
|
}
|
|
|
|
function restoreMeetingTokenFromSession() {
|
|
var path = getRoomPath();
|
|
|
|
if (!path || path === '/' || isIgnoredJitsiPath(path) || hasMeetingToken()) {
|
|
return false;
|
|
}
|
|
|
|
var token = getStoredMeetingToken();
|
|
|
|
if (!token || !isJwtUsable(token)) {
|
|
removeRoomSessionValue('jwt');
|
|
removeRoomSessionValue('title');
|
|
return false;
|
|
}
|
|
|
|
var params = new URLSearchParams(window.location.search);
|
|
params.set('jwt', token);
|
|
window.location.replace(path + '?' + params.toString() + window.location.hash);
|
|
|
|
return true;
|
|
}
|
|
|
|
function isDirectRoomAccess() {
|
|
var path = getRoomPath();
|
|
|
|
if (!path || path === '/') {
|
|
return false;
|
|
}
|
|
|
|
if (isIgnoredJitsiPath(path)) {
|
|
return false;
|
|
}
|
|
|
|
return !hasMeetingToken();
|
|
}
|
|
|
|
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 getMeetingToken() {
|
|
return getMeetingTokenFromUrl() || getStoredMeetingToken() || '';
|
|
}
|
|
|
|
function getPoliticTalkJwtPayloadFromToken(token) {
|
|
try {
|
|
if (!token) {
|
|
return null;
|
|
}
|
|
|
|
return JSON.parse(decodeBase64Url(token.split('.')[1] || ''));
|
|
} catch (error) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
function getPoliticTalkJwtPayload() {
|
|
return getPoliticTalkJwtPayloadFromToken(getMeetingToken());
|
|
}
|
|
|
|
function getPoliticTalkMeetingTitleFromPayload(payload) {
|
|
if (!payload) {
|
|
return '';
|
|
}
|
|
|
|
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 : '';
|
|
}
|
|
|
|
function getPoliticTalkMeetingTitle() {
|
|
return getPoliticTalkMeetingTitleFromPayload(getPoliticTalkJwtPayload())
|
|
|| readRoomSessionValue('title');
|
|
}
|
|
|
|
function normalizePoliticTalkRole(value) {
|
|
var role = String(value || '')
|
|
.trim()
|
|
.toLowerCase()
|
|
.replace(/_/g, '-')
|
|
.replace(/\s+/g, '-');
|
|
|
|
if (role === 'political-voice' || role === 'politicalvoice') {
|
|
return 'individual';
|
|
}
|
|
|
|
if (role === 'org' || role === 'organization') {
|
|
return 'organisation';
|
|
}
|
|
|
|
if (role === 'parallel-citizen' || role === 'parallelcitizen' || role === 'citizen') {
|
|
return 'ordinary';
|
|
}
|
|
|
|
if (role === 'email-invite' || role === 'invitee' || role === 'invited' || role === 'guest') {
|
|
return 'guest';
|
|
}
|
|
|
|
if (role === 'individual' || role === 'organisation' || role === 'ordinary') {
|
|
return role;
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
function getPoliticTalkRoleColor(role) {
|
|
return POLITICTALK_ROLE_COLORS[normalizePoliticTalkRole(role)] || POLITICTALK_ROLE_COLORS.guest;
|
|
}
|
|
|
|
function getPoliticTalkJwtUserContext() {
|
|
var payload = getPoliticTalkJwtPayload();
|
|
|
|
return payload && payload.context && payload.context.user
|
|
? payload.context.user
|
|
: {};
|
|
}
|
|
|
|
function getPoliticTalkLocalRoleMetadata() {
|
|
var user = getPoliticTalkJwtUserContext();
|
|
var role = normalizePoliticTalkRole(
|
|
user.politictalkRole
|
|
|| user.platformRole
|
|
|| user.politicalRole
|
|
|| user.role
|
|
) || 'guest';
|
|
var userId = String(user.id || '').trim();
|
|
|
|
return {
|
|
color: getPoliticTalkRoleColor(role),
|
|
role: role,
|
|
userId: userId,
|
|
userType: String(user.politictalkUserType || user.userType || '').trim()
|
|
};
|
|
}
|
|
|
|
function getPoliticTalkGuestRoleMetadata() {
|
|
return {
|
|
color: getPoliticTalkRoleColor('guest'),
|
|
role: 'guest',
|
|
userId: '',
|
|
userType: ''
|
|
};
|
|
}
|
|
|
|
function rememberPoliticTalkParticipantRole(metadata, endpointId) {
|
|
if (!metadata) {
|
|
return false;
|
|
}
|
|
|
|
var role = normalizePoliticTalkRole(metadata.role || metadata.politictalkRole || metadata.platformRole);
|
|
|
|
if (!role) {
|
|
return false;
|
|
}
|
|
|
|
var normalizedMetadata = {
|
|
color: getPoliticTalkRoleColor(role),
|
|
role: role,
|
|
userId: String(metadata.userId || metadata.id || '').trim(),
|
|
userType: String(metadata.userType || metadata.politictalkUserType || '').trim()
|
|
};
|
|
var normalizedEndpointId = String(endpointId || metadata.endpointId || metadata.participantId || '').trim();
|
|
|
|
if (normalizedEndpointId) {
|
|
politicTalkParticipantRolesByEndpointId[normalizedEndpointId] = normalizedMetadata;
|
|
}
|
|
|
|
if (normalizedMetadata.userId) {
|
|
politicTalkParticipantRolesByUserId[normalizedMetadata.userId] = normalizedMetadata;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
function getPoliticTalkConferenceRoom() {
|
|
var conference = window.APP && window.APP.conference;
|
|
|
|
return conference && (conference._room || conference.room || conference.conference);
|
|
}
|
|
|
|
function getPoliticTalkEndpointIdFromValue(value) {
|
|
if (!value) {
|
|
return '';
|
|
}
|
|
|
|
if (typeof value === 'string') {
|
|
return value;
|
|
}
|
|
|
|
try {
|
|
if (typeof value.getId === 'function') {
|
|
return String(value.getId() || '');
|
|
}
|
|
} catch (error) {
|
|
return '';
|
|
}
|
|
|
|
return String(value.id || value._id || value.participantId || '').trim();
|
|
}
|
|
|
|
function getPoliticTalkLocalEndpointId() {
|
|
var room = getPoliticTalkConferenceRoom();
|
|
var conference = window.APP && window.APP.conference;
|
|
|
|
try {
|
|
if (room && typeof room.myUserId === 'function') {
|
|
return String(room.myUserId() || '');
|
|
}
|
|
|
|
if (room && typeof room.getMyUserId === 'function') {
|
|
return String(room.getMyUserId() || '');
|
|
}
|
|
|
|
if (conference && typeof conference.getMyUserId === 'function') {
|
|
return String(conference.getMyUserId() || '');
|
|
}
|
|
} catch (error) {
|
|
return '';
|
|
}
|
|
|
|
return '';
|
|
}
|
|
|
|
function parsePoliticTalkRoleMetadata(value) {
|
|
if (!value) {
|
|
return null;
|
|
}
|
|
|
|
if (typeof value === 'string') {
|
|
try {
|
|
return JSON.parse(value);
|
|
} catch (error) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
if (value.type === 'politictalk-role') {
|
|
return value.data || value;
|
|
}
|
|
|
|
if (value.value) {
|
|
return parsePoliticTalkRoleMetadata(value.value) || value.attributes || null;
|
|
}
|
|
|
|
if (value.attributes && (value.attributes.role || value.attributes.politictalkRole)) {
|
|
return value.attributes;
|
|
}
|
|
|
|
if (value.role || value.politictalkRole || value.platformRole) {
|
|
return value;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
function handlePoliticTalkRoleMetadataMessage(first, second) {
|
|
var metadata = parsePoliticTalkRoleMetadata(first) || parsePoliticTalkRoleMetadata(second);
|
|
var endpointId = getPoliticTalkEndpointIdFromValue(first) || getPoliticTalkEndpointIdFromValue(second);
|
|
|
|
if (rememberPoliticTalkParticipantRole(metadata, endpointId)) {
|
|
window.cancelAnimationFrame(window.politicTalkRoleTileFrame);
|
|
window.politicTalkRoleTileFrame = window.requestAnimationFrame(applyPoliticTalkTileTheme);
|
|
}
|
|
}
|
|
|
|
function attachPoliticTalkRoleMetadataListeners(room) {
|
|
if (!room || window.politicTalkRoleMetadataRoom === room) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkRoleMetadataRoom = room;
|
|
|
|
try {
|
|
if (typeof room.addCommandListener === 'function') {
|
|
room.addCommandListener('politictalk-role', handlePoliticTalkRoleMetadataMessage);
|
|
}
|
|
} catch (error) {
|
|
// Role colours are cosmetic; keep the room running if the Jitsi internals differ.
|
|
}
|
|
|
|
try {
|
|
if (typeof room.on === 'function') {
|
|
var events = window.JitsiMeetJS && window.JitsiMeetJS.events && window.JitsiMeetJS.events.conference;
|
|
var endpointEvents = [
|
|
events && events.ENDPOINT_MESSAGE_RECEIVED,
|
|
'endpoint_message_received'
|
|
].filter(Boolean);
|
|
|
|
endpointEvents.forEach(function(eventName, index) {
|
|
if (endpointEvents.indexOf(eventName) !== index) {
|
|
return;
|
|
}
|
|
|
|
room.on(eventName, handlePoliticTalkRoleMetadataMessage);
|
|
});
|
|
}
|
|
} catch (error) {
|
|
// Ignore API differences across Jitsi versions.
|
|
}
|
|
}
|
|
|
|
function publishPoliticTalkRoleMetadata() {
|
|
if (directAccessBlocked) {
|
|
return;
|
|
}
|
|
|
|
var metadata = getPoliticTalkLocalRoleMetadata();
|
|
var endpointId = getPoliticTalkLocalEndpointId();
|
|
var room = getPoliticTalkConferenceRoom();
|
|
|
|
rememberPoliticTalkParticipantRole(metadata, endpointId);
|
|
attachPoliticTalkRoleMetadataListeners(room);
|
|
|
|
if (!room) {
|
|
return;
|
|
}
|
|
|
|
var payload = {
|
|
color: metadata.color,
|
|
endpointId: endpointId,
|
|
role: metadata.role,
|
|
type: 'politictalk-role',
|
|
userId: metadata.userId,
|
|
userType: metadata.userType
|
|
};
|
|
|
|
try {
|
|
if (typeof room.sendCommandOnce === 'function') {
|
|
room.sendCommandOnce('politictalk-role', {
|
|
attributes: payload,
|
|
value: JSON.stringify(payload)
|
|
});
|
|
} else if (typeof room.sendCommand === 'function') {
|
|
room.sendCommand('politictalk-role', {
|
|
attributes: payload,
|
|
value: JSON.stringify(payload)
|
|
});
|
|
}
|
|
} catch (error) {
|
|
// Endpoint messages below are a fallback for Jitsi builds without custom commands.
|
|
}
|
|
|
|
try {
|
|
if (typeof room.sendEndpointMessage === 'function') {
|
|
room.sendEndpointMessage('', payload);
|
|
}
|
|
} catch (error) {
|
|
// Nothing else to do; local styling still works from the JWT.
|
|
}
|
|
}
|
|
|
|
function mountPoliticTalkRoleMetadataSync() {
|
|
if (directAccessBlocked) {
|
|
return;
|
|
}
|
|
|
|
publishPoliticTalkRoleMetadata();
|
|
|
|
if (window.politicTalkRoleMetadataInterval) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkRoleMetadataInterval = window.setInterval(function() {
|
|
publishPoliticTalkRoleMetadata();
|
|
applyPoliticTalkTileTheme();
|
|
}, 5000);
|
|
}
|
|
|
|
function isPoliticTalkHost() {
|
|
var payload = getPoliticTalkJwtPayload();
|
|
var user = payload && payload.context && payload.context.user;
|
|
|
|
return Boolean(user && user.moderator);
|
|
}
|
|
|
|
function applyPoliticTalkMeetingTitle() {
|
|
var meetingTitle = getPoliticTalkMeetingTitle();
|
|
|
|
if (!meetingTitle) {
|
|
return;
|
|
}
|
|
|
|
window.config = window.config || {};
|
|
window.config.subject = meetingTitle;
|
|
window.config.localSubject = meetingTitle;
|
|
document.title = meetingTitle + ' | PoliticTalk';
|
|
}
|
|
|
|
function mountPoliticTalkDocumentTitle() {
|
|
var meetingTitle = getPoliticTalkMeetingTitle();
|
|
var pageTitle = meetingTitle ? meetingTitle + ' | PoliticTalk' : 'PoliticTalk';
|
|
|
|
if (directAccessBlocked || !document.head) {
|
|
return;
|
|
}
|
|
|
|
document.title = pageTitle;
|
|
|
|
if (window.politicTalkTitleObserver) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkTitleObserver = new MutationObserver(function() {
|
|
if (document.title !== pageTitle) {
|
|
document.title = pageTitle;
|
|
}
|
|
});
|
|
window.politicTalkTitleObserver.observe(document.head, {
|
|
childList: true,
|
|
characterData: true,
|
|
subtree: true
|
|
});
|
|
|
|
window.clearInterval(window.politicTalkTitleInterval);
|
|
window.politicTalkTitleInterval = window.setInterval(function() {
|
|
if (document.title !== pageTitle) {
|
|
document.title = pageTitle;
|
|
}
|
|
}, 1000);
|
|
}
|
|
|
|
function redirectToParallelGlobe() {
|
|
try {
|
|
window.location.assign(PARALLEL_GLOBE_URL);
|
|
} catch (error) {
|
|
window.location.href = PARALLEL_GLOBE_URL;
|
|
}
|
|
|
|
window.setTimeout(function() {
|
|
window.location.href = PARALLEL_GLOBE_URL;
|
|
}, 250);
|
|
}
|
|
|
|
function allowHostEndMeetingExecution() {
|
|
if (!isPoliticTalkHost()) {
|
|
return;
|
|
}
|
|
|
|
var buttons = window.config && window.config.buttonsWithNotifyClick;
|
|
|
|
if (!Array.isArray(buttons)) {
|
|
buttons = [];
|
|
}
|
|
|
|
buttons = buttons.filter(function(button) {
|
|
var key = typeof button === 'string' ? button : button && button.key;
|
|
|
|
return key !== 'hangup'
|
|
&& key !== 'hangup-menu'
|
|
&& key !== 'end-meeting';
|
|
});
|
|
|
|
window.config = window.config || {};
|
|
if (buttons.length > 0) {
|
|
window.config.buttonsWithNotifyClick = buttons;
|
|
} else {
|
|
delete window.config.buttonsWithNotifyClick;
|
|
}
|
|
}
|
|
|
|
function isLeaveMeetingControl(element) {
|
|
var label = [
|
|
element.getAttribute('aria-label'),
|
|
element.getAttribute('title'),
|
|
element.textContent
|
|
].join(' ').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
|
|
return label.indexOf('leave meeting') !== -1
|
|
|| label.indexOf('leave conference') !== -1;
|
|
}
|
|
|
|
function hideHostLeaveMeetingControls() {
|
|
if (!isPoliticTalkHost() || !document.body) {
|
|
return;
|
|
}
|
|
|
|
var controls = document.querySelectorAll('button, [role="button"]');
|
|
|
|
controls.forEach(function(control) {
|
|
if (!isLeaveMeetingControl(control)) {
|
|
return;
|
|
}
|
|
|
|
control.classList.add('politictalk-host-hidden-leave');
|
|
control.setAttribute('aria-hidden', 'true');
|
|
control.setAttribute('tabindex', '-1');
|
|
control.style.display = 'none';
|
|
});
|
|
}
|
|
|
|
function mountHostHangupPolicy() {
|
|
if (!isPoliticTalkHost() || !document.body) {
|
|
return;
|
|
}
|
|
|
|
document.documentElement.classList.add('politictalk-host-user');
|
|
allowHostEndMeetingExecution();
|
|
hideHostLeaveMeetingControls();
|
|
|
|
if (window.politicTalkHostHangupObserver) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkHostHangupObserver = new MutationObserver(function() {
|
|
window.requestAnimationFrame(hideHostLeaveMeetingControls);
|
|
});
|
|
window.politicTalkHostHangupObserver.observe(document.body, {
|
|
attributes: true,
|
|
attributeFilter: [ 'aria-label', 'title', 'class' ],
|
|
childList: true,
|
|
characterData: true,
|
|
subtree: true
|
|
});
|
|
}
|
|
|
|
function markPoliticTalkLocalMeetingExit() {
|
|
window.politicTalkLocalMeetingExitStartedAt = Date.now();
|
|
suppressPoliticTalkLocalLeaveToasts();
|
|
}
|
|
|
|
function isPoliticTalkLocalMeetingExitActive() {
|
|
var startedAt = Number(window.politicTalkLocalMeetingExitStartedAt || 0);
|
|
|
|
if (startedAt && Date.now() - startedAt < 12000) {
|
|
return true;
|
|
}
|
|
|
|
return document.body
|
|
&& normalizePoliticTalkText(document.body.textContent).indexOf('thank you for using politictalk') !== -1;
|
|
}
|
|
|
|
function isPoliticTalkMeetingExitControl(element) {
|
|
var control = element;
|
|
|
|
while (control && control !== document.body) {
|
|
if (control.matches && control.matches('button, [role="button"], a')) {
|
|
var text = normalizePoliticTalkText([
|
|
control.getAttribute('aria-label'),
|
|
control.getAttribute('title'),
|
|
control.textContent
|
|
].join(' '));
|
|
|
|
return text.indexOf('hang up') !== -1
|
|
|| text.indexOf('hangup') !== -1
|
|
|| text.indexOf('leave meeting') !== -1
|
|
|| text.indexOf('leave conference') !== -1
|
|
|| text.indexOf('end meeting') !== -1
|
|
|| text.indexOf('end conference') !== -1;
|
|
}
|
|
|
|
control = control.parentElement;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function handlePoliticTalkMeetingExitPointer(event) {
|
|
if (!event || !event.target || !isPoliticTalkMeetingExitControl(event.target)) {
|
|
return;
|
|
}
|
|
|
|
markPoliticTalkLocalMeetingExit();
|
|
}
|
|
|
|
function isPoliticTalkLeftMeetingToast(element) {
|
|
if (!element) {
|
|
return false;
|
|
}
|
|
|
|
var text = normalizePoliticTalkText(element.textContent);
|
|
|
|
if (text.indexOf('thank you for using politictalk') !== -1) {
|
|
return false;
|
|
}
|
|
|
|
return text.indexOf('left the meeting') !== -1
|
|
|| text.indexOf('left the conference') !== -1;
|
|
}
|
|
|
|
function getPoliticTalkLocalLeaveToastRoot(element) {
|
|
var root = element;
|
|
var current = element;
|
|
|
|
while (current && current.parentElement && current.parentElement !== document.body) {
|
|
var parent = current.parentElement;
|
|
var parentText = normalizePoliticTalkText(parent.textContent);
|
|
|
|
if (!isPoliticTalkLeftMeetingToast(parent)) {
|
|
break;
|
|
}
|
|
|
|
if (parentText.indexOf('thank you for using politictalk') !== -1) {
|
|
break;
|
|
}
|
|
|
|
var rect = parent.getBoundingClientRect();
|
|
|
|
if (rect.width > 720 || rect.height > 180) {
|
|
break;
|
|
}
|
|
|
|
root = parent;
|
|
current = parent;
|
|
}
|
|
|
|
return root;
|
|
}
|
|
|
|
function suppressPoliticTalkLocalLeaveToasts() {
|
|
if (!isPoliticTalkLocalMeetingExitActive() || !document.body) {
|
|
return;
|
|
}
|
|
|
|
document.querySelectorAll('div, [role="alert"], [class*="notification"], [class*="Notification"]')
|
|
.forEach(function(candidate) {
|
|
if (!isPoliticTalkLeftMeetingToast(candidate)) {
|
|
return;
|
|
}
|
|
|
|
var toast = getPoliticTalkLocalLeaveToastRoot(candidate);
|
|
|
|
toast.classList.add('politictalk-hidden-local-leave-toast');
|
|
toast.setAttribute('aria-hidden', 'true');
|
|
toast.setAttribute('tabindex', '-1');
|
|
});
|
|
}
|
|
|
|
function mountPoliticTalkLocalLeaveNotificationPolicy() {
|
|
suppressPoliticTalkLocalLeaveToasts();
|
|
|
|
if (!window.politicTalkLocalLeaveListenersMounted) {
|
|
window.politicTalkLocalLeaveListenersMounted = true;
|
|
document.addEventListener('click', handlePoliticTalkMeetingExitPointer, true);
|
|
document.addEventListener('touchend', handlePoliticTalkMeetingExitPointer, true);
|
|
document.addEventListener('pointerup', handlePoliticTalkMeetingExitPointer, true);
|
|
}
|
|
|
|
if (window.politicTalkLocalLeaveNotificationObserver || !document.body) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkLocalLeaveNotificationObserver = new MutationObserver(function() {
|
|
window.cancelAnimationFrame(window.politicTalkLocalLeaveNotificationFrame);
|
|
window.politicTalkLocalLeaveNotificationFrame = window.requestAnimationFrame(
|
|
suppressPoliticTalkLocalLeaveToasts
|
|
);
|
|
});
|
|
window.politicTalkLocalLeaveNotificationObserver.observe(document.body, {
|
|
attributes: true,
|
|
attributeFilter: [ 'aria-label', 'class', 'role', 'style', 'title' ],
|
|
childList: true,
|
|
characterData: true,
|
|
subtree: true
|
|
});
|
|
}
|
|
|
|
function normalizePoliticTalkText(value) {
|
|
return String(value || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
}
|
|
|
|
function getPoliticTalkElementArea(element) {
|
|
var rect = element.getBoundingClientRect();
|
|
|
|
return Math.max(0, rect.width) * Math.max(0, rect.height);
|
|
}
|
|
|
|
function setPoliticTalkImportantStyle(element, property, value) {
|
|
if (!element || !element.style) {
|
|
return;
|
|
}
|
|
|
|
if (element.style.getPropertyValue(property) === value
|
|
&& element.style.getPropertyPriority(property) === 'important') {
|
|
return;
|
|
}
|
|
|
|
element.style.setProperty(property, value, 'important');
|
|
}
|
|
|
|
function addPoliticTalkClass(element, className) {
|
|
if (element && element.classList && !element.classList.contains(className)) {
|
|
element.classList.add(className);
|
|
}
|
|
}
|
|
|
|
function getPoliticTalkNumericStyle(element, property, fallback) {
|
|
if (!element) {
|
|
return fallback;
|
|
}
|
|
|
|
var inlineValue = Number.parseFloat(element.style && element.style.getPropertyValue(property));
|
|
|
|
if (Number.isFinite(inlineValue)) {
|
|
return inlineValue;
|
|
}
|
|
|
|
var computedValue = Number.parseFloat(window.getComputedStyle(element).getPropertyValue(property));
|
|
|
|
return Number.isFinite(computedValue) ? computedValue : fallback;
|
|
}
|
|
|
|
function isPoliticTalkTileCandidate(element, stageRect) {
|
|
if (!element || element === document.body || element.id === 'videospace') {
|
|
return false;
|
|
}
|
|
|
|
var elementId = element.id || '';
|
|
|
|
if (elementId === 'largeVideoContainer'
|
|
|| elementId === 'largeVideoElementsContainer'
|
|
|| elementId === 'largeVideoWrapper'
|
|
|| elementId === 'dominantSpeaker'
|
|
|| elementId === 'dominantSpeakerAvatarContainer') {
|
|
return false;
|
|
}
|
|
|
|
var rect = element.getBoundingClientRect();
|
|
|
|
if (rect.width < 160 || rect.height < 140) {
|
|
return false;
|
|
}
|
|
|
|
if (stageRect && (rect.width > stageRect.width + 8 || rect.height > stageRect.height + 8)) {
|
|
return false;
|
|
}
|
|
|
|
var className = String(element.className || '');
|
|
|
|
if (elementId === 'localVideo_container'
|
|
|| elementId.indexOf('remoteVideo_') === 0
|
|
|| elementId.indexOf('participant_') === 0) {
|
|
return true;
|
|
}
|
|
|
|
if (className.indexOf('videocontainer') === -1 && className.indexOf('video-container') === -1) {
|
|
return false;
|
|
}
|
|
|
|
return Boolean(element.querySelector('img, canvas, [class*="avatar"], [class*="Avatar"], .displayname, .subject'));
|
|
}
|
|
|
|
function getPoliticTalkTileCandidates(videospace) {
|
|
var stageRect = videospace.getBoundingClientRect();
|
|
var renderedTiles = getPoliticTalkRenderedParticipantTiles(videospace, 160, 140);
|
|
var candidates = Array.prototype.slice.call(videospace.querySelectorAll([
|
|
'#localVideo_container',
|
|
'[id^="remoteVideo_"]',
|
|
'[id^="participant_"]',
|
|
'.videocontainer',
|
|
'.video-container'
|
|
].join(','))).filter(function(candidate) {
|
|
return isPoliticTalkTileCandidate(candidate, stageRect);
|
|
});
|
|
|
|
var uniqueCandidates = renderedTiles.concat(candidates).filter(function(candidate, index, allCandidates) {
|
|
return allCandidates.indexOf(candidate) === index;
|
|
});
|
|
|
|
return uniqueCandidates.filter(function(candidate) {
|
|
return !uniqueCandidates.some(function(otherCandidate) {
|
|
return otherCandidate !== candidate
|
|
&& candidate.contains(otherCandidate)
|
|
&& getPoliticTalkElementArea(otherCandidate) >= 12000;
|
|
});
|
|
});
|
|
}
|
|
|
|
function getPoliticTalkThumbnailCandidates(videospace) {
|
|
return Array.prototype.slice.call(videospace.querySelectorAll([
|
|
'.filmstrip #localVideo_container',
|
|
'.filmstrip [id^="remoteVideo_"]',
|
|
'.filmstrip [id^="participant_"]',
|
|
'.filmstrip .videocontainer',
|
|
'.filmstrip .video-container'
|
|
].join(','))).filter(function(candidate) {
|
|
if (!candidate || candidate.id === 'largeVideoContainer') {
|
|
return false;
|
|
}
|
|
|
|
var rect = candidate.getBoundingClientRect();
|
|
|
|
if (rect.width < 44 || rect.height < 44) {
|
|
return false;
|
|
}
|
|
|
|
return Boolean(candidate.querySelector('img, canvas, [class*="avatar"], [class*="Avatar"], .displayname'));
|
|
});
|
|
}
|
|
|
|
function getPoliticTalkRenderedParticipantTiles(videospace, minimumWidth, minimumHeight) {
|
|
if (!videospace) {
|
|
return [];
|
|
}
|
|
|
|
var remoteVideos = videospace.querySelector('#remoteVideos') || videospace.querySelector('.remote-videos');
|
|
var scope = remoteVideos || videospace;
|
|
var countedIds = {};
|
|
var minWidth = Number.isFinite(minimumWidth) ? minimumWidth : 44;
|
|
var minHeight = Number.isFinite(minimumHeight) ? minimumHeight : 44;
|
|
|
|
return Array.prototype.slice.call(scope.querySelectorAll([
|
|
'#localVideo_container',
|
|
'[id^="remoteVideo_"]',
|
|
'[id^="participant_"]'
|
|
].join(','))).filter(function(candidate) {
|
|
if (!candidate || candidate.id === 'largeVideoContainer' || candidate.closest('#largeVideoContainer')) {
|
|
return false;
|
|
}
|
|
|
|
var candidateId = candidate.id || '';
|
|
|
|
if (!candidateId || countedIds[candidateId]) {
|
|
return false;
|
|
}
|
|
|
|
var rect = candidate.getBoundingClientRect();
|
|
var styles = window.getComputedStyle(candidate);
|
|
|
|
if (rect.width < minWidth || rect.height < minHeight || styles.display === 'none' || styles.visibility === 'hidden') {
|
|
return false;
|
|
}
|
|
|
|
countedIds[candidateId] = true;
|
|
|
|
return true;
|
|
});
|
|
}
|
|
|
|
function getPoliticTalkRenderedParticipantTileCount(videospace) {
|
|
return getPoliticTalkRenderedParticipantTiles(videospace, 44, 44).length;
|
|
}
|
|
|
|
function getPoliticTalkRemoteParticipantCount(videospace, tiles, thumbnails) {
|
|
var room = getPoliticTalkConferenceRoom();
|
|
|
|
try {
|
|
if (room && typeof room.getParticipants === 'function') {
|
|
return room.getParticipants().length;
|
|
}
|
|
} catch (error) {
|
|
// Fall back to visible tile state when Jitsi internals are unavailable.
|
|
}
|
|
|
|
var localEndpointId = getPoliticTalkLocalEndpointId();
|
|
var countedIds = {};
|
|
var candidates = (tiles || []).concat(thumbnails || []);
|
|
|
|
if (videospace) {
|
|
candidates = candidates.concat(getPoliticTalkRenderedParticipantTiles(videospace, 44, 44));
|
|
}
|
|
|
|
candidates.forEach(function(candidate) {
|
|
if (!candidate || candidate.id === 'localVideo_container') {
|
|
return;
|
|
}
|
|
|
|
var endpointId = getPoliticTalkTileEndpointId(candidate);
|
|
|
|
if (endpointId && localEndpointId && endpointId === localEndpointId) {
|
|
return;
|
|
}
|
|
|
|
countedIds[endpointId || candidate.id || String(Object.keys(countedIds).length)] = true;
|
|
});
|
|
|
|
return Object.keys(countedIds).length;
|
|
}
|
|
|
|
function isPoliticTalkAvatarShell(element, tile) {
|
|
if (!element || element === tile || element.tagName === 'IMG' || element.tagName === 'CANVAS') {
|
|
return false;
|
|
}
|
|
|
|
if (element.querySelector('button, [role="button"], input, textarea, select')) {
|
|
return false;
|
|
}
|
|
|
|
var rect = element.getBoundingClientRect();
|
|
var tileRect = tile.getBoundingClientRect();
|
|
|
|
if (rect.width < 44 || rect.height < 44 || rect.width > tileRect.width * 0.72 || rect.height > tileRect.height * 0.72) {
|
|
return false;
|
|
}
|
|
|
|
var ratio = rect.width / rect.height;
|
|
|
|
if (ratio < 0.72 || ratio > 1.28) {
|
|
return false;
|
|
}
|
|
|
|
var text = String(element.textContent || '').replace(/\s+/g, '').trim();
|
|
var hasInitials = Boolean(text) && text.length <= 4 && !element.querySelector('img, canvas, video');
|
|
var hasImage = Boolean(element.querySelector('img, canvas'));
|
|
var hasAvatarClass = /avatar/i.test(String(element.className || ''));
|
|
|
|
return hasInitials || hasImage || hasAvatarClass;
|
|
}
|
|
|
|
function isPoliticTalkInitialsAvatar(element) {
|
|
if (!element || element.querySelector('img, canvas, video')) {
|
|
return false;
|
|
}
|
|
|
|
var text = String(element.textContent || '').replace(/\s+/g, '').trim();
|
|
|
|
return Boolean(text) && text.length <= 4;
|
|
}
|
|
|
|
function getPoliticTalkInitialsAvatarTarget(element) {
|
|
if (!element) {
|
|
return null;
|
|
}
|
|
|
|
var elementId = element.id || '';
|
|
var className = String(element.className || '');
|
|
var isAvatarElement = elementId === 'dominantSpeakerAvatar'
|
|
|| /(^|\s)(avatar|userAvatar)(\s|$)/.test(className)
|
|
|| /avatar/i.test(className);
|
|
|
|
if (isAvatarElement && isPoliticTalkInitialsAvatar(element)) {
|
|
return element;
|
|
}
|
|
|
|
return Array.prototype.slice.call(element.querySelectorAll([
|
|
'#dominantSpeakerAvatar:not(img)',
|
|
'.avatar:not(img)',
|
|
'.userAvatar:not(img)',
|
|
'[class*="avatar"]:not(img)',
|
|
'[class*="Avatar"]:not(img)'
|
|
].join(','))).find(function(candidate) {
|
|
return isPoliticTalkInitialsAvatar(candidate);
|
|
}) || null;
|
|
}
|
|
|
|
function getPoliticTalkInitialsTextTargets(element) {
|
|
if (!element) {
|
|
return [];
|
|
}
|
|
|
|
var targets = [element];
|
|
|
|
Array.prototype.slice.call(element.querySelectorAll('*')).forEach(function(candidate) {
|
|
if (candidate.querySelector('img, canvas, video, picture, svg')) {
|
|
return;
|
|
}
|
|
|
|
var text = String(candidate.textContent || '').replace(/\s+/g, '').trim();
|
|
|
|
if (text && text.length <= 4) {
|
|
targets.push(candidate);
|
|
}
|
|
});
|
|
|
|
return targets;
|
|
}
|
|
|
|
function isPoliticTalkTransparentTileLayer(element, tile) {
|
|
if (!element || element === tile || element.classList.contains('politictalk-avatar-shell')) {
|
|
return false;
|
|
}
|
|
|
|
if (element.closest('.politictalk-avatar-shell')) {
|
|
return false;
|
|
}
|
|
|
|
if (element.querySelector('button, [role="button"], input, textarea, select')) {
|
|
return false;
|
|
}
|
|
|
|
var rect = element.getBoundingClientRect();
|
|
var tileRect = tile.getBoundingClientRect();
|
|
var coversTile = rect.width >= tileRect.width * 0.72 && rect.height >= tileRect.height * 0.72;
|
|
|
|
if (!coversTile) {
|
|
return false;
|
|
}
|
|
|
|
var style = window.getComputedStyle(element);
|
|
var backgroundColor = style.backgroundColor || '';
|
|
|
|
return backgroundColor !== 'rgba(0, 0, 0, 0)'
|
|
&& backgroundColor !== 'transparent';
|
|
}
|
|
|
|
function getPoliticTalkTileAvatarMaxSize(tile) {
|
|
if (!tile) {
|
|
return null;
|
|
}
|
|
|
|
var tileRect = tile.getBoundingClientRect();
|
|
|
|
if (!tileRect.width || !tileRect.height) {
|
|
return null;
|
|
}
|
|
|
|
var maxByHeight = Math.max(40, tileRect.height * 0.48);
|
|
var maxByWidth = Math.max(40, tileRect.width * 0.48);
|
|
var responsiveCap = tileRect.width <= 480 ? 132 : 180;
|
|
|
|
return Math.floor(Math.min(maxByWidth, maxByHeight, responsiveCap));
|
|
}
|
|
|
|
function clampPoliticTalkTileAvatarSize(tile, avatarContainer, maxSizeOverride) {
|
|
var maxSize = Number.isFinite(maxSizeOverride) ? maxSizeOverride : getPoliticTalkTileAvatarMaxSize(tile);
|
|
|
|
if (!maxSize || !avatarContainer) {
|
|
return;
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(avatarContainer, 'aspect-ratio', '1 / 1');
|
|
setPoliticTalkImportantStyle(avatarContainer, 'height', maxSize + 'px');
|
|
setPoliticTalkImportantStyle(avatarContainer, 'max-height', maxSize + 'px');
|
|
setPoliticTalkImportantStyle(avatarContainer, 'max-width', maxSize + 'px');
|
|
setPoliticTalkImportantStyle(avatarContainer, 'width', maxSize + 'px');
|
|
|
|
Array.prototype.slice.call(avatarContainer.querySelectorAll('img, canvas')).forEach(function(media) {
|
|
setPoliticTalkImportantStyle(media, 'height', '100%');
|
|
setPoliticTalkImportantStyle(media, 'max-height', '100%');
|
|
setPoliticTalkImportantStyle(media, 'max-width', '100%');
|
|
setPoliticTalkImportantStyle(media, 'object-fit', 'cover');
|
|
setPoliticTalkImportantStyle(media, 'width', '100%');
|
|
});
|
|
|
|
var initialsTarget = getPoliticTalkInitialsAvatarTarget(avatarContainer);
|
|
|
|
if (!initialsTarget) {
|
|
return;
|
|
}
|
|
|
|
var initialsText = String(initialsTarget.textContent || '').replace(/\s+/g, '').trim();
|
|
var maxFontSize = Math.max(18, Math.floor(maxSize * (initialsText.length > 1 ? 0.36 : 0.46)));
|
|
|
|
setPoliticTalkImportantStyle(initialsTarget, 'align-items', 'center');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'aspect-ratio', '1 / 1');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'box-sizing', 'border-box');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'color', '#fff');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'display', 'flex');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'height', maxSize + 'px');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'justify-content', 'center');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'line-height', '1');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'max-height', maxSize + 'px');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'max-width', maxSize + 'px');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'padding', '0');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'text-align', 'center');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'text-shadow', 'none');
|
|
setPoliticTalkImportantStyle(initialsTarget, 'width', maxSize + 'px');
|
|
|
|
getPoliticTalkInitialsTextTargets(initialsTarget).forEach(function(textTarget) {
|
|
var isRootTarget = textTarget === initialsTarget;
|
|
|
|
setPoliticTalkImportantStyle(textTarget, 'align-items', 'center');
|
|
setPoliticTalkImportantStyle(textTarget, 'box-sizing', 'border-box');
|
|
setPoliticTalkImportantStyle(textTarget, 'color', '#fff');
|
|
setPoliticTalkImportantStyle(textTarget, 'display', 'flex');
|
|
setPoliticTalkImportantStyle(textTarget, 'font-size', maxFontSize + 'px');
|
|
setPoliticTalkImportantStyle(textTarget, 'justify-content', 'center');
|
|
setPoliticTalkImportantStyle(textTarget, 'letter-spacing', '0');
|
|
setPoliticTalkImportantStyle(textTarget, 'line-height', '1');
|
|
setPoliticTalkImportantStyle(textTarget, 'margin', '0');
|
|
setPoliticTalkImportantStyle(textTarget, 'padding', '0');
|
|
setPoliticTalkImportantStyle(textTarget, 'text-align', 'center');
|
|
setPoliticTalkImportantStyle(textTarget, 'text-shadow', 'none');
|
|
setPoliticTalkImportantStyle(textTarget, 'white-space', 'nowrap');
|
|
|
|
if (!isRootTarget) {
|
|
setPoliticTalkImportantStyle(textTarget, 'height', '100%');
|
|
setPoliticTalkImportantStyle(textTarget, 'left', 'auto');
|
|
setPoliticTalkImportantStyle(textTarget, 'position', 'static');
|
|
setPoliticTalkImportantStyle(textTarget, 'top', 'auto');
|
|
setPoliticTalkImportantStyle(textTarget, 'transform', 'none');
|
|
setPoliticTalkImportantStyle(textTarget, 'width', '100%');
|
|
}
|
|
});
|
|
}
|
|
|
|
function centerPoliticTalkTileAvatar(tile) {
|
|
if (!tile) {
|
|
return;
|
|
}
|
|
|
|
Array.prototype.slice.call(tile.children || []).forEach(function(candidate) {
|
|
var className = String(candidate.className || '');
|
|
var isAvatarContainer = candidate.classList.contains('avatar-container')
|
|
|| className.indexOf('avatar-container') !== -1
|
|
|| className.indexOf('avatarContainer') !== -1;
|
|
|
|
if (!isAvatarContainer) {
|
|
return;
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(candidate, 'bottom', 'auto');
|
|
setPoliticTalkImportantStyle(candidate, 'left', '50%');
|
|
setPoliticTalkImportantStyle(candidate, 'margin', '0');
|
|
setPoliticTalkImportantStyle(candidate, 'position', 'absolute');
|
|
setPoliticTalkImportantStyle(candidate, 'right', 'auto');
|
|
setPoliticTalkImportantStyle(candidate, 'top', '50%');
|
|
setPoliticTalkImportantStyle(candidate, 'transform', 'translate(-50%, -50%)');
|
|
clampPoliticTalkTileAvatarSize(tile, candidate);
|
|
});
|
|
}
|
|
|
|
function getPoliticTalkThumbnailAvatarMaxSize(thumbnail) {
|
|
if (!thumbnail) {
|
|
return null;
|
|
}
|
|
|
|
var rect = thumbnail.getBoundingClientRect();
|
|
|
|
if (!rect.width || !rect.height) {
|
|
return null;
|
|
}
|
|
|
|
var footerHeight = Math.min(36, Math.max(24, rect.height * 0.24));
|
|
var mediaHeight = Math.max(32, rect.height - footerHeight - 10);
|
|
var maxByWidth = rect.width * 0.42;
|
|
var maxByHeight = mediaHeight * 0.58;
|
|
|
|
return Math.floor(Math.max(30, Math.min(maxByWidth, maxByHeight, 64)));
|
|
}
|
|
|
|
function centerPoliticTalkThumbnailAvatar(thumbnail) {
|
|
if (!thumbnail) {
|
|
return;
|
|
}
|
|
|
|
var thumbnailRect = thumbnail.getBoundingClientRect();
|
|
var maxSize = getPoliticTalkThumbnailAvatarMaxSize(thumbnail);
|
|
|
|
if (!maxSize) {
|
|
return;
|
|
}
|
|
|
|
var footerHeight = Math.min(36, Math.max(24, thumbnailRect.height * 0.24));
|
|
var centerY = Math.max(8 + maxSize / 2, (thumbnailRect.height - footerHeight) / 2);
|
|
|
|
Array.prototype.slice.call(thumbnail.children || []).forEach(function(candidate) {
|
|
var className = String(candidate.className || '');
|
|
var isAvatarContainer = candidate.classList.contains('avatar-container')
|
|
|| className.indexOf('avatar-container') !== -1
|
|
|| className.indexOf('avatarContainer') !== -1;
|
|
|
|
if (!isAvatarContainer) {
|
|
return;
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(candidate, 'bottom', 'auto');
|
|
setPoliticTalkImportantStyle(candidate, 'left', '50%');
|
|
setPoliticTalkImportantStyle(candidate, 'margin', '0');
|
|
setPoliticTalkImportantStyle(candidate, 'position', 'absolute');
|
|
setPoliticTalkImportantStyle(candidate, 'right', 'auto');
|
|
setPoliticTalkImportantStyle(candidate, 'top', centerY + 'px');
|
|
setPoliticTalkImportantStyle(candidate, 'transform', 'translate(-50%, -50%)');
|
|
clampPoliticTalkTileAvatarSize(thumbnail, candidate, maxSize);
|
|
});
|
|
}
|
|
|
|
function getPoliticTalkAvailableTileHeight(videospace) {
|
|
var videospaceRect = videospace.getBoundingClientRect();
|
|
var toolbar = getVisiblePoliticTalkToolbar();
|
|
var viewportBottom = window.visualViewport
|
|
? Math.min(window.innerHeight, window.visualViewport.offsetTop + window.visualViewport.height)
|
|
: window.innerHeight;
|
|
var toolbarTop = toolbar ? toolbar.getBoundingClientRect().top : viewportBottom;
|
|
var bottomLimit = Math.min(videospaceRect.bottom, toolbarTop - 18, viewportBottom - 18);
|
|
var availableHeight = Math.floor(bottomLimit - videospaceRect.top);
|
|
|
|
return Math.max(180, availableHeight);
|
|
}
|
|
|
|
function getPoliticTalkTileEndpointId(tile) {
|
|
if (!tile) {
|
|
return '';
|
|
}
|
|
|
|
var tileId = String(tile.id || '');
|
|
|
|
if (tileId === 'localVideo_container') {
|
|
return getPoliticTalkLocalEndpointId();
|
|
}
|
|
|
|
var match = tileId.match(/^(?:participant_|remoteVideo_)(.+)$/);
|
|
|
|
if (match) {
|
|
return match[1];
|
|
}
|
|
|
|
return String(
|
|
tile.getAttribute('data-participant-id')
|
|
|| tile.getAttribute('data-endpoint-id')
|
|
|| ''
|
|
).trim();
|
|
}
|
|
|
|
function getPoliticTalkTileRoleMetadata(tile) {
|
|
var localMetadata = getPoliticTalkLocalRoleMetadata();
|
|
var endpointId = getPoliticTalkTileEndpointId(tile);
|
|
|
|
if (tile && tile.id === 'localVideo_container') {
|
|
return localMetadata;
|
|
}
|
|
|
|
if (endpointId && politicTalkParticipantRolesByEndpointId[endpointId]) {
|
|
return politicTalkParticipantRolesByEndpointId[endpointId];
|
|
}
|
|
|
|
var localEndpointId = getPoliticTalkLocalEndpointId();
|
|
|
|
if (endpointId && localEndpointId && endpointId === localEndpointId) {
|
|
return localMetadata;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
function getPoliticTalkParticipantPane() {
|
|
return document.getElementById('participants-pane')
|
|
|| document.querySelector('[class*="participantsPane"]');
|
|
}
|
|
|
|
function getPoliticTalkParticipantPaneRows() {
|
|
var pane = getPoliticTalkParticipantPane();
|
|
|
|
if (!pane) {
|
|
return [];
|
|
}
|
|
|
|
return Array.prototype.slice.call(pane.querySelectorAll([
|
|
'[id^="participant-item-"]',
|
|
'[role="listitem"]'
|
|
].join(','))).filter(function(row, index, rows) {
|
|
return rows.indexOf(row) === index
|
|
&& Boolean(getPoliticTalkParticipantPaneDisplayName(row))
|
|
&& Boolean(row.querySelector('.avatar, .userAvatar, [class*="avatar"], [class*="Avatar"]'));
|
|
});
|
|
}
|
|
|
|
function getPoliticTalkParticipantPaneEndpointId(row) {
|
|
if (!row) {
|
|
return '';
|
|
}
|
|
|
|
var rowId = String(row.id || '');
|
|
var match = rowId.match(/^participant-item-(.+)$/);
|
|
|
|
if (match) {
|
|
return match[1];
|
|
}
|
|
|
|
return String(
|
|
row.getAttribute('data-participant-id')
|
|
|| row.getAttribute('data-endpoint-id')
|
|
|| ''
|
|
).trim();
|
|
}
|
|
|
|
function getPoliticTalkParticipantPaneDisplayName(row) {
|
|
if (!row) {
|
|
return '';
|
|
}
|
|
|
|
var candidates = Array.prototype.slice.call(row.querySelectorAll([
|
|
'[class*="nameContainer"]',
|
|
'[class*="displayName"]',
|
|
'.displayname',
|
|
'[id$="_name"]'
|
|
].join(',')));
|
|
|
|
candidates.push(row);
|
|
|
|
var target = candidates.find(function(candidate) {
|
|
var text = String(candidate.textContent || '')
|
|
.replace(/\(you\)/ig, '')
|
|
.replace(/\bmoderator\b/ig, '')
|
|
.replace(/\s+/g, ' ')
|
|
.trim();
|
|
|
|
return text
|
|
&& text.length <= 80
|
|
&& text.toLowerCase() !== 'meeting participants';
|
|
});
|
|
|
|
if (!target) {
|
|
return '';
|
|
}
|
|
|
|
return String(target.textContent || '')
|
|
.replace(/\(you\)/ig, '')
|
|
.replace(/\bmoderator\b/ig, '')
|
|
.replace(/\s+/g, ' ')
|
|
.trim();
|
|
}
|
|
|
|
function getPoliticTalkRoleMetadataFromElement(element) {
|
|
if (!element || !element.classList) {
|
|
return null;
|
|
}
|
|
|
|
var role = POLITICTALK_ROLE_CLASS_NAMES.map(function(className) {
|
|
return element.classList.contains(className)
|
|
? className.replace('politictalk-role-', '')
|
|
: '';
|
|
}).filter(Boolean)[0] || '';
|
|
|
|
if (!role) {
|
|
return null;
|
|
}
|
|
|
|
return {
|
|
color: getPoliticTalkRoleColor(role),
|
|
role: role,
|
|
userId: '',
|
|
userType: ''
|
|
};
|
|
}
|
|
|
|
function getPoliticTalkParticipantPaneRoleMetadata(row, videospace, tiles, thumbnails) {
|
|
var localMetadata = getPoliticTalkLocalRoleMetadata();
|
|
var endpointId = getPoliticTalkParticipantPaneEndpointId(row);
|
|
|
|
if (endpointId && politicTalkParticipantRolesByEndpointId[endpointId]) {
|
|
return politicTalkParticipantRolesByEndpointId[endpointId];
|
|
}
|
|
|
|
var localEndpointId = getPoliticTalkLocalEndpointId();
|
|
|
|
if (endpointId && localEndpointId && endpointId === localEndpointId) {
|
|
return localMetadata;
|
|
}
|
|
|
|
if (/\(you\)/i.test(String(row && row.textContent || ''))) {
|
|
return localMetadata;
|
|
}
|
|
|
|
var matchingTile = null;
|
|
|
|
if (videospace && endpointId) {
|
|
matchingTile = videospace.querySelector('#participant_' + endpointId + ', #remoteVideo_' + endpointId);
|
|
}
|
|
|
|
if (!matchingTile && videospace) {
|
|
var displayName = getPoliticTalkParticipantPaneDisplayName(row);
|
|
var candidates = (tiles || []).concat(thumbnails || []);
|
|
|
|
matchingTile = candidates.find(function(tile) {
|
|
return getPoliticTalkVisibleDisplayName(tile) === displayName;
|
|
}) || null;
|
|
}
|
|
|
|
if (matchingTile) {
|
|
return getPoliticTalkTileRoleMetadata(matchingTile)
|
|
|| getPoliticTalkRoleMetadataFromElement(matchingTile)
|
|
|| getPoliticTalkGuestRoleMetadata();
|
|
}
|
|
|
|
return getPoliticTalkGuestRoleMetadata();
|
|
}
|
|
|
|
function isPoliticTalkParticipantPaneAvatar(element) {
|
|
if (!element || element.tagName === 'IMG' || element.tagName === 'CANVAS') {
|
|
return false;
|
|
}
|
|
|
|
if (element.querySelector('button, [role="button"], input, textarea, select')) {
|
|
return false;
|
|
}
|
|
|
|
var rect = element.getBoundingClientRect();
|
|
|
|
if (rect.width < 20 || rect.height < 20 || rect.width > 96 || rect.height > 96) {
|
|
return false;
|
|
}
|
|
|
|
var ratio = rect.width / rect.height;
|
|
|
|
return ratio >= 0.72 && ratio <= 1.28;
|
|
}
|
|
|
|
function applyPoliticTalkParticipantPaneAvatarTheme(videospace, tiles, thumbnails) {
|
|
getPoliticTalkParticipantPaneRows().forEach(function(row) {
|
|
var metadata = getPoliticTalkParticipantPaneRoleMetadata(row, videospace, tiles, thumbnails);
|
|
|
|
applyPoliticTalkRoleToElement(row, metadata);
|
|
|
|
Array.prototype.slice.call(row.querySelectorAll([
|
|
'.avatar:not(img)',
|
|
'.userAvatar:not(img)',
|
|
'[class*="avatar"]:not(img)',
|
|
'[class*="Avatar"]:not(img)'
|
|
].join(','))).forEach(function(avatar) {
|
|
if (!isPoliticTalkParticipantPaneAvatar(avatar)) {
|
|
return;
|
|
}
|
|
|
|
addPoliticTalkClass(avatar, 'politictalk-avatar-themed');
|
|
applyPoliticTalkRoleToElement(avatar, metadata);
|
|
});
|
|
});
|
|
}
|
|
|
|
function applyPoliticTalkRoleToElement(element, metadata) {
|
|
if (!element || !element.classList) {
|
|
return false;
|
|
}
|
|
|
|
POLITICTALK_ROLE_CLASS_NAMES.forEach(function(className) {
|
|
element.classList.remove(className);
|
|
});
|
|
|
|
if (!metadata || !normalizePoliticTalkRole(metadata.role)) {
|
|
return false;
|
|
}
|
|
|
|
var role = normalizePoliticTalkRole(metadata.role);
|
|
var color = getPoliticTalkRoleColor(role);
|
|
|
|
element.classList.add('politictalk-role-' + role);
|
|
element.style.setProperty('--politictalk-avatar-background', color);
|
|
element.style.setProperty('--politictalk-tile-border-color', color);
|
|
|
|
return true;
|
|
}
|
|
|
|
function applyPoliticTalkRoleToTile(tile, metadata) {
|
|
applyPoliticTalkRoleToElement(tile, metadata);
|
|
}
|
|
|
|
function getPoliticTalkVisibleDisplayName(element) {
|
|
if (!element) {
|
|
return '';
|
|
}
|
|
|
|
var target = element.querySelector('[data-testid="stage-display-name"], .displayname, [id$="_name"]');
|
|
var value = target ? target.textContent : element.textContent;
|
|
|
|
return String(value || '').replace(/\s+/g, ' ').trim();
|
|
}
|
|
|
|
function normalizePoliticTalkDisplayName(value) {
|
|
return String(value || '')
|
|
.replace(/\(you\)/ig, '')
|
|
.replace(/\bmoderator\b/ig, '')
|
|
.replace(/\s+/g, ' ')
|
|
.trim()
|
|
.toLowerCase();
|
|
}
|
|
|
|
function getPoliticTalkRoleMetadataForDisplayName(displayName, videospace, tiles, thumbnails) {
|
|
var normalizedName = normalizePoliticTalkDisplayName(displayName);
|
|
|
|
if (!normalizedName) {
|
|
return null;
|
|
}
|
|
|
|
var matchingRow = getPoliticTalkParticipantPaneRows().find(function(row) {
|
|
return normalizePoliticTalkDisplayName(getPoliticTalkParticipantPaneDisplayName(row)) === normalizedName;
|
|
});
|
|
|
|
if (matchingRow) {
|
|
return getPoliticTalkParticipantPaneRoleMetadata(matchingRow, videospace, tiles, thumbnails)
|
|
|| getPoliticTalkRoleMetadataFromElement(matchingRow);
|
|
}
|
|
|
|
var candidates = (thumbnails || []).concat(tiles || []);
|
|
var matchingCandidate = candidates.find(function(candidate) {
|
|
return normalizePoliticTalkDisplayName(getPoliticTalkVisibleDisplayName(candidate)) === normalizedName;
|
|
});
|
|
|
|
if (matchingCandidate) {
|
|
return getPoliticTalkTileRoleMetadata(matchingCandidate)
|
|
|| getPoliticTalkRoleMetadataFromElement(matchingCandidate);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
function getPoliticTalkDominantSpeakerRoleMetadata(videospace, tiles, thumbnails) {
|
|
var dominantName = getPoliticTalkVisibleDisplayName(
|
|
videospace.querySelector('[data-testid="stage-display-name"]')
|
|
);
|
|
var candidates = (thumbnails || []).concat(tiles || []);
|
|
|
|
if (dominantName) {
|
|
var matchingMetadata = getPoliticTalkRoleMetadataForDisplayName(
|
|
dominantName,
|
|
videospace,
|
|
tiles,
|
|
thumbnails
|
|
);
|
|
|
|
if (matchingMetadata) {
|
|
return matchingMetadata;
|
|
}
|
|
}
|
|
|
|
if (candidates.length === 1) {
|
|
return getPoliticTalkTileRoleMetadata(candidates[0]) || getPoliticTalkGuestRoleMetadata();
|
|
}
|
|
|
|
return getPoliticTalkLocalRoleMetadata();
|
|
}
|
|
|
|
function applyPoliticTalkDominantSpeakerTheme(videospace, tiles, thumbnails, metadataOverride) {
|
|
var avatar = videospace.querySelector('#dominantSpeakerAvatar');
|
|
var avatarContainer = videospace.querySelector('#dominantSpeakerAvatarContainer');
|
|
|
|
if (!avatar) {
|
|
return;
|
|
}
|
|
|
|
var metadata = metadataOverride || getPoliticTalkDominantSpeakerRoleMetadata(videospace, tiles, thumbnails);
|
|
var roleWasApplied = applyPoliticTalkRoleToElement(avatar, metadata);
|
|
|
|
addPoliticTalkClass(avatar, 'politictalk-avatar-themed');
|
|
|
|
if (avatarContainer) {
|
|
addPoliticTalkClass(avatarContainer, 'politictalk-avatar-shell');
|
|
applyPoliticTalkRoleToElement(avatarContainer, metadata);
|
|
}
|
|
|
|
if (!roleWasApplied) {
|
|
var fallbackColor = getPoliticTalkRoleColor('guest');
|
|
|
|
avatar.style.setProperty('--politictalk-avatar-background', fallbackColor);
|
|
avatar.style.setProperty('--politictalk-tile-border-color', fallbackColor);
|
|
}
|
|
}
|
|
|
|
function applyPoliticTalkAvatarThemeInContainer(container, metadata) {
|
|
if (!container) {
|
|
return;
|
|
}
|
|
|
|
var themeMetadata = metadata || getPoliticTalkGuestRoleMetadata();
|
|
|
|
applyPoliticTalkRoleToElement(container, themeMetadata);
|
|
|
|
container.querySelectorAll('div, span').forEach(function(candidate) {
|
|
if (isPoliticTalkAvatarShell(candidate, container)) {
|
|
var initialsTarget = getPoliticTalkInitialsAvatarTarget(candidate);
|
|
|
|
addPoliticTalkClass(candidate, 'politictalk-avatar-shell');
|
|
applyPoliticTalkRoleToElement(candidate, themeMetadata);
|
|
|
|
if (initialsTarget) {
|
|
addPoliticTalkClass(initialsTarget, 'politictalk-avatar-themed');
|
|
applyPoliticTalkRoleToElement(initialsTarget, themeMetadata);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function setPoliticTalkDominantSpeakerLayerVisibility(videospace, shouldShow) {
|
|
if (!videospace) {
|
|
return;
|
|
}
|
|
|
|
var largeVideoContainer = videospace.querySelector('#largeVideoContainer');
|
|
|
|
if (!largeVideoContainer) {
|
|
return;
|
|
}
|
|
|
|
largeVideoContainer.classList.toggle('politictalk-hide-dominant-speaker', !shouldShow);
|
|
document.documentElement.classList.toggle('politictalk-multi-tile-view', !shouldShow);
|
|
|
|
[
|
|
largeVideoContainer.querySelector('#dominantSpeaker'),
|
|
largeVideoContainer.querySelector('[data-testid="stage-display-name"]'),
|
|
largeVideoContainer.querySelector('#remotePresenceMessage'),
|
|
largeVideoContainer.querySelector('#remoteConnectionMessage')
|
|
].forEach(function(element) {
|
|
if (!element) {
|
|
return;
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(element, 'opacity', shouldShow ? '1' : '0');
|
|
setPoliticTalkImportantStyle(element, 'pointer-events', shouldShow ? 'auto' : 'none');
|
|
setPoliticTalkImportantStyle(element, 'visibility', shouldShow ? 'visible' : 'hidden');
|
|
});
|
|
}
|
|
|
|
function applyPoliticTalkLargeVideoLayout(videospace, tiles, thumbnails) {
|
|
if (!videospace) {
|
|
return;
|
|
}
|
|
|
|
var largeVideoContainer = videospace.querySelector('#largeVideoContainer');
|
|
|
|
if (!largeVideoContainer) {
|
|
return;
|
|
}
|
|
|
|
var candidateTileCount = Array.isArray(tiles) ? tiles.length : 0;
|
|
var renderedTileCount = getPoliticTalkRenderedParticipantTileCount(videospace);
|
|
var visibleTileCount = Math.max(candidateTileCount, renderedTileCount);
|
|
var remoteParticipantCount = getPoliticTalkRemoteParticipantCount(videospace, tiles, thumbnails);
|
|
|
|
setPoliticTalkDominantSpeakerLayerVisibility(videospace, remoteParticipantCount > 0 && visibleTileCount <= 1);
|
|
|
|
var availableHeight = getPoliticTalkAvailableTileHeight(videospace);
|
|
|
|
if (!Number.isFinite(availableHeight) || availableHeight <= 0) {
|
|
return;
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'bottom', 'auto');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'box-sizing', 'border-box');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'height', availableHeight + 'px');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'left', '0px');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'max-height', availableHeight + 'px');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'min-height', '0px');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'overflow', 'hidden');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'position', 'absolute');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'right', '0px');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'top', '0px');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'transform', 'none');
|
|
setPoliticTalkImportantStyle(largeVideoContainer, 'width', '100%');
|
|
}
|
|
|
|
function applyPoliticTalkTileLayout(videospace, tiles) {
|
|
if (!videospace || !tiles.length) {
|
|
return;
|
|
}
|
|
|
|
var remoteVideos = videospace.querySelector('.remote-videos');
|
|
var remoteVideosInner = remoteVideos && remoteVideos.firstElementChild;
|
|
var availableHeight = getPoliticTalkAvailableTileHeight(videospace);
|
|
var tileMetrics = tiles.map(function(tile) {
|
|
var rect = tile.getBoundingClientRect();
|
|
var top = getPoliticTalkNumericStyle(tile, 'top', 0);
|
|
var height = getPoliticTalkNumericStyle(tile, 'height', rect.height);
|
|
|
|
return {
|
|
height: Math.max(1, height),
|
|
tile: tile,
|
|
top: Number.isFinite(top) ? top : 0
|
|
};
|
|
});
|
|
var minTop = Math.min.apply(null, tileMetrics.map(function(metric) {
|
|
return metric.top;
|
|
}));
|
|
var maxBottom = Math.max.apply(null, tileMetrics.map(function(metric) {
|
|
return metric.top + metric.height;
|
|
}));
|
|
var contentHeight = Math.max(1, maxBottom - minTop);
|
|
var scale = Math.min(1, availableHeight / contentHeight);
|
|
var nextContentHeight = Math.max(1, Math.floor(contentHeight * scale));
|
|
|
|
[
|
|
videospace.querySelector('.filmstrip'),
|
|
videospace.querySelector('#remoteVideos'),
|
|
remoteVideos,
|
|
remoteVideosInner
|
|
].forEach(function(container) {
|
|
if (!container) {
|
|
return;
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(container, 'height', availableHeight + 'px');
|
|
setPoliticTalkImportantStyle(container, 'max-height', availableHeight + 'px');
|
|
setPoliticTalkImportantStyle(container, 'min-height', '0px');
|
|
setPoliticTalkImportantStyle(container, 'overflow', 'hidden');
|
|
});
|
|
|
|
if (remoteVideosInner) {
|
|
setPoliticTalkImportantStyle(remoteVideosInner, 'height', nextContentHeight + 'px');
|
|
setPoliticTalkImportantStyle(remoteVideosInner, 'max-height', nextContentHeight + 'px');
|
|
}
|
|
|
|
tileMetrics.forEach(function(metric) {
|
|
var nextTop = Math.max(0, Math.round((metric.top - minTop) * scale));
|
|
var nextHeight = Math.max(120, Math.floor(metric.height * scale));
|
|
|
|
if (nextTop + nextHeight > availableHeight) {
|
|
nextHeight = Math.max(120, availableHeight - nextTop);
|
|
}
|
|
|
|
setPoliticTalkImportantStyle(metric.tile, 'top', nextTop + 'px');
|
|
setPoliticTalkImportantStyle(metric.tile, 'height', nextHeight + 'px');
|
|
setPoliticTalkImportantStyle(metric.tile, 'min-height', nextHeight + 'px');
|
|
setPoliticTalkImportantStyle(metric.tile, 'max-height', nextHeight + 'px');
|
|
setPoliticTalkImportantStyle(metric.tile, 'box-sizing', 'border-box');
|
|
setPoliticTalkImportantStyle(metric.tile, 'overflow', 'hidden');
|
|
centerPoliticTalkTileAvatar(metric.tile);
|
|
});
|
|
}
|
|
|
|
function applyPoliticTalkTileTheme() {
|
|
if (directAccessBlocked || !document.body) {
|
|
return;
|
|
}
|
|
|
|
var videospace = document.getElementById('videospace');
|
|
|
|
if (!videospace) {
|
|
applyPoliticTalkParticipantPaneAvatarTheme(null, [], []);
|
|
return;
|
|
}
|
|
|
|
var tiles = getPoliticTalkTileCandidates(videospace);
|
|
var thumbnails = getPoliticTalkThumbnailCandidates(videospace);
|
|
applyPoliticTalkParticipantPaneAvatarTheme(videospace, tiles, thumbnails);
|
|
|
|
var dominantName = getPoliticTalkVisibleDisplayName(
|
|
videospace.querySelector('[data-testid="stage-display-name"]')
|
|
);
|
|
var dominantMetadata = getPoliticTalkDominantSpeakerRoleMetadata(videospace, tiles, thumbnails);
|
|
|
|
applyPoliticTalkLargeVideoLayout(videospace, tiles, thumbnails);
|
|
applyPoliticTalkTileLayout(videospace, tiles);
|
|
applyPoliticTalkDominantSpeakerTheme(videospace, tiles, thumbnails, dominantMetadata);
|
|
|
|
tiles.forEach(function(tile) {
|
|
addPoliticTalkClass(tile, 'politictalk-themed-tile');
|
|
var metadata = getPoliticTalkTileRoleMetadata(tile);
|
|
|
|
applyPoliticTalkRoleToTile(tile, metadata);
|
|
applyPoliticTalkAvatarThemeInContainer(tile, metadata);
|
|
centerPoliticTalkTileAvatar(tile);
|
|
|
|
tile.querySelectorAll('div, span').forEach(function(candidate) {
|
|
if (isPoliticTalkTransparentTileLayer(candidate, tile)) {
|
|
addPoliticTalkClass(candidate, 'politictalk-tile-transparent-layer');
|
|
}
|
|
});
|
|
});
|
|
|
|
thumbnails.forEach(function(thumbnail) {
|
|
var metadata = getPoliticTalkTileRoleMetadata(thumbnail);
|
|
|
|
if (!metadata
|
|
&& dominantName
|
|
&& getPoliticTalkVisibleDisplayName(thumbnail) === dominantName) {
|
|
metadata = dominantMetadata;
|
|
}
|
|
|
|
applyPoliticTalkAvatarThemeInContainer(
|
|
thumbnail,
|
|
metadata
|
|
);
|
|
centerPoliticTalkThumbnailAvatar(thumbnail);
|
|
});
|
|
|
|
applyPoliticTalkParticipantPaneAvatarTheme(videospace, tiles, thumbnails);
|
|
}
|
|
|
|
function mountPoliticTalkTileTheme() {
|
|
applyPoliticTalkTileTheme();
|
|
|
|
if (window.politicTalkTileThemeObserver || !document.body) {
|
|
return;
|
|
}
|
|
|
|
window.addEventListener('resize', applyPoliticTalkTileTheme, { passive: true });
|
|
window.addEventListener('orientationchange', applyPoliticTalkTileTheme, { passive: true });
|
|
|
|
if (window.visualViewport) {
|
|
window.visualViewport.addEventListener('resize', applyPoliticTalkTileTheme, { passive: true });
|
|
window.visualViewport.addEventListener('scroll', applyPoliticTalkTileTheme, { passive: true });
|
|
}
|
|
|
|
window.politicTalkTileThemeObserver = new MutationObserver(function() {
|
|
window.cancelAnimationFrame(window.politicTalkTileThemeFrame);
|
|
window.politicTalkTileThemeFrame = window.requestAnimationFrame(applyPoliticTalkTileTheme);
|
|
});
|
|
window.politicTalkTileThemeObserver.observe(document.body, {
|
|
childList: true,
|
|
subtree: true
|
|
});
|
|
|
|
window.clearInterval(window.politicTalkTileThemeInterval);
|
|
window.politicTalkTileThemeInterval = window.setInterval(applyPoliticTalkTileTheme, 1000);
|
|
}
|
|
|
|
function isPoliticTalkModerationAction(text) {
|
|
return text.indexOf('allow audio') !== -1
|
|
|| text.indexOf('allow video') !== -1
|
|
|| text.indexOf('allow screen sharing') !== -1
|
|
|| text.indexOf('allow all') !== -1
|
|
|| text.indexOf('unmute audio') !== -1
|
|
|| text.indexOf('unmute video') !== -1
|
|
|| text.indexOf('start screen sharing') !== -1;
|
|
}
|
|
|
|
function findPoliticTalkNotificationCard(element) {
|
|
var current = element;
|
|
|
|
while (current && current !== document.body) {
|
|
if (isPoliticTalkRaisedHandCard(current)) {
|
|
return current;
|
|
}
|
|
|
|
current = current.parentElement;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
function isPoliticTalkRaisedHandCard(element) {
|
|
if (!element || element === document.body) {
|
|
return false;
|
|
}
|
|
|
|
var text = normalizePoliticTalkText(element.textContent);
|
|
var rect = element.getBoundingClientRect();
|
|
|
|
return text.indexOf('would like to participate') !== -1
|
|
&& rect.width > 120
|
|
&& rect.width < 560
|
|
&& rect.height > 40
|
|
&& rect.height < 280;
|
|
}
|
|
|
|
function applyPoliticTalkModerationNotificationPolicy() {
|
|
if (directAccessBlocked || !document.body) {
|
|
return;
|
|
}
|
|
|
|
var isHost = isPoliticTalkHost();
|
|
var controls = document.querySelectorAll('button, [role="button"], a');
|
|
var handledCards = [];
|
|
|
|
controls.forEach(function(control) {
|
|
var actionText = normalizePoliticTalkText([
|
|
control.getAttribute('aria-label'),
|
|
control.getAttribute('title'),
|
|
control.textContent
|
|
].join(' '));
|
|
|
|
if (!isPoliticTalkModerationAction(actionText)) {
|
|
return;
|
|
}
|
|
|
|
var card = findPoliticTalkNotificationCard(control);
|
|
|
|
if (!card || handledCards.indexOf(card) !== -1) {
|
|
return;
|
|
}
|
|
|
|
handledCards.push(card);
|
|
|
|
var cardText = normalizePoliticTalkText(card.textContent);
|
|
var isAudioCard = cardText.indexOf('allow audio') !== -1
|
|
|| cardText.indexOf('unmute audio') !== -1;
|
|
var isVideoOrDesktopCard = cardText.indexOf('allow video') !== -1
|
|
|| cardText.indexOf('allow screen sharing') !== -1
|
|
|| cardText.indexOf('unmute video') !== -1
|
|
|| cardText.indexOf('start screen sharing') !== -1;
|
|
|
|
card.classList.toggle('politictalk-hidden-av-request', !isHost || isVideoOrDesktopCard || !isAudioCard);
|
|
card.setAttribute('aria-hidden', (!isHost || isVideoOrDesktopCard || !isAudioCard) ? 'true' : 'false');
|
|
|
|
card.querySelectorAll('button, [role="button"], a').forEach(function(cardControl) {
|
|
var cardControlText = normalizePoliticTalkText([
|
|
cardControl.getAttribute('aria-label'),
|
|
cardControl.getAttribute('title'),
|
|
cardControl.textContent
|
|
].join(' '));
|
|
|
|
if (cardControlText.indexOf('allow all') !== -1) {
|
|
cardControl.classList.add('politictalk-hidden-av-request');
|
|
cardControl.setAttribute('aria-hidden', 'true');
|
|
cardControl.setAttribute('tabindex', '-1');
|
|
}
|
|
});
|
|
});
|
|
|
|
if (!isHost) {
|
|
document.querySelectorAll('[role="alert"], [class*="notification"], [class*="Notification"], div')
|
|
.forEach(function(candidate) {
|
|
if (isPoliticTalkRaisedHandCard(candidate)) {
|
|
candidate.classList.add('politictalk-hidden-av-request');
|
|
candidate.setAttribute('aria-hidden', 'true');
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function mountPoliticTalkModerationNotificationPolicy() {
|
|
applyPoliticTalkModerationNotificationPolicy();
|
|
|
|
if (window.politicTalkModerationNotificationObserver || !document.body) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkModerationNotificationObserver = new MutationObserver(function() {
|
|
window.cancelAnimationFrame(window.politicTalkModerationNotificationFrame);
|
|
window.politicTalkModerationNotificationFrame = window.requestAnimationFrame(
|
|
applyPoliticTalkModerationNotificationPolicy
|
|
);
|
|
});
|
|
window.politicTalkModerationNotificationObserver.observe(document.body, {
|
|
attributes: true,
|
|
attributeFilter: [ 'aria-label', 'class', 'style', 'title' ],
|
|
childList: true,
|
|
characterData: true,
|
|
subtree: true
|
|
});
|
|
|
|
window.clearInterval(window.politicTalkModerationNotificationInterval);
|
|
window.politicTalkModerationNotificationInterval = window.setInterval(function() {
|
|
applyPoliticTalkModerationNotificationPolicy();
|
|
}, 800);
|
|
}
|
|
|
|
function isPoliticTalkVideoOrScreenText(text) {
|
|
var normalized = normalizePoliticTalkText(text);
|
|
|
|
return normalized.indexOf('video') !== -1
|
|
|| normalized.indexOf('camera') !== -1
|
|
|| normalized.indexOf('screen-share') !== -1
|
|
|| normalized.indexOf('screen share') !== -1
|
|
|| normalized.indexOf('screen sharing') !== -1
|
|
|| normalized.indexOf('screen-sharing') !== -1
|
|
|| normalized.indexOf('screenshare') !== -1
|
|
|| normalized.indexOf('share screen') !== -1
|
|
|| normalized.indexOf('share your screen') !== -1
|
|
|| normalized.indexOf('desktop') !== -1
|
|
|| normalized.indexOf('kamera') !== -1
|
|
|| normalized.indexOf('bildschirm') !== -1;
|
|
}
|
|
|
|
function hidePoliticTalkVideoScreenControls() {
|
|
if (directAccessBlocked || !document.body) {
|
|
return;
|
|
}
|
|
|
|
var controls = document.querySelectorAll([
|
|
'button',
|
|
'[role="button"]',
|
|
'[role="menuitem"]',
|
|
'[role="menuitemcheckbox"]',
|
|
'.mutevideolink',
|
|
'.mutedesktoplink',
|
|
'[data-testid^="mute-video-"]',
|
|
'[data-testid^="mute-desktop-"]',
|
|
'[data-testid^="unmute-video-"]',
|
|
'[data-testid^="unmute-desktop-"]'
|
|
].join(','));
|
|
|
|
controls.forEach(function(control) {
|
|
var controlText = [
|
|
control.getAttribute('aria-label'),
|
|
control.getAttribute('title'),
|
|
control.getAttribute('class'),
|
|
control.getAttribute('data-testid'),
|
|
control.textContent
|
|
].join(' ');
|
|
|
|
if (!isPoliticTalkVideoOrScreenText(controlText)) {
|
|
return;
|
|
}
|
|
|
|
control.classList.add('politictalk-hidden-video-screen-control');
|
|
control.setAttribute('aria-hidden', 'true');
|
|
control.setAttribute('tabindex', '-1');
|
|
});
|
|
}
|
|
|
|
function mountPoliticTalkAudioOnlyUiPolicy() {
|
|
hidePoliticTalkVideoScreenControls();
|
|
|
|
if (window.politicTalkAudioOnlyUiObserver || !document.body) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkAudioOnlyUiObserver = new MutationObserver(function() {
|
|
window.cancelAnimationFrame(window.politicTalkAudioOnlyUiFrame);
|
|
window.politicTalkAudioOnlyUiFrame = window.requestAnimationFrame(hidePoliticTalkVideoScreenControls);
|
|
});
|
|
window.politicTalkAudioOnlyUiObserver.observe(document.body, {
|
|
attributes: true,
|
|
attributeFilter: [ 'aria-label', 'class', 'role', 'style', 'title' ],
|
|
childList: true,
|
|
characterData: true,
|
|
subtree: true
|
|
});
|
|
}
|
|
|
|
function selectPoliticTalkRoomChatRecipient(select) {
|
|
if (!select || select.tagName !== 'SELECT') {
|
|
return;
|
|
}
|
|
|
|
var groupChatOption = Array.prototype.slice.call(select.options || []).find(function(option) {
|
|
return normalizePoliticTalkText(option.value) === 'groupchat'
|
|
|| normalizePoliticTalkText(option.textContent) === 'everyone';
|
|
});
|
|
|
|
if (!groupChatOption) {
|
|
return;
|
|
}
|
|
|
|
if (select.value !== groupChatOption.value) {
|
|
select.value = groupChatOption.value;
|
|
select.dispatchEvent(new Event('input', { bubbles: true }));
|
|
select.dispatchEvent(new Event('change', { bubbles: true }));
|
|
}
|
|
}
|
|
|
|
function hidePoliticTalkChatRecipientTarget(element) {
|
|
if (!element) {
|
|
return;
|
|
}
|
|
|
|
if (element.tagName === 'SELECT') {
|
|
selectPoliticTalkRoomChatRecipient(element);
|
|
} else if (element.querySelectorAll) {
|
|
element.querySelectorAll('select').forEach(selectPoliticTalkRoomChatRecipient);
|
|
}
|
|
|
|
element.classList.add('politictalk-room-chat-only-hidden');
|
|
element.setAttribute('aria-hidden', 'true');
|
|
element.setAttribute('tabindex', '-1');
|
|
}
|
|
|
|
function enforcePoliticTalkRoomChatOnly() {
|
|
if (directAccessBlocked || !document.body) {
|
|
return;
|
|
}
|
|
|
|
var recipientTargets = document.querySelectorAll([
|
|
'#chat-recipient',
|
|
'#select-chat-recipient',
|
|
'[class*="privateMessageRecipientsList"]',
|
|
'[class*="chat-recipient"]',
|
|
'[class*="chatRecipient"]',
|
|
'[class*="ChatRecipient"]',
|
|
'[class*="recipientDropdown"]',
|
|
'[class*="RecipientDropdown"]'
|
|
].join(','));
|
|
|
|
recipientTargets.forEach(hidePoliticTalkChatRecipientTarget);
|
|
}
|
|
|
|
function mountPoliticTalkRoomChatOnlyPolicy() {
|
|
enforcePoliticTalkRoomChatOnly();
|
|
|
|
if (window.politicTalkRoomChatOnlyObserver || !document.body) {
|
|
return;
|
|
}
|
|
|
|
window.politicTalkRoomChatOnlyObserver = new MutationObserver(function() {
|
|
window.cancelAnimationFrame(window.politicTalkRoomChatOnlyFrame);
|
|
window.politicTalkRoomChatOnlyFrame = window.requestAnimationFrame(enforcePoliticTalkRoomChatOnly);
|
|
});
|
|
window.politicTalkRoomChatOnlyObserver.observe(document.body, {
|
|
attributes: true,
|
|
attributeFilter: [ 'class', 'id', 'value' ],
|
|
childList: true,
|
|
subtree: true
|
|
});
|
|
}
|
|
|
|
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 = 'PoliticTalk';
|
|
image.src = '/images/politictalk/politictalk_logo_text.svg';
|
|
|
|
link.appendChild(image);
|
|
document.body.appendChild(link);
|
|
}
|
|
|
|
function mountDirectAccessMessage() {
|
|
if (!directAccessBlocked || !document.body || document.getElementById('politictalk-direct-access')) {
|
|
return;
|
|
}
|
|
|
|
var wrapper = document.createElement('div');
|
|
wrapper.className = 'politictalk-direct-access';
|
|
wrapper.id = 'politictalk-direct-access';
|
|
|
|
var dialog = document.createElement('div');
|
|
dialog.className = 'politictalk-direct-access__dialog';
|
|
dialog.setAttribute('aria-labelledby', 'politictalk-direct-access-title');
|
|
dialog.setAttribute('aria-modal', 'true');
|
|
dialog.setAttribute('role', 'dialog');
|
|
|
|
var title = document.createElement('h1');
|
|
title.className = 'politictalk-direct-access__title';
|
|
title.id = 'politictalk-direct-access-title';
|
|
title.textContent = 'Parallel Globe account required';
|
|
|
|
var message = document.createElement('p');
|
|
message.className = 'politictalk-direct-access__message';
|
|
message.textContent = 'This PoliticTalk room cannot be opened directly. Please create an account or sign in at Parallel Globe to join PoliticTalk sessions.';
|
|
|
|
var actions = document.createElement('div');
|
|
actions.className = 'politictalk-direct-access__actions';
|
|
|
|
var button = document.createElement('button');
|
|
button.className = 'politictalk-direct-access__button';
|
|
button.textContent = 'OK';
|
|
button.type = 'button';
|
|
button.addEventListener('click', redirectToParallelGlobe);
|
|
|
|
actions.appendChild(button);
|
|
dialog.appendChild(title);
|
|
dialog.appendChild(message);
|
|
dialog.appendChild(actions);
|
|
wrapper.appendChild(dialog);
|
|
document.body.appendChild(wrapper);
|
|
button.focus();
|
|
}
|
|
|
|
applyPoliticTalkMeetingTitle();
|
|
allowHostEndMeetingExecution();
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
mountPoliticTalkDocumentTitle();
|
|
mountPoliticTalkLogo();
|
|
mountDirectAccessMessage();
|
|
mountHostHangupPolicy();
|
|
mountMobileToolbarPositioning();
|
|
mountPoliticTalkStageBrandInset();
|
|
mountPoliticTalkRoleMetadataSync();
|
|
mountPoliticTalkTileTheme();
|
|
mountPoliticTalkModerationNotificationPolicy();
|
|
mountPoliticTalkLocalLeaveNotificationPolicy();
|
|
mountPoliticTalkAudioOnlyUiPolicy();
|
|
mountPoliticTalkRoomChatOnlyPolicy();
|
|
});
|
|
} else {
|
|
mountPoliticTalkDocumentTitle();
|
|
mountPoliticTalkLogo();
|
|
mountDirectAccessMessage();
|
|
mountHostHangupPolicy();
|
|
mountMobileToolbarPositioning();
|
|
mountPoliticTalkStageBrandInset();
|
|
mountPoliticTalkRoleMetadataSync();
|
|
mountPoliticTalkTileTheme();
|
|
mountPoliticTalkModerationNotificationPolicy();
|
|
mountPoliticTalkLocalLeaveNotificationPolicy();
|
|
mountPoliticTalkAudioOnlyUiPolicy();
|
|
mountPoliticTalkRoomChatOnlyPolicy();
|
|
}
|
|
}());
|
|
</script>
|