Added nick button and some cleanup

resolves #55
This commit is contained in:
joeyak 2019-03-21 23:01:21 -04:00
parent e770c0cb62
commit bdfa75f8bc
4 changed files with 18 additions and 5 deletions

View File

@ -37,9 +37,12 @@ var (
)
var ChatCommands = []ChatCommandNames{
CNMe, CNHelp, CNCount, CNColor, CNWhoAmI, CNAuth, CNUsers,
// User
CNMe, CNHelp, CNCount, CNColor, CNWhoAmI, CNAuth, CNUsers, CNNick,
// Mod
CNSv, CNPlaying, CNUnmod, CNKick, CNBan, CNUnban, CNPurge,
CNMod, CNReloadPlayer, CNReloadEmotes, CNModpass, CNNick,
// Admin
CNMod, CNReloadPlayer, CNReloadEmotes, CNModpass,
}
func GetFullChatCommand(c string) string {

View File

@ -2,15 +2,17 @@ package common
type ClientDataType int
// Data types for communicating with the client
const (
CdMessage ClientDataType = iota // a normal message from the client meant to be broadcast
CdUsers // get a list of users
CdPing // ping the server to keep the connection alive
CdHelp // tells server to send help data again for buttons
)
type DataType int
// Data Types
// Data types for command messages
const (
DTInvalid DataType = iota
DTChat // chat message

View File

@ -109,14 +109,21 @@ function setNotifyBox(msg = "") {
// Button Wrapper Functions
function auth() {
let pass = prompt("pass please")
let pass = prompt("Enter pass");
if (pass != "") {
sendMessage("/auth " + pass);
}
}
function nick() {
let nick = prompt("Enter new name");
if (nick != "") {
sendMessage("/nick " + nick);
}
}
function help() {
sendMessage("/help")
sendMessage("/help");
}
// Get the websocket setup in a function so it can be recalled

View File

@ -52,6 +52,7 @@
<button class="button pretty-button" onclick="auth();">Auth</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="nick();">Nick</button>
{{ if .Video }}
<button class="button pretty-button" onclick="initPlayer();">Reload Player</button>
{{ end }}