Skip to content

Latest commit

 

History

History
314 lines (195 loc) · 9.25 KB

clientapi.rst

File metadata and controls

314 lines (195 loc) · 9.25 KB

Client API

kaylee

This part of the documentation covers all the client-side interfaces of Kaylee.

Projects

A typical Kaylee project implements two callbacks in the pj namespce:

Core

Events

Events tirggered by projects

Events triggered by Kaylee

The events below are the basic Kaylee client-side logic events and should not be triggered by the user's project code in order to avoid unpredictable behaviour. Nevertheless, feel free to bind to these events to the code outside of the project and track how Kaylee works internally.

For example, the following code will echo all log messages to the browser console:

kl.message_logged.bind(console.log)

In the following example the total amount of tasks is kept in a counter:

tasks_count = 0

kl.task_received.bind( (task) -> tasks_count += 1 )

AJAX

The AJAX module provides convenient way to make GET/POST requests to the server. It also provides routines to load javascript and stylesheet files on-fly. The functions are accessible by both auto(worker-based) and manual(DOM-based) projects.