Class jabberwerx.ui.ContactPresenceView
Extends
jabberwerx.ui.JWView.
View for displaying a contact's presence.
The view shows the following info for an entity:
- presence icon: Icon showing presence state
- display name: The display name for the entity
- presence status: Optional presence status message
This class provides the following events:
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.ui.ContactPresenceView(entity, delegate)
Creates a new ContactPresenceView with the given entity. |
Field Attributes | Field Name and Description |
---|---|
The client to montior and affect for presence changes. |
|
<static> |
jabberwerx.ui.ContactPresenceView.show_status
The mapping of default show value to display text. |
- Fields borrowed from class jabberwerx.ui.JWView:
- jq
Method Attributes | Method Name and Description |
---|---|
createDOM(doc)
Creates the DOM to display. |
|
restoreDOM(doc)
Restore the DOM to display. |
|
update()
Updates the display for this ContactPresenceView |
- Methods borrowed from class jabberwerx.ui.JWView:
- destroy, destroyDOM, dimensions, height, hide, parent, persistOptions, remove, render, restoreRender, restoreUpdate, shouldBeSavedWithGraph, show, wasUnserialized, width, willBeSerialized
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event
- Methods borrowed from class jabberwerx.JWBase:
- getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString
Creates a new ContactPresenceView with the given entity.
The {delegate} is used to indicate updates to this view are handled by the delegate object, and not by this view directly.
- Parameters:
- {jabberwerx.Entity} entity
- The entity to view presence for
- {Object} delegate Optional
- The delegate for this view
- Throws:
- {TypeError}
- If {entity} is not a jabberwerx.Entity
The client to montior and affect for presence changes.
The mapping of default show value to display text. The choices are:
{ "chat":"Ready to Chat!", "available":"Available", "away": "Away", "xa": "Extended Away" "dnd": "Do Not Disturb", "unavailable": "Offline", "unknown": "Unknown" }
Creates the DOM to display. This method creates the following DOM:
<div class="jabberwerx contact presence show"> <a class="contactlink"/> <span class="displayname">{entity.getDisplayName()}</span> <span class="status"/> </div>
- Parameters:
- {Document} doc
- The document to use for creating content.
- Returns:
- {Element} The generated element to display
Restore the DOM to display.
- Parameters:
- {Document} doc
- The document to use for creating content
- Returns:
- {Element} The generated element to display
Updates the display for this ContactPresenceView
- Returns:
- {Boolean} true if this ContactPresenceView is updatable