Embeddeding chat without iframe besieds videos WIP
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import type { InitConverseJSParams } from 'shared/lib/types'
|
||||
import type { InitConverseJSParams, ChatIncludeMode } from 'shared/lib/types'
|
||||
import { inIframe } from './lib/utils'
|
||||
import { initDom } from './lib/dom'
|
||||
import {
|
||||
@ -54,14 +54,6 @@ function initConversePlugins (peertubeEmbedded: boolean): void {
|
||||
}
|
||||
window.initConversePlugins = initConversePlugins
|
||||
|
||||
/**
|
||||
* ChatIncludeMode:
|
||||
* - chat-only: the chat is on a full page, without Peertube
|
||||
* - peertube-fullpage: the chat is embedded in Peertube, in a full custom page
|
||||
* - peertube-video: the chat is embedded in Peertube, beside a video
|
||||
*/
|
||||
type ChatIncludeMode = 'chat-only' | 'peertube-fullpage' | 'peertube-video'
|
||||
|
||||
/**
|
||||
* Init ConverseJS
|
||||
* @param initConverseParams ConverseJS init Params
|
||||
|
@ -2,9 +2,12 @@
|
||||
@import "shared/styles/index";
|
||||
@import "./peertubetheme";
|
||||
|
||||
body.livechat-iframe #conversejs .chat-head {
|
||||
// Hidding the chat-head when the plugin is displayed in an iframe.
|
||||
display: none;
|
||||
peertube-plugin-livechat-container,
|
||||
body.livechat-iframe {
|
||||
#conversejs .chat-head {
|
||||
// Hidding the chat-head when the plugin is displayed in an iframe or besides a video.
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#conversejs-bg {
|
||||
|
@ -4,7 +4,7 @@ function initDom ({ forceReadonly, transparent }: InitConverseJSParams, isInIfra
|
||||
const body = document.querySelector('body')
|
||||
if (isInIframe) {
|
||||
if (body) {
|
||||
body.classList.add('livechat-iframe')
|
||||
body.classList.add('livechat-iframe') // we need to keep this, for embedded chats in external websites
|
||||
// prevent horizontal scrollbar when in iframe. (don't know why, but does not work if done by CSS)
|
||||
body.style.overflowX = 'hidden'
|
||||
}
|
||||
|
Reference in New Issue
Block a user