Class

Cockpit

Cockpit(toolui)

Constructor

new Cockpit(toolui)

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

View Source mod/cockpit.js, line 3

Extends

Members

String

readonly icon

A single character; use UTF-8 emojis or something
Overrides:

View Source mod/uipage.js, line 45

Boolean

isChannelOnline

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

View Source mod/cockpit.js, line 29

String

readonly localizedName

Gives you the localized name of the page.
Overrides:

View Source mod/uipage.js, line 35

String

readonly name

Gives you the name of the page.
Inherited From:

View Source mod/uipage.js, line 25

String

openChannelId

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

View Source mod/cockpit.js, line 24

Object

openChannelObject

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

View Source mod/cockpit.js, line 35

Boolean

readonly showInViewsList

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:

View Source mod/uipage.js, line 55

Methods

close()

Closes the cockpit page
Overrides:

View Source mod/cockpit.js, line 283

leaveChannel()

Leaves the channel and displays the follows list.

View Source mod/cockpit.js, line 520

async 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

View Source mod/cockpit.js, line 303

open()

Open the cockpit page
Overrides:

View Source mod/cockpit.js, line 237

async 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

View Source mod/cockpit.js, line 439

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

View Source mod/cockpit.js, line 587

This array is always empty
Array

Events

channelleft

Fires when the user left the channel

View Source mod/cockpit.js, line 553

channelopen

Fires when everything is loaded and ready

View Source mod/cockpit.js, line 488