Scripting API

work in progress

kiwi.build_version
kiwi.connections
kiwi.connections.active_connection
kiwi.newIrcConnection({nick, host, port, ssl, password, options}, function(err, network))
kiwi.addMediaMessageType(match_callback, html_builder_callback)
kiwi.plugins.load
kiwi.plugins.on('loaded', fn)

Components

To help with interacting and extending Kiwi, there are multiple components that allow you to extend and interact with certain parts of the application.

  • Applets Extend or completely replace parts of the application
  • Network Reacting and controlling the IRC network
  • Control Input Extend the user input

Settings

A user may have a number of user defined settings stored in their browser. This is where the settings applet reads its config from.
You can read and set a users settings via the kiwi.settings object.

Reading a setting
kiwi.settings.get('setting_name')

Setting a setting
kiwi.settings.set('setting_name', 'value')

Load the settings from the browser into Kiwi
kiwi.settings.load()

Saving the current settings to the browser
kiwi.settings.save()

Panels

A panel within Kiwi may be one of several types: server, channel, query or an applet. While server, channel and query panels all serve the purpose of displaying messages the applet panel may contain any HTML content and has an optional tab at the top of Kiwi. An example of applets are the settings and channel list applets.

Panel functions

Get an array of all open panels
kiwi.panels()

Get the currently active panel
kiwi.panels().active

Panel Events

You can bind to panel related events via:
kiwi.panels.on('event', function)

Switching between panels
Event: active
Event arguments: active_panel, previously_active_panel