2023-09-07 00:15:02 +00:00
|
|
|
{{define "index"}}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<link rel="icon" href="/favicon.ico">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2024-04-06 21:35:52 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="/static/css/bulma.min.css?{{.CacheHash}}">
|
2023-09-07 00:15:02 +00:00
|
|
|
<link rel="stylesheet" href="/static/fontawesome-free-6.1.2-web/css/all.css">
|
|
|
|
<link rel="stylesheet" type="text/css" href="/static/css/chat.css?{{.CacheHash}}">
|
|
|
|
<title>{{.Config.Title}}</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
2023-09-07 06:03:12 +00:00
|
|
|
|
|
|
|
<!-- Photo Detail Modal -->
|
|
|
|
<div class="modal" id="photo-modal">
|
|
|
|
<div class="modal-background" onclick="document.querySelector('#photo-modal').classList.remove('is-active')"></div>
|
|
|
|
<div class="modal-content photo-modal">
|
|
|
|
<div class="image is-fullwidth">
|
2024-03-01 03:30:51 +00:00
|
|
|
<img id="modalImage" oncontextmenu="return false">
|
2023-09-07 06:03:12 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button class="modal-close is-large" aria-label="close" onclick="document.querySelector('#photo-modal').classList.remove('is-active')"></button>
|
|
|
|
</div>
|
|
|
|
|
2023-09-07 00:15:02 +00:00
|
|
|
<div id="app"></div>
|
|
|
|
|
|
|
|
<!-- BareRTC constants injected by IndexPage route -->
|
|
|
|
<script type="text/javascript">
|
|
|
|
const Branding = {{.Config.Branding}};
|
|
|
|
const PublicChannels = {{.Config.GetChannels}};
|
2024-03-29 06:20:09 +00:00
|
|
|
const DMDisclaimer = {{.Config.DirectMessageHistory.DisclaimerMessage}};
|
2023-09-07 00:15:02 +00:00
|
|
|
const WebsiteURL = "{{.Config.WebsiteURL}}";
|
|
|
|
const PermitNSFW = {{AsJS .Config.PermitNSFW}};
|
|
|
|
const TURN = {{.Config.TURN}};
|
|
|
|
const WebhookURLs = {{.Config.WebhookURLs}};
|
|
|
|
const VIP = {{.Config.VIP}};
|
|
|
|
const UserJWTToken = {{.JWTTokenString}};
|
|
|
|
const UserJWTValid = {{if .JWTAuthOK}}true{{else}}false{{end}};
|
|
|
|
const UserJWTClaims = {{.JWTClaims.ToJSON}};
|
|
|
|
const CachedBlocklist = {{.CachedBlocklist}};
|
2024-04-06 21:35:52 +00:00
|
|
|
const CacheHash = {{.CacheHash}};
|
2023-09-07 06:03:12 +00:00
|
|
|
|
|
|
|
// Show the photo detail modal.
|
|
|
|
function setModalImage(url) {
|
|
|
|
let $modalImg = document.querySelector("#modalImage"),
|
|
|
|
$modal = document.querySelector("#photo-modal");
|
|
|
|
$modalImg.src = url;
|
|
|
|
$modal.classList.add("is-active");
|
|
|
|
return false;
|
|
|
|
}
|
2023-09-09 02:37:39 +00:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
// Add global body click to hide the hamburger menu for chat settings.
|
|
|
|
const settingsMenu = document.querySelector("#chat-settings-hamburger-menu");
|
|
|
|
settingsMenu.addEventListener('click', (e) => {
|
|
|
|
settingsMenu.classList.toggle('is-active');
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
|
|
|
document.body.addEventListener('click', () => {
|
|
|
|
if (settingsMenu != undefined && settingsMenu.classList.contains("is-active")) {
|
|
|
|
settingsMenu.classList.remove('is-active');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
2023-09-07 00:15:02 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="module" src="/src/main.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
{{end}}
|