Constructor
new chatBox(client)
Instantiates a new Chat Box object
Parameters:
| Name | Type | Description |
|---|---|---|
client |
channel | Parent client Management Object |
Members
adminIcon
Admin Panel Icon
aspectLock
Whether or not chat-size should be locked to current media aspect ratio
aspectLockIcon
Aspect Lock Icon
Seems weird to stick this in here, but the split is dictated by chat width :P
autoScroll
Whether or not the chat box should auto-scroll on new chat
autocompleteDisplay
Auto-Complete Display
autocompletePlaceholder
Auto-Complete Placeholder
chatBuffer
Chat Buffer Div
chatPanel
Chat Panel Container Div
chatPostprocessor
Chat Post-Processor Object
chatPrompt
Chat Prompt
chatWidthMinimum
Chat-Width Minimum while sized to media Aspect-Ratio
clickDragger
Click-Dragger Object for handling dynamic chat/video split re-sizing
client
Parent Client Management Object
commandPreprocessor
Command Pre-Processor Object
emoteIcon
Emote Icon
flairSelect
Flair Selector
hideChatIcon
Hide Chat Icon
highSelect
High Level Selector
lastHeight
Height of Chat Buffer on last scroll
lastPos
Chat Buffer Scroll Top on last scroll
lastWidth
Width of Chat Buffer on last scroll
sendButton
Send Chat/Command Button
settingsIcon
Settings Panel Icon
showChatIcon
Show Chat Icon
Methods
catChat(text)
Concatenate Text into Chat Prompt
Parameters:
| Name | Type | Description |
|---|---|---|
text |
String | Text to Concatenate |
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 |
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 |
defineListeners()
Defines network-related event listners
displayAutocomplete(event)
Displays auto-complete text against current prompt input
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
displayChat(data)
Receives, Post-Processes, and Displays chat messages from server
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | De-hydrated chat object from server |
handleAutoScroll()
Auto-scrolls chat buffer when new chats are entered.
handleClientInfo(data)
Handles initial client meta-data dump from server upon connection
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | Data dump from server |
handleVideoToggle(show)
Handles Video Toggling
Parameters:
| Name | Type | Description |
|---|---|---|
show |
Boolean | Whether or not the video is currently being hidden |
lockAspect(event)
Locks chat-size to aspect ratio of media
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
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 |
scrollHandler(event)
Handles scrolling within the chat buffer
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
send(event)
Pre-processes and sends text from chat prompt to server
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
setFlair(event)
Sets user flair
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
setHighLevel(event)
Sets user high-level
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
setupInput()
Defines input-related event listeners
sizeToAspect()
Re-sizes chat box relative to media aspect ratio
tabComplete(event)
Called upon tab-complete
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
toggleUI(show)
Toggles Chat Box UX
Parameters:
| Name | Type | Description |
|---|---|---|
show |
Boolean | Whether or not to show Chat Box UX |
tokeWith(user)
Calls a toke command out with a specified user
Parameters:
| Name | Type | Description |
|---|---|---|
user |
String | User to toke with |
unlockAspect(event)
Un-locks chat-size to aspect ratio of media
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Event passed down from Event Handler |
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 |
updateHighSelect(highLevel)
Handles High-Level updates from the server
Parameters:
| Name | Type | Description |
|---|---|---|
highLevel |
Number | High Level to Set |