Merge pull request #119 from dunn/custom-title
allow customization of <title>
This commit is contained in:
commit
c91e5f5e1e
|
@ -328,7 +328,7 @@ func handleIndexTemplate(w http.ResponseWriter, r *http.Request) {
|
||||||
Video: true,
|
Video: true,
|
||||||
Chat: true,
|
Chat: true,
|
||||||
MessageHistoryCount: settings.MaxMessageCount,
|
MessageHistoryCount: settings.MaxMessageCount,
|
||||||
Title: "Movie Night!",
|
Title: settings.PageTitle,
|
||||||
}
|
}
|
||||||
|
|
||||||
path := strings.Split(strings.TrimLeft(r.URL.Path, "/"), "/")
|
path := strings.Split(strings.TrimLeft(r.URL.Path, "/"), "/")
|
||||||
|
|
|
@ -26,6 +26,7 @@ type Settings struct {
|
||||||
StreamStats bool
|
StreamStats bool
|
||||||
MaxMessageCount int
|
MaxMessageCount int
|
||||||
TitleLength int // maximum length of the title that can be set with the /playing
|
TitleLength int // maximum length of the title that can be set with the /playing
|
||||||
|
PageTitle string // primary value for the page <title> element
|
||||||
AdminPassword string
|
AdminPassword string
|
||||||
RegenAdminPass bool // regenerate admin password on start?
|
RegenAdminPass bool // regenerate admin password on start?
|
||||||
StreamKey string
|
StreamKey string
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"MaxMessageCount": 300,
|
"MaxMessageCount": 300,
|
||||||
|
"PageTitle": "Movie Night",
|
||||||
"TitleLength": 50,
|
"TitleLength": 50,
|
||||||
"AdminPassword": "",
|
"AdminPassword": "",
|
||||||
"RegenAdminPass": true,
|
"RegenAdminPass": true,
|
||||||
|
|
|
@ -23,10 +23,10 @@ function deleteCookie(cname) {
|
||||||
function setPlaying(title, link) {
|
function setPlaying(title, link) {
|
||||||
if (title !== "") {
|
if (title !== "") {
|
||||||
$('#playing').text(title);
|
$('#playing').text(title);
|
||||||
document.title = "Movie Night | " + title;
|
document.title = pageTitle + " | " + title;
|
||||||
} else {
|
} else {
|
||||||
$('#playing').text("");
|
$('#playing').text("");
|
||||||
document.title = "Movie Night";
|
document.title = pageTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#playing').removeAttr('href');
|
$('#playing').removeAttr('href');
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{{define "header"}}
|
{{define "header"}}
|
||||||
|
<script>pageTitle = {{ .Title }}</script>
|
||||||
{{if .Chat}}
|
{{if .Chat}}
|
||||||
<script type="application/javascript" src="/static/js/wasm_exec.js"></script>
|
<script type="application/javascript" src="/static/js/wasm_exec.js"></script>
|
||||||
<script type="application/javascript" src="/static/js/chat.js"></script>
|
<script type="application/javascript" src="/static/js/chat.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue