Class: chatBox

chatBox(client)

Class which represents Canopy Chat Box UI

Constructor

new chatBox(client)

Instantiates a new Chat Box object
Parameters:
Name Type Description
client channel Parent client Management Object
Source:

Members

adminIcon

Admin Panel Icon
Source:

aspectLock

Whether or not chat-size should be locked to current media aspect ratio
Source:

aspectLockIcon

Aspect Lock Icon Seems weird to stick this in here, but the split is dictated by chat width :P
Source:

autoScroll

Whether or not the chat box should auto-scroll on new chat
Source:

autocompleteDisplay

Auto-Complete Display
Source:

autocompletePlaceholder

Auto-Complete Placeholder
Source:

chatBuffer

Chat Buffer Div
Source:

chatPanel

Chat Panel Container Div
Source:

chatPostprocessor

Chat Post-Processor Object
Source:

chatPrompt

Chat Prompt
Source:

clickDragger

Click-Dragger Object for handling dynamic chat/video split re-sizing
Source:

client

Parent Client Management Object
Source:

commandPreprocessor

Command Pre-Processor Object
Source:

emoteIcon

Emote Icon
Source:

flairSelect

Flair Selector
Source:

hideChatIcon

Hide Chat Icon
Source:

highSelect

High Level Selector
Source:

lastHeight

Height of Chat Buffer on last scroll
Source:

lastPos

Chat Buffer Scroll Top on last scroll
Source:

lastWidth

Width of Chat Buffer on last scroll
Source:

sendButton

Send Chat/Command Button
Source:

settingsIcon

Settings Panel Icon
Source:

showChatIcon

Show Chat Icon
Source:

Methods

catChat(text)

Concatinate Text into Chat Prompt
Parameters:
Name Type Description
text String Text to Concatinate
Source:

checkAutocomplete(input) → {Object}

Checks string input against auto-complete dictionary to generate the best guess as to what the user is typing
Parameters:
Name Type Description
input String Current input from Chat Prompt
Source:
Returns:
Object containing word we where handed and the match we found
Type
Object

clearChat(data)

Clears chat on command from server
Parameters:
Name Type Description
data Object Data from server
Source:

defineListeners()

Defines network-related event listners
Source:

displayAutocomplete(event)

Displays auto-complete text against current prompt input
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

displayChat(data)

Receives, Post-Processes, and Displays chat messages from server
Parameters:
Name Type Description
data Object De-hydrated chat object from server
Source:

handleAutoScroll()

Auto-scrolls chat buffer when new chats are entered.
Source:

handleClientInfo(data)

Handles initial client meta-data dump from server upon connection
Parameters:
Name Type Description
data Object Data dump from server
Source:

handleVideoToggle(show)

Handles Video Toggling
Parameters:
Name Type Description
show Boolean Whether or not the video is currently being hidden
Source:

lockAspect(event)

Locks chat-size to aspect ratio of media
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

resizeAspect(event)

Re-sizes chat back to aspect ratio on window re-size when chat box is aspect locked Also prevents horizontal scroll-bars from chat/window resizing
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

scrollHandler(event)

Handles scrolling within the chat buffer
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

send(event)

Pre-processes and sends text from chat prompt to server
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

setFlair(event)

Sets user flair
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

setHighLevel(event)

Sets user high-level
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

setupInput()

Defines input-related event listeners
Source:

sizeToAspect()

Re-sizes chat box relative to media aspect ratio
Source:

tabComplete(event)

Called upon tab-complete
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

toggleUI(show)

Toggles Chat Box UX
Parameters:
Name Type Description
show Boolean Whether or not to show Chat Box UX
Source:

tokeWith(user)

Calls a toke command out with a specified user
Parameters:
Name Type Description
user String User to toke with
Source:

unlockAspect(event)

Un-locks chat-size to aspect ratio of media
Parameters:
Name Type Description
event Event Event passed down from Event Handler
Source:

updateFlairSelect(fliarList, fliar)

Handles flair updates from the server
Parameters:
Name Type Description
fliarList Array List of flairs to put into flair select
fliar String Flair to set
Source:

updateHighSelect(highLevel)

Handles High-Level updates from the server
Parameters:
Name Type Description
highLevel Number High Level to Set
Source: