diff --git a/webroot/index.html b/webroot/index.html index 5f411e80d..235a13548 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -101,7 +101,7 @@ GW TODO: v-bind:tags="tags" >{{streamerName}} -
{{extraUserContent}}
+
{{extraUserContent}}
@@ -120,7 +120,7 @@ GW TODO: v-bind:tags="tags" >{{streamerName}} -
{{extraUserContent}}
+
{{extraUserContent}}
diff --git a/webroot/js/app.js b/webroot/js/app.js index a5110753f..3a095e9e6 100644 --- a/webroot/js/app.js +++ b/webroot/js/app.js @@ -50,17 +50,7 @@ async function setupApp() { app.title = config.title; window.document.title = config.title; - - try { - const pageContentFile = config.extraUserInfoFileName; - const response = await fetch(pageContentFile); - const descriptionMarkdown = await response.text() - const descriptionHTML = new showdown.Converter().makeHtml(descriptionMarkdown); - app.extraUserContent = descriptionHTML; - return this; - } catch (error) { - console.log("Error", error); - } + getExtraUserContent(`${URL_PREFIX}${config.extraUserInfoFileName}`); } var websocketReconnectTimer; diff --git a/webroot/js/components.js b/webroot/js/components.js index 3aab4d231..8b4d7aa83 100644 --- a/webroot/js/components.js +++ b/webroot/js/components.js @@ -9,7 +9,7 @@ Vue.component('owncast-footer', { template: ` diff --git a/webroot/js/utils.js b/webroot/js/utils.js index f862dc137..e02e459bd 100644 --- a/webroot/js/utils.js +++ b/webroot/js/utils.js @@ -6,8 +6,9 @@ const URL_PREFIX = 'https://goth.land'; const URL_STATUS = `${URL_PREFIX}/status`; const URL_STREAM = `${URL_PREFIX}/hls/stream.m3u8`; -const URL_WEBSOCKET = 'wss://goth.land/entry'; -// const URL_WEBSOCKET = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/entry`; +const URL_WEBSOCKET = URL_PREFIX + ? 'wss://goth.land/entry' + : `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/entry`; const POSTER_DEFAULT = `${URL_PREFIX}/img/logo.png`; const POSTER_THUMB = `${URL_PREFIX}/thumbnail.jpg`; @@ -23,6 +24,8 @@ const KEY_CHAT_DISPLAYED = 'owncast_chat'; const VIDEO_ID = 'video'; +const URL_OWNCAST = 'https://github.com/gabek/owncast'; + function getLocalStorage(key) { try { @@ -120,3 +123,20 @@ function setVideoPoster(online) { const poster = online ? POSTER_THUMB : POSTER_DEFAULT; player.poster(poster); } + +function getExtraUserContent(path) { + fetch(path) + .then(response => { + if (!response.ok) { + throw new Error(`Network response was not ok ${response.ok}`); + } + return response.text(); + }) + .then(text => { + const descriptionHTML = new showdown.Converter().makeHtml(text); + app.extraUserContent = descriptionHTML; + }) + .catch(error => { + console.log("Error", error); + }); +} \ No newline at end of file diff --git a/webroot/styles/layout.css b/webroot/styles/layout.css index a319ca6a6..fe05f659e 100644 --- a/webroot/styles/layout.css +++ b/webroot/styles/layout.css @@ -155,8 +155,8 @@ footer span { margin: 1em 0; } .extra-user-content { - margin: 1em 0; -} + padding: 1em 3em 3em 3em; + } h2 { font-size: 3em;