Builtin ConverseJS:

* Building with webpack. TODO: include assets.
* Page template
This commit is contained in:
John Livingston
2021-02-20 20:42:41 +01:00
parent fbfb38392d
commit d9e461f984
7 changed files with 129 additions and 8 deletions

View File

@ -27,7 +27,10 @@ function register ({ registerHook, peertubeHelpers }) {
function getBaseRoute () {
// FIXME: should be provided by PeertubeHelpers (does not exists for now)
return '/plugins/livechat/router'
// We are guessing the route with the correct plugin version with this trick:
const staticBase = peertubeHelpers.getBaseStaticRoute()
// we can't use '/plugins/livechat/router', because the loaded html page needs correct relative paths.
return staticBase.replace(/\/static.*$/, '/router')
}
function getIframeUri (uuid) {
@ -38,7 +41,7 @@ function register ({ registerHook, peertubeHelpers }) {
let iframeUri = ''
if (!settings['chat-use-builtin']) {
iframeUri = settings['chat-uri'] || ''
iframeUri = iframeUri.replace('{{VIDEO_UUID}}', uuid)
iframeUri = iframeUri.replace(/{{VIDEO_UUID}}/g, uuid)
if (!/^https?:\/\//.test(iframeUri)) {
logger.error('The webchaturi must begin with https://')
return null