Formatting html files

This commit is contained in:
joeyak 2019-03-17 17:31:48 -04:00
parent 417db785ce
commit 708056a86e
3 changed files with 79 additions and 72 deletions

View File

@ -10,9 +10,11 @@
<script type="application/javascript" src="/static/js/both.js"></script> <script type="application/javascript" src="/static/js/both.js"></script>
{{template "header" .}} {{template "header" .}}
</head> </head>
<body class="scrollbar"> <body class="scrollbar">
<div class="root"> <div class="root">
{{template "body" .}} {{template "body" .}}
</div> </div>
</body> </body>
</html> </html>

View File

@ -6,14 +6,16 @@
<h2>Commands</h2> <h2>Commands</h2>
<dl> <dl>
{{range $k, $v := .Commands}} {{range $k, $v := .Commands}}
<dt>{{$k}}</dt><dd>{{$v}}</dd> <dt>{{$k}}</dt>
<dd>{{$v}}</dd>
{{end}} {{end}}
</dl> </dl>
{{if .ModCommands}} {{if .ModCommands}}
<h2>Moderator</h2> <h2>Moderator</h2>
<dl> <dl>
{{range $k, $v := .ModCommands}} {{range $k, $v := .ModCommands}}
<dt>{{$k}}</dt><dd>{{$v}}</dd> <dt>{{$k}}</dt>
<dd>{{$v}}</dd>
{{end}} {{end}}
</dl> </dl>
{{end}} {{end}}
@ -21,7 +23,8 @@
<h2>Administrator</h2> <h2>Administrator</h2>
<dl> <dl>
{{range $k, $v := .AdminCommands}} {{range $k, $v := .AdminCommands}}
<dt>{{$k}}</dt><dd>{{$v}}</dd> <dt>{{$k}}</dt>
<dd>{{$v}}</dd>
{{end}} {{end}}
</dl> </dl>
{{end}} {{end}}

View File

@ -1,76 +1,78 @@
{{define "header"}} {{define "header"}}
{{ 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>
<script> <script>
maxMessageCount = {{ .MessageHistoryCount }} maxMessageCount = {{ .MessageHistoryCount }}
</script> </script>
<style> <style>
.root { .root {
display: grid; display: grid;
} }
</style> </style>
{{ end }} {{ end }}
{{ if .Video }} {{ if .Video }}
<script type="application/javascript" src="/static/js/flv.min.js"></script> <script type="application/javascript" src="/static/js/flv.min.js"></script>
<script type="application/javascript" src="/static/js/video.js"></script> <script type="application/javascript" src="/static/js/video.js"></script>
{{ if not .Chat }} {{ if not .Chat }}
<style> <style>
#videoElement { #videoElement {
height: 99vh; height: 99vh;
} }
</style> </style>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if and .Video .Chat }} {{ if and .Video .Chat }}
<style> <style>
.root { .root {
grid-template-columns: 5fr 1fr; grid-template-columns: 5fr 1fr;
} }
</style> </style>
{{ end }} {{ end }}
{{end}} {{end}}
{{define "body"}} {{define "body"}}
{{ if .Video }} {{ if .Video }}
<video id="videoElement" controls autoplay x5-video-player-type="h5" x5-video-player-fullscreen="true" <video id="videoElement" controls autoplay x5-video-player-type="h5" x5-video-player-fullscreen="true" playsinline
playsinline webkit-playsinline> webkit-playsinline>
Your browser is too old and doesn't support HTML5 video. Your browser is too old and doesn't support HTML5 video.
</video> </video>
{{ end }} {{ end }}
{{ if .Chat }} {{ if .Chat }}
<div id="chatwindow"> <div id="chatwindow">
<div id="chat" style="display: none;"> <div id="chat" style="display: none;">
<input id="hiddenColorPicker" type="color" hidden/> <input id="hiddenColorPicker" type="color" hidden />
<div id="notifiyBox"></div> <div id="notifiyBox"></div>
<div id="hidden"> <div id="hidden">
<div id="chatButtons"> <div id="chatButtons">
<button class="button pretty-button" onclick="auth();">Auth</button> <button class="button pretty-button" onclick="auth();">Auth</button>
<button class="button pretty-button" onclick="help();">Help</button> <button class="button pretty-button" onclick="help();">Help</button>
<button class="button pretty-button" onclick="$('#hiddenColorPicker').trigger('click');">Color</button> <button class="button pretty-button" onclick="$('#hiddenColorPicker').trigger('click');">Color</button>
{{ if .Video }} {{ if .Video }}
<button class="button pretty-button" onclick="initPlayer();">Reload Player</button> <button class="button pretty-button" onclick="initPlayer();">Reload Player</button>
{{ end }} {{ end }}
</div>
<hr/>
<a id="playing" target="_blank"></a>
</div>
<div id="messages" class="scrollbar"></div>
<div id="msgbox">
<div id="suggestions"></div>
<textarea id="msg"></textarea>
</div>
<button id="send" class="button" onclick="sendChat();">Send</button>
<div><!-- This is an empty div so there can be an empty space below the send button --></div>
</div>
<div id="joinbox">
<p style="color:#e5e0e5">Please enter your name to Join the chat</P>
<input id="name" maxlength="36">
<button id="join" class="button pretty-button" onclick="join();">Join</button>
</div> </div>
<hr />
<a id="playing" target="_blank"></a>
</div> </div>
{{ end }} <div id="messages" class="scrollbar"></div>
<div id="msgbox">
<div id="suggestions"></div>
<textarea id="msg"></textarea>
</div>
<button id="send" class="button" onclick="sendChat();">Send</button>
<div>
<!-- This is an empty div so there can be an empty space below the send button -->
</div>
</div>
<div id="joinbox">
<p style="color:#e5e0e5">Please enter your name to Join the chat</P>
<input id="name" maxlength="36">
<button id="join" class="button pretty-button" onclick="join();">Join</button>
</div>
</div>
{{ end }}
{{end}} {{end}}