peertube-plugin-livechat/conversejs/lib/dom.ts
John Livingston 3bc05d88df
Chat Federation: using S2S if available.
* if both local and remote instance have external XMPP connections enabled, the user joins the remote room with his local account
* some code refactoring (builtin.ts)

Note: documentation and settings descriptions are to do.

Related to #112
2023-05-31 16:52:47 +02:00

26 lines
691 B
TypeScript

import type { InitConverseParams } from './types'
function initDom ({ forceReadonly, transparent }: InitConverseParams, isInIframe: boolean): void {
const body = document.querySelector('body')
if (isInIframe) {
if (body) {
body.classList.add('livechat-iframe')
// prevent horizontal scrollbar when in iframe. (don't know why, but does not work if done by CSS)
body.style.overflowX = 'hidden'
}
}
if (forceReadonly) {
body?.classList.add('livechat-readonly')
if (forceReadonly === 'noscroll') {
body?.classList.add('livechat-noscroll')
}
}
if (transparent) {
body?.classList.add('livechat-transparent')
}
}
export {
initDom
}