Cockpit

new Cockpit(toolui)

This is the main page. It contains the channel selection and chat
Parameters:
Name Type Description
toolui ToolUI
Fires:

Extends

Members

isChannelOnline :Boolean

Is true when the channel is online. false when not. Is true if no channel is open.

readonly localizedName :String

Gives you the localized name of the page.
Inherited From:

readonly name :String

Gives you the name of the page.
Inherited From:

openChannelId :String

The id of the currently open channel. Might be empty if no channel is open.

openChannelObject :Object

The twitch api object of the currently open channel. Has no properties when no channel is open.
See:

readonly showInViewsList :Boolean

Wether or not to show this page in the views list; If false you have to make sure yourself that the user can access this page
Inherited From:

Methods

close()

Is being called when open and is being closed.
Overrides:

leaveChannel()

Leaves the channel and displays the follows list.

loadMoreFollows(reset)

Loads more Follows for the channel list.
Parameters:
Name Type Description
reset Boolean If true empties the list and begins from the start

open()

Is being called when this page is opened.
Overrides:

openChannel(channelid)

Hides the channel list and opens up the chat for a channel. Will show an error message if a channel is already open. Loads channel information, badges and connects to the irc channel.
Parameters:
Name Type Description
channelid String Id of the channel you want to open
Fires:

searchGame(str) → {Array}

Searches for a game and shows a suggestion list for the game entry field.
Parameters:
Name Type Description
str String Needle to search for
Returns:
Array - This array is always empty

Events

channelleft

Fires when the user left the channel

channelopen

Fires when everything is loaded and ready