Add list of events (not yet formatted).
[mkws-moved-to-github.git] / doc / mkws-developer.markdown
index 25fd397..f6f7e54 100644 (file)
@@ -83,6 +83,25 @@ file `mkws-templates.js`.
 
 
 
+Event passing
+-------------
+
+The primary method of communication between components of the widget
+set -- specifically, between teams and their widgets -- is event
+passing. Widgets subscribe to named events; when something relevant
+happens (such as the reception of a message from metasearch
+middleware), the event is published, along with the relevant data. All
+widgets that susbcribed to the event are then notified, and can take
+appropriate action.
+
+Different kinds of events have different data associated with
+them. This data is passed when the event is published, and so is made
+available to the subscribing code.
+
+The possible events, and their associated data, are described
+[below](#events).
+
+
 Defining new types of widget
 ----------------------------
 
@@ -132,8 +151,7 @@ This simple widget illustrates several important points:
 * You can add functionality to a widget by subscribing it to an
   event's queue using `this.team.queue("EVENT").subscribe`. The
   argument is a function which is called whenever the event is
-  published. The arguments to the event-callback function are
-  different for different events.
+  published.
 
 * As with so much JavaScript programming, the value of the special
   variable `this` is lost inside the `subscribe` callback function,
@@ -324,7 +342,23 @@ complete major-release cycle.
 Events
 ------
 
-FIXME: list of events that can be usefully subscribed to.
+The following events are generated by the widget-set code:
+
+resize-wide
+resize-narrow
+authenticated(authName, realm)
+ready
+log(m_teamName, timestamp, s)
+targets(data)
+stat(data)
+firstrecords(hitcount)
+complete(hitcount)
+facets(data)
+pager(data)
+records(data)
+record(data)
+navi -- consult team.filters.
+
 
 
 - - -